@syhr/sy-graph 1.1.0-rc.6 → 1.1.0-rc.7

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,6 +1,6 @@
1
- "use strict";require('./sy-graph.css');var Rt=Object.defineProperty,Pt=Object.defineProperties;var Dt=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var Ot=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable;var Re=(r,e,t)=>e in r?Rt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e)=>{for(var t in e||(e={}))Ot.call(e,t)&&Re(r,t,e[t]);if(Be)for(var t of Be(e))Lt.call(e,t)&&Re(r,t,e[t]);return r},x=(r,e)=>Pt(r,Dt(e));var ne=(r,e,t)=>Re(r,typeof e!="symbol"?e+"":e,t);var q=(r,e,t)=>new Promise((a,n)=>{var o=E=>{try{p(t.next(E))}catch(C){n(C)}},i=E=>{try{p(t.throw(E))}catch(C){n(C)}},p=E=>E.done?a(E.value):Promise.resolve(E.value).then(o,i);p((t=t.apply(r,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),Mt=require("qs"),Ft=require("axios"),Ut=require("mitt"),Gt=require("dayjs");require("crypto-js");const le=require("gm-crypto"),Ce=require("lodash-es"),H=require("element-plus"),pt=require("@meta2d/utils"),U=require("@meta2d/core"),Bt=require("@meta2d/plugin-mind-core"),Vt=require("@meta2d/plugin-mind-collapse"),Ht=require("@meta2d/form-diagram"),Kt=require("@meta2d/class-diagram"),Wt=require("@meta2d/le5le-charts"),de=require("@meta2d/core/src/diagrams"),Ve=require("@meta2d/flow-diagram"),Pe=require("@meta2d/fta-diagram"),He=require("@meta2d/sequence-diagram"),Ke=require("@meta2d/activity-diagram"),Yt=require("@element-plus/icons-vue"),__$t__={OFFLINE:0},qt={STOP:2},jt={1:1,2:2,3:3,4:4,5:5},O={AREA:1,BAY:2,DEVICE:3,COMPONENT:4,POINT:5,YX:6,YC:7,YK:8,AUX_DEVICE:9,LD:10,LN:11,SG:12,GIS_SENSOR:13},zt={[O.AREA]:"area",[O.BAY]:"bay",[O.DEVICE]:"device",[O.COMPONENT]:"component",[O.POINT]:"patrolpoint",[O.YX]:"yxpoint",[O.YC]:"ycpoint",[O.YK]:"ykpoint",[O.AUX_DEVICE]:"acdevice",[O.LD]:"ld",[O.LN]:"ln",[O.SG]:"sgpoint",[O.GIS_SENSOR]:"gisuhfsensor"},Y={CUSTOM_MSG:"CUSTOM_MSG",OPEN_CAMERA:"OPEN_CAMERA",CLOSE_CAMERA:"CLOSE_CAMERA",OPEN_AUDIO:"OPEN_AUDIO",CLOSE_AUDIO:"CLOSE_AUDIO",CHANGE_GRAPH:"CHANGE_GRAPH",NOTIFY_DIALOG:"NOTIFY_DIALOG",GIS_PROPS_PANEL:"GIS_PROPS_PANEL"},Ee={Emit:7},Ie={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},b={TEXT:"TEXT",NORMAL:"NORMAL",MP4:"MP4",TIME:"TIME",AUDIO:"AUDIO",RADIO:"RADIO",TABLE:"TABLE",INPUT:"INPUT",BUTTON:"BUTTON",CAMERA:"CAMERA",SELECT:"SELECT",SENSOR:"SENSOR",GIS_SENSOR:"GIS_SENSOR",GIS_DB_VALUE:"GIS_DB_VALUE",SLIDER:"SLIDER",SWITCH:"SWITCH",CHECKBOX:"CHECKBOX",POINT_VALUE:"POINT_VALUE",LIGHT_PLATE:"LIGHT_PLATE",VIDEO_STREAM:"VIDEO_STREAM"},We={GRAPH:{SOCKET:"GRAPH_SOCKET"}},De={AC:{ALARM:"ac.channel.alarm",CONDITION:"ac.channel.gk",OPERATION:"ac.channel.op"},AUDIT:{MSG:"audit.msg",ALARM:"audit.alarm"},DATA:{TASK_STATUS:"data.patroldevice.taskstatus",TASK_RESULT:"data.patroldevice.taskresult"},HOST:{STATUS:"status.platform.hoststatus"},NEST:{BATTERY:"status.platform.nestbattery",HUMIDITY:"status.platform.nesthumidity",TEMPERATURE:"status.platform.nesttemperature",AIR_STATE:"status.platform.nestairstate",DOOR_STATE:"status.platform.nestdoorstate",CHARGE_STATE:"status.platform.nestchargestate",RUNNING_STATE:"status.platform.nestrunningstate",BATTERY_STATE:"status.platform.nestbatterystate",BATTERY_ENABLE:"status.platform.nestbatteryenable",BATTERY_VOLTAGE:"status.platform.nestbatteryvoltage",PLATFORM_STATE:"status.platform.nestsysstate"},MEDIA:{NVR_INFO:"status.platform.nvrinfo",NVR_STATUS:"status.platform.nvrstatus",CAMERA_STATUS:"status.platform.camerastatus"},DRONE:{STATUS:"status.platform.dronestatus",ELECTRICITY:"status.platform.droneelectricity",FLIGHT_TIME:"status.platform.flighttime",FLIGHT_HEIGHT:"status.platform.flightheight",FLIGHT_STATUS:"status.platform.flightstatus",FLIGHT_DISTANCE:"status.platform.flightdistance",PTZ_ELEVATION:"status.platform.ptzelevation",PTZ_YAW_ANGLE:"status.platform.ptzyawangle",PTZ_ROLL_ANGLE:"status.platform.ptzrollangle",LOW_BATTERY:"status.platform.lowbattery",COMM_ABNORMAL:"status.platform.commabnormal",DRIVE_EXCEPTION:"status.platform.driveexception",FAULT_ALARM:"status.platform.faultalarm",CONTROL_STATUS:"status.platform.controlstatus",MILEAGE:"status.platform.mileage",CONTROL_MODE:"status.platform.controlmode"},ROBOT:{SPEED:"status.platform.robotspeed",STATUS:"status.platform.robotstatus",BATTERY:"status.platform.robotbattery",MILEAGE:"status.platform.robotmileage",HUMIDITY:"status.platform.robothumidity",WINDSPEED:"status.platform.robotwindspeed",COORDINATE:"status.platform.robotcoordinate",COORDINATES:"status.platform.robotcoordinates",FAULT_ALARM:"status.platform.robotfaultalarm",LOW_BATTERY:"status.platform.robotlowbattery",TEMPERATURE:"status.platform.robottemperature",CONTROL_MODE:"status.platform.robotcontrolmode",COMM_ABNORMAL:"status.platform.robotcommabnormal",RUNNING_STATE:"status.platform.robotrunningstate",CONTROL_STATUS:"status.platform.robotcontrolstatus",DRIVE_EXCEPTION:"status.platform.robotdriveexception",TRANSPORT_STATUS:"status.platform.robottransportstatus",ULTRASONIC_STOPPING:"status.platform.robotultrasonicstopping"},VOICE:{STATUS:"voiceprint.status",DATA:"voice.data",VOICEPRINT:"voiceprint.data",TIME_DOMAIN:"voiceprint.time.domain",FREQ_DOMAIN:"voiceprint.freq.domain"},PATROL:{ALARM:"patrol.alarm",TASK_ITEM:"patrol.task.item",TASK_INDEX:"patrol.task.index",SINGLE_RESULT:"patrol.single.result",CAMERA_ITEM:"patrol.camera.item",PATROLDEVICE_TASKSTATUS:"data.patroldevice.taskstatus",PATROLDEVICE_TASKRESULT:"data.patroldevice.taskresult",MASTER_ALARM:"patrol.master.alarm",MASTER_SILENCE:"patrol.task.master.silence",MASTER_TASK_ITEM:"patrol.task.master.item",MASTER_TASK_INDEX:"patrol.task.master.index"},REPORT:{ALARM:"report.alarm.message",EXCEL:"report.excel.message",PATROL:"report.patrol.message",PICTURE:"report.picture.message"},ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"},ALARM:{VOICE:"alarm.platform.alarm"},LINKAGE:{TASK:"linkage.record.task",CAMERA:"linkage.record.camera",PRESET:"linkage.record.preset",CONTROL:"linkage.record.control",PATROLPOINT:"linkage.record.patrolpoint"},METRICS:{SERVER:"metrics.metrics.server",CONTAINER:"metrics.metrics.container"},STATION:{SF6:"status.platform.stationsf6",OXYGEN:"status.platform.stationoxygen",HUMIDITY:"status.platform.stationhumidity",PRESSURE:"status.platform.stationpressure",RAINFALL:"status.platform.stationrainfall",WINDSPEED:"status.platform.stationwindspeed",TEMPERATURE:"status.platform.stationtemperature",WINDDIRECTION:"status.platform.stationwinddirection"},INTERFACE:{ANALYSIS:"analyse.pic.result",ALGORITHM:"algorithm.update.result"},PATROL_DEVICE:{BATTERY:"status.platform.battery",MILEAGE:"status.platform.mileage",GEOGRAPHY:"status.platform.coordinate_geography",COORDINATE:"status.platform.coordinate",COORDINATES:"status.platform.coordinates",ELECTRICITY:"status.platform.electricity",PTZYAWANGLE:"status.platform.ptzyawangle",PTZELEVATION:"status.platform.ptzelevation",PTZROLLANGLE:"status.platform.ptzrollangle",VERTICAL_SPEED:"status.platform.verticalspeed",HORIZONTAL_SPEED:"status.platform.horizontalspeed",FAULT_ALARM:"status.platform.faultalarm",LOW_BATTERY:"status.platform.lowbattery",CONTROL_MODE:"status.platform.controlmode",COMM_ABNORMAL:"status.platform.commabnormal",RUNNING_STATE:"status.platform.runningstate",CONTROL_STATUS:"status.platform.controlstatus",DRIVE_EXCEPTION:"status.platform.driveexception",TRANSPORT_STATUS:"status.platform.transportstatus",ULTRASONIC_STOPPING:"status.platform.ultrasonicstopping"}};var Ne={};/*!
1
+ "use strict";require('./sy-graph.css');var kt=Object.defineProperty,Rt=Object.defineProperties;var Dt=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var Mt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;var ke=(n,e,t)=>e in n?kt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,l=(n,e)=>{for(var t in e||(e={}))Mt.call(e,t)&&ke(n,t,e[t]);if(Be)for(var t of Be(e))Ot.call(e,t)&&ke(n,t,e[t]);return n},D=(n,e)=>Rt(n,Dt(e));var oe=(n,e,t)=>ke(n,typeof e!="symbol"?e+"":e,t);var j=(n,e,t)=>new Promise((a,r)=>{var o=p=>{try{u(t.next(p))}catch(g){r(g)}},i=p=>{try{u(t.throw(p))}catch(g){r(g)}},u=p=>p.done?a(p.value):Promise.resolve(p.value).then(o,i);u((t=t.apply(n,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),Lt=require("qs"),Ft=require("axios"),Ut=require("mitt"),Gt=require("dayjs");require("crypto-js");const he=require("gm-crypto"),Ce=require("lodash-es"),q=require("element-plus"),ft=require("@meta2d/utils"),V=require("@meta2d/core"),Bt=require("@meta2d/plugin-mind-core"),Vt=require("@meta2d/plugin-mind-collapse"),Ht=require("@meta2d/form-diagram"),Kt=require("@meta2d/class-diagram"),Wt=require("@meta2d/le5le-charts"),me=require("@meta2d/core/src/diagrams"),Ve=require("@meta2d/flow-diagram"),Re=require("@meta2d/fta-diagram"),He=require("@meta2d/sequence-diagram"),Ke=require("@meta2d/activity-diagram"),Yt=require("@element-plus/icons-vue"),__$t__={OFFLINE:0},qt={STOP:2},zt={1:1,2:2,3:3,4:4,5:5},F={AREA:1,BAY:2,DEVICE:3,COMPONENT:4,POINT:5,YX:6,YC:7,YK:8,AUX_DEVICE:9,LD:10,LN:11,SG:12,GIS_SENSOR:13},jt={[F.AREA]:"area",[F.BAY]:"bay",[F.DEVICE]:"device",[F.COMPONENT]:"component",[F.POINT]:"patrolpoint",[F.YX]:"yxpoint",[F.YC]:"ycpoint",[F.YK]:"ykpoint",[F.AUX_DEVICE]:"acdevice",[F.LD]:"ld",[F.LN]:"ln",[F.SG]:"sgpoint",[F.GIS_SENSOR]:"gisuhfsensor"},X={CUSTOM_MSG:"CUSTOM_MSG",OPEN_CAMERA:"OPEN_CAMERA",CLOSE_CAMERA:"CLOSE_CAMERA",OPEN_AUDIO:"OPEN_AUDIO",CLOSE_AUDIO:"CLOSE_AUDIO",CHANGE_GRAPH:"CHANGE_GRAPH",NOTIFY_DIALOG:"NOTIFY_DIALOG",GIS_PROPS_PANEL:"GIS_PROPS_PANEL"},ye={Emit:7},Ee={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},b={TEXT:"TEXT",NORMAL:"NORMAL",MP4:"MP4",TIME:"TIME",AUDIO:"AUDIO",RADIO:"RADIO",TABLE:"TABLE",INPUT:"INPUT",BUTTON:"BUTTON",CAMERA:"CAMERA",SELECT:"SELECT",SENSOR:"SENSOR",GIS_SENSOR:"GIS_SENSOR",GIS_SENSOR_WRAPPER:"GIS_SENSOR_WRAPPER",GIS_DB_VALUE:"GIS_DB_VALUE",SLIDER:"SLIDER",SWITCH:"SWITCH",CHECKBOX:"CHECKBOX",POINT_VALUE:"POINT_VALUE",LIGHT_PLATE:"LIGHT_PLATE",VIDEO_STREAM:"VIDEO_STREAM"},We={GRAPH:{SOCKET:"GRAPH_SOCKET"}},De={AC:{ALARM:"ac.channel.alarm",CONDITION:"ac.channel.gk",OPERATION:"ac.channel.op"},AUDIT:{MSG:"audit.msg",ALARM:"audit.alarm"},DATA:{TASK_STATUS:"data.patroldevice.taskstatus",TASK_RESULT:"data.patroldevice.taskresult"},HOST:{STATUS:"status.platform.hoststatus"},NEST:{BATTERY:"status.platform.nestbattery",HUMIDITY:"status.platform.nesthumidity",TEMPERATURE:"status.platform.nesttemperature",AIR_STATE:"status.platform.nestairstate",DOOR_STATE:"status.platform.nestdoorstate",CHARGE_STATE:"status.platform.nestchargestate",RUNNING_STATE:"status.platform.nestrunningstate",BATTERY_STATE:"status.platform.nestbatterystate",BATTERY_ENABLE:"status.platform.nestbatteryenable",BATTERY_VOLTAGE:"status.platform.nestbatteryvoltage",PLATFORM_STATE:"status.platform.nestsysstate"},MEDIA:{NVR_INFO:"status.platform.nvrinfo",NVR_STATUS:"status.platform.nvrstatus",CAMERA_STATUS:"status.platform.camerastatus"},DRONE:{STATUS:"status.platform.dronestatus",ELECTRICITY:"status.platform.droneelectricity",FLIGHT_TIME:"status.platform.flighttime",FLIGHT_HEIGHT:"status.platform.flightheight",FLIGHT_STATUS:"status.platform.flightstatus",FLIGHT_DISTANCE:"status.platform.flightdistance",PTZ_ELEVATION:"status.platform.ptzelevation",PTZ_YAW_ANGLE:"status.platform.ptzyawangle",PTZ_ROLL_ANGLE:"status.platform.ptzrollangle",LOW_BATTERY:"status.platform.lowbattery",COMM_ABNORMAL:"status.platform.commabnormal",DRIVE_EXCEPTION:"status.platform.driveexception",FAULT_ALARM:"status.platform.faultalarm",CONTROL_STATUS:"status.platform.controlstatus",MILEAGE:"status.platform.mileage",CONTROL_MODE:"status.platform.controlmode"},ROBOT:{SPEED:"status.platform.robotspeed",STATUS:"status.platform.robotstatus",BATTERY:"status.platform.robotbattery",MILEAGE:"status.platform.robotmileage",HUMIDITY:"status.platform.robothumidity",WINDSPEED:"status.platform.robotwindspeed",COORDINATE:"status.platform.robotcoordinate",COORDINATES:"status.platform.robotcoordinates",FAULT_ALARM:"status.platform.robotfaultalarm",LOW_BATTERY:"status.platform.robotlowbattery",TEMPERATURE:"status.platform.robottemperature",CONTROL_MODE:"status.platform.robotcontrolmode",COMM_ABNORMAL:"status.platform.robotcommabnormal",RUNNING_STATE:"status.platform.robotrunningstate",CONTROL_STATUS:"status.platform.robotcontrolstatus",DRIVE_EXCEPTION:"status.platform.robotdriveexception",TRANSPORT_STATUS:"status.platform.robottransportstatus",ULTRASONIC_STOPPING:"status.platform.robotultrasonicstopping"},VOICE:{STATUS:"voiceprint.status",DATA:"voice.data",VOICEPRINT:"voiceprint.data",TIME_DOMAIN:"voiceprint.time.domain",FREQ_DOMAIN:"voiceprint.freq.domain"},PATROL:{ALARM:"patrol.alarm",TASK_ITEM:"patrol.task.item",TASK_INDEX:"patrol.task.index",SINGLE_RESULT:"patrol.single.result",CAMERA_ITEM:"patrol.camera.item",PATROLDEVICE_TASKSTATUS:"data.patroldevice.taskstatus",PATROLDEVICE_TASKRESULT:"data.patroldevice.taskresult",MASTER_ALARM:"patrol.master.alarm",MASTER_SILENCE:"patrol.task.master.silence",MASTER_TASK_ITEM:"patrol.task.master.item",MASTER_TASK_INDEX:"patrol.task.master.index"},REPORT:{ALARM:"report.alarm.message",EXCEL:"report.excel.message",PATROL:"report.patrol.message",PICTURE:"report.picture.message"},ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"},ALARM:{VOICE:"alarm.platform.alarm"},LINKAGE:{TASK:"linkage.record.task",CAMERA:"linkage.record.camera",PRESET:"linkage.record.preset",CONTROL:"linkage.record.control",PATROLPOINT:"linkage.record.patrolpoint"},METRICS:{SERVER:"metrics.metrics.server",CONTAINER:"metrics.metrics.container"},STATION:{SF6:"status.platform.stationsf6",OXYGEN:"status.platform.stationoxygen",HUMIDITY:"status.platform.stationhumidity",PRESSURE:"status.platform.stationpressure",RAINFALL:"status.platform.stationrainfall",WINDSPEED:"status.platform.stationwindspeed",TEMPERATURE:"status.platform.stationtemperature",WINDDIRECTION:"status.platform.stationwinddirection"},INTERFACE:{ANALYSIS:"analyse.pic.result",ALGORITHM:"algorithm.update.result"},PATROL_DEVICE:{BATTERY:"status.platform.battery",MILEAGE:"status.platform.mileage",GEOGRAPHY:"status.platform.coordinate_geography",COORDINATE:"status.platform.coordinate",COORDINATES:"status.platform.coordinates",ELECTRICITY:"status.platform.electricity",PTZYAWANGLE:"status.platform.ptzyawangle",PTZELEVATION:"status.platform.ptzelevation",PTZROLLANGLE:"status.platform.ptzrollangle",VERTICAL_SPEED:"status.platform.verticalspeed",HORIZONTAL_SPEED:"status.platform.horizontalspeed",FAULT_ALARM:"status.platform.faultalarm",LOW_BATTERY:"status.platform.lowbattery",CONTROL_MODE:"status.platform.controlmode",COMM_ABNORMAL:"status.platform.commabnormal",RUNNING_STATE:"status.platform.runningstate",CONTROL_STATUS:"status.platform.controlstatus",DRIVE_EXCEPTION:"status.platform.driveexception",TRANSPORT_STATUS:"status.platform.transportstatus",ULTRASONIC_STOPPING:"status.platform.ultrasonicstopping"}};var xe={};/*!
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(Ne,"__esModule",{value:!0});var me=typeof window!="undefined"?window.proxy||window:{},ft=function(r){me!=null&&me.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),me.qiankunName&&(window.moudleQiankunAppLifeCycles[me.qiankunName]=r))};Ne.default=ft;var Oe=Ne.qiankunWindow=me;Ne.renderWithQiankun=ft;function Xt(){return window.__POWERED_BY_WUJIE__||window.$wujie?Ie.WUJIE:window.__POWERED_BY_QIANKUN__||Oe!=null&&Oe.__POWERED_BY_QIANKUN__?Ie.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?Ie.MICROAPP:Ie.NONE}const be="/",At=window.meta.app.encrypt;Xt();const Qt=location.protocol==="https:",Jt=location.hostname,Zt=Qt?"wss:":"ws:",ea=location.port,ta=location.origin,Ye=`${Zt}//${location.host}/ws`;var Ze,et,tt,at,nt,rt,it,ot,st,lt,ct,dt;(et=(Ze=window.meta)==null?void 0:Ze.graph)!=null&&et.savePath,(at=(tt=window.meta)==null?void 0:tt.graph)!=null&&at.graphPenPath,(rt=(nt=window.meta)==null?void 0:nt.graph)!=null&&rt.templatePath,(ot=(it=window.meta)==null?void 0:it.graph)!=null&&ot.graphImgUploadPath,(lt=(st=window.meta)==null?void 0:st.graph)!=null&&lt.threeSavePath,(dt=(ct=window.meta)==null?void 0:ct.graph)!=null&&dt.threeModelPath;var ut;const R=Ft.create({baseURL:ta,timeout:((ut=window.meta.axios)==null?void 0:ut.timeout)||6e4,withCredentials:!1,paramsSerializer:r=>Mt.stringify(r)});R.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r));R.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function aa(r,e={},t={}){return new Promise(a=>{R.get(r,l({params:e},t)).then(n=>a({res:n,err:null})).catch(n=>a({res:null,err:n}))})}function na(r,e={},t={}){return new Promise(a=>{R.post(r,e,t).then(n=>a({res:n,err:null})).catch(n=>a({res:null,err:n}))})}function ra(r,e={},t={}){return R.get(r,l({params:e},t))}function ia(r,e={},t={}){return R.post(r,e,t)}function oa(r,e={}){return R.get(`/filehandle/${r}`,{params:e})}function sa(r,e={},t={}){return R.post(`/filehandle/${r}`,e,t)}function la(r,e={}){return R.get(`/user/${r}`,{params:e})}function ca(r,e={},t={}){return R.post(`/user/${r}`,e,t)}function da(r,e={}){return R.get(`${r}`,e.local?{params:e,baseURL:be}:{params:e})}function ua(r,e={}){return R.get(`/media/${r}/`,{params:e})}function ma(r,e={},t={}){return R.post(`/media/${r}/`,e,t)}function ha(r,e={}){return R.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function pa(r,e={},t={}){return R.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function fa(r,e={}){return R.get(`/history/${r}`,{params:e})}function Aa(r,e={},t={}){return R.post(`/history/${r}`,e,t)}function ga(r,e={}){return R.get(`/scada/${r}`,{params:e})}function _a(r,e={},t={}){return R.post(`/scada/${r}`,e,t)}function wa(r,e={}){return R.get(`/common/factory/${r}`,{params:e})}function va(r,e={},t={}){return R.post(`/common/factory/${r}`,e,t)}function Ea(r,e={}){return R.get(`/factory/${r}`,{params:e})}function Ia(r,e={},t={}){return R.post(`/factory/${r}`,e,t)}function ya(r,e={}){return R.get(`/pd/${r}`,{params:e})}function Ta(r,e={},t={}){return R.post(`/pd/${r}`,e,t)}const ie={getApi:aa,postApi:na,getFileApi:oa,postFileApi:sa,getBaseApi:ra,postBaseApi:ia,getUserApi:la,postUserApi:ca,getGraphApi:da,getMediaApi:ua,postMediaApi:ma,getScadaApi:ga,postScadaApi:_a,getCommonApi:ha,postCommonApi:pa,getHistoryApi:fa,postHistoryApi:Aa,getFactoryApi:Ea,postFactoryApi:Ia,getCommonFactoryApi:wa,postCommonFactoryApi:va,getPDApi:ya,postPDApi:Ta},Fe=Ut(),Sa=[65535,-99999];function Le(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function Ue(r){return!["null","undefined"].includes(r)&&r!==void 0&&r!==null&&r!==""}function ye(r){return typeof r=="number"&&!Sa.includes(r)}const $e=()=>{var a;const r={},e=((a=window.location.href.split("?"))==null?void 0:a[1])||"",t=new URLSearchParams(e);for(const[n,o]of t.entries())r[n]=o;return r};function Me(r){return Object.prototype.toString.call(r).slice(8,-1)}(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 ba(){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 a,n,o,i,p,E;for(o=t.length,n=0,a="";n<o;){if(i=t.charCodeAt(n++)&255,n==o){a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4),a+="==";break}if(p=t.charCodeAt(n++),n==o){a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4|(p&240)>>4),a+=r.charAt((p&15)<<2),a+="=";break}E=t.charCodeAt(n++),a+=r.charAt(i>>2),a+=r.charAt((i&3)<<4|(p&240)>>4),a+=r.charAt((p&15)<<2|(E&192)>>6),a+=r.charAt(E&63)}return a},this.decode=function(t){var a,n,o,i,p,E,C;for(E=t.length,p=0,C="";p<E;){do a=e[t.charCodeAt(p++)&255];while(p<E&&a==-1);if(a==-1)break;do n=e[t.charCodeAt(p++)&255];while(p<E&&n==-1);if(n==-1)break;C+=String.fromCharCode(a<<2|(n&48)>>4);do{if(o=t.charCodeAt(p++)&255,o==61)return C;o=e[o]}while(p<E&&o==-1);if(o==-1)break;C+=String.fromCharCode((n&15)<<4|(o&60)>>2);do{if(i=t.charCodeAt(p++)&255,i==61)return C;i=e[i]}while(p<E&&i==-1);if(i==-1)break;C+=String.fromCharCode((o&3)<<6|i)}return C},this.utf16to8=function(t){var a,n,o,i;for(a="",o=t.length,n=0;n<o;n++)i=t.charCodeAt(n),i>=1&&i<=127?a+=t.charAt(n):i>2047?(a+=String.fromCharCode(224|i>>12&15),a+=String.fromCharCode(128|i>>6&63),a+=String.fromCharCode(128|i>>0&63)):(a+=String.fromCharCode(192|i>>6&31),a+=String.fromCharCode(128|i>>0&63));return a},this.utf8to16=function(t){var a,n,o,i,p,E;for(a="",o=t.length,n=0;n<o;)switch(i=t.charCodeAt(n++),i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=t.charAt(n-1);break;case 12:case 13:p=t.charCodeAt(n++),a+=String.fromCharCode((i&31)<<6|p&63);break;case 14:p=t.charCodeAt(n++),E=t.charCodeAt(n++),a+=String.fromCharCode((i&15)<<12|(p&63)<<6|(E&63)<<0);break}return a},this.charToHex=function(t){var a,n,o;for(a="",n=0;n<t.length;)o=t.charCodeAt(n++).toString(16),a+="\\0x"+o,a+=n>0&&n%8==0?`\r
6
- `:", ";return a}}function Ca(){var r=0,e=new Object;this.add=function(t,a){this.containsKey(t)||r++,e[t]=a},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 a in e)if(e[a]==t)return!0;return!1},this.getValues=function(){var t=[];for(var a in e)t.push(e[a]);return t},this.getKeys=function(){var t=[];for(var a in e)t.push(a);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function Na(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new Ca,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,a){var n=Object.id(a).toString();this.callbacks_.add(n,a);var o={MsgId:n,Method:e+"|"+r};t&&(o.Param=JSON.stringify(t));var i=JSON.stringify(o);this.connect&&this.ws.send(i)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),a=t.MsgId;if(this.callbacks_.containsKey(a)){var n=this.callbacks_.getValue(a);n(t.Result,t.Response),this.callbacks_.remove(a)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},a){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],a)},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:a},n){this.exec("Arm_VerifyPIN",[parseInt(e),a,t],n)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},a){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],a)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},a){this.exec("Arm_LEDControl",[parseInt(e),t],a)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},a){this.exec("Arm_SwitchProtocol",[parseInt(e),t],a)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:a,AttrBuffer:n},o){this.exec("Arm_CreateFile",[parseInt(e),a,parseInt(t),n],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:a,FileOffset:n,DataInput:o},i){this.exec("Arm_WriteFile",[parseInt(e),a,parseInt(t),parseInt(n),o],i)},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:a},n){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),a],n)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:a,DataLen:n},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),a,a.length,parseInt(n)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:a},n){this.exec("Arm_DeleteFile",[parseInt(e),a,parseInt(t)],n)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:a},n){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),a],n)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:a},n){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),a],n)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},a){this.exec("Arm_WriteShareMemory",[parseInt(e),t],a)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},a){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],a)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:a,TryCount:n,PinFlag:o},i){this.exec("Arm_ChangePIN",[parseInt(e),o,a,t,parseInt(n)],i)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},a){this.exec("Arm_ResetUserPIN",[parseInt(e),t],a)},this.Arm_SetUserID=function({Handle:e,UserID:t},a){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],a)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},a){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],a)},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},a){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},a){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},a){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],a)},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:a,RsaPriFileID:n,RsaPriFileSize:o},i){this.exec("Arm_RsaPri",[parseInt(e),parseInt(n),parseInt(o),t,a],i)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:a,RsaPubInData:n,RsaPubFileSize:o},i){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),a,t,t.length,n],i)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:a},n){this.exec("Arm_EccSign",[parseInt(e),parseInt(a),t],n)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:a,EccSignData:n},o){this.exec("Arm_EccVerify",[parseInt(e),a,a.length,t,n],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:a},n){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(a),t],n)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:a,Sm2SignData:n},o){this.exec("Arm_Sm2Verify",[parseInt(e),a,a.length,t,n],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:a,TdesInData:n},o){this.exec("Arm_TDES",[parseInt(e),parseInt(a),t,n],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:a,Sm4InData:n},o){this.exec("Arm_SM4",[parseInt(e),parseInt(a),t,n],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:a},n){this.exec("Arm_HASH",[parseInt(e),t,a],n)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:a},n){this.exec("Arm_Seed",[parseInt(e),a,t],n)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},a){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],a)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:a,SonCount:n,StartUserID:o,AdminTryCount:i,UserPin:p,UserTryCount:E,UpdateRSAPriKey:C},ae){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),a,p,parseInt(E),parseInt(i),C,parseInt(o),parseInt(n)],ae)},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},a){this.exec("Arm_InitSon",[parseInt(e),t],a)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},a){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],a)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:p,DataBuffer:E,UpRSAPubKey:C},ae){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,a,o,parseInt(n),parseInt(i),E,C,parseInt(p)],ae)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:a,FileID:n,FileType:o,Offset:i,DataLen:p,DataBuffer:E},C){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,a,o,parseInt(n),parseInt(i),E,parseInt(p)],C)},this.Arm_Update=function({Handle:e,UpdateData:t},a){this.exec("Arm_Update",[parseInt(e),t],a)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:a},n){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(a)],n)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:a,Priv:n,IsReset:o,IsDecOnRAM:i},p){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[a,parseInt(t),parseInt(e),parseInt(n),parseInt(i),parseInt(o)],p)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},a){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},a){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},a){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],a)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:a,IsDecOnRAM:n},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(n),parseInt(a)],o)},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:a,InBuffer:n,CallLimit:o},i){this.exec("Arm_Set_EXE_FILE_INFO",[n,parseInt(a),parseInt(e),parseInt(o),t,t.length],i)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const xa={HID:0},Te={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},qe={USER:0};class gt{constructor(){ne(this,"Base64",new ba);ne(this,"AtlCtrl",null);ne(this,"ArmCount",0);ne(this,"ArmIndex",0);ne(this,"ArmHandle",0);ne(this,"ArmRandom","");try{this.AtlCtrl=new Na("{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((a,n)=>{a?(this.ArmCount=+n,e(n)):t(n)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,a)=>{this.AtlCtrl.Arm_Open({Index:e},(n,o)=>{n?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,a(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_Close({Handle:e},(n,o)=>{n?t(o):a(o)})})}armChangePIN(e,t,a=255,n=qe.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,p)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:a,PinFlag:n},(E,C)=>{E&&C==0?(this.ArmPin=e,i(C)):p(C)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,i)=>{o?(this.ArmRandom=i,a(i)):n(i)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(n,o)=>{n?(this.ArmDeadline=o,t(o)):a(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,i)=>{o?(this.ArmUKey=i,a(i)):n(i)})})}armGetDongleInfo(e=0,t=Te.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((a,n)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,i)=>{if(o){switch(t){case Te.USER_ID:this.ArmUid=i;break;case Te.PRODUCT_ID:this.ArmPid=i;break;case Te.HARDWARE_ID:this.ArmHid=i;break}a(i)}else n(i)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_RFS({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,i)=>{if(o&&i.length>0)try{i=this.Base64.decode(i),a(i)}catch(p){console.error(p),a(i)}else n(i)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(n,o)=>{n&&o==0?t(o):a(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armSwitchProtocol(e=xa.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,i)=>{o&&i==0?a(i):n(i)})})}armVerifyPIN(e,t=qe.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:a,UserPin:e,UserType:t},(i,p)=>{i&&p==0?(this.ArmPin=e,n(p)):o(p)})})}armReadData(e=0,t=128,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_ReadData({Handle:a,Offset:e,ReadLength:t},(i,p)=>{i?(this.ArmData=p,n(p)):o(p)})})}armWriteData(e,t=0,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,o)=>{this.AtlCtrl.Arm_WriteData({Handle:a,Offset:t,DataInput:e},(i,p)=>{i&&p==0?n(p):o(p)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(n,o)=>{n?(this.ArmData=o,t(o)):a(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,n)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,i)=>{o&&i==0?a(i):n(i)})})}}const _t="0123456789abcdeffedcba9876543210",wt="4b0de988570c3a0f",ka=window.ENCRYPT;let he=ka&&new gt;function vt(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",a=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*a)],r--;return t}function Et(){return q(this,null,function*(){return he||(he=new gt),new Promise((r,e)=>{he.armEnum().then(t=>{r(+t)}).catch(t=>{H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Ce.throttle(()=>q(exports,null,function*(){const r=yield Et(),e={};if(typeof r!="number"||r<=0)H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Pa();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(H.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(H.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Ra(r=0){return q(this,null,function*(){return he?new Promise((e,t)=>{he.armGetDongleInfo(r).then(a=>{a?e(a):(H.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(a))}).catch(a=>{t(a)})}):H.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Pa(){return q(this,null,function*(){if(!he)return H.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield Et();let e=[];for(let t=0;t<r;t++){const a=yield Ra(t);e.push(a)}return e})}vt(16);vt(16);const It=window.meta.app.inspect?le.SM4.constants.CBC:le.SM4.constants.ECB,{publicKey:cn,privateKey:dn}=le.SM2.generateKeyPair();function Da(r,e,t={}){const a=yt(wt),n=t.mode||It;t=n===le.SM4.constants.ECB?l({mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t):l({iv:_t,mode:n,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=le.SM4.encrypt(r,a,t)}catch(i){console.log("err: ",i)}return o}function Oa(r,e,t={}){const a=yt(wt),n=t.mode||It;return t=n===le.SM4.constants.ECB?l({mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t):l({iv:_t,mode:n,inputEncoding:"hex",outputEncoding:"utf8"},t),le.SM4.decrypt(r,a,t)}function yt(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}function Se(r){return r=At&&Ue(r)?Oa(r):r,Ue(r)?JSON.parse(r):r}function je(r){return r=At&&Ue(r)?Da(r):r,JSON.stringify(r)}function ue(r,e,t,a){const n=new StorageEvent("storage",{url:window.location.href,key:r,oldValue:e,newValue:t,storageArea:a});window.dispatchEvent(n)}const ze={getLocal:r=>{try{const e=window.localStorage.getItem(r);return Se(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{const t=window.localStorage.getItem(r),a=je(e);window.localStorage.setItem(r,a),ue(r,t,a,window.localStorage)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||Me(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const a=window.localStorage.key(e);r((void 0).getLocal(a),a)}},clearLocal:()=>{window.localStorage.clear(),ue(null,null,null,window.localStorage)},removeLocal:r=>{const e=window.localStorage.getItem(r);window.localStorage.removeItem(r),ue(r,e,null,window.localStorage)},getSession:r=>{try{const e=window.sessionStorage.getItem(r);return Se(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{const t=window.sessionStorage.getItem(r),a=je(e);window.sessionStorage.setItem(r,a),ue(r,t,a,window.sessionStorage)}catch(t){console.error(t)}},eachSession:r=>{if(!r||Me(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const a=window.sessionStorage.key(e);r((void 0).getSession(a),a)}},clearSession:()=>{window.sessionStorage.clear(),ue(null,null,null,window.sessionStorage)},removeSession:r=>{const e=window.sessionStorage.getItem(r);window.sessionStorage.removeItem(r),ue(r,e,null,window.sessionStorage)},onStorageChange:r=>{if(!r||Me(r)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{r({url:t.url,key:t.key,newValue:t.newValue?Se(t.newValue):null,oldValue:t.oldValue?Se(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},Xe=r=>{const{quality:e,value:t,function_id:a}=r;return(e>>7&1)===1||e===0&&a===2&&t===1},Qe="USER_TOKEN",Je="STATION_ID",La=[{key:0,value:"离线"},{key:1,value:"在线"}],Ma=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],Fa=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],Ua="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1753954524851'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1506'%20width='256'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M888.65792%20280.15616a46.80704%2046.80704%200%200%200-46.80704-46.80704H233.34912a46.80704%2046.80704%200%200%200-46.80704%2046.80704v93.61408h702.11584V280.15616zM186.54208%20420.5824v374.46144a46.80704%2046.80704%200%200%200%2046.80704%2046.80704h608.49664a46.80704%2046.80704%200%200%200%2046.80704-46.80704V420.5824H186.54208z%20m442.9056%2084.98688l30.92992%2011.47904c-15.62624%2024.23808-35.39968%2050.38592-50.70848%2067.6096l-25.51296-10.84416c15.31392-17.85856%2034.7648-46.56128%2045.29152-68.24448z%20m-184.64768-1.59744c17.54112%2020.09088%2038.26688%2047.5136%2047.5136%2065.37728l-25.51296%2015.62624c-8.61184-17.85856-28.70272-46.23872-45.92128-67.28704l23.92064-13.71648z%20m199.95136%20267.2384h-45.28128c-32.20992%200-39.86432-8.92928-39.86432-39.86432v-102.36416h-46.23872c-5.73952%2069.8368-21.6832%20121.18528-101.0944%20149.56544-3.5072-7.97184-11.47904-19.456-18.49344-25.51296%2072.07424-22.9632%2083.87072-66.01728%2088.65792-124.05248H399.19616v-28.70272h122.7776V483.88096h30.92992v116.39808h122.46016v28.70272h-85.7856v102.04672c0%2010.5216%201.90976%2012.11904%2013.71136%2012.11904h38.90176c8.92928%200%2010.84416-4.1472%2011.8016-28.38016%206.69696%204.78208%2019.12832%209.56928%2027.42272%2011.47904-3.49696%2035.39968-11.4688%2044.96384-36.66432%2044.96384z'%20fill='%23005CFF'%20p-id='1507'%3e%3c/path%3e%3c/svg%3e",re=window.meta.graph.penFormMap?window.meta.graph.penFormMap:{NORMAL:[{name:"颜色",key:"color",type:"color",dataIds:{}}],TEXT:[{name:"显示内容",key:"text",type:"text",dataIds:{}}],AUDIO:[{name:"颜色",key:"color",type:"color",dataIds:{}}],MP4:[{name:"颜色",key:"color",type:"color",dataIds:{}}],CAMERA:[{name:"颜色",key:"color",type:"color",dataIds:{}}],VIDEO_STREAM:[{name:"颜色",key:"color",type:"color",dataIds:{}}],LIGHT_PLATE:[{name:"光字牌",key:"light_plate",type:"select",dataIds:{},options:[{label:"离线",value:-1},{label:"正常",value:0},{label:"预警",value:1},{label:"一般",value:2},{label:"严重",value:3},{label:"危急",value:4}]}]},Tt=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200",1:"#e2ac06",2:"#fa800a",3:"#f04155",4:"#ff0000"},St=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff",1:"#fff",2:"#fff",3:"#fff",4:"#fff"},L={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:La.map(r=>({label:r.value,value:r.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:Ma.map(r=>({label:r.value,value:r.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:Fa.map(r=>({label:r.value,value:r.key}))}],anchors:[{x:0,y:.5,id:"0"},{x:.5,y:0,id:"1"},{x:1,y:.5,id:"2"},{x:.5,y:1,id:"3"}],dataType:window.dataType,dataProp:window.dataProp,visibleLevel:window.visibleLevel},h=x(l({penType:b.NORMAL},L),{form:[...re[b.NORMAL],...L.form]});O.YX,O.YX,O.YX,b.POINT_VALUE,L.anchors,window.visibleLevel,L.form,L.form,window.dataType,window.dataProp,window.visibleLevel,L.form,window.dataType,window.dataProp,window.visibleLevel,L.form,window.dataType,window.dataProp,window.visibleLevel,St[0],b.LIGHT_PLATE,Tt[0],L.anchors,window.visibleLevel,[...re[b.LIGHT_PLATE],...L.form],be+"",b.SENSOR,L.anchors,window.visibleLevel,[...re[b.LIGHT_PLATE],...L.form],x(l({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:b.TEXT},L),{form:[...re[b.TEXT],...L.form]}),l({width:100,height:100,name:"square",penName:"正方形"},h),x(l({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},h),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),l({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},h),l({width:100,height:100,name:"circle",penName:"圆"},h),l({width:100,height:100,name:"triangle",penName:"三角形"},h),l({width:100,height:100,name:"diamond",penName:"菱形"},h),l({width:100,height:100,name:"pentagon",penName:"五边形"},h),l({width:100,height:100,name:"hexagon",penName:"六边形"},h),l({width:100,height:100,name:"pentagram",penName:"五角星"},h),l({width:120,height:60,name:"leftArrow",penName:"左箭头"},h),l({width:120,height:60,penName:"右箭头",name:"rightArrow"},h),l({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},h),l({width:100,height:100,name:"cloud",penName:"云"},h),l({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},h),l({width:80,height:100,name:"file",penName:"文件"},h),x(l({width:60,height:100,name:"cube",penName:"立方体",z:.25},h),{props:{custom:[{key:"z",label:"Z",type:"number",min:0,placeholder:"<= 1 即宽度的比例"},{key:"backgroundFront",label:"前背景色",type:"color"},{key:"backgroundUp",label:"顶背景色",type:"color"},{key:"backgroundRight",label:"右背景色",type:"color"}]}}),l({width:70,height:100,name:"people",penName:"人"},h),x(l({name:"rectangle",penName:"按钮",width:80,height:30,borderRadius:.2,text:"按钮",background:"#1890ff",color:"#1890ff",textColor:"#fff",activeBackground:"#40a9ff",activeColor:"#40a9ff",activeTextColor:"#fff",hoverBackground:"#40a9ff",hoverColor:"#40a9ff",hoverTextColor:"#fff"},h),{penType:b.BUTTON}),x(l({name:"rectangle",penName:"输入框",height:50,width:200,input:!0,borderRadius:.05,ellipsis:!0,text:"输入数据",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10},h),{penType:b.INPUT}),x(l({name:"rectangle",penName:"选择器",height:50,width:200,borderRadius:.05,ellipsis:!0,text:"选项1",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10,dropdownList:[{text:"选项1"},{text:"选项2"},{text:"选项3"}]},h),{penType:b.SELECT}),x(l({name:"slider",penName:"进度条",width:300,height:30,value:10,textWidth:50,barHeight:4,fontSize:20,min:0,max:100,color:"#1890ff",background:"#D4D6D9",textColor:"#222",unit:"%"},h),{penType:b.SLIDER}),x(l({name:"time",penName:"时间",width:300,height:40,text:`${Gt().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},h),{penType:b.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...h.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),x(l({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},h),{penType:b.SWITCH}),x(l({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},h),{penType:b.RADIO}),x(l({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},h),{penType:b.CHECKBOX}),x(l({name:"table2",penName:"表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),x(l({name:"table2",penName:"斑马纹表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!0,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),x(l({name:"table2",penName:"滚动表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,swiper:!0,maxNum:5,hasHeader:!0,color:"#333",textColor:"#444"},h),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}],["5","智能家居","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),x(l({name:"svg",width:100,height:100,image:be+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:b.AUDIO},L),{form:[...re[b.AUDIO],...L.form],events:[{name:"enter",action:Ee.Emit,value:Y.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:Y.OPEN_AUDIO,data:""})},{name:"leave",action:Ee.Emit,value:Y.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:Y.CLOSE_AUDIO,data:""})}]}),x(l({name:"svg",width:100,height:100,image:be+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:Ee.Emit,value:Y.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:Y.OPEN_CAMERA,data:""})},{name:"leave",action:Ee.Emit,value:Y.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:Y.CLOSE_CAMERA,data:""})}],penType:b.CAMERA},L),{form:[...re[b.CAMERA],...L.form]}),x(l({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:b.MP4},L),{form:[...re[b.MP4],...L.form]}),x(l({name:"video",width:100,height:100,penName:"视频流",datable:!0,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penType:b.VIDEO_STREAM},L),{form:[...re[b.VIDEO_STREAM],...L.form]}),l({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},h),l({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},h),l({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},h),l({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},h),l({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},h),l({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},h),l({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},h),l({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},h),l({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},h),l({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},h),l({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},h),l({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},h),l({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},h),l({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},h),l({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},h),l({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},h),l({width:30,height:30,name:"activityFinal",penName:"结束"},h),l({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},h),l({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},h),l({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},h),l({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},h),l({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},h),l({name:"andGate",penName:"与门",width:100,height:150},h),l({name:"basicEvent",penName:"基本事件",width:100,height:150},h),l({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},h),l({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},h),l({name:"forbiddenGate",penName:"禁止门",width:100,height:150},h),l({name:"event",penName:"事件",width:100,height:150},h),l({name:"switchEvent",penName:"开关事件",width:100,height:150},h),l({name:"conditionalEvent",penName:"条件事件",width:150,height:100},h),l({name:"transferSymbol",penName:"转移符号",width:100,height:150},h),l({name:"orGate",penName:"或门",width:100,height:150},h),l({name:"xorGate",penName:"异或门",width:100,height:150},h),l({name:"votingGate",penName:"表决门",width:100,height:150},h);const Ga=(r,e={isDev:!1,devServerUrl:"",devServerPort:8443})=>r.replace(/(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,`$1${e.isDev?e.devServerUrl:Jt}:${e.isDev?e.devServerPort:ea}`),xe=(r,e)=>{const t=r.__vccOpts||r;for(const[a,n]of e)t[a]=n;return t},Ba={class:"props-panel__title"},Va={class:"props-panel__value"},Ha={class:"props-panel__value-num"},Ka=Object.assign({name:"PropsPanle"},{__name:"PropsPanle",props:{data:{type:Object,default:null}},emits:["close"],setup(r,{emit:e}){const t=r,a=e;function n(i){return i==null||i==="—"?"—":typeof i=="number"?i.toFixed(2):i}const o=()=>{a("close")};return(i,p)=>{var E,C;return c.openBlock(),c.createElementBlock("div",{class:"props-panel",onMouseleave:o},[c.createElementVNode("div",Ba,c.toDisplayString(((E=t==null?void 0:t.data)==null?void 0:E.name)||"—"),1),p[1]||(p[1]=c.createElementVNode("div",{class:"props-panel__label"},"脉冲峰值",-1)),c.createElementVNode("div",Va,[c.createElementVNode("span",Ha,c.toDisplayString(n((C=t==null?void 0:t.data)==null?void 0:C.value)),1),p[0]||(p[0]=c.createElementVNode("span",{class:"props-panel__unit"},"dBm",-1))])],32)}}}),Wa=xe(Ka,[["__scopeId","data-v-343ad322"]]);class Ya{constructor(e){ne(this,"editor");this.editor=e}initPlugin(e,t,a={}){e.installPenPlugins({name:t},[{plugin:Bt.mindBoxPlugin,options:a},{plugin:Vt.collapseChildPlugin,options:a}])}}const $a="original_meta2d";function qa(){return localStorage.removeItem($a)}let Ae={};const ja=r=>{const e=document.querySelectorAll("video");let t=null;if(e.forEach(n=>{n.getAttribute("src")===r.video&&(t=n)}),!t)return;t.setAttribute("muted","muted"),t.setAttribute("autoplay","autoplay"),t.setAttribute("loop","loop"),t.setAttribute("crossorigin",""),t.setAttribute("controls",""),t.style.display="none",t.parentElement.style.border="2px solid #ffc878";const a=new JessibucaPro({container:t.parentElement,background:"",hasControl:!1,controlAutoHide:!0,checkFirstIFrame:!0,debug:!1,decoder:"./wasm/decoder-pro.js",forceNoOffscreen:!0,hotKey:!1,hasAudio:!1,hasVideo:!0,hiddenAutoPause:!1,isFlv:!0,isResize:!1,isNotMute:!0,loadingIcon:!0,loadingText:"加载中...",networkDelayTimeoutReplay:!1,playbackForwardMaxRateDecodeIFrame:8,showBandwidth:!1,showPerformance:!1,syncAudioAndVideo:!0,supportDblclickFullscreen:!1,timeout:10,useMSE:!0,useWCS:!1,useSIMD:!0,useVideoRender:!0,useCanvasRender:!1,videoBuffer:.2,videoBufferDelay:1});return r.autoPlay&&r.streamUrl&&a.play(r.streamUrl),Ae[r.id]=a,a},za=()=>{Object.keys(Ae).forEach(r=>{Ae[r].destroy(),Ae[r]=null}),Ae={}},Xa={class:"sy-empty"},Qa={key:1,class:"sy-empty-picture"},Ja={class:"sy-empty-description"},Za=Object.assign({name:"SyEmpty"},{__name:"index",props:{image:{type:String,default:"empty"},imageSize:{type:Number,default:80},description:{type:String,default:"暂无数据"},onlyText:{type:Boolean,default:!1}},setup(r){c.useCssVars(n=>({a7383bac:a.value.width,v736d2d7a:a.value.height}));const e=r,t=c.computed(()=>({"font-size":e.imageSize?`${e.imageSize}px`:"80px"})),a=c.computed(()=>e.imageSize?{width:e.imageSize*1.2+"px",height:e.imageSize+"px"}:{width:"187px",height:"144px"});return(n,o)=>{const i=c.resolveComponent("SyIcon"),p=c.resolveComponent("el-icon");return c.openBlock(),c.createElementBlock("div",Xa,[r.image!=="empty"?(c.openBlock(),c.createElementBlock("span",{key:0,class:"sy-empty-image",style:c.normalizeStyle(t.value)},[r.image!=="loading"?(c.openBlock(),c.createBlock(i,{key:0,name:r.image,gradient:""},null,8,["name"])):(c.openBlock(),c.createBlock(p,{key:1,class:"is-loading",style:{color:"#1671d4"}},{default:c.withCtx(()=>[c.createVNode(c.unref(Yt.Loading))]),_:1}))],4)):r.onlyText?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",Qa)),c.createElementVNode("div",Ja,[c.createElementVNode("p",null,c.toDisplayString(r.description),1)])])}}}),en=xe(Za,[["__scopeId","data-v-247a0fc9"]]),tn=Object.assign({name:"Meta2dEditor"},{__name:"index",props:{url:{type:String,default:""},data:{type:Object,default:()=>{}},local:{type:Boolean,default:!1},preview:{type:Boolean,default:!1},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["loaded","load-error"],setup(r,{expose:e,emit:t}){const a=t,n=r,o=c.ref(null),i=c.shallowRef(),p=c.computed(()=>!!(n.data||n.url));c.watch(()=>[n.data,n.url],()=>{p.value&&C()});let E=c.ref(!0);function C(){return q(this,null,function*(){try{if(E.value=!0,yield c.nextTick(),!o.value){console.error("未找到meta2d元素!");return}let w=null;if(n.data?w=n.data:n.url&&(w=yield _e()),!w||!w.data){E.value=!1,console.log("图纸数据为空"),a("load-error");return}const N=w.options||{background:"#eee",disableAnchor:!1};if(i.value&&(i.value.destroy(!0),i.value=null),!o.value){console.error("Meta2D 容器元素不可用");return}i.value=new U.Meta2d(o.value,l({},N)),N.visibleLevel&&i.value.scale(N.visibleLevel),ae(),J(),yield Z(w.data),i.value.render(),oe(),setTimeout(()=>{window.meta2dTools&&window.registerToolsNew()},1e3),a("loaded",i.value)}catch(w){console.error("初始化编辑器失败:",w)}})}function ae(){if(!i.value)return;new Ya({}).initPlugin(i.value,"mindNode",{})}function J(){U.register(Kt.classPens()),U.register(Ve.flowPens()),U.registerAnchors(Ve.flowAnchors()),U.register(He.sequencePens()),U.registerCanvasDraw(He.sequencePensbyCtx()),U.register(Ke.activityDiagram()),U.registerCanvasDraw(Ke.activityDiagramByCtx()),U.registerCanvasDraw(Ht.formPens()),U.registerCanvasDraw(Wt.chartsPens()),U.register(Pe.ftaPens()),U.registerAnchors(Pe.ftaAnchors()),U.registerCanvasDraw(Pe.ftaPensbyCtx())}function Z(w){var N;if(i.value){if(typeof w.locked=="undefined"&&(w.locked=0),w.bkImage&&i.value.setBackgroundImage(w.bkImage),w.pens&&w.pens.length>0){const M=[];w.pens.forEach(T=>{T.name==="video"&&T.streamUrl?M.push(T):T.name==="image"&&T.image?T.image=Ga(T.image,n.devConfig):T.lineType==="gisLine"?T.visible=!n.preview:T.penType===b.TABLE&&T.dataType&&P(T)}),M.length>0&&setTimeout(()=>{M.forEach(T=>{ja(T)})},500);const X=window.meta.graph.penCountThreshold||2e3;w.pens.length>X&&w.scale&&w.pens.forEach(T=>{const B=T.visibleLevel;B!==void 0?(T.visible=w.scale>=B,T.visible||(T.disabled=!0,T.locked=U.LockState.Disable)):(T.visible=!0,T.disabled=!1,T.locked=U.LockState.None)})}i.value.open(w),!n.preview&&((N=w.networks)!=null&&N.length)&&i.value.closeNetwork()}}const P=w=>q(this,null,function*(){var M;const N=yield ie.getCommonApi(zt[w.dataType],{offset:0,limit:w.tableSize||10});if((M=N.data)!=null&&M.length){const X=w.tableHeader||[{prop:"id",label:"ID"},{prop:"guid",label:"标识"},{prop:"name",label:"名称"}],$=N.data.map(T=>X.filter(B=>B.isShow).map(B=>{const K=T[B.prop];return B.choices?B.choices[K]||K:Ce.isObject(K)?K.name:K}));i.value.setValue({id:w.id,dataY:$})}else i.value.setValue({id:w.id,dataY:[]})}),oe=()=>{i.value&&(i.value.on("scale",ee),n.preview||i.value.on("connectLine",pe))},ee=Ce.debounce(w=>{var N,M,X,$;try{if(!i.value)return;Fe.emit("graph-scale",w);let T=i.value.store.data.pens;const B=window.meta.graph.penCountThreshold||2e3,K=T.length>B;for(let F=0;F<T.length;F++){const D=T[F];if([b.VIDEO_STREAM,b.MP4].includes(D.penType)){if(((M=(N=de.videos[D.id])==null?void 0:N.children)==null?void 0:M.length)===3){let j=de.videos[D.id].children[0],Q=de.videos[D.id].children[2];j.style.width=Q.currentTime/Q.duration*D.calculative.worldRect.width+"px"}else if((($=(X=de.videos[D.id])==null?void 0:X.children)==null?void 0:$.length)===2){let j=de.videos[D.id].children[0],Q=de.videos[D.id].children[1];j.style.width=Q.currentTime/Q.duration*D.calculative.worldRect.width+"px"}}if(K){const j=D.visibleLevel!==void 0?w>=D.visibleLevel:!0;i.value._setValue({id:D.id,visible:j,disabled:!j,locked:j?U.LockState.None:U.LockState.Disable})}}i.value.render()}catch(T){console.error("处理缩放失败:",T)}},500),pe=X=>q(this,[X],function*({line:w,lineAnchor:N,pen:M}){var ce;if(N!=null&&N.start||(M==null?void 0:M.penType)!==b.GIS_SENSOR)return;const $=(ce=w==null?void 0:w.calculative)==null?void 0:ce.worldAnchors;if($.length!==2||$!=null&&$.some(fe=>!fe.connectTo))return;const[T,B]=$;if(T.connectTo===B.connectTo)return;const K=window.meta2d.findOne(T.connectTo),F=window.meta2d.findOne(B.connectTo);let D=K==null?void 0:K.bindData,j=F==null?void 0:F.bindData;if(!D||!j)return;const Q=yield ie.postPDApi("setchannelpaired/",{data:[{channel1:D.guid,channel2:j.guid}]}),we=yield ie.postCommonApi("sgpoint",{ln__in:`${D.guid},${j.guid}`,group_number__in:6});Q.success&&we.success?(i.value.setValue({id:w.id,color:"#00d200",lineDash:[3,3],lineWidth:2,lineType:"gisLine"}),H.ElMessage.success("配对成功")):H.ElMessage.error("配对失败",Q.detail||we.detail)});function _e(){return q(this,null,function*(){if(!n.url)return H.ElMessage.error("图纸路径为空!"),null;try{return(yield ie.getGraphApi(n.url,{local:n.local}))||null}catch(w){return null}})}const te=()=>{i.value&&(i.value.resize(),i.value.fitView(!0,10))};return c.onMounted(()=>{var w,N;p.value&&(w=o.value)!=null&&w.clientHeight&&(N=o.value)!=null&&N.clientWidth&&C(),window.addEventListener("resize",te)}),c.onUnmounted(()=>{za(),qa(),i.value&&(n.preview?(pt.clearLineCross(),i.value.destroy(!0)):i.value.off("scale",ee)),window.removeEventListener("resize",te)}),e({stage:i}),(w,N)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"meta2dRef",ref:o,class:"meta2d-editor"},[c.unref(E)?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(en,{key:0,class:"meta2d-empty",description:"图纸不存在"}))],512))}}),an=xe(tn,[["__scopeId","data-v-5fbd34fd"]]),nn={key:0,class:"back-btn"};var mt,ht;const rn=Object.assign({name:"Meta2dPreview"},{__name:"index",props:{url:{type:String,default:""},gid:{type:String,default:""},data:{type:Object,default:null},local:{type:Boolean,default:!1},lang:{type:String,default:((ht=(mt=window.meta)==null?void 0:mt.app)==null?void 0:ht.lang)||"zh-cn"},config:{type:Object,default:()=>({socketUrl:Ye,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,enableWebSocket:!0,graphSocket:We.GRAPH.SOCKET})},showMap:{type:Boolean,default:!1},isFactory:{type:Boolean,default:!1},isInitData:{type:Boolean,default:!0},apiInstance:{type:Object,default:()=>ie},mittInstance:{type:Object,default:()=>Fe},customCallbacks:{type:Object,default:()=>({})},errorHandler:{type:Object,default:()=>({callback:null,showMessage:!0})},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["error","loaded","custom-msg","socket-msg"],setup(r,{expose:e,emit:t}){const a=t,n=r;let o=c.ref(!1),i=c.ref(""),p=c.ref(!1);const E=c.ref(null),C=c.ref(null),ae=c.ref(null),J=c.ref(""),Z=c.ref(!1),P=c.computed(()=>{var s;return(s=ae.value)==null?void 0:s.stage}),oe=c.computed(()=>{var s;return(s=P.value)==null?void 0:s.store}),ee=c.computed(()=>l({socketUrl:Ye,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,fitPadding:10,enableWebSocket:!0,graphSocket:We.GRAPH.SOCKET},n.config)),pe=()=>n.apiInstance||ie,_e=()=>n.mittInstance||Fe,te=(s,u="")=>{const A={error:s,message:u,timestamp:new Date().toISOString()};a("error",A),n.errorHandler.callback?n.errorHandler.callback(A):n.errorHandler.showMessage&&H.ElMessage&&H.ElMessage.error(`${u}: ${s.message||s}`)},w=()=>{i.value&&(J.value=i.value,Z.value=p.value)},N={},M=c.ref(!1),X=c.ref({left:0,top:0}),$=(s,u)=>{if(!E.value)return{left:s+20,top:u+20};const A=E.value.getBoundingClientRect(),S=s-A.left,k=u-A.top;let y=300,v=150;if(C.value){const g=C.value.$el||C.value;g&&g.offsetWidth&&(y=g.offsetWidth,v=g.offsetHeight)}let m=S+20,_=k+20;return m+y>A.width&&(m=S-y-20),_+v>A.height&&(_=k-v-20),{left:Math.max(0,Math.min(m,A.width-y)),top:Math.max(0,Math.min(_,A.height-v))}},T=s=>{M.value&&(X.value=$(s.clientX,s.clientY))},B=s=>{var u,A,S,k,y,v;try{if(!s)return;if((u=s==null?void 0:s.includes)!=null&&u.call(s,"token 必传"))return H.ElMessage.warning(s);const m=typeof s=="string"?JSON.parse(s):s;if((m==null?void 0:m.data)==="服务错误"||(S=(A=m==null?void 0:m.data)==null?void 0:A.includes)!=null&&S.call(A,"token is expired"))return H.ElMessage.warning(m.data);switch(a("socket-msg",m),m.action){case De.ACPOINT.YCVALUE:case De.ACPOINT.YXVALUE:if((k=m==null?void 0:m.data)!=null&&k.point_id){const _=P.value.find(m.data.point_id);_&&(N[m.data.point_id]=m.action===De.ACPOINT.YXVALUE?ye(m.data.value)?m.data.value:0:ye(m.data.value_disp||m.data.value)?m.data.value_disp||m.data.value:0,ve(_,m.data))}break;default:if(((y=m.data)==null?void 0:y.length)>0){const _=setTimeout(()=>{clearTimeout(_),P.value&&(m.data.forEach(g=>{N[g.dataId||g.point_id]=g.value_disp||g.value}),m.data.forEach(g=>{const I=P.value.find(g.dataId||g.point_id);ve(I,g)}))},ee.value.messageDelay);n.customCallbacks.onWebSocketMessage&&n.customCallbacks.onWebSocketMessage(m),(v=window.customSocketFn)==null||v.call(window,s)}break}return!0}catch(m){return te(m,"WebSocket消息处理"),!0}},K=c.ref({});let F={},D=null;const j=s=>q(this,null,function*(){try{if(s.msgName)switch(s.msgName){case Y.CHANGE_GRAPH:case Y.NOTIFY_DIALOG:case Y.GIS_PROPS_PANEL:Q(s);break}else Q(s);a("custom-msg",s),n.customCallbacks.onCustomMessage&&n.customCallbacks.onCustomMessage(s)}catch(u){te(u,"自定义消息处理")}}),Q=s=>{var S,k;let u;if(s.params)try{u=JSON.parse(s.params)}catch(y){u=s.params}switch(s.msgName){case Y.CHANGE_GRAPH:(u==null?void 0:u.data)!=="图纸id"?(i.value=J.value,p.value=Z.value,o.value=u.isBack,(S=u==null?void 0:u.data)!=null&&S.startsWith("/")?(J.value=u==null?void 0:u.data,Z.value=!0):(Z.value=!1,ce(u.data))):console.warn("切换图纸信息为空");break;case Y.NOTIFY_DIALOG:u.msg!=="通知内容"?H.ElNotification(l({message:u.msg},u)):console.warn("通知内容为空");break;case Y.GIS_PROPS_PANEL:s.eventName==="enter"?(M.value=!0,K.value=((k=s==null?void 0:s.pen)==null?void 0:k.bindData)||{},s.e&&(X.value=$(s.e.clientX,s.e.clientY))):(M.value=!1,K.value={});break}},we=s=>{var u,A,S,k,y,v,m,_,g;try{a("loaded",s);const I=$e(),d=ee.value,f=ze.getSession(d.stationIdKey),V=ze.getSession(d.userTokenKey);d.enableWebSocket&&f&&V&&((S=(A=(u=s.store)==null?void 0:u.data)==null?void 0:A.networks)!=null&&S.length?(v=(y=(k=s.store)==null?void 0:k.data)==null?void 0:y.networks)==null||v.forEach(W=>{var se;W.protocol==="websocket"&&((se=W.url)!=null&&se.includes("station_id")||(W.url=`${W.url}?station_id=${f}`),d.enableToken?W.protocols=d.userToken||V:W.protocols=void 0)}):(_=(m=s.store)==null?void 0:m.data)!=null&&_.websocket?((g=s.store.data.websocket)!=null&&g.includes("station_id")||(s.store.data.websocket=`${s.store.data.websocket}?station_id=${f}`),d.enableToken?s.store.data.websocketProtocols=d.userToken||V:s.store.data.websocketProtocols=void 0,s.closeSocket(),s.connectSocket()):(s.store.data.websocket=`${d.socketUrl}?station_id=${f}`,d.enableToken?s.store.data.websocketProtocols=V:s.store.data.websocketProtocols=void 0,s.connectWebsocket())),(n.showMap||I.showMap==="true")&&s.showMap(),s.setRule({rule:!1}),s.setOptions({disableRuleLine:!0}),s.setGrid({grid:!1}),s.lock(U.LockState.DisableEdit),ke().forEach(W=>{var se;(se=W==null?void 0:W.events)!=null&&se.length?G({id:W.id,locked:1},!1):G({id:W.id,locked:10},!1)}),s.render(),d.enableAutoFit&&s.fitView(!0,d.fitPadding),Object.values(Y).forEach(W=>{s.on(W,se=>j(x(l({},se),{msgName:W})))}),s&&(s.socketFn=B),n.customCallbacks.onStageLoaded&&n.customCallbacks.onStageLoaded(s),n.isInitData&&bt(s),window.addEventListener("mousemove",T)}catch(I){te(I,"图纸加载完成处理")}},ce=Ce.throttle(s=>q(this,null,function*(){var u;try{if(n.url){Z.value=n.local,yield fe(n.url);return}const A=$e();if(s=s||n.gid||A.id,A.local==="true"&&(Z.value=!0),s){const S=pe();if(S&&S.getCommonApi){const k=yield S.getCommonApi(n.isFactory?"graph":"floorplan",{guid:s});if((u=k.data)!=null&&u.length)yield fe(k.data[0].path);else{const y="未找到图纸!";te(new Error(y),"获取图纸数据")}}else te(new Error("API实例不可用"),"初始化图纸数据!")}else Z.value=n.local,yield fe(n.url);n.customCallbacks.onGraphLoaded&&n.customCallbacks.onGraphLoaded(J.value)}catch(A){te(A,"获取图纸数据失败")}})),fe=s=>q(this,null,function*(){const u=s.split(".");if(s.includes(n.lang)||u.length!==3){J.value=s;return}const A=`${u[0]}.${n.lang}.${u[2]}`;try{const S=yield ie.getGraphApi(A,{local:n.local}).catch(()=>{console.warn("多语言图纸不存在,使用默认图纸")});J.value=S?A:s}catch(S){J.value=s}}),bt=s=>q(this,null,function*(){var u,A,S,k;if(s){let y=[],v=[],m=[];F={};const _=s.store.data.pens;for(let I=0;I<_.length;I++){const d=_[I];d.bindDataId?(u=d.form)!=null&&u.length?d.form.forEach(f=>{if(f.dataIds.dataId)switch(f.dataIds.dataType){case O.YC:y.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.YX:v.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.SG:v.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break;case O.POINT:m.push(x(l({},f),{nodeName:f.dataIds.name,penId:d.id,penName:d.penName}));break}}):(d.penType===b.GIS_SENSOR||d.penType===b.GIS_DB_VALUE)&&d.bindData&&(F[d.bindData.ied_id]||(F[d.bindData.ied_id]=[]),G({id:d.id,title:void 0}),F[d.bindData.ied_id].push(l({penId:d.id,penType:d.penType},d.bindData))):(A=d.statusBindData)!=null&&A.length&&d.statusBindData.forEach(f=>{if(f.dataId)switch(f.dataType){case O.YX:v.push({showChild:0,value:0,nodeName:f.dataName,penId:d.id,penName:d.penName,dataId:f.dataId});break;case O.SG:v.push({showChild:0,value:0,nodeName:f.dataName,penId:d.id,penName:d.penName,dataId:f.dataId});break}})}let g=[];if(y.length){const I=pe();if(I&&I.postCommonApi){const d=yield I.postCommonApi("queryrealtimepoint",{point_id:y.map(f=>{var V;return((V=f==null?void 0:f.dataIds)==null?void 0:V.dataId)||f.dataId}).join(",")});(S=d==null?void 0:d.data)!=null&&S.length&&(d.data.forEach(f=>{N[f.guid]=f.value_disp||f.value}),g=[...g,...d.data])}}if(v.length){const I=pe();if(I&&I.postCommonApi){const d=yield I.postCommonApi("queryrealtimepoint",{point_id:v.map(f=>{var V;return((V=f==null?void 0:f.dataIds)==null?void 0:V.dataId)||f.dataId}).join(",")});(k=d==null?void 0:d.data)!=null&&k.length&&(d.data.forEach(f=>{N[f.guid]=Le(f.value)?Number(f.value):f.value}),g=[...g,...d.data])}}g.length&&g.forEach(I=>{const d=s.find(I.guid);ve(d,x(l({},I),{value:Le(I.value)?ye(Number(I.value))?Number(I.value):0:I.value,value_disp:I.value_disp,alarm_value:I.alarm_value,point_id:I.guid}))}),F&&Object.keys(F).length?(D&&clearInterval(D),Ge(),D=setInterval(()=>{Ge()},3e3)):D&&clearInterval(D)}}),Ge=()=>q(this,null,function*(){var s;if(F){const u=Object.keys(F);if(u.length){const A=yield ie.postPDApi("querychannelstatus/",{data:u.map(S=>({ied_id:S,ln_list:F[S].map(k=>k.ln_id)}))});(s=A==null?void 0:A.data)!=null&&s.length&&(u.forEach(S=>{const k=A.data.find(v=>v.ied_id===S),y=F[S];y!=null&&y.length&&y.forEach(v=>{const m=k.result.find(_=>_.ln_id===v.ln_id);if(m){const _=Le(m.amp_peak)?ye(Number(m.amp_peak))?Number(m.amp_peak):0:m.amp_peak;v.penType===b.GIS_SENSOR?G({id:v.penId,showChild:m.status==="告警"?2:m.status==="正常"?1:0,bindData:x(l({},v),{status:m.status,value:_})},!1):G({id:v.penId,text:`${_} dBm`},!1)}})}),P.value.render())}}}),G=(s,u=!0)=>{if(P.value)return P.value.setValue(s,{render:u})},Ct=()=>P.value,ke=()=>{var s,u;return((u=(s=oe.value)==null?void 0:s.data)==null?void 0:u.pens)||[]},Nt=()=>b,ve=(()=>{let s=null;const u=new Map,A=new Map,S=y=>{var m;if(!((m=y.children)!=null&&m.length))return[];const v=y.id||"";if(!v)return[];if(!A.has(v)&&oe.value){const _=U.getAllChildren(y,oe.value);A.set(v,_)}return A.get(v)||[]},k=()=>{if(u.size===0||!P.value||!oe.value)return;const y=[],v=[],m=oe.value.animates;u.forEach(({pen:_,dataItem:g,formKey:I})=>{switch(I){case"showChild":G({id:_.id,showChild:+g.value},!1);break;case"text":G({id:_.id,text:g.value_disp||g.value},!1);break;case"light_plate":{const d=g.value===-1||Xe(g)?"#999999":St[g.value!==void 0?g.value:g.alarm_value],f=g.value===-1||Xe(g)?"#cccccc":Tt[g.value!==void 0?g.value:g.alarm_value];G({id:_.id,textColor:d,background:f},!1)}break;case"point_value":_.penType===b.POINT_VALUE&&S(_).forEach(f=>{f.name==="text"&&G({id:f.id,text:g.value},!1)});break;case"online_state":{let d=g.value?void 0:"contrast(0%)";G({id:_.id,filter:d},!1),S(_).forEach(V=>{G({id:V.id,filter:d},!1)})}break;case"charged_state":{const d=g.value===__$t__.OFFLINE?"contrast(0%)":void 0;d!==_.filter&&(G({id:_.id,filter:d},!1),S(_).forEach(V=>{G({id:V.id,filter:d},!1)}))}break;case"electric_direction":g.value===qt.STOP?m!=null&&m.has(_)&&v.push(_):!!g.value!==_.animateReverse&&(G({id:_.id,animateReverse:!!g.value},!1),m!=null&&m.has(_)||y.push(_));break;case"electric_size":{const d=jt[g.value];d!==void 0&&d!==_.lineWidth&&G({id:_.id,lineWidth:d},!1)}break;default:G({id:_.id,[I]:g.value},!1);break}}),v.length>0&&P.value.stopAnimate(v),y.length>0&&P.value.startAnimate(y),u.clear(),P.value.render()};return(y,v)=>{y!=null&&y.length&&(y.forEach(m=>{var g;const _=m.form;if((g=m.statusBindData)!=null&&g.length){if(!N[v.guid])return;const I=[...m.statusBindData],d=I.findIndex(f=>f.dataId===v.guid);if(d!==-1){const f=I[d];I.find(z=>f.sort<z.sort&&N[z.dataId])||u.set(m.id,{pen:m,formKey:"showChild",dataItem:x(l({},v),{value:d})})}}else _!=null&&_.length&&_.forEach(I=>{if(!(Array.isArray(I.dataIds)?I.dataIds:[I.dataIds]).some(z=>(z==null?void 0:z.dataId)&&((z==null?void 0:z.dataId)===v.dataId||(z==null?void 0:z.dataId)===v.point_id)))return;const V=`${m.id}-${I.key}`;u.set(V,{pen:m,dataItem:v,formKey:I.key})})}),s&&clearTimeout(s),s=setTimeout(()=>{k(),s=null},ee.value.debounceDelay))}})(),xt=s=>{if(P.value){for(let u=0;u<s.length;u++){const A=s[u];N[A.dataId||A.point_id]=A.value_disp||A.value;const S=P.value.find(A.dataId);setTimeout(()=>{ve(S,A)},ee.value.messageDelay)}P.value.render(),n.customCallbacks.onBatchUpdate&&n.customCallbacks.onBatchUpdate(s)}},kt=(s,u=!1)=>{if(!P.value)return;const A=ke();for(let S=0;S<A.length;S++){const k=A[S];let y=!1;u?y=s===k.dataProp:y=s===5?!0:k.dataProp<=s,G({id:k.id,visible:y},!1)}P.value.fitView(),P.value.render(),n.customCallbacks.onLevelChange&&n.customCallbacks.onLevelChange(s,u)};return c.watch(()=>[n.gid,n.url,n.data,n.lang,n.local,n.isFactory],()=>{ce()}),c.watch(()=>n.showMap,s=>{P.value&&(s?P.value.showMap():P.value.hideMap())}),c.onMounted(()=>{const s=_e();s&&s.on&&s.on(ee.value.graphSocket,B),ce()}),c.onUnmounted(()=>{F=null;const s=_e();s&&s.off&&s.off(ee.value.graphSocket,B),window.removeEventListener("mousemove",T)}),e({setValue:G,getStage:Ct,getAllPens:ke,getCustomPenType:Nt,batchUpdatePen:xt,handleLineCross:pt.handleLineCross,changeVisibleByLevel:kt}),(s,u)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"previewRef",ref:E,class:"meta2d-preview"},[c.createVNode(an,{ref_key:"graphRef",ref:ae,url:J.value,local:Z.value,data:n.data,"dev-config":n.devConfig,preview:"",onLoaded:we},null,8,["url","local","data","dev-config"]),c.unref(o)?(c.openBlock(),c.createElementBlock("div",nn,[c.createVNode(c.unref(H.ElButton),{type:"primary",onClick:w},{default:c.withCtx(()=>[...u[1]||(u[1]=[c.createTextVNode("返回",-1)])]),_:1})])):c.createCommentVNode("",!0),M.value?(c.openBlock(),c.createBlock(Wa,{key:1,ref_key:"panelRef",ref:C,data:K.value,style:c.normalizeStyle({top:X.value.top+"px",left:X.value.left+"px",position:"absolute",pointerEvents:"none"}),onClose:u[0]||(u[0]=A=>M.value=!1)},null,8,["data","style"])):c.createCommentVNode("",!0)],512))}}),ge=xe(rn,[["__scopeId","data-v-b001ce67"]]);ge.name||(ge.name="SyGraph");const on=r=>{r.component(ge.name||"SyGraph",ge)},sn={install:on};exports.SyGraph=ge;exports.default=sn;
5
+ */Object.defineProperty(xe,"__esModule",{value:!0});var pe=typeof window!="undefined"?window.proxy||window:{},pt=function(n){pe!=null&&pe.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),pe.qiankunName&&(window.moudleQiankunAppLifeCycles[pe.qiankunName]=n))};xe.default=pt;var Me=xe.qiankunWindow=pe;xe.renderWithQiankun=pt;function Xt(){return window.__POWERED_BY_WUJIE__||window.$wujie?Ee.WUJIE:window.__POWERED_BY_QIANKUN__||Me!=null&&Me.__POWERED_BY_QIANKUN__?Ee.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?Ee.MICROAPP:Ee.NONE}const be="/",At=window.meta.app.encrypt;Xt();const Qt=location.protocol==="https:",Jt=location.hostname,Zt=Qt?"wss:":"ws:",ea=location.port,ta=location.origin,Ye=`${Zt}//${location.host}/ws`;var Ze,et,tt,at,nt,rt,it,ot,st,lt,ct,dt;(et=(Ze=window.meta)==null?void 0:Ze.graph)!=null&&et.savePath,(at=(tt=window.meta)==null?void 0:tt.graph)!=null&&at.graphPenPath,(rt=(nt=window.meta)==null?void 0:nt.graph)!=null&&rt.templatePath,(ot=(it=window.meta)==null?void 0:it.graph)!=null&&ot.graphImgUploadPath,(lt=(st=window.meta)==null?void 0:st.graph)!=null&&lt.threeSavePath,(dt=(ct=window.meta)==null?void 0:ct.graph)!=null&&dt.threeModelPath;var ut;const L=Ft.create({baseURL:ta,timeout:((ut=window.meta.axios)==null?void 0:ut.timeout)||6e4,withCredentials:!1,paramsSerializer:n=>Lt.stringify(n)});L.interceptors.request.use(n=>(n.headers["x-token"]="ewoglCJhbGcilDogpc3",n),n=>Promise.reject(n));L.interceptors.response.use(n=>{const{data:e}=n;return Promise.resolve(e)},n=>Promise.reject(n));function aa(n,e={},t={}){return new Promise(a=>{L.get(n,l({params:e},t)).then(r=>a({res:r,err:null})).catch(r=>a({res:null,err:r}))})}function na(n,e={},t={}){return new Promise(a=>{L.post(n,e,t).then(r=>a({res:r,err:null})).catch(r=>a({res:null,err:r}))})}function ra(n,e={},t={}){return L.get(n,l({params:e},t))}function ia(n,e={},t={}){return L.post(n,e,t)}function oa(n,e={}){return L.get(`/filehandle/${n}`,{params:e})}function sa(n,e={},t={}){return L.post(`/filehandle/${n}`,e,t)}function la(n,e={}){return L.get(`/user/${n}`,{params:e})}function ca(n,e={},t={}){return L.post(`/user/${n}`,e,t)}function da(n,e={}){return L.get(`${n}`,e.local?{params:e,baseURL:be}:{params:e})}function ua(n,e={}){return L.get(`/media/${n}/`,{params:e})}function ha(n,e={},t={}){return L.post(`/media/${n}/`,e,t)}function ma(n,e={}){return L.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${n}/`,{params:e})}function fa(n,e={},t={}){return L.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${n}/`,e,t)}function pa(n,e={}){return L.get(`/history/${n}`,{params:e})}function Aa(n,e={},t={}){return L.post(`/history/${n}`,e,t)}function ga(n,e={}){return L.get(`/scada/${n}`,{params:e})}function wa(n,e={},t={}){return L.post(`/scada/${n}`,e,t)}function _a(n,e={}){return L.get(`/common/factory/${n}`,{params:e})}function va(n,e={},t={}){return L.post(`/common/factory/${n}`,e,t)}function ya(n,e={}){return L.get(`/factory/${n}`,{params:e})}function Ea(n,e={},t={}){return L.post(`/factory/${n}`,e,t)}function Ia(n,e={}){return L.get(`/pd/${n}`,{params:e})}function Ta(n,e={},t={}){return L.post(`/pd/${n}`,e,t)}const le={getApi:aa,postApi:na,getFileApi:oa,postFileApi:sa,getBaseApi:ra,postBaseApi:ia,getUserApi:la,postUserApi:ca,getGraphApi:da,getMediaApi:ua,postMediaApi:ha,getScadaApi:ga,postScadaApi:wa,getCommonApi:ma,postCommonApi:fa,getHistoryApi:pa,postHistoryApi:Aa,getFactoryApi:ya,postFactoryApi:Ea,getCommonFactoryApi:_a,postCommonFactoryApi:va,getPDApi:Ia,postPDApi:Ta},Fe=Ut(),Sa=[65535,-99999];function Oe(n){if(typeof n!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return n.trim()!==""&&e.test(n.trim())}function Ue(n){return!["null","undefined"].includes(n)&&n!==void 0&&n!==null&&n!==""}function Ie(n){return typeof n=="number"&&!Sa.includes(n)}const $e=()=>{var a;const n={},e=((a=window.location.href.split("?"))==null?void 0:a[1])||"",t=new URLSearchParams(e);for(const[r,o]of t.entries())n[r]=o;return n};function Le(n){return Object.prototype.toString.call(n).slice(8,-1)}(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 ba(){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 a,r,o,i,u,p;for(o=t.length,r=0,a="";r<o;){if(i=t.charCodeAt(r++)&255,r==o){a+=n.charAt(i>>2),a+=n.charAt((i&3)<<4),a+="==";break}if(u=t.charCodeAt(r++),r==o){a+=n.charAt(i>>2),a+=n.charAt((i&3)<<4|(u&240)>>4),a+=n.charAt((u&15)<<2),a+="=";break}p=t.charCodeAt(r++),a+=n.charAt(i>>2),a+=n.charAt((i&3)<<4|(u&240)>>4),a+=n.charAt((u&15)<<2|(p&192)>>6),a+=n.charAt(p&63)}return a},this.decode=function(t){var a,r,o,i,u,p,g;for(p=t.length,u=0,g="";u<p;){do a=e[t.charCodeAt(u++)&255];while(u<p&&a==-1);if(a==-1)break;do r=e[t.charCodeAt(u++)&255];while(u<p&&r==-1);if(r==-1)break;g+=String.fromCharCode(a<<2|(r&48)>>4);do{if(o=t.charCodeAt(u++)&255,o==61)return g;o=e[o]}while(u<p&&o==-1);if(o==-1)break;g+=String.fromCharCode((r&15)<<4|(o&60)>>2);do{if(i=t.charCodeAt(u++)&255,i==61)return g;i=e[i]}while(u<p&&i==-1);if(i==-1)break;g+=String.fromCharCode((o&3)<<6|i)}return g},this.utf16to8=function(t){var a,r,o,i;for(a="",o=t.length,r=0;r<o;r++)i=t.charCodeAt(r),i>=1&&i<=127?a+=t.charAt(r):i>2047?(a+=String.fromCharCode(224|i>>12&15),a+=String.fromCharCode(128|i>>6&63),a+=String.fromCharCode(128|i>>0&63)):(a+=String.fromCharCode(192|i>>6&31),a+=String.fromCharCode(128|i>>0&63));return a},this.utf8to16=function(t){var a,r,o,i,u,p;for(a="",o=t.length,r=0;r<o;)switch(i=t.charCodeAt(r++),i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=t.charAt(r-1);break;case 12:case 13:u=t.charCodeAt(r++),a+=String.fromCharCode((i&31)<<6|u&63);break;case 14:u=t.charCodeAt(r++),p=t.charCodeAt(r++),a+=String.fromCharCode((i&15)<<12|(u&63)<<6|(p&63)<<0);break}return a},this.charToHex=function(t){var a,r,o;for(a="",r=0;r<t.length;)o=t.charCodeAt(r++).toString(16),a+="\\0x"+o,a+=r>0&&r%8==0?`\r
6
+ `:", ";return a}}function Ca(){var n=0,e=new Object;this.add=function(t,a){this.containsKey(t)||n++,e[t]=a},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 a in e)if(e[a]==t)return!0;return!1},this.getValues=function(){var t=[];for(var a in e)t.push(e[a]);return t},this.getKeys=function(){var t=[];for(var a in e)t.push(a);return t},this.getSize=function(){return n},this.clear=function(){n=0,e=new Object}}function xa(n){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new Ca,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,a){var r=Object.id(a).toString();this.callbacks_.add(r,a);var o={MsgId:r,Method:e+"|"+n};t&&(o.Param=JSON.stringify(t));var i=JSON.stringify(o);this.connect&&this.ws.send(i)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),a=t.MsgId;if(this.callbacks_.containsKey(a)){var r=this.callbacks_.getValue(a);r(t.Result,t.Response),this.callbacks_.remove(a)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},a){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],a)},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:a},r){this.exec("Arm_VerifyPIN",[parseInt(e),a,t],r)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},a){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],a)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},a){this.exec("Arm_LEDControl",[parseInt(e),t],a)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},a){this.exec("Arm_SwitchProtocol",[parseInt(e),t],a)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:a,AttrBuffer:r},o){this.exec("Arm_CreateFile",[parseInt(e),a,parseInt(t),r],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:a,FileOffset:r,DataInput:o},i){this.exec("Arm_WriteFile",[parseInt(e),a,parseInt(t),parseInt(r),o],i)},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:a},r){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),a],r)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:a,DataLen:r},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),a,a.length,parseInt(r)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:a},r){this.exec("Arm_DeleteFile",[parseInt(e),a,parseInt(t)],r)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:a},r){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),a],r)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:a},r){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),a],r)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},a){this.exec("Arm_WriteShareMemory",[parseInt(e),t],a)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},a){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],a)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:a,TryCount:r,PinFlag:o},i){this.exec("Arm_ChangePIN",[parseInt(e),o,a,t,parseInt(r)],i)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},a){this.exec("Arm_ResetUserPIN",[parseInt(e),t],a)},this.Arm_SetUserID=function({Handle:e,UserID:t},a){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],a)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},a){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],a)},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},a){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},a){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],a)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},a){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],a)},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:a,RsaPriFileID:r,RsaPriFileSize:o},i){this.exec("Arm_RsaPri",[parseInt(e),parseInt(r),parseInt(o),t,a],i)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:a,RsaPubInData:r,RsaPubFileSize:o},i){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),a,t,t.length,r],i)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:a},r){this.exec("Arm_EccSign",[parseInt(e),parseInt(a),t],r)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:a,EccSignData:r},o){this.exec("Arm_EccVerify",[parseInt(e),a,a.length,t,r],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:a},r){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(a),t],r)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:a,Sm2SignData:r},o){this.exec("Arm_Sm2Verify",[parseInt(e),a,a.length,t,r],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:a,TdesInData:r},o){this.exec("Arm_TDES",[parseInt(e),parseInt(a),t,r],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:a,Sm4InData:r},o){this.exec("Arm_SM4",[parseInt(e),parseInt(a),t,r],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:a},r){this.exec("Arm_HASH",[parseInt(e),t,a],r)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:a},r){this.exec("Arm_Seed",[parseInt(e),a,t],r)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},a){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],a)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:a,SonCount:r,StartUserID:o,AdminTryCount:i,UserPin:u,UserTryCount:p,UpdateRSAPriKey:g},Z){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),a,u,parseInt(p),parseInt(i),g,parseInt(o),parseInt(r)],Z)},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},a){this.exec("Arm_InitSon",[parseInt(e),t],a)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},a){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],a)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:a,FileID:r,FileType:o,Offset:i,DataLen:u,DataBuffer:p,UpRSAPubKey:g},Z){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,a,o,parseInt(r),parseInt(i),p,g,parseInt(u)],Z)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:a,FileID:r,FileType:o,Offset:i,DataLen:u,DataBuffer:p},g){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,a,o,parseInt(r),parseInt(i),p,parseInt(u)],g)},this.Arm_Update=function({Handle:e,UpdateData:t},a){this.exec("Arm_Update",[parseInt(e),t],a)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:a},r){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(a)],r)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:a,Priv:r,IsReset:o,IsDecOnRAM:i},u){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[a,parseInt(t),parseInt(e),parseInt(r),parseInt(i),parseInt(o)],u)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},a){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},a){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],a)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},a){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],a)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:a,IsDecOnRAM:r},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(r),parseInt(a)],o)},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:a,InBuffer:r,CallLimit:o},i){this.exec("Arm_Set_EXE_FILE_INFO",[r,parseInt(a),parseInt(e),parseInt(o),t,t.length],i)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const Na={HID:0},Te={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},qe={USER:0};class gt{constructor(){oe(this,"Base64",new ba);oe(this,"AtlCtrl",null);oe(this,"ArmCount",0);oe(this,"ArmIndex",0);oe(this,"ArmHandle",0);oe(this,"ArmRandom","");try{this.AtlCtrl=new xa("{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((a,r)=>{a?(this.ArmCount=+r,e(r)):t(r)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,a)=>{this.AtlCtrl.Arm_Open({Index:e},(r,o)=>{r?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,a(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_Close({Handle:e},(r,o)=>{r?t(o):a(o)})})}armChangePIN(e,t,a=255,r=qe.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,u)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:a,PinFlag:r},(p,g)=>{p&&g==0?(this.ArmPin=e,i(g)):u(g)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,i)=>{o?(this.ArmRandom=i,a(i)):r(i)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(r,o)=>{r?(this.ArmDeadline=o,t(o)):a(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,i)=>{o?(this.ArmUKey=i,a(i)):r(i)})})}armGetDongleInfo(e=0,t=Te.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((a,r)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,i)=>{if(o){switch(t){case Te.USER_ID:this.ArmUid=i;break;case Te.PRODUCT_ID:this.ArmPid=i;break;case Te.HARDWARE_ID:this.ArmHid=i;break}a(i)}else r(i)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,i)=>{o&&i==0?a(i):r(i)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_RFS({Handle:e},(r,o)=>{r&&o==0?t(o):a(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,i)=>{if(o&&i.length>0)try{i=this.Base64.decode(i),a(i)}catch(u){console.error(u),a(i)}else r(i)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(r,o)=>{r&&o==0?t(o):a(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,i)=>{o&&i==0?a(i):r(i)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,i)=>{o&&i==0?a(i):r(i)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,i)=>{o&&i==0?a(i):r(i)})})}armSwitchProtocol(e=Na.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,i)=>{o&&i==0?a(i):r(i)})})}armVerifyPIN(e,t=qe.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:a,UserPin:e,UserType:t},(i,u)=>{i&&u==0?(this.ArmPin=e,r(u)):o(u)})})}armReadData(e=0,t=128,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,o)=>{this.AtlCtrl.Arm_ReadData({Handle:a,Offset:e,ReadLength:t},(i,u)=>{i?(this.ArmData=u,r(u)):o(u)})})}armWriteData(e,t=0,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,o)=>{this.AtlCtrl.Arm_WriteData({Handle:a,Offset:t,DataInput:e},(i,u)=>{i&&u==0?r(u):o(u)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,a)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(r,o)=>{r?(this.ArmData=o,t(o)):a(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,r)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,i)=>{o&&i==0?a(i):r(i)})})}}const wt="0123456789abcdeffedcba9876543210",_t="4b0de988570c3a0f",Pa=window.ENCRYPT;let Ae=Pa&&new gt;function vt(n=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",a=e.length;for(;n>0;)t+=e[Math.floor(Math.random()*a)],n--;return t}function yt(){return j(this,null,function*(){return Ae||(Ae=new gt),new Promise((n,e)=>{Ae.armEnum().then(t=>{n(+t)}).catch(t=>{q.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Ce.throttle(()=>j(exports,null,function*(){const n=yield yt(),e={};if(typeof n!="number"||n<=0)q.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Ra();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(q.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(q.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function ka(n=0){return j(this,null,function*(){return Ae?new Promise((e,t)=>{Ae.armGetDongleInfo(n).then(a=>{a?e(a):(q.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(a))}).catch(a=>{t(a)})}):q.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Ra(){return j(this,null,function*(){if(!Ae)return q.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const n=yield yt();let e=[];for(let t=0;t<n;t++){const a=yield ka(t);e.push(a)}return e})}vt(16);vt(16);const Et=window.meta.app.inspect?he.SM4.constants.CBC:he.SM4.constants.ECB,{publicKey:mn,privateKey:fn}=he.SM2.generateKeyPair();function Da(n,e,t={}){const a=It(_t),r=t.mode||Et;t=r===he.SM4.constants.ECB?l({mode:r,inputEncoding:"utf8",outputEncoding:"hex"},t):l({iv:wt,mode:r,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=he.SM4.encrypt(n,a,t)}catch(i){console.log("err: ",i)}return o}function Ma(n,e,t={}){const a=It(_t),r=t.mode||Et;return t=r===he.SM4.constants.ECB?l({mode:r,inputEncoding:"hex",outputEncoding:"utf8"},t):l({iv:wt,mode:r,inputEncoding:"hex",outputEncoding:"utf8"},t),he.SM4.decrypt(n,a,t)}function It(n){return[...n].map(e=>e.charCodeAt().toString(16)).join("")}function Se(n){return n=At&&Ue(n)?Ma(n):n,Ue(n)?JSON.parse(n):n}function ze(n){return n=At&&Ue(n)?Da(n):n,JSON.stringify(n)}function fe(n,e,t,a){const r=new StorageEvent("storage",{url:window.location.href,key:n,oldValue:e,newValue:t,storageArea:a});window.dispatchEvent(r)}const je={getLocal:n=>{try{const e=window.localStorage.getItem(n);return Se(e)}catch(e){console.error(e)}},setLocal:(n,e)=>{try{const t=window.localStorage.getItem(n),a=ze(e);window.localStorage.setItem(n,a),fe(n,t,a,window.localStorage)}catch(t){console.error(t)}},eachLocal:n=>{if(!n||Le(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const a=window.localStorage.key(e);n((void 0).getLocal(a),a)}},clearLocal:()=>{window.localStorage.clear(),fe(null,null,null,window.localStorage)},removeLocal:n=>{const e=window.localStorage.getItem(n);window.localStorage.removeItem(n),fe(n,e,null,window.localStorage)},getSession:n=>{try{const e=window.sessionStorage.getItem(n);return Se(e)}catch(e){console.error(e)}},setSession:(n,e)=>{try{const t=window.sessionStorage.getItem(n),a=ze(e);window.sessionStorage.setItem(n,a),fe(n,t,a,window.sessionStorage)}catch(t){console.error(t)}},eachSession:n=>{if(!n||Le(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const a=window.sessionStorage.key(e);n((void 0).getSession(a),a)}},clearSession:()=>{window.sessionStorage.clear(),fe(null,null,null,window.sessionStorage)},removeSession:n=>{const e=window.sessionStorage.getItem(n);window.sessionStorage.removeItem(n),fe(n,e,null,window.sessionStorage)},onStorageChange:n=>{if(!n||Le(n)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{n({url:t.url,key:t.key,newValue:t.newValue?Se(t.newValue):null,oldValue:t.oldValue?Se(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},Xe=n=>{const{quality:e,value:t,function_id:a}=n;return(e>>7&1)===1||e===0&&a===2&&t===1},Qe="USER_TOKEN",Je="STATION_ID",Oa=[{key:0,value:"离线"},{key:1,value:"在线"}],La=[{key:0,value:"反向"},{key:1,value:"正向"},{key:2,value:"停止"}],Fa=[{key:1,value:1},{key:2,value:2},{key:3,value:3},{key:4,value:4},{key:5,value:5}],Ua="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1753954524851'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1506'%20width='256'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M888.65792%20280.15616a46.80704%2046.80704%200%200%200-46.80704-46.80704H233.34912a46.80704%2046.80704%200%200%200-46.80704%2046.80704v93.61408h702.11584V280.15616zM186.54208%20420.5824v374.46144a46.80704%2046.80704%200%200%200%2046.80704%2046.80704h608.49664a46.80704%2046.80704%200%200%200%2046.80704-46.80704V420.5824H186.54208z%20m442.9056%2084.98688l30.92992%2011.47904c-15.62624%2024.23808-35.39968%2050.38592-50.70848%2067.6096l-25.51296-10.84416c15.31392-17.85856%2034.7648-46.56128%2045.29152-68.24448z%20m-184.64768-1.59744c17.54112%2020.09088%2038.26688%2047.5136%2047.5136%2065.37728l-25.51296%2015.62624c-8.61184-17.85856-28.70272-46.23872-45.92128-67.28704l23.92064-13.71648z%20m199.95136%20267.2384h-45.28128c-32.20992%200-39.86432-8.92928-39.86432-39.86432v-102.36416h-46.23872c-5.73952%2069.8368-21.6832%20121.18528-101.0944%20149.56544-3.5072-7.97184-11.47904-19.456-18.49344-25.51296%2072.07424-22.9632%2083.87072-66.01728%2088.65792-124.05248H399.19616v-28.70272h122.7776V483.88096h30.92992v116.39808h122.46016v28.70272h-85.7856v102.04672c0%2010.5216%201.90976%2012.11904%2013.71136%2012.11904h38.90176c8.92928%200%2010.84416-4.1472%2011.8016-28.38016%206.69696%204.78208%2019.12832%209.56928%2027.42272%2011.47904-3.49696%2035.39968-11.4688%2044.96384-36.66432%2044.96384z'%20fill='%23005CFF'%20p-id='1507'%3e%3c/path%3e%3c/svg%3e",se=window.meta.graph.penFormMap?window.meta.graph.penFormMap:{NORMAL:[{name:"颜色",key:"color",type:"color",dataIds:{}}],TEXT:[{name:"显示内容",key:"text",type:"text",dataIds:{}}],AUDIO:[{name:"颜色",key:"color",type:"color",dataIds:{}}],MP4:[{name:"颜色",key:"color",type:"color",dataIds:{}}],CAMERA:[{name:"颜色",key:"color",type:"color",dataIds:{}}],VIDEO_STREAM:[{name:"颜色",key:"color",type:"color",dataIds:{}}],LIGHT_PLATE:[{name:"光字牌",key:"light_plate",type:"select",dataIds:{},options:[{label:"离线",value:-1},{label:"正常",value:0},{label:"预警",value:1},{label:"一般",value:2},{label:"严重",value:3},{label:"危急",value:4}]}]},Tt=window.meta.graph.lightPlateColorMap?window.meta.graph.lightPlateColorMap:{0:"#00d200",1:"#e2ac06",2:"#fa800a",3:"#f04155",4:"#ff0000"},St=window.meta.graph.lightPlateTextMap?window.meta.graph.lightPlateTextMap:{0:"#fff",1:"#fff",2:"#fff",3:"#fff",4:"#fff"},G={form:[{name:"带电状态",key:"charged_state",type:"select",dataIds:{},options:Oa.map(n=>({label:n.value,value:n.key}))},{name:"潮流方向",key:"electric_direction",type:"select",dataIds:{},options:La.map(n=>({label:n.value,value:n.key}))},{name:"电荷大小",key:"electric_size",type:"select",dataIds:{},options:Fa.map(n=>({label:n.value,value:n.key}))}],anchors:[{x:0,y:.5,id:"0"},{x:.5,y:0,id:"1"},{x:1,y:.5,id:"2"},{x:.5,y:1,id:"3"}],dataType:window.dataType,dataProp:window.dataProp,visibleLevel:window.visibleLevel},f=D(l({penType:b.NORMAL},G),{form:[...se[b.NORMAL],...G.form]});F.YX,F.YX,F.YX,b.POINT_VALUE,G.anchors,window.visibleLevel,G.form,G.form,window.dataType,window.dataProp,window.visibleLevel,G.form,window.dataType,window.dataProp,window.visibleLevel,G.form,window.dataType,window.dataProp,window.visibleLevel,St[0],b.LIGHT_PLATE,Tt[0],G.anchors,window.visibleLevel,[...se[b.LIGHT_PLATE],...G.form],be+"",b.SENSOR,G.anchors,window.visibleLevel,[...se[b.LIGHT_PLATE],...G.form],D(l({width:100,height:30,name:"text",penName:"文本",text:"文本",disableAnchor:!0,penType:b.TEXT},G),{form:[...se[b.TEXT],...G.form]}),l({width:100,height:100,name:"square",penName:"正方形"},f),D(l({type:1,name:"line",width:100,height:5,lineWidth:2,lineName:"line",penName:"line",background:"#FFF000",color:"#FFF000"},f),{lineAnimateType:1,anchors:[{x:0,y:.5,id:"0"},{x:1,y:.5,id:"1"}]}),l({width:200,height:50,borderRadius:0,name:"rectangle",penName:"矩形"},f),l({width:100,height:100,name:"circle",penName:"圆"},f),l({width:100,height:100,name:"triangle",penName:"三角形"},f),l({width:100,height:100,name:"diamond",penName:"菱形"},f),l({width:100,height:100,name:"pentagon",penName:"五边形"},f),l({width:100,height:100,name:"hexagon",penName:"六边形"},f),l({width:100,height:100,name:"pentagram",penName:"五角星"},f),l({width:120,height:60,name:"leftArrow",penName:"左箭头"},f),l({width:120,height:60,penName:"右箭头",name:"rightArrow"},f),l({width:150,height:60,name:"twowayArrow",penName:"双向箭头"},f),l({width:100,height:100,name:"cloud",penName:"云"},f),l({textTop:-.1,width:100,height:100,name:"message",penName:"消息框"},f),l({width:80,height:100,name:"file",penName:"文件"},f),D(l({width:60,height:100,name:"cube",penName:"立方体",z:.25},f),{props:{custom:[{key:"z",label:"Z",type:"number",min:0,placeholder:"<= 1 即宽度的比例"},{key:"backgroundFront",label:"前背景色",type:"color"},{key:"backgroundUp",label:"顶背景色",type:"color"},{key:"backgroundRight",label:"右背景色",type:"color"}]}}),l({width:70,height:100,name:"people",penName:"人"},f),D(l({name:"rectangle",penName:"按钮",width:80,height:30,borderRadius:.2,text:"按钮",background:"#1890ff",color:"#1890ff",textColor:"#fff",activeBackground:"#40a9ff",activeColor:"#40a9ff",activeTextColor:"#fff",hoverBackground:"#40a9ff",hoverColor:"#40a9ff",hoverTextColor:"#fff"},f),{penType:b.BUTTON}),D(l({name:"rectangle",penName:"输入框",height:50,width:200,input:!0,borderRadius:.05,ellipsis:!0,text:"输入数据",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10},f),{penType:b.INPUT}),D(l({name:"rectangle",penName:"选择器",height:50,width:200,borderRadius:.05,ellipsis:!0,text:"选项1",textAlign:"left",color:"#D9D9D9FF",textColor:"#000000FF",hoverTextColor:"#000000FF",activeTextColor:"#000000FF",textLeft:10,dropdownList:[{text:"选项1"},{text:"选项2"},{text:"选项3"}]},f),{penType:b.SELECT}),D(l({name:"slider",penName:"进度条",width:300,height:30,value:10,textWidth:50,barHeight:4,fontSize:20,min:0,max:100,color:"#1890ff",background:"#D4D6D9",textColor:"#222",unit:"%"},f),{penType:b.SLIDER}),D(l({name:"time",penName:"时间",width:300,height:40,text:`${Gt().format("YYYY-MM-DD HH:mm:ss")}`,lineWidth:0,fontSize:20,interval:67,fillZero:!0},f),{penType:b.TIME,form:[{key:"timeFormat",name:"显示格式",type:"text"},{key:"fillZero",name:"是否补0",type:"switch"},...f.form],timeFormat:"`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`"}),D(l({name:"switch",penName:"开关",height:30,width:60,checked:!1,offColor:"#BFBFBF",onColor:"#1890ff",disableOffColor:"#E5E5E5",disableOnColor:"#A3D3FF",locked:0},f),{penType:b.SWITCH}),D(l({name:"radio",penName:"单选框",direction:"horizontal",width:150,height:30,checked:"",options:[{text:"选项一"},{text:"选项二"},{text:"选项三",isForbidden:!0}]},f),{penType:b.RADIO}),D(l({name:"checkbox",penName:"多选框",width:30,height:30,checked:!0,value:"选项一"},f),{penType:b.CHECKBOX}),D(l({name:"table2",penName:"表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,hasHeader:!0,color:"#333",textColor:"#444"},f),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),D(l({name:"table2",penName:"斑马纹表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!0,hasHeader:!0,color:"#333",textColor:"#444"},f),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","物联网设备/智能家居/智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),D(l({name:"table2",penName:"滚动表格",width:80,height:30,datable:!0,disableAnchor:!0,colWidth:90,rowHeight:32,bordered:!0,vLine:!0,hLine:!0,stripe:!1,swiper:!0,maxNum:5,hasHeader:!0,color:"#333",textColor:"#444"},f),{penType:b.TABLE,replaceMode:2,data:[["设备 ID","设备名称","数据协议","级别"],["1","200","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["2","湿度传感器","MQTT",{text:"二级告警",background:"#4d2a02",textColor:"#E6A82EFF"}],["3","物联网设备","MQTT",{text:"一级告警",background:"#650b09",textColor:"#FF5D3CFF"}],["4","智慧城市","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}],["5","智能家居","MQTT",{text:"三级告警",textColor:"#58CC84FF",background:"#042617;"}]],styles:[{row:0,textColor:"#000"}]}),D(l({name:"svg",width:100,height:100,image:be+"/icon/audio.svg",audioId:"",penName:"音频",datable:!0,penType:b.AUDIO},G),{form:[...se[b.AUDIO],...G.form],events:[{name:"enter",action:ye.Emit,value:X.OPEN_AUDIO,where:{type:""},params:JSON.stringify({action:X.OPEN_AUDIO,data:""})},{name:"leave",action:ye.Emit,value:X.CLOSE_AUDIO,where:{type:""},params:JSON.stringify({action:X.CLOSE_AUDIO,data:""})}]}),D(l({name:"svg",width:100,height:100,image:be+"/icon/camera.svg",cameraId:"",penName:"摄像机",datable:!0,events:[{name:"enter",action:ye.Emit,value:X.OPEN_CAMERA,where:{type:""},params:JSON.stringify({action:X.OPEN_CAMERA,data:""})},{name:"leave",action:ye.Emit,value:X.CLOSE_CAMERA,where:{type:""},params:JSON.stringify({action:X.CLOSE_CAMERA,data:""})}],penType:b.CAMERA},G),{form:[...se[b.CAMERA],...G.form]}),D(l({name:"video",width:100,height:100,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penName:"MP4",penType:b.MP4},G),{form:[...se[b.MP4],...G.form]}),D(l({name:"video",width:100,height:100,penName:"视频流",datable:!0,video:"https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4",autoPlay:!0,penType:b.VIDEO_STREAM},G),{form:[...se[b.VIDEO_STREAM],...G.form]}),l({text:"开始/结束",width:120,height:40,borderRadius:.5,name:"rectangle",penName:"开始/结束"},f),l({text:"流程",width:120,height:40,name:"rectangle",penName:"流程"},f),l({text:"判定",width:120,height:60,name:"diamond",penName:"判定"},f),l({text:"数据",width:120,height:50,name:"flowData",penName:"数据",offsetX:.14},f),l({text:"准备",width:120,height:50,name:"hexagon",penName:"准备"},f),l({text:"子流程",width:120,height:50,name:"flowSubprocess",penName:"子流程"},f),l({text:"数据库",width:80,height:120,name:"flowDb",penName:"数据库"},f),l({text:"文档",width:120,height:100,name:"flowDocument",penName:"文档"},f),l({text:"内部存储",width:120,height:80,name:"flowInternalStorage",penName:"内部存储"},f),l({text:"外部存储",width:120,height:80,name:"flowExternStorage",penName:"外部存储"},f),l({text:"队列",width:100,height:100,name:"flowQueue",penName:"队列"},f),l({text:"手动输入",width:120,height:80,name:"flowManually",penName:"手动输入"},f),l({text:"展示",width:120,height:80,name:"flowDisplay",penName:"展示"},f),l({text:"并行模式",width:120,height:50,name:"flowParallel",penName:"并行模式"},f),l({text:"注释",width:100,height:100,name:"flowComment",penName:"注释"},f),l({text:"",width:30,height:30,name:"circle",penName:"开始",background:"#555",lineWidth:0},f),l({width:30,height:30,name:"activityFinal",penName:"结束"},f),l({text:"活动",width:120,height:50,borderRadius:.25,name:"rectangle",penName:"活动"},f),l({text:"决策/合并",width:120,height:50,name:"diamond",penName:"决策/合并"},f),l({text:"垂直泳道",width:200,height:500,name:"swimlaneV",penName:"垂直泳道",textBaseline:"top",textTop:20,lineTop:.08},f),l({text:"水平泳道",width:500,height:200,name:"swimlaneH",penName:"水平泳道",textWidth:.01,textLeft:.04,textAlign:"left",lineLeft:.08},f),l({text:"垂直分岔/汇合",width:10,height:150,name:"forkV",penName:"垂直分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},f),l({text:"水平分岔/汇合",width:150,height:10,name:"forkH",penName:"水平分岔/汇合",fillStyle:"#555",strokeStyle:"transparent"},f),l({name:"andGate",penName:"与门",width:100,height:150},f),l({name:"basicEvent",penName:"基本事件",width:100,height:150},f),l({name:"unexpandedEvent",penName:"未展开事件",width:100,height:150},f),l({name:"priorityAndGate",penName:"优先AND门",width:100,height:150},f),l({name:"forbiddenGate",penName:"禁止门",width:100,height:150},f),l({name:"event",penName:"事件",width:100,height:150},f),l({name:"switchEvent",penName:"开关事件",width:100,height:150},f),l({name:"conditionalEvent",penName:"条件事件",width:150,height:100},f),l({name:"transferSymbol",penName:"转移符号",width:100,height:150},f),l({name:"orGate",penName:"或门",width:100,height:150},f),l({name:"xorGate",penName:"异或门",width:100,height:150},f),l({name:"votingGate",penName:"表决门",width:100,height:150},f);const Ga=(n,e={isDev:!1,devServerUrl:"",devServerPort:8443})=>n.replace(/(https?:\/\/)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(:(\d+))?/,`$1${e.isDev?e.devServerUrl:Jt}:${e.isDev?e.devServerPort:ea}`),Ne=(n,e)=>{const t=n.__vccOpts||n;for(const[a,r]of e)t[a]=r;return t},Ba={class:"props-panel__title"},Va={class:"props-panel__value"},Ha={class:"props-panel__value-num"},Ka=Object.assign({name:"PropsPanle"},{__name:"PropsPanle",props:{data:{type:Object,default:null}},emits:["close"],setup(n,{emit:e}){const t=n,a=e;function r(i){return i==null||i==="—"?"—":typeof i=="number"?i.toFixed(2):i}const o=()=>{a("close")};return(i,u)=>{var p,g;return c.openBlock(),c.createElementBlock("div",{class:"props-panel",onMouseleave:o},[c.createElementVNode("div",Ba,c.toDisplayString(((p=t==null?void 0:t.data)==null?void 0:p.name)||"—"),1),u[1]||(u[1]=c.createElementVNode("div",{class:"props-panel__label"},"脉冲峰值",-1)),c.createElementVNode("div",Va,[c.createElementVNode("span",Ha,c.toDisplayString(r((g=t==null?void 0:t.data)==null?void 0:g.value)),1),u[0]||(u[0]=c.createElementVNode("span",{class:"props-panel__unit"},"dBm",-1))])],32)}}}),Wa=Ne(Ka,[["__scopeId","data-v-343ad322"]]);class Ya{constructor(e){oe(this,"editor");this.editor=e}initPlugin(e,t,a={}){e.installPenPlugins({name:t},[{plugin:Bt.mindBoxPlugin,options:a},{plugin:Vt.collapseChildPlugin,options:a}])}}function $a(n,e){var N,ee;const t=e||new Path2D,{x:a,y:r,width:o,height:i}=n.calculative.worldRect,u=a+o/2,p=r+i/2,g=o/2,Z=(N=n.startAngle)!=null?N:0,W=(ee=n.endAngle)!=null?ee:2*Math.PI;if(t.arc(u,p,g,Z,W,!0),t instanceof Path2D)return t}function qa(n,e){const t=e||new Path2D,{x:a,y:r,width:o,height:i}=n.calculative.worldRect;if(t.rect(a,r,o,i),t instanceof Path2D)return t}function za(n,e){const t=n||new Path2D,a=e.dimensionData;if(!a)return t;const r=e.calculative.worldRect,o=P=>({x:r.x+P.x*r.width,y:r.y+P.y*r.height}),i=o(a.tp1),u=o(a.tp2),p=o(a.dimStart),g=o(a.dimEnd),Z=e.calculative.fontSize||12;n&&n.beginPath&&(n.save(),n.beginPath(),n.strokeStyle=e.color||"#000",n.lineWidth=e.calculative.lineWidth||1);const W=Math.max(5,Z*.4),Q=p.x-i.x,N=p.y-i.y,ee=Math.hypot(Q,N)||1,ne=p.x+Q/ee*W,ce=p.y+N/ee*W,de=g.x-u.x,ae=g.y-u.y,_=Math.hypot(de,ae)||1,x=g.x+de/_*W,U=g.y+ae/_*W;t.moveTo(i.x,i.y),t.lineTo(ne,ce),t.moveTo(u.x,u.y),t.lineTo(x,U),t.moveTo(p.x,p.y),t.lineTo(g.x,g.y);const J=Math.hypot(g.x-p.x,g.y-p.y),B=Math.min(10,J/2.1),E=(P,M)=>{if(B<1)return;const R=Math.atan2(M.y-P.y,M.x-P.x),k=Math.PI/6,Y=M.x-B*Math.cos(R-k),H=M.y-B*Math.sin(R-k),re=M.x-B*Math.cos(R+k),ie=M.y-B*Math.sin(R+k);t.moveTo(M.x,M.y),t.lineTo(Y,H),t.lineTo(re,ie),t.closePath()};if(E(g,p),E(p,g),n&&n.stroke&&(n.stroke(),n.restore()),n&&n.fillText&&a.text){n.save(),n.fillStyle=e.textColor||e.color||"#000",n.textAlign="center",n.textBaseline="bottom";let P=Z;n.font=`${e.fontStyle||""} ${e.fontWeight||""} ${P}px ${e.fontFamily||"Arial"}`;const M=n.measureText(a.text),R=J*.9;if(M.width>R&&R>0){const re=R/M.width;P=P*re,n.font=`${e.fontStyle||""} ${e.fontWeight||""} ${P}px ${e.fontFamily||"Arial"}`}const k=(p.x+g.x)/2,Y=(p.y+g.y)/2;let H=Math.atan2(g.y-p.y,g.x-p.x);(H>Math.PI/2||H<-Math.PI/2)&&(H+=Math.PI),n.translate(k,Y),n.rotate(H),n.fillText(a.text,0,-P*.2),n.restore()}if(t instanceof Path2D)return t}function ja(){return j(this,null,function*(){yield meta2d.register({arc:$a,mtext:qa}),yield meta2d.registerCanvasDraw({dimension:za})})}const Xa="original_meta2d";function Qa(){return localStorage.removeItem(Xa)}let we={};const Ja=n=>{const e=document.querySelectorAll("video");let t=null;if(e.forEach(r=>{r.getAttribute("src")===n.video&&(t=r)}),!t)return;t.setAttribute("muted","muted"),t.setAttribute("autoplay","autoplay"),t.setAttribute("loop","loop"),t.setAttribute("crossorigin",""),t.setAttribute("controls",""),t.style.display="none",t.parentElement.style.border="2px solid #ffc878";const a=new JessibucaPro({container:t.parentElement,background:"",hasControl:!1,controlAutoHide:!0,checkFirstIFrame:!0,debug:!1,decoder:"./wasm/decoder-pro.js",forceNoOffscreen:!0,hotKey:!1,hasAudio:!1,hasVideo:!0,hiddenAutoPause:!1,isFlv:!0,isResize:!1,isNotMute:!0,loadingIcon:!0,loadingText:"加载中...",networkDelayTimeoutReplay:!1,playbackForwardMaxRateDecodeIFrame:8,showBandwidth:!1,showPerformance:!1,syncAudioAndVideo:!0,supportDblclickFullscreen:!1,timeout:10,useMSE:!0,useWCS:!1,useSIMD:!0,useVideoRender:!0,useCanvasRender:!1,videoBuffer:.2,videoBufferDelay:1});return n.autoPlay&&n.streamUrl&&a.play(n.streamUrl),we[n.id]=a,a},Za=()=>{Object.keys(we).forEach(n=>{we[n].destroy(),we[n]=null}),we={}},en={class:"sy-empty"},tn={key:1,class:"sy-empty-picture"},an={class:"sy-empty-description"},nn=Object.assign({name:"SyEmpty"},{__name:"index",props:{image:{type:String,default:"empty"},imageSize:{type:Number,default:80},description:{type:String,default:"暂无数据"},onlyText:{type:Boolean,default:!1}},setup(n){c.useCssVars(r=>({a7383bac:a.value.width,v736d2d7a:a.value.height}));const e=n,t=c.computed(()=>({"font-size":e.imageSize?`${e.imageSize}px`:"80px"})),a=c.computed(()=>e.imageSize?{width:e.imageSize*1.2+"px",height:e.imageSize+"px"}:{width:"187px",height:"144px"});return(r,o)=>{const i=c.resolveComponent("SyIcon"),u=c.resolveComponent("el-icon");return c.openBlock(),c.createElementBlock("div",en,[n.image!=="empty"?(c.openBlock(),c.createElementBlock("span",{key:0,class:"sy-empty-image",style:c.normalizeStyle(t.value)},[n.image!=="loading"?(c.openBlock(),c.createBlock(i,{key:0,name:n.image,gradient:""},null,8,["name"])):(c.openBlock(),c.createBlock(u,{key:1,class:"is-loading",style:{color:"#1671d4"}},{default:c.withCtx(()=>[c.createVNode(c.unref(Yt.Loading))]),_:1}))],4)):n.onlyText?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",tn)),c.createElementVNode("div",an,[c.createElementVNode("p",null,c.toDisplayString(n.description),1)])])}}}),rn=Ne(nn,[["__scopeId","data-v-247a0fc9"]]),on=Object.assign({name:"Meta2dEditor"},{__name:"index",props:{url:{type:String,default:""},data:{type:Object,default:()=>{}},local:{type:Boolean,default:!1},preview:{type:Boolean,default:!1},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["loaded","load-error"],setup(n,{expose:e,emit:t}){const a=t,r=n,o=c.ref(null),i=c.shallowRef(),u=c.computed(()=>!!(r.data||r.url));c.watch(()=>[r.data,r.url],()=>{u.value&&g()});let p=c.ref(!0);function g(){return j(this,null,function*(){try{if(p.value=!0,yield c.nextTick(),!o.value){console.error("未找到meta2d元素!");return}let _=null;if(r.data?_=r.data:r.url&&(_=yield de()),!_||!_.data){p.value=!1,console.log("图纸数据为空"),a("load-error");return}const x=_.options||{background:"#eee",disableAnchor:!1};if(i.value&&(i.value.destroy(!0),i.value=null),!o.value){console.error("Meta2D 容器元素不可用");return}i.value=new V.Meta2d(o.value,l({},x)),x.visibleLevel&&i.value.scale(x.visibleLevel),Z(),W(),yield Q(_.data),i.value.render(),ee(),setTimeout(()=>{window.meta2dTools&&window.registerToolsNew()},1e3),a("loaded",i.value)}catch(_){console.error("初始化编辑器失败:",_)}})}function Z(){if(!i.value)return;new Ya({}).initPlugin(i.value,"mindNode",{})}function W(){ja(),V.register(Kt.classPens()),V.register(Ve.flowPens()),V.registerAnchors(Ve.flowAnchors()),V.register(He.sequencePens()),V.registerCanvasDraw(He.sequencePensbyCtx()),V.register(Ke.activityDiagram()),V.registerCanvasDraw(Ke.activityDiagramByCtx()),V.registerCanvasDraw(Ht.formPens()),V.registerCanvasDraw(Wt.chartsPens()),V.register(Re.ftaPens()),V.registerAnchors(Re.ftaAnchors()),V.registerCanvasDraw(Re.ftaPensbyCtx())}function Q(_){var x;if(i.value){if(typeof _.locked=="undefined"&&(_.locked=0),_.bkImage&&i.value.setBackgroundImage(_.bkImage),_.pens&&_.pens.length>0){const U=[];_.pens.forEach(E=>{E.name==="video"&&E.streamUrl?U.push(E):E.name==="image"&&E.image?E.image=Ga(E.image,r.devConfig):E.lineType==="gisLine"?E.visible=!r.preview:E.penType===b.TABLE&&E.dataType?N(E):E.penType===b.GIS_SENSOR_WRAPPER&&r.preview&&(E.title="")}),U.length>0&&setTimeout(()=>{U.forEach(E=>{Ja(E)})},500);const J=window.meta.graph.penCountThreshold||2e3;_.pens.length>J&&_.scale&&_.pens.forEach(E=>{const P=E.visibleLevel;P!==void 0?(E.visible=_.scale>=P,E.visible||(E.disabled=!0,E.locked=V.LockState.Disable)):(E.visible=!0,E.disabled=!1,E.locked=V.LockState.None)})}i.value.open(_),!r.preview&&((x=_.networks)!=null&&x.length)&&i.value.closeNetwork()}}const N=_=>j(this,null,function*(){var U;const x=yield le.getCommonApi(jt[_.dataType],{offset:0,limit:_.tableSize||10});if((U=x.data)!=null&&U.length){const J=_.tableHeader||[{prop:"id",label:"ID"},{prop:"guid",label:"标识"},{prop:"name",label:"名称"}],B=x.data.map(E=>J.filter(P=>P.isShow).map(P=>{const M=E[P.prop];return P.choices?P.choices[M]||M:Ce.isObject(M)?M.name:M}));i.value.setValue({id:_.id,dataY:B})}else i.value.setValue({id:_.id,dataY:[]})}),ee=()=>{i.value&&(i.value.on("scale",ne),r.preview||i.value.on("connectLine",ce))},ne=Ce.debounce(_=>{var x,U,J,B;try{if(!i.value)return;Fe.emit("graph-scale",_);let E=i.value.store.data.pens;const P=window.meta.graph.penCountThreshold||2e3,M=E.length>P;for(let R=0;R<E.length;R++){const k=E[R];if([b.VIDEO_STREAM,b.MP4].includes(k.penType)){if(((U=(x=me.videos[k.id])==null?void 0:x.children)==null?void 0:U.length)===3){let Y=me.videos[k.id].children[0],H=me.videos[k.id].children[2];Y.style.width=H.currentTime/H.duration*k.calculative.worldRect.width+"px"}else if(((B=(J=me.videos[k.id])==null?void 0:J.children)==null?void 0:B.length)===2){let Y=me.videos[k.id].children[0],H=me.videos[k.id].children[1];Y.style.width=H.currentTime/H.duration*k.calculative.worldRect.width+"px"}}if(M){const Y=k.visibleLevel!==void 0?_>=k.visibleLevel:!0;i.value._setValue({id:k.id,visible:Y,disabled:!Y,locked:Y?V.LockState.None:V.LockState.Disable})}}i.value.render()}catch(E){console.error("处理缩放失败:",E)}},500),ce=J=>j(this,[J],function*({line:_,lineAnchor:x,pen:U}){var ie;if(x!=null&&x.start||(U==null?void 0:U.penType)!==b.GIS_SENSOR)return;const B=(ie=_==null?void 0:_.calculative)==null?void 0:ie.worldAnchors;if(B.length!==2||B!=null&&B.some(ge=>!ge.connectTo))return;const[E,P]=B;if(E.connectTo===P.connectTo)return;const M=window.meta2d.findOne(E.connectTo),R=window.meta2d.findOne(P.connectTo);let k=M==null?void 0:M.bindData,Y=R==null?void 0:R.bindData;if(!k||!Y)return;const H=yield le.postPDApi("setchannelpaired/",{data:[{channel1:k.guid,channel2:Y.guid}]}),re=yield le.postCommonApi("sgpoint",{ln__in:`${k.guid},${Y.guid}`,group_number__in:6});H.success&&re.success?(i.value.setValue({id:_.id,color:"#00d200",lineDash:[3,3],lineWidth:2,lineType:"gisLine"}),q.ElMessage.success("配对成功")):q.ElMessage.error("配对失败",H.detail||re.detail)});function de(){return j(this,null,function*(){if(!r.url)return q.ElMessage.error("图纸路径为空!"),null;try{return(yield le.getGraphApi(r.url,{local:r.local}))||null}catch(_){return null}})}const ae=()=>{i.value&&(i.value.resize(),i.value.fitView(!0,10))};return c.onMounted(()=>{var _,x;u.value&&(_=o.value)!=null&&_.clientHeight&&(x=o.value)!=null&&x.clientWidth&&g(),window.addEventListener("resize",ae)}),c.onUnmounted(()=>{Za(),Qa(),i.value&&(r.preview?(ft.clearLineCross(),i.value.destroy(!0)):i.value.off("scale",ne)),window.removeEventListener("resize",ae)}),e({stage:i}),(_,x)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"meta2dRef",ref:o,class:"meta2d-editor"},[c.unref(p)?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(rn,{key:0,class:"meta2d-empty",description:"图纸不存在"}))],512))}}),sn=Ne(on,[["__scopeId","data-v-f157e247"]]),ln={key:0,class:"back-btn"};var ht,mt;const cn=Object.assign({name:"Meta2dPreview"},{__name:"index",props:{url:{type:String,default:""},gid:{type:String,default:""},data:{type:Object,default:null},local:{type:Boolean,default:!1},lang:{type:String,default:((mt=(ht=window.meta)==null?void 0:ht.app)==null?void 0:mt.lang)||"zh-cn"},config:{type:Object,default:()=>({socketUrl:Ye,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,enableWebSocket:!0,graphSocket:We.GRAPH.SOCKET})},showMap:{type:Boolean,default:!1},isFactory:{type:Boolean,default:!1},isInitData:{type:Boolean,default:!0},apiInstance:{type:Object,default:()=>le},mittInstance:{type:Object,default:()=>Fe},customCallbacks:{type:Object,default:()=>({})},errorHandler:{type:Object,default:()=>({callback:null,showMessage:!0})},devConfig:{type:Object,default:()=>({isDev:!1,devServerUrl:"",devServerPort:8443})}},emits:["error","loaded","custom-msg","socket-msg"],setup(n,{expose:e,emit:t}){const a=t,r=n;let o=c.ref(!1),i=c.ref(""),u=c.ref(!1);const p=c.ref(null),g=c.ref(null),Z=c.ref(null),W=c.ref(""),Q=c.ref(!1),N=c.computed(()=>{var s;return(s=Z.value)==null?void 0:s.stage}),ee=c.computed(()=>{var s;return(s=N.value)==null?void 0:s.store}),ne=c.computed(()=>l({socketUrl:Ye,stationIdKey:Je,enableToken:!0,userTokenKey:Qe,userToken:void 0,messageDelay:200,debounceDelay:100,enableAutoFit:!0,fitPadding:10,enableWebSocket:!0,graphSocket:We.GRAPH.SOCKET},r.config)),ce=()=>r.apiInstance||le,de=()=>r.mittInstance||Fe,ae=(s,h="")=>{const w={error:s,message:h,timestamp:new Date().toISOString()};a("error",w),r.errorHandler.callback?r.errorHandler.callback(w):r.errorHandler.showMessage&&q.ElMessage&&q.ElMessage.error(`${h}: ${s.message||s}`)},_=()=>{i.value&&(W.value=i.value,Q.value=u.value)},x={},U=c.ref(!1),J=c.ref({left:0,top:0}),B=(s,h)=>{if(!p.value)return{left:s+20,top:h+20};const w=p.value.getBoundingClientRect(),C=s-w.left,O=h-w.top;let S=300,I=150;if(g.value){const v=g.value.$el||g.value;v&&v.offsetWidth&&(S=v.offsetWidth,I=v.offsetHeight)}let m=C+20,y=O+20;return m+S>w.width&&(m=C-S-20),y+I>w.height&&(y=O-I-20),{left:Math.max(0,Math.min(m,w.width-S)),top:Math.max(0,Math.min(y,w.height-I))}},E=s=>{U.value&&(J.value=B(s.clientX,s.clientY))},P=s=>{var h,w,C,O,S,I;try{if(!s)return;if((h=s==null?void 0:s.includes)!=null&&h.call(s,"token 必传"))return q.ElMessage.warning(s);const m=typeof s=="string"?JSON.parse(s):s;if((m==null?void 0:m.data)==="服务错误"||(C=(w=m==null?void 0:m.data)==null?void 0:w.includes)!=null&&C.call(w,"token is expired"))return q.ElMessage.warning(m.data);switch(a("socket-msg",m),m.action){case De.ACPOINT.YCVALUE:case De.ACPOINT.YXVALUE:if((O=m==null?void 0:m.data)!=null&&O.point_id){const y=N.value.find(m.data.point_id);y&&(x[m.data.point_id]=m.action===De.ACPOINT.YXVALUE?Ie(m.data.value)?m.data.value:0:Ie(m.data.value_disp||m.data.value)?m.data.value_disp||m.data.value:0,ve(y,m.data))}break;default:if(((S=m.data)==null?void 0:S.length)>0){const y=setTimeout(()=>{clearTimeout(y),N.value&&(m.data.forEach(v=>{x[v.dataId||v.point_id]=v.value_disp||v.value}),m.data.forEach(v=>{const T=N.value.find(v.dataId||v.point_id);ve(T,v)}))},ne.value.messageDelay);r.customCallbacks.onWebSocketMessage&&r.customCallbacks.onWebSocketMessage(m),(I=window.customSocketFn)==null||I.call(window,s)}break}return!0}catch(m){return ae(m,"WebSocket消息处理"),!0}},M=c.ref({});let R={},k=null;const Y=s=>j(this,null,function*(){try{if(s.msgName)switch(s.msgName){case X.CHANGE_GRAPH:case X.NOTIFY_DIALOG:case X.GIS_PROPS_PANEL:H(s);break}else H(s);a("custom-msg",s),r.customCallbacks.onCustomMessage&&r.customCallbacks.onCustomMessage(s)}catch(h){ae(h,"自定义消息处理")}}),H=s=>{var C,O;let h;if(s.params)try{h=JSON.parse(s.params)}catch(S){h=s.params}switch(s.msgName){case X.CHANGE_GRAPH:(h==null?void 0:h.data)!=="图纸id"?(i.value=W.value,u.value=Q.value,o.value=h.isBack,(C=h==null?void 0:h.data)!=null&&C.startsWith("/")?(W.value=h==null?void 0:h.data,Q.value=!0):(Q.value=!1,ie(h.data))):console.warn("切换图纸信息为空");break;case X.NOTIFY_DIALOG:h.msg!=="通知内容"?q.ElNotification(l({message:h.msg},h)):console.warn("通知内容为空");break;case X.GIS_PROPS_PANEL:s.eventName==="enter"?(U.value=!0,M.value=((O=s==null?void 0:s.pen)==null?void 0:O.bindData)||{},s.e&&(J.value=B(s.e.clientX,s.e.clientY))):(U.value=!1,M.value={});break}},re=s=>{var h,w,C,O,S,I,m,y,v;try{a("loaded",s);const T=$e(),d=ne.value,A=je.getSession(d.stationIdKey),$=je.getSession(d.userTokenKey);d.enableWebSocket&&A&&$&&((C=(w=(h=s.store)==null?void 0:h.data)==null?void 0:w.networks)!=null&&C.length?(I=(S=(O=s.store)==null?void 0:O.data)==null?void 0:S.networks)==null||I.forEach(z=>{var ue;z.protocol==="websocket"&&((ue=z.url)!=null&&ue.includes("station_id")||(z.url=`${z.url}?station_id=${A}`),d.enableToken?z.protocols=d.userToken||$:z.protocols=void 0)}):(y=(m=s.store)==null?void 0:m.data)!=null&&y.websocket?((v=s.store.data.websocket)!=null&&v.includes("station_id")||(s.store.data.websocket=`${s.store.data.websocket}?station_id=${A}`),d.enableToken?s.store.data.websocketProtocols=d.userToken||$:s.store.data.websocketProtocols=void 0,s.closeSocket(),s.connectSocket()):(s.store.data.websocket=`${d.socketUrl}?station_id=${A}`,d.enableToken?s.store.data.websocketProtocols=$:s.store.data.websocketProtocols=void 0,s.connectWebsocket())),(r.showMap||T.showMap==="true")&&s.showMap(),s.setRule({rule:!1}),s.setOptions({disableRuleLine:!0}),s.setGrid({grid:!1}),s.lock(V.LockState.DisableEdit),Pe().forEach(z=>{var ue;(ue=z==null?void 0:z.events)!=null&&ue.length?K({id:z.id,locked:1},!1):K({id:z.id,locked:10},!1)}),s.render(),d.enableAutoFit&&s.fitView(!0,d.fitPadding),Object.values(X).forEach(z=>{s.on(z,ue=>Y(D(l({},ue),{msgName:z})))}),s&&(s.socketFn=P),r.customCallbacks.onStageLoaded&&r.customCallbacks.onStageLoaded(s),r.isInitData&&bt(s),window.addEventListener("mousemove",E)}catch(T){ae(T,"图纸加载完成处理")}},ie=Ce.throttle(s=>j(this,null,function*(){var h;try{if(r.url){Q.value=r.local,yield ge(r.url);return}const w=$e();if(s=s||r.gid||w.id,w.local==="true"&&(Q.value=!0),s){const C=ce();if(C&&C.getCommonApi){const O=yield C.getCommonApi(r.isFactory?"graph":"floorplan",{guid:s});if((h=O.data)!=null&&h.length)yield ge(O.data[0].path);else{const S="未找到图纸!";ae(new Error(S),"获取图纸数据")}}else ae(new Error("API实例不可用"),"初始化图纸数据!")}else Q.value=r.local,yield ge(r.url);r.customCallbacks.onGraphLoaded&&r.customCallbacks.onGraphLoaded(W.value)}catch(w){ae(w,"获取图纸数据失败")}})),ge=s=>j(this,null,function*(){const h=s.split(".");if(s.includes(r.lang)||h.length!==3){W.value=s;return}const w=`${h[0]}.${r.lang}.${h[2]}`;try{const C=yield le.getGraphApi(w,{local:r.local}).catch(()=>{console.warn("多语言图纸不存在,使用默认图纸")});W.value=C?w:s}catch(C){W.value=s}}),bt=s=>j(this,null,function*(){var h,w,C,O;if(s){let S=[],I=[],m=[];R={};const y=s.store.data.pens;for(let T=0;T<y.length;T++){const d=y[T];d.bindDataId?(h=d.form)!=null&&h.length?d.form.forEach(A=>{if(A.dataIds.dataId)switch(A.dataIds.dataType){case F.YC:S.push(D(l({},A),{nodeName:A.dataIds.name,penId:d.id,penName:d.penName}));break;case F.YX:I.push(D(l({},A),{nodeName:A.dataIds.name,penId:d.id,penName:d.penName}));break;case F.SG:I.push(D(l({},A),{nodeName:A.dataIds.name,penId:d.id,penName:d.penName}));break;case F.POINT:m.push(D(l({},A),{nodeName:A.dataIds.name,penId:d.id,penName:d.penName}));break}}):(d.penType===b.GIS_SENSOR||d.penType===b.GIS_DB_VALUE)&&d.bindData&&(R[d.bindData.ied_id]||(R[d.bindData.ied_id]=[]),K({id:d.id,title:void 0}),R[d.bindData.ied_id].push(l({penId:d.id,penType:d.penType},d.bindData))):(w=d.statusBindData)!=null&&w.length&&d.statusBindData.forEach(A=>{if(A.dataId)switch(A.dataType){case F.YX:I.push({showChild:0,value:0,nodeName:A.dataName,penId:d.id,penName:d.penName,dataId:A.dataId});break;case F.SG:I.push({showChild:0,value:0,nodeName:A.dataName,penId:d.id,penName:d.penName,dataId:A.dataId});break}})}let v=[];if(S.length){const T=ce();if(T&&T.postCommonApi){const d=yield T.postCommonApi("queryrealtimepoint",{point_id:S.map(A=>{var $;return(($=A==null?void 0:A.dataIds)==null?void 0:$.dataId)||A.dataId}).join(",")});(C=d==null?void 0:d.data)!=null&&C.length&&(d.data.forEach(A=>{x[A.guid]=A.value_disp||A.value}),v=[...v,...d.data])}}if(I.length){const T=ce();if(T&&T.postCommonApi){const d=yield T.postCommonApi("queryrealtimepoint",{point_id:I.map(A=>{var $;return(($=A==null?void 0:A.dataIds)==null?void 0:$.dataId)||A.dataId}).join(",")});(O=d==null?void 0:d.data)!=null&&O.length&&(d.data.forEach(A=>{x[A.guid]=Oe(A.value)?Number(A.value):A.value}),v=[...v,...d.data])}}v.length&&v.forEach(T=>{const d=s.find(T.guid);ve(d,D(l({},T),{value:Oe(T.value)?Ie(Number(T.value))?Number(T.value):0:T.value,value_disp:T.value_disp,alarm_value:T.alarm_value,point_id:T.guid}))}),R&&Object.keys(R).length?(k&&clearInterval(k),Ge(),k=setInterval(()=>{Ge()},3e3)):k&&clearInterval(k)}}),Ge=()=>j(this,null,function*(){var s;if(R){const h=Object.keys(R);if(h.length){const w=yield le.postPDApi("querychannelstatus/",{data:h.map(C=>({ied_id:C,ln_list:R[C].map(O=>O.ln_id)}))});(s=w==null?void 0:w.data)!=null&&s.length&&(h.forEach(C=>{const O=w.data.find(I=>I.ied_id===C),S=R[C];S!=null&&S.length&&S.forEach(I=>{const m=O.result.find(y=>y.ln_id===I.ln_id);if(m){const y=Oe(m.amp_peak)?Ie(Number(m.amp_peak))?Number(m.amp_peak):0:m.amp_peak;I.penType===b.GIS_SENSOR?K({id:I.penId,showChild:m.status==="告警"?2:m.status==="正常"?1:0,bindData:D(l({},I),{status:m.status,value:y})},!1):K({id:I.penId,text:`${y} dBm`},!1)}})}),N.value.render())}}}),K=(s,h=!0)=>{if(N.value)return N.value.setValue(s,{render:h})},Ct=()=>N.value,Pe=()=>{var s,h;return((h=(s=ee.value)==null?void 0:s.data)==null?void 0:h.pens)||[]},xt=()=>b,ve=(()=>{let s=null;const h=new Map,w=new Map,C=S=>{var m;if(!((m=S.children)!=null&&m.length))return[];const I=S.id||"";if(!I)return[];if(!w.has(I)&&ee.value){const y=V.getAllChildren(S,ee.value);w.set(I,y)}return w.get(I)||[]},O=()=>{if(h.size===0||!N.value||!ee.value)return;const S=[],I=[],m=ee.value.animates;h.forEach(({pen:y,dataItem:v,formKey:T})=>{switch(T){case"showChild":K({id:y.id,showChild:+v.value},!1);break;case"text":K({id:y.id,text:v.value_disp||v.value},!1);break;case"light_plate":{const d=v.value===-1||Xe(v)?"#999999":St[v.value!==void 0?v.value:v.alarm_value],A=v.value===-1||Xe(v)?"#cccccc":Tt[v.value!==void 0?v.value:v.alarm_value];K({id:y.id,textColor:d,background:A},!1)}break;case"point_value":y.penType===b.POINT_VALUE&&C(y).forEach(A=>{A.name==="text"&&K({id:A.id,text:v.value},!1)});break;case"online_state":{let d=v.value?void 0:"contrast(0%)";K({id:y.id,filter:d},!1),C(y).forEach($=>{K({id:$.id,filter:d},!1)})}break;case"charged_state":{const d=v.value===__$t__.OFFLINE?"contrast(0%)":void 0;d!==y.filter&&(K({id:y.id,filter:d},!1),C(y).forEach($=>{K({id:$.id,filter:d},!1)}))}break;case"electric_direction":v.value===qt.STOP?m!=null&&m.has(y)&&I.push(y):!!v.value!==y.animateReverse&&(K({id:y.id,animateReverse:!!v.value},!1),m!=null&&m.has(y)||S.push(y));break;case"electric_size":{const d=zt[v.value];d!==void 0&&d!==y.lineWidth&&K({id:y.id,lineWidth:d},!1)}break;default:K({id:y.id,[T]:v.value},!1);break}}),I.length>0&&N.value.stopAnimate(I),S.length>0&&N.value.startAnimate(S),h.clear(),N.value.render()};return(S,I)=>{S!=null&&S.length&&(S.forEach(m=>{var v;const y=m.form;if((v=m.statusBindData)!=null&&v.length){if(!x[I.guid])return;const T=[...m.statusBindData],d=T.findIndex(A=>A.dataId===I.guid);if(d!==-1){const A=T[d];T.find(te=>A.sort<te.sort&&x[te.dataId])||h.set(m.id,{pen:m,formKey:"showChild",dataItem:D(l({},I),{value:d})})}}else y!=null&&y.length&&y.forEach(T=>{if(!(Array.isArray(T.dataIds)?T.dataIds:[T.dataIds]).some(te=>(te==null?void 0:te.dataId)&&((te==null?void 0:te.dataId)===I.dataId||(te==null?void 0:te.dataId)===I.point_id)))return;const $=`${m.id}-${T.key}`;h.set($,{pen:m,dataItem:I,formKey:T.key})})}),s&&clearTimeout(s),s=setTimeout(()=>{O(),s=null},ne.value.debounceDelay))}})(),Nt=s=>{if(N.value){for(let h=0;h<s.length;h++){const w=s[h];x[w.dataId||w.point_id]=w.value_disp||w.value;const C=N.value.find(w.dataId);setTimeout(()=>{ve(C,w)},ne.value.messageDelay)}N.value.render(),r.customCallbacks.onBatchUpdate&&r.customCallbacks.onBatchUpdate(s)}},Pt=(s,h=!1)=>{if(!N.value)return;const w=Pe();for(let C=0;C<w.length;C++){const O=w[C];let S=!1;h?S=s===O.dataProp:S=s===5?!0:O.dataProp<=s,K({id:O.id,visible:S},!1)}N.value.fitView(),N.value.render(),r.customCallbacks.onLevelChange&&r.customCallbacks.onLevelChange(s,h)};return c.watch(()=>[r.gid,r.url,r.data,r.lang,r.local,r.isFactory],()=>{ie()}),c.watch(()=>r.showMap,s=>{N.value&&(s?N.value.showMap():N.value.hideMap())}),c.onMounted(()=>{const s=de();s&&s.on&&s.on(ne.value.graphSocket,P),ie()}),c.onUnmounted(()=>{R=null;const s=de();s&&s.off&&s.off(ne.value.graphSocket,P),window.removeEventListener("mousemove",E)}),e({setValue:K,getStage:Ct,getAllPens:Pe,getCustomPenType:xt,batchUpdatePen:Nt,handleLineCross:ft.handleLineCross,changeVisibleByLevel:Pt}),(s,h)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"previewRef",ref:p,class:"meta2d-preview"},[c.createVNode(sn,{ref_key:"graphRef",ref:Z,url:W.value,local:Q.value,data:r.data,"dev-config":r.devConfig,preview:"",onLoaded:re},null,8,["url","local","data","dev-config"]),c.unref(o)?(c.openBlock(),c.createElementBlock("div",ln,[c.createVNode(c.unref(q.ElButton),{type:"primary",onClick:_},{default:c.withCtx(()=>[...h[1]||(h[1]=[c.createTextVNode("返回",-1)])]),_:1})])):c.createCommentVNode("",!0),U.value?(c.openBlock(),c.createBlock(Wa,{key:1,ref_key:"panelRef",ref:g,data:M.value,style:c.normalizeStyle({top:J.value.top+"px",left:J.value.left+"px",position:"absolute",pointerEvents:"none"}),onClose:h[0]||(h[0]=w=>U.value=!1)},null,8,["data","style"])):c.createCommentVNode("",!0)],512))}}),_e=Ne(cn,[["__scopeId","data-v-b001ce67"]]);_e.name||(_e.name="SyGraph");const dn=n=>{n.component(_e.name||"SyGraph",_e)},un={install:dn};exports.SyGraph=_e;exports.default=un;