geekin-devtoys 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/GButton/index.js +1 -1
- package/lib/GButton/index.mjs +1 -1
- package/lib/GButton/style.css +1 -1
- package/lib/GInputTreeTag/index.js +1 -1
- package/lib/GInputTreeTag/index.mjs +133 -136
- package/lib/GInputTreeTag/style.css +1 -1
- package/lib/GPluginVideo/index.js +1 -1
- package/lib/GPluginVideo/index.mjs +149 -2072
- package/lib/GPluginVideo/web-control.esm.min.js +2 -0
- package/lib/GTag/index.js +1 -1
- package/lib/GTag/index.mjs +4 -4
- package/lib/GTree/index.js +1 -0
- package/lib/GTree/index.mjs +295 -0
- package/lib/GTree/style.css +1 -0
- package/lib/GTree.d.ts +1 -0
- package/lib/assets/GTag.css +1 -1
- package/lib/components/GButton/index.d.ts +1 -1
- package/lib/components/GInputTreeTag/index.d.ts +322 -2006
- package/lib/components/GTag/index.d.ts +1 -1
- package/lib/components/GTree/index.d.ts +83 -0
- package/lib/components/GTree/types.d.ts +53 -0
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +9 -6
- package/lib/index/style.css +4 -2
- package/lib/index.d.ts +2 -1
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("vue"),Bt=require("jsencrypt"),ne=require("element-plus");var qe,$t=new Uint8Array(16);function Zt(){if(!qe&&!(qe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qe($t)}var Ht=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Vt(e){return typeof e=="string"&&Ht.test(e)}for(var y=[],Ie=0;Ie<256;++Ie)y.push((Ie+256).toString(16).substr(1));function N(e,t,s){var o=(e=e||{}).random||(e.rng||Zt)();return o[6]=15&o[6]|64,o[8]=63&o[8]|128,(function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(y[n[r+0]]+y[n[r+1]]+y[n[r+2]]+y[n[r+3]]+"-"+y[n[r+4]]+y[n[r+5]]+"-"+y[n[r+6]]+y[n[r+7]]+"-"+y[n[r+8]]+y[n[r+9]]+"-"+y[n[r+10]]+y[n[r+11]]+y[n[r+12]]+y[n[r+13]]+y[n[r+14]]+y[n[r+15]]).toLowerCase();if(!Vt(a))throw TypeError("Stringified UUID is invalid");return a})(o)}const Gt=typeof atob=="function",jt=typeof btoa=="function",te=typeof Buffer=="function",Ze=typeof TextDecoder=="function"?new TextDecoder:void 0,He=typeof TextEncoder=="function"?new TextEncoder:void 0,ie=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),me=(e=>{let t={};return ie.forEach(((s,o)=>t[s]=o)),t})(),Kt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,v=String.fromCharCode.bind(String),Ve=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):(e,t=(s=>s))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),pt=e=>e.replace(/=/g,"").replace(/[+\/]/g,(t=>t=="+"?"-":"_")),mt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),bt=e=>{let t,s,o,n,r="";const a=e.length%3;for(let i=0;i<e.length;){if((s=e.charCodeAt(i++))>255||(o=e.charCodeAt(i++))>255||(n=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");t=s<<16|o<<8|n,r+=ie[t>>18&63]+ie[t>>12&63]+ie[t>>6&63]+ie[63&t]}return a?r.slice(0,a-3)+"===".substring(a):r},Le=jt?e=>btoa(e):te?e=>Buffer.from(e,"binary").toString("base64"):bt,Oe=te?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let s=0,o=e.length;s<o;s+=4096)t.push(v.apply(null,e.subarray(s,s+4096)));return Le(t.join(""))},fe=(e,t=!1)=>t?pt(Oe(e)):Oe(e),Xt=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?v(192|t>>>6)+v(128|63&t):v(224|t>>>12&15)+v(128|t>>>6&63)+v(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return v(240|t>>>18&7)+v(128|t>>>12&63)+v(128|t>>>6&63)+v(128|63&t)},Yt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,gt=e=>e.replace(Yt,Xt),Ge=te?e=>Buffer.from(e,"utf8").toString("base64"):He?e=>Oe(He.encode(e)):e=>Le(gt(e)),ee=(e,t=!1)=>t?pt(Ge(e)):Ge(e),je=e=>ee(e,!0),Qt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,es=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return v(55296+(t>>>10))+v(56320+(1023&t));case 3:return v((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return v((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},ft=e=>e.replace(Qt,es),_t=e=>{if(e=e.replace(/\s+/g,""),!Kt.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,s,o,n="";for(let r=0;r<e.length;)t=me[e.charAt(r++)]<<18|me[e.charAt(r++)]<<12|(s=me[e.charAt(r++)])<<6|(o=me[e.charAt(r++)]),n+=s===64?v(t>>16&255):o===64?v(t>>16&255,t>>8&255):v(t>>16&255,t>>8&255,255&t);return n},Ne=Gt?e=>atob(mt(e)):te?e=>Buffer.from(e,"base64").toString("binary"):_t,Ct=te?e=>Ve(Buffer.from(e,"base64")):e=>Ve(Ne(e),(t=>t.charCodeAt(0))),wt=e=>Ct(St(e)),ts=te?e=>Buffer.from(e,"base64").toString("utf8"):Ze?e=>Ze.decode(Ct(e)):e=>ft(Ne(e)),St=e=>mt(e.replace(/[-_]/g,(t=>t=="-"?"+":"/"))),Fe=e=>ts(St(e)),Rt=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Ke=function(){const e=(t,s)=>Object.defineProperty(String.prototype,t,Rt(s));e("fromBase64",(function(){return Fe(this)})),e("toBase64",(function(t){return ee(this,t)})),e("toBase64URI",(function(){return ee(this,!0)})),e("toBase64URL",(function(){return ee(this,!0)})),e("toUint8Array",(function(){return wt(this)}))},Xe=function(){const e=(t,s)=>Object.defineProperty(Uint8Array.prototype,t,Rt(s));e("toBase64",(function(t){return fe(this,t)})),e("toBase64URI",(function(){return fe(this,!0)})),e("toBase64URL",(function(){return fe(this,!0)}))},ss={version:"3.7.2",VERSION:"3.7.2",atob:Ne,atobPolyfill:_t,btoa:Le,btoaPolyfill:bt,fromBase64:Fe,toBase64:ee,encode:ee,encodeURI:je,encodeURL:je,utob:gt,btou:ft,decode:Fe,isValid:e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:fe,toUint8Array:wt,extendString:Ke,extendUint8Array:Xe,extendBuiltins:()=>{Ke(),Xe()}},d=new class{constructor(){this.oBase64=ss}browser(){const e=navigator.userAgent.toLowerCase(),t=/(edge)[/]([\w.]+)/.exec(e)||/(chrome)[/]([\w.]+)/.exec(e)||/(safari)[/]([\w.]+)/.exec(e)||/(opera)(?:.*version)?[/]([\w.]+)/.exec(e)||/(trident.*rv:)([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(e)||["unknow","0"];t.length>0&&t[1].indexOf("trident")>-1&&(t[1]="msie");const s={};return s[t[1]]=!0,s.version=t[2],s}getCreateWndMode(){const e=navigator.userAgent,t=navigator.platform,s=t==="Win64"||t==="Win32"||t==="Windows",o=this.browser();let n=!0;return window.top!==window?n=!1:s?(e.indexOf("Windows NT 10.0")>-1&&o.mozilla&&(n=!1),o.edge&&(n=!1)):n=!1,n}getWndPostion(e,t,s,o){let n=0,r=0;const a=e.ownerDocument.defaultView,i=e.getBoundingClientRect(),c=window.getComputedStyle(e),l={top:i.top+parseInt(c["border-top-width"].slice(0,-2),10),left:i.left+parseInt(c["border-left-width"].slice(0,-2),10)},u=this.getDevicePixelRatio(),h=this.browser().chrome?a.outerWidth/u:a.outerWidth,_=this.browser().chrome?a.outerHeight/u:a.outerHeight;if(t)if(this.browser().msie){const m=a.outerWidth-a.innerWidth-(a.screenLeft-a.screenX);n=l.left+(a.screenLeft-a.screenX)-m,r=l.top+(a.screenTop-a.screenY)}else{let m=0,S=0;const g=Math.round((h-a.innerWidth)/2);this.isWindows()&&this.browser().chrome&&(g===-8||a.screen.height-a.outerHeight==0?g===-8&&(m=8,S=8):g===8?m=-5:g===0&&(S=8)),this.browser().mozilla&&(g===7||g===6?m=-6:g===8&&(m=-8)),n=l.left+g+m,r=l.top+(_-a.innerHeight-g)+S}else{const m=window.top;let S=0,g=0,P=0,z=0;try{S=h-m.innerWidth,g=_-m.innerHeight,P=m.screenLeft-m.screenX,z=m.screenTop-m.screenY}catch{S=s.outerWidth-s.innerWidth,g=s.outerHeight-s.innerHeight,P=s.screenLeft-s.screenX,z=s.screenTop-s.screenY}if(this.browser().msie){let I=S-P;I=0,n=l.left+P-I,r=l.top+z}else{const I=S/2;n=l.left+I,r=l.top+(g-I),this.isWindows()&&this.browser().chrome&&I===0&&(n+=8,r+=8)}n+=o.left,r+=o.top}return this.isWindows()&&(this.browser().chrome||this.browser().safari)&&(n=l.left,r=l.top,n+=o.left,r+=o.top),this.browser().msie&&this.browser().version==="10.0"&&(n+=a.pageXOffset,r+=a.pageYOffset),n=Math.round(n*u),r=Math.round(r*u),{left:n,top:r}}detectPort(e,t,s){if(e===t)return void s.success(e);const o=`HikCentralWebControlPort:${e}-${t}`,n=this;let r=0,a=!1,i=null;sessionStorage&&(i=sessionStorage.getItem(o),i!==null&&(i=parseInt(i,10)));const c=[];for(let g=e;g<=t;g++)g!==i&&c.push(g);i!==null&&c.unshift(i);const l=[],u=function(){r>0&&clearTimeout(r)},h=function(){for(let g=0,P=l.length;g<P;g++)delete l[g]};let _=0;const m=function(g){sessionStorage&&sessionStorage.setItem(o,g),!a&&s.success&&(u(),h(),s.success(g))},S=new Date().getTime();for(let g=0,P=c.length;g<P;g++)setTimeout((()=>{l.push(n.createImageHttp(c[g],{timeStamp:S+g,success(z){m(z)},error(){_++,c.length===_&&!a&&s.error&&(u(),h(),s.error())}}))}),100);r=setTimeout((()=>{a=!0,s.error&&(h(),s.error())}),6e4)}createImageHttp(e,t){const s=new Image;return s.crossOrigin="anonymous",s.onload=function(){t.success&&t.success(e)},s.onerror=function(){t.error&&t.error()},s.onabort=function(){t.abort&&t.abort()},s.src=`http://127.0.0.1:${e}/imghttp/local?update=${t.timeStamp}`,s}utf8to16(e){let t="",s=0;const o=e.length;let n,r,a;for(;s<o;)switch(n=e.charCodeAt(s++),n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=e.charAt(s-1);break;case 12:case 13:r=e.charCodeAt(s++),t+=String.fromCharCode((31&n)<<6|63&r);break;case 14:r=e.charCodeAt(s++),a=e.charCodeAt(s++),t+=String.fromCharCode((15&n)<<12|(63&r)<<6|(63&a)<<0)}return t}createEventScript(e,t,s){const o=document.createElement("script");o.htmlFor=e,o.event=t,o.innerHTML=s,document.getElementById(e).appendChild(o)}isMacOS(){return navigator.platform==="MacIntel"}isWindows(){return navigator.platform.indexOf("Win")>-1}getDevicePixelRatio(){let e=1;return this.isMacOS()||(e=window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),e}Base64(){return this.oBase64||{}}},yt=" ";function ns(e){window.top.document.title=window.top.document.title+yt+e}function os(e){window.top.document.title=window.top.document.title.replace(yt+e,"")}function ke(e,t){(t||ns)(e)}function oe(e,t){(t||os)(e)}const Pe=class{constructor(e){this.oOptions=Object.assign({iPort:-1,cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null},e),this.oWebSocket=null,this.szUUID="",this.szVersion="",this.oRequestList={},this.bNormalClose=!1,this.oWindowControlCallback={},this.oSadpCallback={},this.oSliceCallback={},this.oSerialCallback={},this.oUIControlCallback={},this.oUpgradeCallback={},this.init()}init(){const e=this,t=function(){e.oOptions.cbConnectClose&&e.oOptions.cbConnectClose(e.bNormalClose),e.bNormalClose=!1};e.oWebSocket=new WebSocket(`ws://127.0.0.1:${e.oOptions.iPort}`),e.oWebSocket.onerror=function(){},e.oWebSocket.onopen=function(){const s={sequence:N(),cmd:"system.connect"},o=JSON.stringify(s);e.oWebSocket.send(o)},e.oWebSocket.onmessage=function(s){const o=s.data,n=JSON.parse(o),r=n.sequence;r===void 0&&n.cmd===void 0?(e.szUUID=n.uuid,e.szVersion=n.version,e.oOptions.cbConnectSuccess&&e.oOptions.cbConnectSuccess()):n.cmd!==void 0?e.parseCmd(n):e.oRequestList[r]!==void 0&&(n.errorModule===0&&n.errorCode===0?e.oRequestList[r].resolve(n):e.oRequestList[r].reject(n),delete e.oRequestList[r])},e.oWebSocket.onclose=function(){e.oWebSocket=null,d.browser().mozilla?setTimeout((()=>{t()}),100):t()}}setWindowControlCallback(e){this.oWindowControlCallback=e}setSadpCallback(e){this.oSadpCallback=e}setSliceCallback(e){this.oSliceCallback=e}setSerialCallback(e){this.oSerialCallback=e}setUIControlCallback(e){this.oUIControlCallback=e}setUpgradeCallback(e){this.oUpgradeCallback=e}getServiceVersion(){return this.szVersion}getRequestUUID(){return this.szUUID}disconnect(){this.bNormalClose=!0,this.oWebSocket&&WebSocket.OPEN===this.oWebSocket.readyState&&(this.oWebSocket.close(),delete this.oWebSocket)}sendRequest(e){const t=this;return new Promise(((s,o)=>{const n=N();e.sequence=n,t.oRequestList[n]={resolve:s,reject:o},e.uuid=t.szUUID,e.timestamp=`${new Date().getTime()}`;const r=JSON.stringify(e);t.oWebSocket&&WebSocket.OPEN===t.oWebSocket.readyState?t.oWebSocket.send(r):o()}))}parseCmd(e){const t=e.cmd.split("."),s=t[1].replace(/^[a-z]{1}/g,(o=>o.toUpperCase()));t[0]==="window"||t[0]==="play"?this.oWindowControlCallback[`cb${s}`]&&this.oWindowControlCallback[`cb${s}`](e):t[0]==="sadp"?this.oSadpCallback[`cb${s}`]&&this.oSadpCallback[`cb${s}`](e):t[0]==="serial"?this.oSerialCallback[`cb${s}`]&&this.oSerialCallback[`cb${s}`](e):t[0]==="slice"?this.oSliceCallback[`cb${s}`]&&this.oSliceCallback[`cb${s}`](e):t[0]==="ui"?this.oUIControlCallback[`cb${s}`]&&this.oUIControlCallback[`cb${s}`](e):t[0]==="upgrade"&&this.oUpgradeCallback[`cb${s}`]&&this.oUpgradeCallback[`cb${s}`](e)}};function se(e){let t=e.length;for(;--t>=0;)e[t]=0}const Me=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),_e=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),rs=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ye=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new Array(576);se(A);const le=new Array(60);se(le);const he=new Array(512);se(he);const ce=new Array(256);se(ce);const Be=new Array(29);se(Be);const we=new Array(30);function Te(e,t,s,o,n){this.static_tree=e,this.extra_bits=t,this.extra_base=s,this.elems=o,this.max_length=n,this.has_stree=e&&e.length}let Qe,et,tt;function De(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}se(we);const vt=e=>e<256?he[e]:he[256+(e>>>7)],pe=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},k=(e,t,s)=>{e.bi_valid>16-s?(e.bi_buf|=t<<e.bi_valid&65535,pe(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=s-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=s)},U=(e,t,s)=>{k(e,s[2*t],s[2*t+1])},qt=(e,t)=>{let s=0;do s|=1&e,e>>>=1,s<<=1;while(--t>0);return s>>>1},It=(e,t,s)=>{const o=new Array(16);let n,r,a=0;for(n=1;n<=15;n++)o[n]=a=a+s[n-1]<<1;for(r=0;r<=t;r++){let i=e[2*r+1];i!==0&&(e[2*r]=qt(o[i]++,i))}},kt=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Pt=e=>{e.bi_valid>8?pe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},st=(e,t,s,o)=>{const n=2*t,r=2*s;return e[n]<e[r]||e[n]===e[r]&&o[t]<=o[s]},ze=(e,t,s)=>{const o=e.heap[s];let n=s<<1;for(;n<=e.heap_len&&(n<e.heap_len&&st(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!st(t,o,e.heap[n],e.depth));)e.heap[s]=e.heap[n],s=n,n<<=1;e.heap[s]=o},nt=(e,t,s)=>{let o,n,r,a,i=0;if(e.last_lit!==0)do o=e.pending_buf[e.d_buf+2*i]<<8|e.pending_buf[e.d_buf+2*i+1],n=e.pending_buf[e.l_buf+i],i++,o===0?U(e,n,t):(r=ce[n],U(e,r+256+1,t),a=Me[r],a!==0&&(n-=Be[r],k(e,n,a)),o--,r=vt(o),U(e,r,s),a=_e[r],a!==0&&(o-=we[r],k(e,o,a)));while(i<e.last_lit);U(e,256,t)},We=(e,t)=>{const s=t.dyn_tree,o=t.stat_desc.static_tree,n=t.stat_desc.has_stree,r=t.stat_desc.elems;let a,i,c,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<r;a++)s[2*a]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):s[2*a+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,s[2*c]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=o[2*c+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)ze(e,s,a);c=r;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ze(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=i,s[2*c]=s[2*a]+s[2*i],e.depth[c]=(e.depth[a]>=e.depth[i]?e.depth[a]:e.depth[i])+1,s[2*a+1]=s[2*i+1]=c,e.heap[1]=c++,ze(e,s,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((u,h)=>{const _=h.dyn_tree,m=h.max_code,S=h.stat_desc.static_tree,g=h.stat_desc.has_stree,P=h.stat_desc.extra_bits,z=h.stat_desc.extra_base,I=h.stat_desc.max_length;let Z,R,x,C,H,X,V=0;for(C=0;C<=15;C++)u.bl_count[C]=0;for(_[2*u.heap[u.heap_max]+1]=0,Z=u.heap_max+1;Z<573;Z++)R=u.heap[Z],C=_[2*_[2*R+1]+1]+1,C>I&&(C=I,V++),_[2*R+1]=C,R>m||(u.bl_count[C]++,H=0,R>=z&&(H=P[R-z]),X=_[2*R],u.opt_len+=X*(C+H),g&&(u.static_len+=X*(S[2*R+1]+H)));if(V!==0){do{for(C=I-1;u.bl_count[C]===0;)C--;u.bl_count[C]--,u.bl_count[C+1]+=2,u.bl_count[I]--,V-=2}while(V>0);for(C=I;C!==0;C--)for(R=u.bl_count[C];R!==0;)x=u.heap[--Z],x>m||(_[2*x+1]!==C&&(u.opt_len+=(C-_[2*x+1])*_[2*x],_[2*x+1]=C),R--)}})(e,t),It(s,l,e.bl_count)},ot=(e,t,s)=>{let o,n,r=-1,a=t[1],i=0,c=7,l=4;for(a===0&&(c=138,l=3),t[2*(s+1)+1]=65535,o=0;o<=s;o++)n=a,a=t[2*(o+1)+1],++i<c&&n===a||(i<l?e.bl_tree[2*n]+=i:n!==0?(n!==r&&e.bl_tree[2*n]++,e.bl_tree[32]++):i<=10?e.bl_tree[34]++:e.bl_tree[36]++,i=0,r=n,a===0?(c=138,l=3):n===a?(c=6,l=3):(c=7,l=4))},rt=(e,t,s)=>{let o,n,r=-1,a=t[1],i=0,c=7,l=4;for(a===0&&(c=138,l=3),o=0;o<=s;o++)if(n=a,a=t[2*(o+1)+1],!(++i<c&&n===a)){if(i<l)do U(e,n,e.bl_tree);while(--i!=0);else n!==0?(n!==r&&(U(e,n,e.bl_tree),i--),U(e,16,e.bl_tree),k(e,i-3,2)):i<=10?(U(e,17,e.bl_tree),k(e,i-3,3)):(U(e,18,e.bl_tree),k(e,i-11,7));i=0,r=n,a===0?(c=138,l=3):n===a?(c=6,l=3):(c=7,l=4)}};let it=!1;const Tt=(e,t,s,o)=>{k(e,0+(o?1:0),3),((n,r,a,i)=>{Pt(n),pe(n,a),pe(n,~a),n.pending_buf.set(n.window.subarray(r,r+a),n.pending),n.pending+=a})(e,t,s)};var is=(e,t,s,o)=>{let n,r,a=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=(i=>{let c,l=4093624447;for(c=0;c<=31;c++,l>>>=1)if(1&l&&i.dyn_ltree[2*c]!==0)return 0;if(i.dyn_ltree[18]!==0||i.dyn_ltree[20]!==0||i.dyn_ltree[26]!==0)return 1;for(c=32;c<256;c++)if(i.dyn_ltree[2*c]!==0)return 1;return 0})(e)),We(e,e.l_desc),We(e,e.d_desc),a=(i=>{let c;for(ot(i,i.dyn_ltree,i.l_desc.max_code),ot(i,i.dyn_dtree,i.d_desc.max_code),We(i,i.bl_desc),c=18;c>=3&&i.bl_tree[2*Ye[c]+1]===0;c--);return i.opt_len+=3*(c+1)+5+5+4,c})(e),n=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=n&&(n=r)):n=r=s+5,s+4<=n&&t!==-1?Tt(e,t,s,o):e.strategy===4||r===n?(k(e,2+(o?1:0),3),nt(e,A,le)):(k(e,4+(o?1:0),3),((i,c,l,u)=>{let h;for(k(i,c-257,5),k(i,l-1,5),k(i,u-4,4),h=0;h<u;h++)k(i,i.bl_tree[2*Ye[h]+1],3);rt(i,i.dyn_ltree,c-1),rt(i,i.dyn_dtree,l-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),nt(e,e.dyn_ltree,e.dyn_dtree)),kt(e),o&&Pt(e)},as={_tr_init:e=>{it||((()=>{let t,s,o,n,r;const a=new Array(16);for(o=0,n=0;n<28;n++)for(Be[n]=o,t=0;t<1<<Me[n];t++)ce[o++]=n;for(ce[o-1]=n,r=0,n=0;n<16;n++)for(we[n]=r,t=0;t<1<<_e[n];t++)he[r++]=n;for(r>>=7;n<30;n++)for(we[n]=r<<7,t=0;t<1<<_e[n]-7;t++)he[256+r++]=n;for(s=0;s<=15;s++)a[s]=0;for(t=0;t<=143;)A[2*t+1]=8,t++,a[8]++;for(;t<=255;)A[2*t+1]=9,t++,a[9]++;for(;t<=279;)A[2*t+1]=7,t++,a[7]++;for(;t<=287;)A[2*t+1]=8,t++,a[8]++;for(It(A,287,a),t=0;t<30;t++)le[2*t+1]=5,le[2*t]=qt(t,5);Qe=new Te(A,Me,257,286,15),et=new Te(le,_e,0,30,15),tt=new Te(new Array(0),rs,0,19,7)})(),it=!0),e.l_desc=new De(e.dyn_ltree,Qe),e.d_desc=new De(e.dyn_dtree,et),e.bl_desc=new De(e.bl_tree,tt),e.bi_buf=0,e.bi_valid=0,kt(e)},_tr_stored_block:Tt,_tr_flush_block:is,_tr_tally:(e,t,s)=>(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&s,e.last_lit++,t===0?e.dyn_ltree[2*s]++:(e.matches++,t--,e.dyn_ltree[2*(ce[s]+256+1)]++,e.dyn_dtree[2*vt(t)]++),e.last_lit===e.lit_bufsize-1),_tr_align:e=>{k(e,2,3),U(e,256,A),(t=>{t.bi_valid===16?(pe(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(e)}},Dt=(e,t,s,o)=>{let n=65535&e|0,r=e>>>16&65535|0,a=0;for(;s!==0;){a=s>2e3?2e3:s,s-=a;do n=n+t[o++]|0,r=r+n|0;while(--a);n%=65521,r%=65521}return n|r<<16|0};const ls=new Uint32Array((()=>{let e,t=[];for(var s=0;s<256;s++){e=s;for(var o=0;o<8;o++)e=1&e?3988292384^e>>>1:e>>>1;t[s]=e}return t})());var O=(e,t,s,o)=>{const n=ls,r=o+s;e^=-1;for(let a=o;a<r;a++)e=e>>>8^n[255&(e^t[a])];return-1^e},Se={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},zt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:cs,_tr_stored_block:us,_tr_flush_block:ds,_tr_tally:B,_tr_align:hs}=as,{Z_NO_FLUSH:K,Z_PARTIAL_FLUSH:ps,Z_FULL_FLUSH:ms,Z_FINISH:J,Z_BLOCK:at,Z_OK:E,Z_STREAM_END:lt,Z_STREAM_ERROR:D,Z_DATA_ERROR:bs,Z_BUF_ERROR:Ee,Z_DEFAULT_COMPRESSION:gs,Z_FILTERED:fs,Z_HUFFMAN_ONLY:be,Z_RLE:_s,Z_FIXED:Cs,Z_DEFAULT_STRATEGY:ws,Z_UNKNOWN:Ss,Z_DEFLATED:Re}=zt,M=(e,t)=>(e.msg=Se[t],t),ct=e=>(e<<1)-(e>4?9:0),L=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let $=(e,t,s)=>(t<<e.hash_shift^s)&e.hash_mask;const F=e=>{const t=e.state;let s=t.pending;s>e.avail_out&&(s=e.avail_out),s!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+s),e.next_out),e.next_out+=s,t.pending_out+=s,e.total_out+=s,e.avail_out-=s,t.pending-=s,t.pending===0&&(t.pending_out=0))},q=(e,t)=>{ds(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)},f=(e,t)=>{e.pending_buf[e.pending++]=t},re=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Rs=(e,t,s,o)=>{let n=e.avail_in;return n>o&&(n=o),n===0?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),s),e.state.wrap===1?e.adler=Dt(e.adler,t,n,s):e.state.wrap===2&&(e.adler=O(e.adler,t,n,s)),e.next_in+=n,e.total_in+=n,n)},Wt=(e,t)=>{let s,o,n=e.max_chain_length,r=e.strstart,a=e.prev_length,i=e.nice_match;const c=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,l=e.window,u=e.w_mask,h=e.prev,_=e.strstart+258;let m=l[r+a-1],S=l[r+a];e.prev_length>=e.good_match&&(n>>=2),i>e.lookahead&&(i=e.lookahead);do if(s=t,l[s+a]===S&&l[s+a-1]===m&&l[s]===l[r]&&l[++s]===l[r+1]){r+=2,s++;do;while(l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&r<_);if(o=258-(_-r),r=_-258,o>a){if(e.match_start=t,a=o,o>=i)break;m=l[r+a-1],S=l[r+a]}}while((t=h[t&u])>c&&--n!=0);return a<=e.lookahead?a:e.lookahead},j=e=>{const t=e.w_size;let s,o,n,r,a;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,o=e.hash_size,s=o;do n=e.head[--s],e.head[s]=n>=t?n-t:0;while(--o);o=t,s=o;do n=e.prev[--s],e.prev[s]=n>=t?n-t:0;while(--o);r+=t}if(e.strm.avail_in===0)break;if(o=Rs(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=o,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=$(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=$(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&e.strm.avail_in!==0)},Ue=(e,t)=>{let s,o;for(;;){if(e.lookahead<262){if(j(e),e.lookahead<262&&t===K)return 1;if(e.lookahead===0)break}if(s=0,e.lookahead>=3&&(e.ins_h=$(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),s!==0&&e.strstart-s<=e.w_size-262&&(e.match_length=Wt(e,s)),e.match_length>=3)if(o=B(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=$(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=$(e,e.ins_h,e.window[e.strstart+1]);else o=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(o&&(q(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,t===J?(q(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(q(e,!1),e.strm.avail_out===0)?1:2},Q=(e,t)=>{let s,o,n;for(;;){if(e.lookahead<262){if(j(e),e.lookahead<262&&t===K)return 1;if(e.lookahead===0)break}if(s=0,e.lookahead>=3&&(e.ins_h=$(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,s!==0&&e.prev_length<e.max_lazy_match&&e.strstart-s<=e.w_size-262&&(e.match_length=Wt(e,s),e.match_length<=5&&(e.strategy===fs||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,o=B(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=$(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,o&&(q(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(o=B(e,0,e.window[e.strstart-1]),o&&q(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(o=B(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===J?(q(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(q(e,!1),e.strm.avail_out===0)?1:2};function W(e,t,s,o,n){this.good_length=e,this.max_lazy=t,this.nice_length=s,this.max_chain=o,this.func=n}const ae=[new W(0,0,0,0,((e,t)=>{let s=65535;for(s>e.pending_buf_size-5&&(s=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),e.lookahead===0&&t===K)return 1;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const o=e.block_start+s;if((e.strstart===0||e.strstart>=o)&&(e.lookahead=e.strstart-o,e.strstart=o,q(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-262&&(q(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,t===J?(q(e,!0),e.strm.avail_out===0?3:4):(e.strstart>e.block_start&&(q(e,!1),e.strm.avail_out),1)})),new W(4,4,8,4,Ue),new W(4,5,16,8,Ue),new W(4,6,32,32,Ue),new W(4,4,16,16,Q),new W(8,16,32,32,Q),new W(8,16,128,128,Q),new W(8,32,128,256,Q),new W(32,128,258,1024,Q),new W(32,258,258,4096,Q)];function ys(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Re,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),L(this.dyn_ltree),L(this.dyn_dtree),L(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),L(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),L(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=e=>{if(!e||!e.state)return M(e,D);e.total_in=e.total_out=0,e.data_type=Ss;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=t.wrap===2?0:1,t.last_flush=K,cs(t),E},Ut=e=>{const t=Et(e);var s;return t===E&&((s=e.state).window_size=2*s.w_size,L(s.head),s.max_lazy_match=ae[s.level].max_lazy,s.good_match=ae[s.level].good_length,s.nice_match=ae[s.level].nice_length,s.max_chain_length=ae[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=2,s.match_available=0,s.ins_h=0),t},ut=(e,t,s,o,n,r)=>{if(!e)return D;let a=1;if(t===gs&&(t=6),o<0?(a=0,o=-o):o>15&&(a=2,o-=16),n<1||n>9||s!==Re||o<8||o>15||t<0||t>9||r<0||r>Cs)return M(e,D);o===8&&(o=9);const i=new ys;return e.state=i,i.strm=e,i.wrap=a,i.gzhead=null,i.w_bits=o,i.w_size=1<<i.w_bits,i.w_mask=i.w_size-1,i.hash_bits=n+7,i.hash_size=1<<i.hash_bits,i.hash_mask=i.hash_size-1,i.hash_shift=~~((i.hash_bits+3-1)/3),i.window=new Uint8Array(2*i.w_size),i.head=new Uint16Array(i.hash_size),i.prev=new Uint16Array(i.w_size),i.lit_bufsize=1<<n+6,i.pending_buf_size=4*i.lit_bufsize,i.pending_buf=new Uint8Array(i.pending_buf_size),i.d_buf=1*i.lit_bufsize,i.l_buf=3*i.lit_bufsize,i.level=t,i.strategy=r,i.method=s,Ut(e)};var ue={deflateInit:(e,t)=>ut(e,t,Re,15,8,ws),deflateInit2:ut,deflateReset:Ut,deflateResetKeep:Et,deflateSetHeader:(e,t)=>e&&e.state?e.state.wrap!==2?D:(e.state.gzhead=t,E):D,deflate:(e,t)=>{let s,o;if(!e||!e.state||t>at||t<0)return e?M(e,D):D;const n=e.state;if(!e.output||!e.input&&e.avail_in!==0||n.status===666&&t!==J)return M(e,e.avail_out===0?Ee:D);n.strm=e;const r=n.last_flush;if(n.last_flush=t,n.status===42)if(n.wrap===2)e.adler=0,f(n,31),f(n,139),f(n,8),n.gzhead?(f(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),f(n,255&n.gzhead.time),f(n,n.gzhead.time>>8&255),f(n,n.gzhead.time>>16&255),f(n,n.gzhead.time>>24&255),f(n,n.level===9?2:n.strategy>=be||n.level<2?4:0),f(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(f(n,255&n.gzhead.extra.length),f(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=O(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(f(n,0),f(n,0),f(n,0),f(n,0),f(n,0),f(n,n.level===9?2:n.strategy>=be||n.level<2?4:0),f(n,3),n.status=113);else{let a=Re+(n.w_bits-8<<4)<<8,i=-1;i=n.strategy>=be||n.level<2?0:n.level<6?1:n.level===6?2:3,a|=i<<6,n.strstart!==0&&(a|=32),a+=31-a%31,n.status=113,re(n,a),n.strstart!==0&&(re(n,e.adler>>>16),re(n,65535&e.adler)),e.adler=1}if(n.status===69)if(n.gzhead.extra){for(s=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>s&&(e.adler=O(e.adler,n.pending_buf,n.pending-s,s)),F(e),s=n.pending,n.pending!==n.pending_buf_size));)f(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>s&&(e.adler=O(e.adler,n.pending_buf,n.pending-s,s)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(n.status===73)if(n.gzhead.name){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=O(e.adler,n.pending_buf,n.pending-s,s)),F(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,f(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=O(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.gzindex=0,n.status=91)}else n.status=91;if(n.status===91)if(n.gzhead.comment){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=O(e.adler,n.pending_buf,n.pending-s,s)),F(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,f(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=O(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.status=103)}else n.status=103;if(n.status===103&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&F(e),n.pending+2<=n.pending_buf_size&&(f(n,255&e.adler),f(n,e.adler>>8&255),e.adler=0,n.status=113)):n.status=113),n.pending!==0){if(F(e),e.avail_out===0)return n.last_flush=-1,E}else if(e.avail_in===0&&ct(t)<=ct(r)&&t!==J)return M(e,Ee);if(n.status===666&&e.avail_in!==0)return M(e,Ee);if(e.avail_in!==0||n.lookahead!==0||t!==K&&n.status!==666){let a=n.strategy===be?((i,c)=>{let l;for(;;){if(i.lookahead===0&&(j(i),i.lookahead===0)){if(c===K)return 1;break}if(i.match_length=0,l=B(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,l&&(q(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,c===J?(q(i,!0),i.strm.avail_out===0?3:4):i.last_lit&&(q(i,!1),i.strm.avail_out===0)?1:2})(n,t):n.strategy===_s?((i,c)=>{let l,u,h,_;const m=i.window;for(;;){if(i.lookahead<=258){if(j(i),i.lookahead<=258&&c===K)return 1;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=3&&i.strstart>0&&(h=i.strstart-1,u=m[h],u===m[++h]&&u===m[++h]&&u===m[++h])){_=i.strstart+258;do;while(u===m[++h]&&u===m[++h]&&u===m[++h]&&u===m[++h]&&u===m[++h]&&u===m[++h]&&u===m[++h]&&u===m[++h]&&h<_);i.match_length=258-(_-h),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=3?(l=B(i,1,i.match_length-3),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(l=B(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),l&&(q(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,c===J?(q(i,!0),i.strm.avail_out===0?3:4):i.last_lit&&(q(i,!1),i.strm.avail_out===0)?1:2})(n,t):ae[n.level].func(n,t);if(a!==3&&a!==4||(n.status=666),a===1||a===3)return e.avail_out===0&&(n.last_flush=-1),E;if(a===2&&(t===ps?hs(n):t!==at&&(us(n,0,0,!1),t===ms&&(L(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),F(e),e.avail_out===0))return n.last_flush=-1,E}return t!==J?E:n.wrap<=0?lt:(n.wrap===2?(f(n,255&e.adler),f(n,e.adler>>8&255),f(n,e.adler>>16&255),f(n,e.adler>>24&255),f(n,255&e.total_in),f(n,e.total_in>>8&255),f(n,e.total_in>>16&255),f(n,e.total_in>>24&255)):(re(n,e.adler>>>16),re(n,65535&e.adler)),F(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?E:lt)},deflateEnd:e=>{if(!e||!e.state)return D;const t=e.state.status;return t!==42&&t!==69&&t!==73&&t!==91&&t!==103&&t!==113&&t!==666?M(e,D):(e.state=null,t===113?M(e,bs):E)},deflateSetDictionary:(e,t)=>{let s=t.length;if(!e||!e.state)return D;const o=e.state,n=o.wrap;if(n===2||n===1&&o.status!==42||o.lookahead)return D;if(n===1&&(e.adler=Dt(e.adler,t,s,0)),o.wrap=0,s>=o.w_size){n===0&&(L(o.head),o.strstart=0,o.block_start=0,o.insert=0);let c=new Uint8Array(o.w_size);c.set(t.subarray(s-o.w_size,s),0),t=c,s=o.w_size}const r=e.avail_in,a=e.next_in,i=e.input;for(e.avail_in=s,e.next_in=0,e.input=t,j(o);o.lookahead>=3;){let c=o.strstart,l=o.lookahead-2;do o.ins_h=$(o,o.ins_h,o.window[c+3-1]),o.prev[c&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=c,c++;while(--l);o.strstart=c,o.lookahead=2,j(o)}return o.strstart+=o.lookahead,o.block_start=o.strstart,o.insert=o.lookahead,o.lookahead=0,o.match_length=o.prev_length=2,o.match_available=0,e.next_in=a,e.input=i,e.avail_in=r,o.wrap=n,E},deflateInfo:"pako deflate (from Nodeca project)"};const vs=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var qs=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const s=t.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(const o in s)vs(s,o)&&(e[o]=s[o])}}return e},Is=e=>{let t=0;for(let o=0,n=e.length;o<n;o++)t+=e[o].length;const s=new Uint8Array(t);for(let o=0,n=0,r=e.length;o<r;o++){let a=e[o];s.set(a,n),n+=a.length}return s};try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{}const Je=new Uint8Array(256);for(let e=0;e<256;e++)Je[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Je[254]=Je[254]=1;var At=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,s,o,n,r,a=e.length,i=0;for(n=0;n<a;n++)s=e.charCodeAt(n),(64512&s)==55296&&n+1<a&&(o=e.charCodeAt(n+1),(64512&o)==56320&&(s=65536+(s-55296<<10)+(o-56320),n++)),i+=s<128?1:s<2048?2:s<65536?3:4;for(t=new Uint8Array(i),r=0,n=0;r<i;n++)s=e.charCodeAt(n),(64512&s)==55296&&n+1<a&&(o=e.charCodeAt(n+1),(64512&o)==56320&&(s=65536+(s-55296<<10)+(o-56320),n++)),s<128?t[r++]=s:s<2048?(t[r++]=192|s>>>6,t[r++]=128|63&s):s<65536?(t[r++]=224|s>>>12,t[r++]=128|s>>>6&63,t[r++]=128|63&s):(t[r++]=240|s>>>18,t[r++]=128|s>>>12&63,t[r++]=128|s>>>6&63,t[r++]=128|63&s);return t},ks=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const xt=Object.prototype.toString,{Z_NO_FLUSH:Ps,Z_SYNC_FLUSH:Ts,Z_FULL_FLUSH:Ds,Z_FINISH:zs,Z_OK:ye,Z_STREAM_END:Ws,Z_DEFAULT_COMPRESSION:Es,Z_DEFAULT_STRATEGY:Us,Z_DEFLATED:As}=zt;function Ce(e){this.options=qs({level:Es,method:As,chunkSize:16384,windowBits:15,memLevel:8,strategy:Us},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ks,this.strm.avail_out=0;let s=ue.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(s!==ye)throw new Error(Se[s]);if(t.header&&ue.deflateSetHeader(this.strm,t.header),t.dictionary){let o;if(o=typeof t.dictionary=="string"?At(t.dictionary):xt.call(t.dictionary)==="[object ArrayBuffer]"?new Uint8Array(t.dictionary):t.dictionary,s=ue.deflateSetDictionary(this.strm,o),s!==ye)throw new Error(Se[s]);this._dict_set=!0}}function xs(e,t){const s=new Ce(t);if(s.push(e,!0),s.err)throw s.msg||Se[s.err];return s.result}Ce.prototype.push=function(e,t){const s=this.strm,o=this.options.chunkSize;let n,r;if(this.ended)return!1;for(r=t===~~t?t:t===!0?zs:Ps,typeof e=="string"?s.input=At(e):xt.call(e)==="[object ArrayBuffer]"?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;;)if(s.avail_out===0&&(s.output=new Uint8Array(o),s.next_out=0,s.avail_out=o),(r===Ts||r===Ds)&&s.avail_out<=6)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else{if(n=ue.deflate(s,r),n===Ws)return s.next_out>0&&this.onData(s.output.subarray(0,s.next_out)),n=ue.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ye;if(s.avail_out!==0){if(r>0&&s.next_out>0)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else if(s.avail_in===0)break}else this.onData(s.output)}return!0},Ce.prototype.onData=function(e){this.chunks.push(e)},Ce.prototype.onEnd=function(e){e===ye&&(this.result=Is(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Os={deflate:xs};const{deflate:Fs}=Os;var Ms=Fs;const Ae=class{constructor(e){this.oOptions=Object.assign({iPort:-1,cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null},e),this.szHost="http://127.0.0.1",this.szUUID="",this.szVersion="",this.bNormalClose=!1,this.bConnected=!1,this.bInitConnect=!0,this.iGetErrorCount=0,this.oWindowControlCallback={},this.oSadpCallback={},this.oSliceCallback={},this.oSerialCallback={},this.oUIControlCallback={},this.oUpgradeCallback={},this.init()}init(){const e=this,t=N(),s={sequence:t,cmd:"system.connect"},o=JSON.stringify(s);e.sendImageHttp(`${e.szHost}:${e.oOptions.iPort}/imghttp/local`,o,t,{success(n){const r=JSON.parse(n);e.szUUID=r.uuid,e.szVersion=r.version,e.bConnected=!0,e.bInitConnect=!1,setTimeout((()=>{e.imageHttpPolling()}),100),e.oOptions.cbConnectSuccess&&e.oOptions.cbConnectSuccess()},error(){}})}sendImageHttp(e,t,s,o){const n=this;o=Object.assign({success:null,error:null,abort:null},o);let r=Ms(t);new Uint8Array().toString()!==""&&(d.isMacOS()||d.browser().msie)&&(r=Array.prototype.slice.call(r));const a=encodeURIComponent(btoa(r)),i=this.splitStr(a),c=[];let l="";for(let u=0,h=i.length;u<h;u++)l=u===h-1?`update=${new Date().getTime()}&isLast=true&data=${i[u]}&sequence=${s}`:`update=${new Date().getTime()}&isLast=false&data=${i[u]}&sequence=${s}`,c.push(l);if(c.length>0){const u=function(){n.imageHttp(`${e}?${c[0]}`,{success(h){c.shift(),c.length>0?(n.bInitConnect||n.bConnected)&&u():o.success&&o.success(h)},error(){o.error&&o.error()},abort(){o.abort&&o.abort()}})};u()}}splitStr(e){const t=this.getByteLen(e),s=[],o=1500;for(let n=0,r=Math.ceil(t/o);n<r;n++)s[n]=e.slice(o*n,o*(n+1));return s}getByteLen(e){let t=0,s="";for(let o=0,n=e.length;o<n;o++)s=e.charAt(o),/[^\x00-\xff]/.test(s)?t+=2:t+=1;return t}imageHttp(e,t){t=Object.assign({success:null,error:null,abort:null},t);const s=new Image;s.onload=function(){if(t.success){const o=document.createElement("canvas"),n=o.getContext("2d"),r=s.width,a=s.height;o.width=r,o.height=a;try{n.drawImage(s,0,0);const i=n.getImageData(0,0,r,a).data;let c="",l=-1;for(let u=a-1;u>=0;u--)for(let h=0;h<4*r&&(l=u*r*4+h,i[l]!==0);h++)i[l]!==255&&(c+=String.fromCharCode(i[l]));t.success(d.utf8to16(c))}catch{t.error&&t.error()}}},s.onerror=function(){t.error&&t.error()},s.onabort=function(){t.abort&&t.abort()},s.crossOrigin="anonymous",s.src=e}setWindowControlCallback(e){this.oWindowControlCallback=e}setSadpCallback(e){this.oSadpCallback=e}setSliceCallback(e){this.oSliceCallback=e}setSerialCallback(e){this.oSerialCallback=e}setUIControlCallback(e){this.oUIControlCallback=e}setUpgradeCallback(e){this.oUpgradeCallback=e}getServiceVersion(){return this.szVersion}getRequestUUID(){return this.szUUID}disconnect(){const e=this,t=N(),s={sequence:t,uuid:e.szUUID,cmd:"system.disconnect"},o=JSON.stringify(s);e.bConnected&&e.sendImageHttp(`${e.szHost}:${e.oOptions.iPort}/imghttp/local`,o,t,{success(){e.bNormalClose=!0,e.bConnected=!1,e.oOptions.cbConnectClose&&e.oOptions.cbConnectClose(e.bNormalClose)},error(){e.bConnected=!1}})}imageHttpPolling(){const e=this,t=N(),s={sequence:t,uuid:e.szUUID,cmd:"system.get"},o=JSON.stringify(s);e.bConnected&&e.sendImageHttp(`${e.szHost}:${e.oOptions.iPort}/imghttp/local`,o,t,{success(n){if(e.iGetErrorCount=0,n==="timeout")setTimeout((()=>{e.imageHttpPolling()}),100);else if(n==="invalid")e.bConnected=!1,e.oOptions.cbConnectError&&e.oOptions.cbConnectError();else if(n==="closed")console.log("connected is disconnected");else{const r=JSON.parse(n);r.cmd!==void 0?e.parseCmd(r):console.log(`[jsWebControl]imgHttpPolling push message error:${n}`),setTimeout((()=>{e.imageHttpPolling()}),100)}},error(){e.iGetErrorCount===5?(console.log("[jsWebControl]imageHttpPolling get polling finished"),e.bNormalClose=!1,e.bConnected=!1,e.oOptions.cbConnectClose&&e.oOptions.cbConnectClose(e.bNormalClose)):setTimeout((()=>{console.log("[jsWebControl]imgHttpPolling get polling failed"),e.iGetErrorCount++,e.imageHttpPolling()}),100)}})}sendRequest(e){const t=this;return new Promise(((s,o)=>{const n=e.cmd.split(".");let r="";n.length>1?r=n[0]==="laputa"?"laputa":"local":o();const a=N();e.sequence=a,e.uuid=t.szUUID,e.timestamp=`${new Date().getTime()}`;const i=JSON.stringify(e);t.bConnected?t.sendImageHttp(`${t.szHost}:${t.oOptions.iPort}/imghttp/${r}`,i,a,{success(c){const l=JSON.parse(c);l.errorModule===0&&l.errorCode===0?s(l):o(l)},error(){o()}}):o()}))}parseCmd(e){const t=e.cmd.split("."),s=t[1].replace(/^[a-z]{1}/g,(o=>o.toUpperCase()));t[0]==="window"||t[0]==="play"?this.oWindowControlCallback[`cb${s}`]&&this.oWindowControlCallback[`cb${s}`](e):t[0]==="sadp"?this.oSadpCallback[`cb${s}`]&&this.oSadpCallback[`cb${s}`](e):t[0]==="serial"?this.oSerialCallback[`cb${s}`]&&this.oSerialCallback[`cb${s}`](e):t[0]==="slice"?this.oSliceCallback[`cb${s}`]&&this.oSliceCallback[`cb${s}`](e):t[0]==="ui"?this.oUIControlCallback[`cb${s}`]&&this.oUIControlCallback[`cb${s}`](e):t[0]==="upgrade"&&this.oUpgradeCallback[`cb${s}`]&&this.oUpgradeCallback[`cb${s}`](e)}},Js=class{constructor(e){this.oOptions=Object.assign({szPluginContainer:"",iPort:-1,cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null,szClassId:""},e),this.oPlugin=null,this.szPluginId="",this.szUUID="",this.szVersion="",this.oRequestList={},this.bNormalClose=!1,this.aMessage=[],this.oWindowControlCallback={},this.oSadpCallback={},this.oSliceCallback={},this.oSerialCallback={},this.oUIControlCallback={},this.oUpgradeCallback={},this.init()}init(){const e=this;e.initPlugin(),e.oPlugin.object&&e.oPlugin.createSocket(`ws://127.0.0.1:${e.oOptions.iPort}`)}initPlugin(){const e=this;this.szPluginId=`webActiveX_${new Date().getTime()}`;const t=`<object id='${this.szPluginId}' classid='clsid:${e.oOptions.szClassId}' codebase='' standby='Waiting...' width='100%' height='100%' align='center' ></object>`;let{szPluginContainer:s}=e.oOptions;if(s===""){s=`${this.szPluginId}_div`;const o=document.createElement("div");o.id=s,document.body.parentNode.appendChild(o)}document.getElementById(s).innerHTML=t,e.oPlugin=document.getElementById(this.szPluginId),window.onConnectMessage=function(o,n){n?(e.aMessage.push(o),e.onConnectMessage(e.aMessage.join("")),e.aMessage.length=0):e.aMessage.push(o)},window.onConnectClose=function(){e.onConnectClose()},window.onConnectError=function(){e.onConnectError()},window.onConnectCloseException=function(){e.onConnectCloseException()},window.onConnectOpen=function(){e.onConnectOpen()},d.createEventScript(this.szPluginId,"onConnectMessage(szData, bLast)","onConnectMessage(szData, bLast);"),d.createEventScript(this.szPluginId,"onConnectClose()","onConnectClose();"),d.createEventScript(this.szPluginId,"onConnectError()","onConnectError();"),d.createEventScript(this.szPluginId,"onConnectCloseException()","onConnectCloseException();"),d.createEventScript(this.szPluginId,"onConnectOpen()","onConnectOpen();")}onConnectMessage(e){const t=this;if(e){const s=JSON.parse(e),o=s.sequence;o===void 0&&s.cmd===void 0?(t.szUUID=s.uuid,t.szVersion=s.version,t.oOptions.cbConnectSuccess&&t.oOptions.cbConnectSuccess()):s.cmd!==void 0?t.parseCmd(s):t.oRequestList[o]!==void 0&&(s.errorModule===0&&s.errorCode===0?t.oRequestList[o].resolve(s):t.oRequestList[o].reject(s),delete t.oRequestList[o])}}onConnectClose(){if(this.oPlugin=null,this.szPluginId!==""){const e=document.getElementById(this.szPluginId);e.parentNode.removeChild(e);const t=document.getElementById(`${this.szPluginId}_div`);t!==null&&t.parentNode.removeChild(t)}this.oOptions.cbConnectClose&&this.oOptions.cbConnectClose(this.bNormalClose)}onConnectCloseException(){const e=this;setTimeout((()=>{e.oPlugin.object&&e.oPlugin.closeSocket()}),1e3)}onConnectOpen(){const e={sequence:N(),cmd:"system.connect"},t=JSON.stringify(e);this.oPlugin.object&&this.oPlugin.sendRequest(t)}onConnectError(){}setWindowControlCallback(e){this.oWindowControlCallback=e}setSadpCallback(e){this.oSadpCallback=e}setSliceCallback(e){this.oSliceCallback=e}setSerialCallback(e){this.oSerialCallback=e}setUIControlCallback(e){this.oUIControlCallback=e}setUpgradeCallback(e){this.oUpgradeCallback=e}getServiceVersion(){return this.szVersion}getRequestUUID(){return this.szUUID}disconnect(){this.bNormalClose=!0,this.oPlugin&&this.oPlugin.object&&this.oPlugin.closeSocket()}sendRequest(e){const t=this;return e.cmd==="window.hideWnd"?t.oPlugin&&t.oPlugin.object&&(t.oPlugin.style.visibility="hidden"):e.cmd==="window.showWnd"&&t.oPlugin&&t.oPlugin.object&&(t.oPlugin.style.visibility="visible"),new Promise(((s,o)=>{const n=N();e.sequence=n,t.oRequestList[n]={resolve:s,reject:o},e.uuid=t.szUUID,e.timestamp=`${new Date().getTime()}`;const r=JSON.stringify(e);t.oPlugin&&t.oPlugin.object?t.oPlugin.sendRequest(r):o()}))}parseCmd(e){const t=e.cmd.split("."),s=t[1].replace(/^[a-z]{1}/g,(o=>o.toUpperCase()));t[0]==="window"||t[0]==="play"?this.oWindowControlCallback[`cb${s}`]&&this.oWindowControlCallback[`cb${s}`](e):t[0]==="sadp"?this.oSadpCallback[`cb${s}`]&&this.oSadpCallback[`cb${s}`](e):t[0]==="serial"?this.oSerialCallback[`cb${s}`]&&this.oSerialCallback[`cb${s}`](e):t[0]==="slice"?this.oSliceCallback[`cb${s}`]&&this.oSliceCallback[`cb${s}`](e):t[0]==="ui"?this.oUIControlCallback[`cb${s}`]&&this.oUIControlCallback[`cb${s}`](e):t[0]==="upgrade"&&this.oUpgradeCallback[`cb${s}`]&&this.oUpgradeCallback[`cb${s}`](e)}},Ls=class{constructor(e){this.oOptions=Object.assign({szPluginContainer:"",cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null,iServicePortStart:-1,iServicePortEnd:-1,szClassId:""},e),this.iPort=-1,this.oRequest=null,this.bInit=!1,this.oCallbacks={},this.init()}init(){const e=this;d.detectPort(e.oOptions.iServicePortStart,e.oOptions.iServicePortEnd,{success(t){if(e.iPort=t,d.browser().msie)d.browser().version==="11.0"?window.location.protocol==="https:"?e.oRequest=new Ae({iPort:e.iPort,cbConnectSuccess:e.oOptions.cbConnectSuccess,cbConnectError:e.oOptions.cbConnectError,cbConnectClose:e.oOptions.cbConnectClose}):e.oRequest=new Pe({iPort:e.iPort,cbConnectSuccess:e.oOptions.cbConnectSuccess,cbConnectError:e.oOptions.cbConnectError,cbConnectClose:e.oOptions.cbConnectClose}):e.oRequest=new Js({szPluginContainer:e.oOptions.szPluginContainer,iPort:e.iPort,cbConnectSuccess:e.oOptions.cbConnectSuccess,cbConnectError:e.oOptions.cbConnectError,cbConnectClose:e.oOptions.cbConnectClose,szClassId:e.oOptions.szClassId});else if(window.location.protocol==="https:")if(d.browser().chrome||d.browser().mozilla)try{e.oRequest=new Pe({iPort:e.iPort,cbConnectSuccess:e.oOptions.cbConnectSuccess,cbConnectError:e.oOptions.cbConnectError,cbConnectClose:e.oOptions.cbConnectClose})}catch{e.oRequest=new Ae({iPort:e.iPort,cbConnectSuccess:e.oOptions.cbConnectSuccess,cbConnectError:e.oOptions.cbConnectError,cbConnectClose:e.oOptions.cbConnectClose})}else e.oRequest=new Ae({iPort:e.iPort,cbConnectSuccess:e.oOptions.cbConnectSuccess,cbConnectError:e.oOptions.cbConnectError,cbConnectClose:e.oOptions.cbConnectClose});else"WebSocket"in window&&(e.oRequest=new Pe({iPort:e.iPort,cbConnectSuccess:e.oOptions.cbConnectSuccess,cbConnectError:e.oOptions.cbConnectError,cbConnectClose:e.oOptions.cbConnectClose}));e.bInit=!0;for(const s in e.oCallbacks)e.oRequest[s](e.oCallbacks[s])},error(){e.oOptions.cbConnectError&&e.oOptions.cbConnectError()}})}setWindowControlCallback(e){this.bInit?this.oRequest.setWindowControlCallback(e):this.oCallbacks.setWindowControlCallback=e}setSadpCallback(e){this.bInit?this.oRequest.setSadpCallback(e):this.oCallbacks.setSadpCallback=e}setSliceCallback(e){this.bInit?this.oRequest.setSliceCallback(e):this.oCallbacks.setSliceCallback=e}setSerialCallback(e){this.bInit?this.oRequest.setSerialCallback(e):this.oCallbacks.setSerialCallback=e}setUIControlCallback(e){this.bInit?this.oRequest.setUIControlCallback(e):this.oCallbacks.setUIControlCallback=e}setUpgradeCallback(e){this.bInit?this.oRequest.setUpgradeCallback(e):this.oCallbacks.setUpgradeCallback=e}getServiceVersion(){return this.oRequest.getServiceVersion()}getRequestUUID(){return this.oRequest.getRequestUUID()}startService(e,t){const s={cmd:"system.startService",type:e};return t!==void 0&&(s.options=t),this.oRequest.sendRequest(s)}stopService(e){const t=this;return new Promise(((s,o)=>{t.oRequest!==null?t.oRequest.sendRequest({cmd:"system.stopService",type:e}).then((n=>{s(n)}),(n=>{o(n)})):o()}))}disconnect(){const e=this;return new Promise(((t,s)=>{e.oRequest!==null?(e.oRequest.disconnect(),t("cbConnectClose callback is really success")):s()}))}openDirectory(e){return this.oRequest.sendRequest({cmd:"system.openDirectory",path:e})}openFile(e,t,s){return this.oRequest.sendRequest({cmd:"system.openFile",path:e,relative:t,version:s})}selectDirectory(e,t){const s=this;return new Promise(((o,n)=>{s.oRequest!==null?s.oRequest.sendRequest({cmd:"system.selectDirectory",caption:e!==void 0&&e!==""?d.Base64().encode(e):"",dir:t!==void 0&&t!==""?d.Base64().encode(t):""}).then((r=>{r.path!==""&&(r.path=d.Base64().decode(r.path)),o(r)}),(r=>{n(r)})):n()}))}selectFile(e,t,s){const o=this;return new Promise(((n,r)=>{o.oRequest!==null?o.oRequest.sendRequest({cmd:"system.selectFile",caption:e!==""?d.Base64().encode(e):"",dir:t!==""?d.Base64().encode(t):"",filter:s}).then((a=>{a.path!==""&&(a.path=d.Base64().decode(a.path)),n(a)}),(a=>{r(a)})):r()}))}getLocalConfig(e){return this.oRequest.sendRequest({cmd:"system.getLocalConfig",default:e})}setLocalConfig(e){return e.cmd="system.setLocalConfig",this.oRequest.sendRequest(e)}createWnd(e,t,s,o,n,r,a,i=""){return this.oRequest.sendRequest({cmd:"window.createWnd",rect:{left:e,top:t,width:s,height:o},className:n,embed:r,activeXParentWnd:a,HWND:i})}showWnd(){return this.oRequest.sendRequest({cmd:"window.showWnd"})}hideWnd(){return this.oRequest.sendRequest({cmd:"window.hideWnd"})}destroyWnd(){const e=this;return new Promise(((t,s)=>{e.oRequest!==null?e.oRequest.sendRequest({cmd:"window.destroyWnd"}).then((o=>{t(o)}),(o=>{s(o)})):s()}))}setWndGeometry(e,t,s,o){return this.oRequest.sendRequest({cmd:"window.setWndGeometry",rect:{left:e,top:t,width:s,height:o}})}setWndCover(e,t){const s=this;return new Promise(((o,n)=>{s.oRequest!==null?s.oRequest.sendRequest({cmd:"window.setWndCover",position:e,size:t}).then((r=>{o(r)}),(r=>{n(r)})):n()}))}cuttingPartWindow(e,t,s,o,n){const r=this;return new Promise(((a,i)=>{r.oRequest!==null?r.oRequest.sendRequest({cmd:"window.cuttingPartWindow",rect:{left:e,top:t,width:s,height:o},round:n}).then((c=>{a(c)}),(c=>{i(c)})):i()}))}repairPartWindow(e,t,s,o,n){const r=this;return new Promise(((a,i)=>{r.oRequest!==null?r.oRequest.sendRequest({cmd:"window.repairPartWindow",rect:{left:e,top:t,width:s,height:o},round:n}).then((c=>{a(c)}),(c=>{i(c)})):i()}))}setWndZOrder(e){return this.oRequest.sendRequest({cmd:"window.setWndZOrder",flag:e})}changePlayMode(e){return this.oRequest.sendRequest({cmd:"window.changePlayMode",type:e})}setLanguageType(e){return this.oRequest.sendRequest({cmd:"window.setLanguageType",type:e})}initLoginInfo(e){return this.oRequest.sendRequest({cmd:"window.initLoginInfo",vsmAddress:e.vsmAddress,vsmPort:e.vsmPort,sessionID:e.sessionID,loginModel:e.loginModel,userType:e.userType,networkType:e.networkType})}setTranslateFile(e){return this.oRequest.sendRequest({cmd:"window.setTranslateFile",url:e})}switchToSimple(e){return this.oRequest.sendRequest({cmd:"window.switchToSimple",simple:e})}setVsmToken(e){return this.oRequest.sendRequest({cmd:"play.setVsmToken",token:e})}startPlay(e,t,s,o,n,r,a,i,c){const l={cmd:"play.startPlay",url:e,username:t,password:s,siteID:o,areaName:d.Base64().encode(n),cameraName:d.Base64().encode(r),permission:a,wndIndex:i};return c!==void 0&&(l.options=c,l.options.siteName!==void 0&&(l.options.siteName=d.Base64().encode(l.options.siteName))),this.oRequest.sendRequest(l)}setPreview3DPosition(e){return this.oRequest.sendRequest({cmd:"play.setPreview3DPosition",open:e})}stopTotal(){const e=this;return new Promise(((t,s)=>{e.oRequest!==null?e.oRequest.sendRequest({cmd:"play.stopTotal"}).then((o=>{t(o)}),(o=>{s(o)})):s()}))}setDragMode(e){return this.oRequest.sendRequest({cmd:"play.setDragMode",drag:e})}showErrorInfoInFullScreen(e){return this.oRequest.sendRequest({cmd:"play.showErrorInfoInFullScreen",error:d.Base64().encode(e)})}setNumberOfWindows(e){return this.oRequest.sendRequest({cmd:"play.setNumberOfWindows",number:e})}initCardReader(e){return this.oRequest.sendRequest({cmd:"serial.ACSInitCardReader",param:e})}unInitCardReader(){return this.oRequest.sendRequest({cmd:"serial.ACSUnInitCardReader"})}startAutoMode(){return this.oRequest.sendRequest({cmd:"serial.ACSStartAutoMode"})}stopAutoMode(){return this.oRequest.sendRequest({cmd:"serial.ACSStopAutoMode"})}initFingerprint(e){return this.oRequest.sendRequest({cmd:"serial.ACSInitFingerprint",param:e})}unInitFingerprint(){return this.oRequest.sendRequest({cmd:"serial.ACSUnInitFingerprint"})}startCollectFingerprint(){return this.oRequest.sendRequest({cmd:"serial.ACSStartCollectFingerprint"})}stopCollectFingerprint(){return this.oRequest.sendRequest({cmd:"serial.ACSStopCollectFingerprint"})}isCollectingFingerprint(){return this.oRequest.sendRequest({cmd:"serial.ACSIsCollectingFingerprint"})}initVideocapture(e){return e.majorTitle=d.Base64().encode(e.majorTitle),e.tip=d.Base64().encode(e.tip),e.captureBtnTxt=d.Base64().encode(e.captureBtnTxt),e.USBRemovedTip=d.Base64().encode(e.USBRemovedTip),this.oRequest.sendRequest({cmd:"serial.ACSStartCollectImage",param:e})}unInitVideocapture(){return this.oRequest.sendRequest({cmd:"serial.ACSStopCollectImage"})}registerDeviceType(e){return this.oRequest.sendRequest({cmd:"sadp.registDeviceType",deviceType:e})}activeOnlineDevice(e,t){return this.oRequest.sendRequest({cmd:"sadp.activeDevice",serialNumber:e,password:t})}refreshDeviceList(){return this.oRequest.sendRequest({cmd:"sadp.refreshDeviceList"})}modifyDeviceNetParam(e,t,s,o,n,r,a){return this.oRequest.sendRequest({cmd:"sadp.modifyDeviceParam",macAddress:e,password:t,ipv4Address:s,ipv4Gateway:o,ipv4SubnetMask:n,port:r,httpPort:a})}exportKeyFile(e){return this.oRequest.sendRequest({cmd:"sadp.exportKeyFile",serialNumber:e})}importKeyFile(){return this.oRequest.sendRequest({cmd:"sadp.importKeyFile"})}resetPassword(e,t,s,o){return this.oRequest.sendRequest({cmd:"sadp.resetPassword",serialNumber:e,password:t,importFileData:s,szCode:o})}uploadPicture(e){return this.oRequest.sendRequest({cmd:"slice.uploadPicture",path:d.Base64().encode(e)})}showSelectMenu(e,t,s,o,n){return this.oRequest.sendRequest({cmd:"ui.showSelectMenu",items:n,rect:{left:e,top:t,width:s,height:o}})}hideSelectMenu(){return this.oRequest.sendRequest({cmd:"ui.hideSelectMenu"})}destroySelectMenu(){const e=this;return new Promise(((t,s)=>{e.oRequest!==null?e.oRequest.sendRequest({cmd:"ui.destroySelectMenu"}).then((o=>{t(o)}),(o=>{s(o)})):s()}))}deviceConfig(e){return this.oRequest.sendRequest({cmd:"laputa.encodingDevice",param:e})}cloudStorageConfig(e){return this.oRequest.sendRequest({cmd:"laputa.cloudStorage",param:e})}ezvizRemoteConfig(e){return this.oRequest.sendRequest({cmd:"laputa.ezvizRemote",param:e})}showAlarmInfoInFullScreen(e,t,s){return this.oRequest.sendRequest({cmd:"window.showAlarmInfoInFullScreen",alarmTitle:e,alarmMessage:t,alarmId:s})}updateParentWnd(){return this.oRequest.sendRequest({cmd:"window.updateParentWnd"})}restoreWnd(){return this.oRequest.sendRequest({cmd:"window.restoreWnd"})}setImmediatePlaybackTime(e){return this.oRequest.sendRequest({cmd:"play.setImmediatePlaybackTime",specifyTime:e})}setDrawStatus(e){return this.oRequest.sendRequest({cmd:"draw.setDrawStatus",enable:e})}clearRegion(){return this.oRequest.sendRequest({cmd:"draw.clearRegion"})}setDrawShapeInfo(e,t){return this.oRequest.sendRequest({cmd:"draw.setDrawShapeInfo",drawType:e,drawInfo:t})}setGridInfo(e){return this.oRequest.sendRequest({cmd:"draw.setGridInfo",gridInfo:e})}getGridInfo(){return this.oRequest.sendRequest({cmd:"draw.getGridInfo"})}setPolygonInfo(e){return this.oRequest.sendRequest({cmd:"draw.setPolygonInfo",polygonInfo:e})}getPolygonInfo(){return this.oRequest.sendRequest({cmd:"draw.getPolygonInfo"})}setLineInfo(e){return this.oRequest.sendRequest({cmd:"draw.setLineInfo",lineInfo:e})}getLineInfo(){return this.oRequest.sendRequest({cmd:"draw.getLineInfo"})}setRectInfo(e){return this.oRequest.sendRequest({cmd:"draw.setRectInfo",rectInfo:e})}getRectInfo(){return this.oRequest.sendRequest({cmd:"draw.getRectInfo"})}clearShapeByType(e){return this.oRequest.sendRequest({cmd:"draw.clearShapeByType",type:e})}sensitiveEncrypt(e,t,s){const o={cmd:"laputa.sensitiveEncrypt",encryptType:e,encryptField:t};return s!==void 0&&(o.options=s),this.oRequest.sendRequest(o)}sendRequest(e){return this.oRequest.sendRequest(e)}requestInterface(e){const t={cmd:"window.requestInterface"};return t.requestParams=e,this.oRequest.sendRequest(t)}stopPlay(e){return e===void 0&&(e=-1),this.oRequest.sendRequest({cmd:"play.stopPlay",wndIndex:e})}showRemoteConfig(e){const t=this;return e.cmd="config.showRemoteConfig",new Promise(((s,o)=>{t.oRequest!==null?t.oRequest.sendRequest(e).then((n=>{s(n)}),(n=>{o(n)})):o()}))}video2Picture(){const e={cmd:"window.video2Picture"};return this.oRequest.sendRequest(e)}picture2Video(){const e={cmd:"window.picture2Video"};return this.oRequest.sendRequest(e)}ptzControl(e){return this.oRequest.sendRequest({cmd:"laputa.ptzControl",param:e})}simMouseClickEvent(e,t){return this.oRequest.sendRequest({cmd:"window.simMouseClickEvent",pointX:e,pointY:t})}us_SetMaxJobCount(e){return this.oRequest.sendRequest({cmd:"upgrade.setMaxJobCount",xml:e})}us_GetMaxJobCount(){return this.oRequest.sendRequest({cmd:"upgrade.getMaxJobCount"})}us_AddSchedule(e){return this.oRequest.sendRequest({cmd:"upgrade.addSchedule",xml:d.Base64().encode(e)})}us_DelSchedule(e){return this.oRequest.sendRequest({cmd:"upgrade.delSchedule",scheduleId:e})}us_GetScheduleList(e){const t=this;return new Promise(((s,o)=>{t.oRequest!==null?t.oRequest.sendRequest({cmd:"upgrade.getScheduleList",xml:e}).then((n=>{n.xml!==""&&(n.xml=d.Base64().decode(n.xml)),s(n)}),(n=>{o(n)})):o()}))}us_GetSchedule(e,t){const s=this;return new Promise(((o,n)=>{s.oRequest!==null?s.oRequest.sendRequest({cmd:"upgrade.getSchedule",xml:t,scheduleId:e}).then((r=>{r.xml!==""&&(r.xml=d.Base64().decode(r.xml)),o(r)}),(r=>{n(r)})):n()}))}us_UpgradeAction(e,t){return this.oRequest.sendRequest({cmd:"upgrade.upgradeAction",xml:t,scheduleId:e})}us_CheckUpgradeableDevice(e){return this.oRequest.sendRequest({cmd:"upgrade.checkUpgradeableDevice",param:e})}us_CheckUpgradeableDeviceList(e){return this.oRequest.sendRequest({cmd:"upgrade.checkUpgradeableDeviceList",param:e})}us_IsRunningAsyCheckUpgradeable(){return this.oRequest.sendRequest({cmd:"upgrade.isRunningAsyCheckUpgradeable"})}us_StopAsyCheckUpgradeable(){return this.oRequest.sendRequest({cmd:"upgrade.stopAsyCheckUpgradeable"})}getFishEyePTZPreset(e){return this.oRequest.sendRequest({cmd:"play.getFishEyePTZPreset",wndIndex:e})}setFishEyePTZPreset(e,t,s){return this.oRequest.sendRequest({cmd:"play.setFishEyePTZPreset",wndIndex:e,command:t,presetInfo:s})}controlFishEyePTZ(e,t,s,o){return this.oRequest.sendRequest({cmd:"play.controlFishEyePTZ",wndIndex:e,command:t,stop:s,speed:o})}controlFishEyeParol(e,t,s){return this.oRequest.sendRequest({cmd:"play.controlFishEyeParol",wndIndex:e,command:t,cruisePointList:s})}setFirstDayOfWeek(e){return this.oRequest.sendRequest({cmd:"window.setFirstDayOfWeek",firstDay:e})}setEhomePlayInfo(e,t,s,o,n,r){return this.oRequest.sendRequest({cmd:"play.setEhomePlayInfo",guid:e,protocal:t,session:s,token:o,ip:n,port:r})}startPlayPatch(e){if(e.length>0)for(let t=0,s=e.length;t<s;t++)e[t].areaName=d.Base64().encode(e[t].areaName),e[t].cameraName=d.Base64().encode(e[t].cameraName);return this.oRequest.sendRequest({cmd:"play.startPlayPatch",params:e})}grabOpen(){const e=this;return new Promise(((t,s)=>{e.oRequest!==null?e.oRequest.sendRequest({cmd:"window.grabOpen"}).then((o=>{t(o)}),(o=>{s(o)})):s()}))}setWndAutoPanState(e,t){return this.oRequest.sendRequest({cmd:"play.setWndAutoPanState",wndIndex:e,open:t})}enablePrivileges(){return this.oRequest.sendRequest({cmd:"system.enablePrivileges"})}},Ot=class{constructor(e){const t=this;this.oOptions=Object.assign({szPluginContainer:"",cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null,iServicePortStart:16960,iServicePortEnd:16969,szClassId:"55A7329E-FAAD-439a-87BC-75BAB3332E7C"},e),this.bFreeze=!1,this.bFocus=!0,this.bEmbed=d.getCreateWndMode(),this.szWndId="",this.iCreateWndTimer=-1,this.iUpdateParentWndTimer=-1,this.bDevTool=!1,this.iVCTimeStart=-1,this.iVCTimeEnd=-1,this.oWndCover={left:0,top:0,right:0,bottom:0},this.oDocOffset={left:0,top:0},this.szTitle="",this.oWindowAttr={outerWidth:0,innerWidth:0,outerHeight:0,innerHeight:0,screenTop:0,screenLeft:0,screenX:0,screenY:0},this.iFixedResizeTimer=-1,this.fVisibilityChange=function(){if(d.isMacOS())document.hidden?t.fHideWnd():t.fShowWnd();else if(document.hidden)t.iVCTimeStart=new Date().getTime(),t.fHideWnd();else{t.iVCTimeEnd=new Date().getTime();const s=d.browser();if(s.chrome||s.mozilla)if(t.iUpdateParentWndTimer>0&&(clearTimeout(t.iUpdateParentWndTimer),t.iUpdateParentWndTimer=-1),t.iVCTimeEnd-t.iVCTimeStart<100){const o=t.oRequest.getRequestUUID();ke(o,t.oOptions.cbSetDocTitle),t.iUpdateParentWndTimer=setTimeout((()=>{t.oRequest.updateParentWnd().then((()=>{oe(o,t.oOptions.cbUnsetDocTitle),t.bFreeze||t.bDevTool||t.fShowWnd()}),(()=>{oe(o,t.oOptions.cbUnsetDocTitle)}))}),100)}else t.bFreeze||t.bDevTool||t.fShowWnd();else t.bFreeze||t.bDevTool||t.fShowWnd()}},this.fHideWnd=function(){t.oRequest.hideWnd().then((()=>{}),(()=>{}))},this.fShowWnd=function(){t.oRequest.showWnd().then((()=>{}),(()=>{}))},this.fFocus=function(){t.bFocus=!0,setTimeout((()=>{t.removeGrabImage(),document.hidden||t.bFreeze||t.bDevTool||t.fShowWnd()}),200)},this.fBlur=function(){t.bFocus=!1},this.removeGrabImage=function(){if(!d.isMacOS()){let s=null;if(t.szWndId!==""&&(s=document.getElementById(t.szWndId),s)){const o=s.querySelectorAll('[data-name="wc-grab-open-image"]');Array.prototype.slice.call(o).forEach((n=>{n.parentNode.removeChild(n)}))}}},this.oRequest=new Ls({szPluginContainer:this.oOptions.szPluginContainer,cbConnectSuccess:this.oOptions.cbConnectSuccess,cbConnectError:this.oOptions.cbConnectError,cbConnectClose(s){t.iCreateWndTimer>0&&(clearTimeout(t.iCreateWndTimer),t.iCreateWndTimer=-1),t.removeGrabImage(),t.oOptions.cbConnectClose&&t.oOptions.cbConnectClose(s)},iServicePortStart:this.oOptions.iServicePortStart,iServicePortEnd:this.oOptions.iServicePortEnd,szClassId:this.oOptions.szClassId})}JS_SetWindowControlCallback(e){const t=this,s={cbSelectWnd(o){e.cbSelectWnd&&e.cbSelectWnd(parseInt(o.wndIndex,10),o.cameraID,o.siteID,o.opendFisheye)},cbTogglePTZ(o){e.cbTogglePTZ&&e.cbTogglePTZ(o.cameraID,o.siteID)},cbUpdateCameraIcon(o){e.cbUpdateCameraIcon&&e.cbUpdateCameraIcon(o.cameraID,parseInt(o.playing,10),o.siteID)},cbGetLastError(o){e.cbGetLastError&&e.cbGetLastError(o.error,parseInt(o.type,10))},cbTalkUrlEmpty(o){e.cbTalkUrlEmpty&&e.cbTalkUrlEmpty(o.cameraID)},cbGotoPlayback(o){e.cbGotoPlayback&&e.cbGotoPlayback(o.cameraID,o.siteID)},cbShowDisplayInfo(o){e.cbShowDisplayInfo&&e.cbShowDisplayInfo(parseInt(o.videoWidth,10),parseInt(o.videoHeight,10),parseInt(o.frameRate,10))},cbPreviewWnd3DPostion(o){e.cbPreviewWnd3DPostion&&e.cbPreviewWnd3DPostion(parseInt(o.startX,10),parseInt(o.startY,10),parseInt(o.endX,10),parseInt(o.endY,10))},cbStopPlayAll(){e.cbStopPlayAll&&e.cbStopPlayAll()},cbWheelEvent(o){e.cbWheelEvent&&e.cbWheelEvent(parseInt(o.delta,10))},cbAlarmDetail(o){e.cbAlarmDetail&&e.cbAlarmDetail(o.alarmId)},cbQuitedFullScreen(){setTimeout((()=>{t.fShowWnd()}),100)},cbManuallyClose(o){e.cbManuallyClose&&e.cbManuallyClose(o.cameraID,o.siteID,parseInt(o.wndIndex,10))},cbIntegrationCallBack(o){e.cbIntegrationCallBack&&e.cbIntegrationCallBack(o)},cbChangeStorage(o){e.cbChangeStorage&&e.cbChangeStorage(parseInt(o.storageType,10),o.cameraID,o.siteID)},cbFisheyeExpandChanged(o){e.cbFisheyeExpandChanged&&e.cbFisheyeExpandChanged(o.cameraID,o.siteID,parseInt(o.wndIndex,10),o.open)},cbGetEhomePlayInfo(o){e.cbGetEhomePlayInfo&&e.cbGetEhomePlayInfo(o.siteID,o.guid)},cbWndPtzControl(o){e.cbWndPtzControl&&e.cbWndPtzControl(parseInt(o.wndIndex,10),o.cameraID,o.command,o.speed,o.stop)},cbMessageCallBack(o){o=o.data;const n=t.oRequest.getRequestUUID();o.type==="menuOpen"?t.szWndId!==""&&(document.getElementById(t.szWndId).innerHTML=`<img data-name='wc-grab-open-image' src='data:image/png;base64,${o.message.image}' width='100%' height='100%' />`):o.type==="changeTitle"?document.title.indexOf(n)===-1&&(t.szTitle=document.title,ke(n,t.oOptions.cbSetDocTitle),setTimeout((()=>{o.message==="updateParentWnd"?t.oRequest.updateParentWnd():o.message==="restoreWnd"&&t.oRequest.restoreWnd()}),300)):o.type==="changeTitleDone"?t.szTitle!==""&&oe(n,t.oOptions.cbUnsetDocTitle):o.type==="splitChange"?e.cbSplitChange&&e.cbSplitChange(o.message.splitType):o.type==="showMaximized"&&e.cbShowMaximized&&e.cbShowMaximized(o.message.showMax)}};this.oRequest.setWindowControlCallback(s)}JS_SetSadpCallback(e){const t={cbDeviceFind:null};Object.assign(t,e),this.oRequest.setSadpCallback(t)}JS_SetSliceCallback(e){const t={cbImageSliced(s){e.cbImageSliced&&(s.picName!==""&&(s.picName=d.Base64().decode(s.picName)),e.cbImageSliced(s))}};this.oRequest.setSliceCallback(t)}JS_SetSerialCallback(e){const t={cbCardFind(s){e.cbCardFind&&e.cbCardFind(s)},cbFingerFind(s){e.cbFingerFind&&e.cbFingerFind(s.fingerPrint,s.fingerQuality)},cbImageFind(s){e.cbImageFind&&e.cbImageFind(s.image)},cbImageErrorFind(s){e.cbImageErrorFind&&e.cbImageErrorFind(s.errorModule,s.errorCode)},cbImageWndVisibleFind(s){e.cbImageWndVisibleFind&&e.cbImageWndVisibleFind(s.visible)}};this.oRequest.setSerialCallback(t)}JS_SetUIControlCallback(e){const t={cbClickMenuItem(s){e.cbClickMenuItem&&e.cbClickMenuItem(s.itemIndex)},cbMenuMouseIn(){e.cbMenuMouseIn&&e.cbMenuMouseIn()},cbMenuMouseOut(){e.cbMenuMouseOut&&e.cbMenuMouseOut()}};this.oRequest.setUIControlCallback(t)}JS_SetUpgradeCallback(e){const t={cbCheckUpgrade(s){e.cbCheckUpgrade&&e.cbCheckUpgrade(s)}};this.oRequest.setUpgradeCallback(t)}JS_CheckVersion(e){let t=this.oRequest.getServiceVersion(),s=[],o=[];t!==""&&(t=t.replace(/,[\s]*/g,"."),s=t.split(".")),e!==""&&(o=(e=e.replace(/,[\s]*/g,".")).split("."));let n=!1;if(o.length===s.length){for(let r=0,a=s.length;r<a;r++)if(parseInt(o[r],10)!==parseInt(s[r],10)){if(parseInt(o[r],10)>parseInt(s[r],10)){n=!0;break}break}}return n}JS_StartService(e,t){return this.oRequest.startService(e,t)}JS_StopService(e){return this.oRequest.stopService(e)}JS_Disconnect(){return this.oRequest.disconnect()}JS_OpenDirectory(e){return this.oRequest.openDirectory(e)}JS_OpenFile(e,t,s){return this.oRequest.openFile(e,t,s)}JS_SelectDirectory(e,t){return this.oRequest.selectDirectory(e,t)}JS_SelectFile(e,t,s){return this.oRequest.selectFile(e,t,s)}JS_GetLocalConfig(e){return this.oRequest.getLocalConfig(e)}JS_SetLocalConfig(e){return this.oRequest.setLocalConfig(e)}JS_SetDocOffset(e){return e&&(this.oDocOffset=e),!0}JS_SetWindowAttr(e){return e&&(this.oWindowAttr=e),!0}JS_CreateWnd(e,t,s,o){const n=this;this.szWndId=e,(o=o||{}).bEmbed!==void 0&&(this.bEmbed=o.bEmbed);let r=!0;return o.bActiveXParentWnd!==void 0&&(r=o.bActiveXParentWnd),new Promise(((a,i)=>{const c=document.getElementById(e);if(c){let l="";d.browser().msie?l="IEFrame":d.browser().chrome?l="Chrome":d.browser().safari&&(l=window.top.document.title),o.cbSetDocTitle&&(n.oOptions.cbSetDocTitle=o.cbSetDocTitle),o.cbUnsetDocTitle&&(n.oOptions.cbUnsetDocTitle=o.cbUnsetDocTitle);const u=n.oRequest.getRequestUUID();ke(u,o.cbSetDocTitle),n.iCreateWndTimer=setTimeout((()=>{if(!n.bDevTool){const h=d.getDevicePixelRatio(),_=d.getWndPostion(c,n.bEmbed,n.oWindowAttr,n.oDocOffset);t=Math.round(t*h),s=Math.round(s*h),n.oRequest.createWnd(_.left,_.top,t,s,l,n.bEmbed,r,o.HWND||"").then((()=>{oe(u,o.cbUnsetDocTitle),a()}),(m=>{oe(u,o.cbUnsetDocTitle),m.errorCode===5001?(document.hidden||n.bFreeze||!n.bFocus||n.fShowWnd(),a()):i(m)}))}}),300),document.addEventListener("visibilitychange",n.fVisibilityChange,!1),window.addEventListener("focus",n.fFocus),window.addEventListener("blur",n.fBlur)}else i()}))}JS_ShowWnd(){this.bFreeze=!1,document.hidden||this.bDevTool||this.fShowWnd()}JS_HideWnd(){this.bFreeze=!0,this.fHideWnd()}JS_DestroyWnd(){return document.removeEventListener("visibilitychange",this.fVisibilityChange,!1),window.removeEventListener("focus",this.fFocus),window.removeEventListener("blur",this.fBlur),this.oRequest.destroyWnd()}JS_Resize(e,t,s){let o=null;const n=e,r=t;if(this.szWndId!==""&&(o=document.getElementById(this.szWndId)),o){const a=d.getWndPostion(o,this.bEmbed,this.oWindowAttr,this.oDocOffset),i=d.getDevicePixelRatio();(!d.browser().msie||d.browser().msie&&d.browser().version==="11.0")&&(this.oWndCover.left>0&&(a.left+=Math.round(this.oWndCover.left*i),e-=this.oWndCover.left),this.oWndCover.top>0&&(a.top+=Math.round(this.oWndCover.top*i),t-=this.oWndCover.top),this.oWndCover.right>0&&(e-=this.oWndCover.right),this.oWndCover.bottom>0&&(t-=this.oWndCover.bottom)),e=Math.round(e*i),t=Math.round(t*i),this.oRequest.setWndGeometry(a.left,a.top,e,t),(d.browser().msie&&d.browser().version==="11.0"||!d.isWindows())&&(s&&s.bFixed?this.iFixedResizeTimer=-1:(this.iFixedResizeTimer>-1&&(clearTimeout(this.iFixedResizeTimer),this.iFixedResizeTimer=-1),this.iFixedResizeTimer=setTimeout((()=>{this.JS_Resize(n,r,{bFixed:!0})}),300)))}}JS_SetWndCover(e,t){const s=d.getDevicePixelRatio();return(!d.browser().msie||d.browser().msie&&d.browser().version==="11.0")&&(e==="left"?this.oWndCover.left=t:e==="top"?this.oWndCover.top=t:e==="right"?this.oWndCover.right=t:e==="bottom"&&(this.oWndCover.bottom=t)),t=Math.round(t*s),this.oRequest.setWndCover(e,t)}JS_CuttingPartWindow(e,t,s,o,n){const r=d.getDevicePixelRatio();return e=Math.round(e*r),t=Math.round(t*r),s=Math.round(s*r),o=Math.round(o*r),n=Math.round(n*r),this.oRequest.cuttingPartWindow(e,t,s,o,n)}JS_RepairPartWindow(e,t,s,o,n){const r=d.getDevicePixelRatio();return e=Math.round(e*r),t=Math.round(t*r),s=Math.round(s*r),o=Math.round(o*r),n=Math.round(n*r),this.oRequest.repairPartWindow(e,t,s,o,n)}JS_ChangePlayMode(e){return this.oRequest.changePlayMode(e)}JS_SetLanguageType(e){return this.oRequest.setLanguageType(e)}JS_InitLoginInfo(e){return this.oRequest.initLoginInfo(e)}JS_SetTranslateFile(e){return this.oRequest.setTranslateFile(e)}JS_SwitchToSimple(e){return this.oRequest.switchToSimple(e)}JS_SetVsmToken(e){return this.oRequest.setVsmToken(e)}JS_Play(e,t,s,o,n,r,a,i,c){return this.oRequest.startPlay(e,t,s,o,n,r,a,i,c)}JS_Enable3DZoom(e){return this.oRequest.setPreview3DPosition(e)}JS_StopTotal(){return this.oRequest.stopTotal()}JS_SetDragMode(e){return this.oRequest.setDragMode(e)}JS_ShowErrorInfoInFullScreen(e){return this.oRequest.showErrorInfoInFullScreen(e)}JS_SetNumberOfWindows(e){return this.oRequest.setNumberOfWindows(e)}JS_InitCardReader(e){return this.oRequest.initCardReader(e)}JS_UnInitCardReader(){return this.oRequest.unInitCardReader()}JS_StartAutoMode(){return this.oRequest.startAutoMode()}JS_StopAutoMode(){return this.oRequest.stopAutoMode()}JS_InitFingerprint(e){return this.oRequest.initFingerprint(e)}JS_UnInitFingerprint(){return this.oRequest.unInitFingerprint()}JS_StartCollectFingerprint(){return this.oRequest.startCollectFingerprint()}JS_StopCollectFingerprint(){return this.oRequest.stopCollectFingerprint()}JS_IsCollectingFingerprint(){return this.oRequest.isCollectingFingerprint()}JS_InitVideocapture(e){return this.oRequest.initVideocapture(e)}JS_UnInitVideocapture(){return this.oRequest.unInitVideocapture()}JS_RegisterDeviceType(e){return this.oRequest.registerDeviceType(e)}JS_ActiveOnlineDevice(e,t){return this.oRequest.activeOnlineDevice(e,t)}JS_RefreshDeviceList(){return this.oRequest.refreshDeviceList()}JS_ModifyDeviceNetParam(e,t,s,o,n,r,a){return this.oRequest.modifyDeviceNetParam(e,t,s,o,n,r,a)}JS_ExportKeyFile(e){return this.oRequest.exportKeyFile(e)}JS_ImportKeyFile(){return this.oRequest.importKeyFile()}JS_ResetPassword(e,t,s,o){return this.oRequest.resetPassword(e,t,s,o)}JS_UploadPicture(e){return this.oRequest.uploadPicture(e)}JS_ShowSelectMenu(e,t,s,o,n){const r=document.getElementById(e);if(r){const a=d.getWndPostion(r,!1,this.oWindowAttr,this.oDocOffset);n==="center"?a.left-=Math.round((t-r.offsetWidth)/2):n==="right"&&(a.left-=Math.round(t-r.offsetWidth));const i=d.getDevicePixelRatio();t=Math.round(t*i),s=Math.round(s*i);const c=1*window.getComputedStyle(r).height.slice(0,-2),l=Math.round(c*i);this.oRequest.showSelectMenu(a.left,a.top+l,t,s,o)}}JS_HideSelectMenu(){this.oRequest.hideSelectMenu()}JS_DestroySelectMenu(){return this.oRequest.destroySelectMenu()}JS_DeviceConfig(e){return this.oRequest.deviceConfig(e)}JS_CloudStorageConfig(e){return this.oRequest.cloudStorageConfig(e)}JS_EzvizRemoteConfig(e){return this.oRequest.ezvizRemoteConfig(e)}JS_ShowAlarmInfoInFullScreen(e,t,s){return this.oRequest.showAlarmInfoInFullScreen(e,t,s)}JS_SetImmediatePlaybackTime(e){return this.oRequest.setImmediatePlaybackTime(e)}JS_SetDrawStatus(e){return this.oRequest.setDrawStatus(e)}JS_ClearRegion(){return this.oRequest.clearRegion()}JS_SetDrawShapeInfo(e,t){return this.oRequest.setDrawShapeInfo(e,t)}JS_SetGridInfo(e){return this.oRequest.setGridInfo(e)}JS_GetGridInfo(){return this.oRequest.getGridInfo()}JS_SetPolygonInfo(e){return this.oRequest.setPolygonInfo(e)}JS_GetPolygonInfo(){return this.oRequest.getPolygonInfo()}JS_SetLineInfo(e){return this.oRequest.setLineInfo(e)}JS_GetLineInfo(){return this.oRequest.getLineInfo()}JS_SetRectInfo(e){return this.oRequest.setRectInfo(e)}JS_GetRectInfo(){return this.oRequest.getRectInfo()}JS_ClearShapeByType(e){return this.oRequest.clearShapeByType(e)}JS_SensitiveEncrypt(e,t,s){return this.oRequest.sensitiveEncrypt(e,t,s)}JS_SendRequest(e){return this.oRequest.sendRequest(e)}JS_RequestInterface(e){return this.oRequest.requestInterface(e)}JS_StopPlay(e){return this.oRequest.stopPlay(e)}JS_ShowRemoteConfig(e){return this.oRequest.showRemoteConfig(e)}static JS_WakeUp(e){const t=document.createElement("iframe");t.style.display="none",t.src=e,document.body.appendChild(t),setTimeout((()=>{document.body.removeChild(t)}),3e3)}JS_Video2Picture(){return this.oRequest.video2Picture()}JS_Picture2Video(){return this.oRequest.picture2Video()}JS_PtzControl(e){return this.oRequest.ptzControl(e)}JS_SimMouseClickEvent(e,t){return this.oRequest.simMouseClickEvent(e,t)}JS_US_SetMaxJobCount(e){return this.oRequest.us_SetMaxJobCount(e)}JS_US_GetMaxJobCount(){return this.oRequest.us_GetMaxJobCount()}JS_US_AddSchedule(e){return this.oRequest.us_AddSchedule(e)}JS_US_DelSchedule(e){return this.oRequest.us_DelSchedule(e)}JS_US_GetScheduleList(e){return this.oRequest.us_GetScheduleList(e)}JS_US_GetSchedule(e,t){return this.oRequest.us_GetSchedule(e,t)}JS_US_UpgradeAction(e,t){return this.oRequest.us_UpgradeAction(e,t)}JS_US_CheckUpgradeableDevice(e){return this.oRequest.us_CheckUpgradeableDevice(e)}JS_US_CheckUpgradeableDeviceList(e){return this.oRequest.us_CheckUpgradeableDeviceList(e)}JS_US_IsRunningAsyCheckUpgradeable(){return this.oRequest.us_IsRunningAsyCheckUpgradeable()}JS_US_StopAsyCheckUpgradeable(){return this.oRequest.us_StopAsyCheckUpgradeable()}JS_GetFishEyePTZPreset(e){return this.oRequest.getFishEyePTZPreset(e)}JS_SetFishEyePTZPreset(e,t,s){return this.oRequest.setFishEyePTZPreset(e,t,s)}JS_ControlFishEyePTZ(e,t,s,o){return this.oRequest.controlFishEyePTZ(e,t,s,o)}JS_ControlFishEyeParol(e,t,s){return this.oRequest.controlFishEyeParol(e,t,s)}JS_SetFirstDayOfWeek(e){return this.oRequest.setFirstDayOfWeek(e)}JS_SetEhomePlayInfo(e,t,s,o,n,r){return this.oRequest.setEhomePlayInfo(e,t,s,o,n,r)}JS_PlayPatch(e){return this.oRequest.startPlayPatch(e)}JS_SetWndAutoPanState(e,t){return this.oRequest.setWndAutoPanState(e,t)}JS_EnablePrivileges(){return this.oRequest.enablePrivileges()}};Ot.version="1.2.7";const Ns={id:"playWnd",class:"playWnd"},dt=3,ht=3e3,xe="插件未启动,正在尝试启动,请稍候...",ge="插件启动失败,请检查插件是否安装!",de={__name:"index",props:{isPlayVideo:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},cameraIndexCode:{type:String,default:""},currentPlayType:{type:Number,default:0},baseUrl:{type:String,default:"http://92.97.137.81:48181"},usefullData:{type:Object,default:()=>({appkey:"24460774",secret:"vphyI4pTqEVk4lT67jVe",ip:"61.27.16.15",port:443})},size:{type:Object,default:()=>({windowWidth:300,windowHeight:200})},isMulTip:{type:Boolean,default:!1},multipPointsArr:{type:Array,default:()=>[]},happenedTime:{type:String,default:""},isDoubleClickClose:{type:Boolean,default:!1}},emits:["closeVideoEmit"],setup(e,{expose:t,emit:s}){const o=e,n=s,r=w.ref(null),a=w.ref(0),i=w.ref(""),c=w.ref(""),l=w.ref("1x1"),u=w.ref(0),h=w.ref([]),_=w.ref(1),m=w.ref([]),S=w.ref(0);function g(){return new Promise((b,p)=>{if(window.WebControl){b();return}try{window.WebControl=Ot,console.log("web-control.esm.min.js加载成功"),b()}catch(T){console.error("web-control.esm.min.js加载失败",T),p(new Error("加载web-control.esm.min.js失败"))}})}function P(b){const p=new Date(Number(b));return p.setMinutes(p.getMinutes()-1),p.getTime()}function z(b){const p=new Date(Number(b));return p.setMinutes(p.getMinutes()+1),p.getTime()}function I(b,p){const T=[];for(let Y=0;Y<b.length;Y+=p)T.push(b.slice(Y,Y+p));return T}function Z(b){const p=new Bt;return p.setPublicKey(i.value),p.encrypt(b)}function R(b){n("closeVideoEmit",b),r.value!==null&&(r.value.JS_RequestInterface({funcName:"stopAllPreview"}),r.value.JS_HideWnd(),r.value.JS_Disconnect().then(()=>{},()=>{}))}function x(){r.value&&(r.value.JS_RequestInterface({funcName:"stopAllPreview"}),r.value.JS_HideWnd(),r.value.JS_RequestInterface({funcName:"destroyWnd"}))}function C(b){r.value.JS_RequestInterface({funcName:"getRSAPubKey",argument:JSON.stringify({keyLength:1024})}).then(p=>{p.responseMsg.data&&(i.value=p.responseMsg.data,b())})}function H(){let b=o.cameraIndexCode.trim();r.value.JS_RequestInterface({funcName:"startPreview",argument:JSON.stringify({cameraIndexCode:b,streamMode:0,transMode:1,gpuMode:0,wndId:-1})})}function X(){let b=o.cameraIndexCode,p="",T="";o.happenedTime?(p=P(o.happenedTime),T=z(o.happenedTime)):(p=Date.now()-1440*60*1e3,T=Date.now()),r.value.JS_RequestInterface({funcName:"startPlayback",argument:JSON.stringify({cameraIndexCode:b,startTimeStamp:Math.floor(p/1e3).toString(),endTimeStamp:Math.floor(T/1e3).toString(),recordLocation:1,transMode:1,gpuMode:0,wndId:-1})})}function V(){const b=m.value.map((p,T)=>({cameraIndexCode:p.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:T+1}));r.value.JS_RequestInterface({funcName:"startMultiPreviewByCameraIndexCode",argument:JSON.stringify({list:b})})}function ve(){let b="",p="";o.happenedTime?(b=P(o.happenedTime),p=z(o.happenedTime)):(b=Date.now()-1440*60*1e3,p=Date.now());const T=m.value.map((Y,Nt)=>({startTimeStamp:Math.floor(b/1e3).toString(),endTimeStamp:Math.floor(p/1e3).toString(),cameraIndexCode:Y.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:Nt+1}));r.value.JS_RequestInterface({funcName:"startMultiPlaybackByCameraIndexCode",argument:JSON.stringify({list:T})})}function Ft(){C(()=>{r.value.JS_RequestInterface({funcName:"init",argument:JSON.stringify({appkey:o.usefullData.appkey,secret:Z(o.usefullData.secret),ip:o.usefullData.ip,playMode:o.currentPlayType,port:o.usefullData.port,snapDir:"D:\\SnapDir",videoDir:"D:\\VideoDir",layout:l.value,enableHTTPS:1,encryptedFields:"secret",showToolbar:1,showSmart:0,buttonIDs:"0,256,257,258,259,260,512,513,514,515,516,517,768,769"})}).then(()=>{r.value.JS_Resize(o.size.windowWidth,o.size.windowHeight),o.isMulTip?o.currentPlayType===1?ve():V():o.currentPlayType===1?X():H()}),o.isFullScreen&&r.value.JS_RequestInterface({funcName:"setFullScreen"})})}function Mt(b){const{responseMsg:p}=b;p.type===6&&(u.value=o.multipPointsArr.length,_.value=1,h.value=o.multipPointsArr,l.value=p.msg.layout,S.value=p.msg.wndNum,h.value=I(h.value,p.msg.wndNum),m.value=[...h.value[_.value-1]],r.value.JS_Disconnect().then(()=>{G()},()=>{})),p.type===7&&o.isDoubleClickClose&&R("doubleClick")}function G(){r.value=new window.WebControl({szPluginContainer:"playWnd",iServicePortStart:15900,iServicePortEnd:15900,szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",cbConnectSuccess:()=>{r.value.JS_StartService("window",{dllPath:"./VideoPluginConnect.dll"}).then(()=>{r.value.JS_SetWindowControlCallback({cbIntegrationCallBack:Mt}),r.value.JS_CreateWnd("playWnd",o.size.windowWidth,o.size.windowHeight).then(()=>{Ft()})})},cbConnectError:()=>{r.value=null,ne.ElMessage.error(xe),c.value=xe,window.WebControl.JS_WakeUp("VideoWebPlugin://"),a.value++,a.value<dt?setTimeout(()=>G(),ht):(ne.ElMessage.error(ge),c.value=ge)},cbConnectClose:b=>{b||(r.value=null,c.value=xe,a.value++,a.value<dt?setTimeout(()=>G(),ht):(ne.ElMessage.error(ge),c.value=ge))}})}function $e(){ne.ElMessageBox.alert("播放视频需要下载插件","提示",{confirmButtonText:"下载插件",cancelButtonText:"取消",type:"info",showCancelButton:!0}).then(()=>{Jt(),ne.ElMessage({type:"success",message:"下载插件成功"})}).catch(()=>{R()})}function Jt(){try{const b=o.baseUrl+"static/VideoWebPlugin.exe",p=document.createElement("a");p.href=b,p.download="VideoWebPlugin.exe",p.style.display="none",document.body.appendChild(p),p.click(),setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p),R()},100)}catch{R()}}function Lt(){o.isMulTip&&(S.value=4,u.value=o.multipPointsArr.length,l.value=u.value<=1?"1x1":"2x2",h.value=I(o.multipPointsArr,4),m.value=[...h.value[_.value-1]])}return w.watch(()=>o.isPlayVideo,b=>{b===!0&&G(),b===!1&&R()}),w.watch(()=>o.happenedTime,()=>{ve()}),w.watch(()=>o.cameraIndexCode,(b,p)=>{b!==p&&(x(),r.value.JS_Disconnect().then(()=>{G()},()=>{}))}),w.watch(c,b=>{b!==""&&$e()}),w.onMounted(()=>{Lt(),g().then(()=>{o.isPlayVideo&&G()}).catch(()=>{$e()})}),w.onBeforeUnmount(()=>{r.value&&(r.value.JS_RequestInterface({funcName:"stopAllPreview"}),r.value.JS_HideWnd(),r.value.JS_RequestInterface({funcName:"destroyWnd"}))}),t({closeVideo:R,initPlugin:G,startPlay:H,startPlayback:X,startMultiPreview:V,startMultiPlayback:ve}),(b,p)=>w.withDirectives((w.openBlock(),w.createElementBlock("div",Ns,null,512)),[[w.vShow,!e.isFullScreen]])}};de.install=e=>{e.component(de.name,de)};exports.GPluginVideo=de;exports.default=de;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),L=require("jsencrypt"),d=require("element-plus"),Y={id:"playWnd",class:"playWnd"},W=3,k=3e3,b="插件未启动,正在尝试启动,请稍候...",S="插件启动失败,请检查插件是否安装!",f={__name:"index",props:{isPlayVideo:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},cameraIndexCode:{type:String,default:""},currentPlayType:{type:Number,default:0},baseUrl:{type:String,default:"http://92.97.137.81:48181"},basePath:{type:String,default:""},usefullData:{type:Object,default:()=>({appkey:"24460774",secret:"vphyI4pTqEVk4lT67jVe",ip:"61.27.16.15",port:443})},size:{type:Object,default:()=>({windowWidth:300,windowHeight:200})},isMulTip:{type:Boolean,default:!1},multipPointsArr:{type:Array,default:()=>[]},happenedTime:{type:String,default:""},isDoubleClickClose:{type:Boolean,default:!1}},emits:["closeVideoEmit"],setup(p,{expose:A,emit:E}){const n=p,B=E,a=l.ref(null),m=l.ref(0),C=l.ref(""),c=l.ref(""),g=l.ref("1x1"),h=l.ref(0),r=l.ref([]),w=l.ref(1),v=l.ref([]),M=l.ref(0);let T="/";try{T="/"}catch{}const q=()=>{const e=n.basePath||T;return e.endsWith("/")?e:`${e}/`};let y=null;function V(){return window.WebControl?Promise.resolve():(y||(y=import(`${q()}web-control.esm.min.js`).then(e=>{window.WebControl=e.WebControl}).catch(e=>{throw y=null,console.error("web-control.esm.min.js加载失败",e),new Error("加载web-control.esm.min.js失败")})),y)}function _(e){const t=new Date(Number(e));return t.setMinutes(t.getMinutes()-1),t.getTime()}function I(e){const t=new Date(Number(e));return t.setMinutes(t.getMinutes()+1),t.getTime()}function J(e,t){const o=[];for(let s=0;s<e.length;s+=t)o.push(e.slice(s,s+t));return o}function O(e){const t=new L;return t.setPublicKey(C.value),t.encrypt(e)}function u(e){B("closeVideoEmit",e),a.value!==null&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_Disconnect().then(()=>{},()=>{}))}function z(){a.value&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_RequestInterface({funcName:"destroyWnd"}))}function F(e){a.value.JS_RequestInterface({funcName:"getRSAPubKey",argument:JSON.stringify({keyLength:1024})}).then(t=>{t.responseMsg.data&&(C.value=t.responseMsg.data,e())})}function N(){let e=n.cameraIndexCode.trim();a.value.JS_RequestInterface({funcName:"startPreview",argument:JSON.stringify({cameraIndexCode:e,streamMode:0,transMode:1,gpuMode:0,wndId:-1})})}function D(){let e=n.cameraIndexCode,t="",o="";n.happenedTime?(t=_(n.happenedTime),o=I(n.happenedTime)):(t=Date.now()-1440*60*1e3,o=Date.now()),a.value.JS_RequestInterface({funcName:"startPlayback",argument:JSON.stringify({cameraIndexCode:e,startTimeStamp:Math.floor(t/1e3).toString(),endTimeStamp:Math.floor(o/1e3).toString(),recordLocation:1,transMode:1,gpuMode:0,wndId:-1})})}function R(){const e=v.value.map((t,o)=>({cameraIndexCode:t.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:o+1}));a.value.JS_RequestInterface({funcName:"startMultiPreviewByCameraIndexCode",argument:JSON.stringify({list:e})})}function P(){let e="",t="";n.happenedTime?(e=_(n.happenedTime),t=I(n.happenedTime)):(e=Date.now()-1440*60*1e3,t=Date.now());const o=v.value.map((s,K)=>({startTimeStamp:Math.floor(e/1e3).toString(),endTimeStamp:Math.floor(t/1e3).toString(),cameraIndexCode:s.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:K+1}));a.value.JS_RequestInterface({funcName:"startMultiPlaybackByCameraIndexCode",argument:JSON.stringify({list:o})})}function H(){F(()=>{a.value.JS_RequestInterface({funcName:"init",argument:JSON.stringify({appkey:n.usefullData.appkey,secret:O(n.usefullData.secret),ip:n.usefullData.ip,playMode:n.currentPlayType,port:n.usefullData.port,snapDir:"D:\\SnapDir",videoDir:"D:\\VideoDir",layout:g.value,enableHTTPS:1,encryptedFields:"secret",showToolbar:1,showSmart:0,buttonIDs:"0,256,257,258,259,260,512,513,514,515,516,517,768,769"})}).then(()=>{a.value.JS_Resize(n.size.windowWidth,n.size.windowHeight),n.isMulTip?n.currentPlayType===1?P():R():n.currentPlayType===1?D():N()}),n.isFullScreen&&a.value.JS_RequestInterface({funcName:"setFullScreen"})})}function j(e){const{responseMsg:t}=e;t.type===6&&(h.value=n.multipPointsArr.length,w.value=1,r.value=n.multipPointsArr,g.value=t.msg.layout,M.value=t.msg.wndNum,r.value=J(r.value,t.msg.wndNum),v.value=[...r.value[w.value-1]],a.value.JS_Disconnect().then(()=>{i()},()=>{})),t.type===7&&n.isDoubleClickClose&&u("doubleClick")}function i(){a.value=new window.WebControl({szPluginContainer:"playWnd",iServicePortStart:15900,iServicePortEnd:15900,szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",cbConnectSuccess:()=>{a.value.JS_StartService("window",{dllPath:"./VideoPluginConnect.dll"}).then(()=>{a.value.JS_SetWindowControlCallback({cbIntegrationCallBack:j}),a.value.JS_CreateWnd("playWnd",n.size.windowWidth,n.size.windowHeight).then(()=>{H()})})},cbConnectError:()=>{a.value=null,d.ElMessage.error(b),c.value=b,window.WebControl.JS_WakeUp("VideoWebPlugin://"),m.value++,m.value<W?setTimeout(()=>i(),k):(d.ElMessage.error(S),c.value=S)},cbConnectClose:e=>{e||(a.value=null,c.value=b,m.value++,m.value<W?setTimeout(()=>i(),k):(d.ElMessage.error(S),c.value=S))}})}function x(){d.ElMessageBox.alert("播放视频需要下载插件","提示",{confirmButtonText:"下载插件",cancelButtonText:"取消",type:"info",showCancelButton:!0}).then(()=>{U(),d.ElMessage({type:"success",message:"下载插件成功"})}).catch(()=>{u()})}function U(){try{const e=n.baseUrl+"static/VideoWebPlugin.exe",t=document.createElement("a");t.href=e,t.download="VideoWebPlugin.exe",t.style.display="none",document.body.appendChild(t),t.click(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),u()},100)}catch{u()}}function G(){n.isMulTip&&(M.value=4,h.value=n.multipPointsArr.length,g.value=h.value<=1?"1x1":"2x2",r.value=J(n.multipPointsArr,4),v.value=[...r.value[w.value-1]])}return l.watch(()=>n.isPlayVideo,e=>{e===!0&&i(),e===!1&&u()}),l.watch(()=>n.happenedTime,()=>{P()}),l.watch(()=>n.cameraIndexCode,(e,t)=>{e!==t&&(z(),a.value.JS_Disconnect().then(()=>{i()},()=>{}))}),l.watch(c,e=>{e!==""&&x()}),l.onMounted(()=>{G(),V().then(()=>{n.isPlayVideo&&i()}).catch(()=>{x()})}),l.onBeforeUnmount(()=>{a.value&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_RequestInterface({funcName:"destroyWnd"}))}),A({closeVideo:u,initPlugin:i,startPlay:N,startPlayback:D,startMultiPreview:R,startMultiPlayback:P}),(e,t)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",Y,null,512)),[[l.vShow,!p.isFullScreen]])}};f.install=p=>{p.component(f.name,f)};exports.GPluginVideo=f;exports.default=f;
|