You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
139 KiB
1 lines
139 KiB
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204],{8753:function(t,e,s){"use strict";function i(t){return 0|t}s.d(e,{Z:function(){return Sa}});let n="warn",r=()=>{},a=()=>{},h=()=>{},o=()=>{};function l(t,e=!1){try{return decodeURIComponent(escape(t))}catch(Ur){if(Ur instanceof URIError&&e)return t;throw Ur}}function c(t){return unescape(encodeURIComponent(t))}!function(t){if("undefined"===typeof t?t=n:n=t,r=a=h=o=()=>{},"undefined"!==typeof window.console)switch(t){case"debug":r=console.debug.bind(window.console);case"info":a=console.info.bind(window.console);case"warn":h=console.warn.bind(window.console);case"error":o=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+t+"'")}}();let d="ontouchstart"in document.documentElement||void 0!==document.ontouchstart||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.addEventListener("touchstart",(function t(){d=!0,window.removeEventListener("touchstart",t,!1)}),!1);let u=10*(window.devicePixelRatio||1),_=!1;try{const t=document.createElement("canvas");t.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',0===t.style.cursor.indexOf("url")?(a("Data URI scheme cursor supported"),_=!0):h("Data URI scheme cursor not supported")}catch(Qa){o("Data URI scheme cursor test exception: "+Qa)}const f=_;let p=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),p=!0}catch(Aa){}const g=p;let m=!0;try{const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",document.body.appendChild(t);const e=document.createElement("div");t.appendChild(e);const s=t.offsetWidth-e.offsetWidth;t.parentNode.removeChild(t),m=0!=s}catch(Qa){o("Scrollbar test exception: "+Qa)}function w(){return navigator&&!!/mac/i.exec(navigator.platform)}function b(){return navigator&&!!/win/i.exec(navigator.platform)}function v(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function k(){return navigator&&!!/trident/i.exec(navigator.userAgent)}function y(){return navigator&&!!/edge/i.exec(navigator.userAgent)}function C(){return navigator&&!!/firefox/i.exec(navigator.userAgent)}function x(t,e,s){const i=s.getBoundingClientRect();let n={x:0,y:0};return t<i.left?n.x=0:t>=i.right?n.x=i.width-1:n.x=t-i.left,e<i.top?n.y=0:e>=i.bottom?n.y=i.height-1:n.y=e-i.top,n}function S(t){t.stopPropagation(),t.preventDefault()}let Q=!1,A=null;function E(t){if(Q)return;const e=new t.constructor(t.type,t);Q=!0,document.captureElement?document.captureElement.dispatchEvent(e):A.dispatchEvent(e),Q=!1,t.stopPropagation(),e.defaultPrevented&&t.preventDefault(),"mouseup"===t.type&&F()}function M(){document.getElementById("noVNC_mouse_capture_elem").style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;const T=new MutationObserver(M);function F(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;A=document.captureElement,document.captureElement=null,T.disconnect();document.getElementById("noVNC_mouse_capture_elem").style.display="none",window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",E)}}var L={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode(t){let e="";const s=t.length,i=s%3;for(let r=0;r<s-2;r+=3)e+=this.toBase64Table[t[r]>>2],e+=this.toBase64Table[((3&t[r])<<4)+(t[r+1]>>4)],e+=this.toBase64Table[((15&t[r+1])<<2)+(t[r+2]>>6)],e+=this.toBase64Table[63&t[r+2]];const n=s-i;return 2===i?(e+=this.toBase64Table[t[n]>>2],e+=this.toBase64Table[((3&t[n])<<4)+(t[n+1]>>4)],e+=this.toBase64Table[(15&t[n+1])<<2],e+=this.toBase64Table[64]):1===i&&(e+=this.toBase64Table[t[n]>>2],e+=this.toBase64Table[(3&t[n])<<4],e+=this.toBase64Table[64],e+=this.toBase64Table[64]),e},toBinaryTable:[-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,0,-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],decode(t,e=0){let s=t.indexOf("=")-e;s<0&&(s=t.length-e);const i=3*(s>>2)+Math.floor(s%4/1.5),n=new Array(i);let r=0,a=0;for(let h=0,l=e;l<t.length;l++){const e=this.toBinaryTable[127&t.charCodeAt(l)],s=t.charAt(l)===this.base64Pad;-1!==e?(a=a<<6|e,r+=6,r>=8&&(r-=8,s||(n[h++]=a>>r&255),a&=(1<<r)-1)):o("Illegal character code "+t.charCodeAt(l)+" at position "+l)}if(r){const t=new Error("Corrupted base64 string");throw t.name="Base64-Error",t}return n}};class D{constructor(t){if(this._drawCtx=null,this._renderQ=[],this._flushing=!1,this._fbWidth=0,this._fbHeight=0,this._prevDrawStyle="",this._tile=null,this._tile16x16=null,this._tileX=0,this._tileY=0,r(">> Display.constructor"),this._target=t,!this._target)throw new Error("Target must be set");if("string"===typeof this._target)throw new Error("target must be a DOM element");if(!this._target.getContext)throw new Error("no getContext method");if(this._targetCtx=this._target.getContext("2d"),this._viewportLoc={x:0,y:0,w:this._target.width,h:this._target.height},this._backbuffer=document.createElement("canvas"),this._drawCtx=this._backbuffer.getContext("2d"),this._damageBounds={left:0,top:0,right:this._backbuffer.width,bottom:this._backbuffer.height},r("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),r("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=()=>{}}get scale(){return this._scale}set scale(t){this._rescale(t)}get clipViewport(){return this._clipViewport}set clipViewport(t){this._clipViewport=t;const e=this._viewportLoc;this.viewportChangeSize(e.w,e.h),this.viewportChangePos(0,0)}get width(){return this._fbWidth}get height(){return this._fbHeight}viewportChangePos(t,e){const s=this._viewportLoc;t=Math.floor(t),e=Math.floor(e),this._clipViewport||(t=-s.w,e=-s.h);const i=s.x+s.w-1,n=s.y+s.h-1;t<0&&s.x+t<0&&(t=-s.x),i+t>=this._fbWidth&&(t-=i+t-this._fbWidth+1),s.y+e<0&&(e=-s.y),n+e>=this._fbHeight&&(e-=n+e-this._fbHeight+1),0===t&&0===e||(r("viewportChange deltaX: "+t+", deltaY: "+e),s.x+=t,s.y+=e,this._damage(s.x,s.y,s.w,s.h),this.flip())}viewportChangeSize(t,e){this._clipViewport&&"undefined"!==typeof t&&"undefined"!==typeof e||(r("Setting viewport to full display region"),t=this._fbWidth,e=this._fbHeight),t=Math.floor(t),e=Math.floor(e),t>this._fbWidth&&(t=this._fbWidth),e>this._fbHeight&&(e=this._fbHeight);const s=this._viewportLoc;if(s.w!==t||s.h!==e){s.w=t,s.h=e;const i=this._target;i.width=t,i.height=e,this.viewportChangePos(0,0),this._damage(s.x,s.y,s.w,s.h),this.flip(),this._rescale(this._scale)}}absX(t){return 0===this._scale?0:i(t/this._scale+this._viewportLoc.x)}absY(t){return 0===this._scale?0:i(t/this._scale+this._viewportLoc.y)}resize(t,e){this._prevDrawStyle="",this._fbWidth=t,this._fbHeight=e;const s=this._backbuffer;if(s.width!==t||s.height!==e){let i=null;s.width>0&&s.height>0&&(i=this._drawCtx.getImageData(0,0,s.width,s.height)),s.width!==t&&(s.width=t),s.height!==e&&(s.height=e),i&&this._drawCtx.putImageData(i,0,0)}const i=this._viewportLoc;this.viewportChangeSize(i.w,i.h),this.viewportChangePos(0,0)}_damage(t,e,s,i){t<this._damageBounds.left&&(this._damageBounds.left=t),e<this._damageBounds.top&&(this._damageBounds.top=e),t+s>this._damageBounds.right&&(this._damageBounds.right=t+s),e+i>this._damageBounds.bottom&&(this._damageBounds.bottom=e+i)}flip(t){if(0===this._renderQ.length||t){let t=this._damageBounds.left,e=this._damageBounds.top,s=this._damageBounds.right-t,i=this._damageBounds.bottom-e,n=t-this._viewportLoc.x,r=e-this._viewportLoc.y;n<0&&(s+=n,t-=n,n=0),r<0&&(i+=r,e-=r,r=0),n+s>this._viewportLoc.w&&(s=this._viewportLoc.w-n),r+i>this._viewportLoc.h&&(i=this._viewportLoc.h-r),s>0&&i>0&&this._targetCtx.drawImage(this._backbuffer,t,e,s,i,n,r,s,i),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}else this._renderQPush({type:"flip"})}pending(){return this._renderQ.length>0}flush(){0===this._renderQ.length?this.onflush():this._flushing=!0}fillRect(t,e,s,i,n,r){0===this._renderQ.length||r?(this._setFillColor(n),this._drawCtx.fillRect(t,e,s,i),this._damage(t,e,s,i)):this._renderQPush({type:"fill",x:t,y:e,width:s,height:i,color:n})}copyImage(t,e,s,i,n,r,a){0===this._renderQ.length||a?(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,t,e,n,r,s,i,n,r),this._damage(s,i,n,r)):this._renderQPush({type:"copy",oldX:t,oldY:e,x:s,y:i,width:n,height:r})}imageRect(t,e,s,i,n,r){if(0===s||0===i)return;const a=new Image;a.src="data: "+n+";base64,"+L.encode(r),this._renderQPush({type:"img",img:a,x:t,y:e,width:s,height:i})}startTile(t,e,s,i,n){this._tileX=t,this._tileY=e,this._tile=16===s&&16===i?this._tile16x16:this._drawCtx.createImageData(s,i);const r=n[2],a=n[1],h=n[0],o=this._tile.data;for(let l=0;l<s*i*4;l+=4)o[l]=r,o[l+1]=a,o[l+2]=h,o[l+3]=255}subTile(t,e,s,i,n){const r=n[2],a=n[1],h=n[0],o=t+s,l=e+i,c=this._tile.data,d=this._tile.width;for(let u=e;u<l;u++)for(let e=t;e<o;e++){const t=4*(e+u*d);c[t]=r,c[t+1]=a,c[t+2]=h,c[t+3]=255}}finishTile(){this._drawCtx.putImageData(this._tile,this._tileX,this._tileY),this._damage(this._tileX,this._tileY,this._tile.width,this._tile.height)}blitImage(t,e,s,i,n,r,a){if(0===this._renderQ.length||a)this._bgrxImageData(t,e,s,i,n,r);else{const r=new Uint8Array(s*i*4);r.set(new Uint8Array(n.buffer,0,r.length)),this._renderQPush({type:"blit",data:r,x:t,y:e,width:s,height:i})}}blitRgbImage(t,e,s,i,n,r,a){if(0===this._renderQ.length||a)this._rgbImageData(t,e,s,i,n,r);else{const r=new Uint8Array(s*i*3);r.set(new Uint8Array(n.buffer,0,r.length)),this._renderQPush({type:"blitRgb",data:r,x:t,y:e,width:s,height:i})}}blitRgbxImage(t,e,s,i,n,r,a){if(0===this._renderQ.length||a)this._rgbxImageData(t,e,s,i,n,r);else{const r=new Uint8Array(s*i*4);r.set(new Uint8Array(n.buffer,0,r.length)),this._renderQPush({type:"blitRgbx",data:r,x:t,y:e,width:s,height:i})}}drawImage(t,e,s){this._drawCtx.drawImage(t,e,s),this._damage(e,s,t.width,t.height)}autoscale(t,e){let s;if(0===t||0===e)s=0;else{const i=this._viewportLoc,n=t/e;s=i.w/i.h>=n?t/i.w:e/i.h}this._rescale(s)}_rescale(t){this._scale=t;const e=this._viewportLoc,s=t*e.w+"px",i=t*e.h+"px";this._target.style.width===s&&this._target.style.height===i||(this._target.style.width=s,this._target.style.height=i)}_setFillColor(t){const e="rgb("+t[2]+","+t[1]+","+t[0]+")";e!==this._prevDrawStyle&&(this._drawCtx.fillStyle=e,this._prevDrawStyle=e)}_rgbImageData(t,e,s,i,n,r){const a=this._drawCtx.createImageData(s,i),h=a.data;for(let o=0,l=r;o<s*i*4;o+=4,l+=3)h[o]=n[l],h[o+1]=n[l+1],h[o+2]=n[l+2],h[o+3]=255;this._drawCtx.putImageData(a,t,e),this._damage(t,e,a.width,a.height)}_bgrxImageData(t,e,s,i,n,r){const a=this._drawCtx.createImageData(s,i),h=a.data;for(let o=0,l=r;o<s*i*4;o+=4,l+=4)h[o]=n[l+2],h[o+1]=n[l+1],h[o+2]=n[l],h[o+3]=255;this._drawCtx.putImageData(a,t,e),this._damage(t,e,a.width,a.height)}_rgbxImageData(t,e,s,i,n,r){let a;g?a=new ImageData(new Uint8ClampedArray(n.buffer,n.byteOffset,s*i*4),s,i):(a=this._drawCtx.createImageData(s,i),a.data.set(new Uint8ClampedArray(n.buffer,n.byteOffset,s*i*4))),this._drawCtx.putImageData(a,t,e),this._damage(t,e,a.width,a.height)}_renderQPush(t){this._renderQ.push(t),1===this._renderQ.length&&this._scanRenderQ()}_resumeRenderQ(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}_scanRenderQ(){let t=!0;for(;t&&this._renderQ.length>0;){const e=this._renderQ[0];switch(e.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(e.oldX,e.oldY,e.x,e.y,e.width,e.height,!0);break;case"fill":this.fillRect(e.x,e.y,e.width,e.height,e.color,!0);break;case"blit":this.blitImage(e.x,e.y,e.width,e.height,e.data,0,!0);break;case"blitRgb":this.blitRgbImage(e.x,e.y,e.width,e.height,e.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(e.x,e.y,e.width,e.height,e.data,0,!0);break;case"img":if(e.img.complete&&0!==e.img.width&&0!==e.img.height){if(e.img.width!==e.width||e.img.height!==e.height)return void o("Decoded image has incorrect dimensions. Got "+e.img.width+"x"+e.img.height+". Expected "+e.width+"x"+e.height+".");this.drawImage(e.img,e.x,e.y)}else e.img._noVNCDisplay=this,e.img.addEventListener("load",this._resumeRenderQ),t=!1}t&&this._renderQ.shift()}0===this._renderQ.length&&this._flushing&&(this._flushing=!1,this.onflush())}}function B(t,e,s,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(s,s+i),n);else for(var r=0;r<i;r++)t[n+r]=e[s+r]}var z=Uint8Array,U=Uint16Array,I=Int32Array;function R(t,e,s,i){for(var n=65535&t|0,r=t>>>16&65535|0,a=0;0!==s;){s-=a=s>2e3?2e3:s;do{r=r+(n=n+e[i++]|0)|0}while(--a);n%=65521,r%=65521}return n|r<<16|0}function N(){for(var t,e=[],s=0;s<256;s++){t=s;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[s]=t}return e}N();function P(t,e){var s,i,n,r,a,h,o,l,c,d,u,_,f,p,g,m,w,b,v,k,y,C,x,S,Q;s=t.state,i=t.next_in,S=t.input,n=i+(t.avail_in-5),r=t.next_out,Q=t.output,a=r-(e-t.avail_out),h=r+(t.avail_out-257),o=s.dmax,l=s.wsize,c=s.whave,d=s.wnext,u=s.window,_=s.hold,f=s.bits,p=s.lencode,g=s.distcode,m=(1<<s.lenbits)-1,w=(1<<s.distbits)-1;t:do{f<15&&(_+=S[i++]<<f,f+=8,_+=S[i++]<<f,f+=8),b=p[_&m];e:for(;;){if(_>>>=v=b>>>24,f-=v,0===(v=b>>>16&255))Q[r++]=65535&b;else{if(!(16&v)){if(0===(64&v)){b=p[(65535&b)+(_&(1<<v)-1)];continue e}if(32&v){s.mode=12;break t}t.msg="invalid literal/length code",s.mode=30;break t}k=65535&b,(v&=15)&&(f<v&&(_+=S[i++]<<f,f+=8),k+=_&(1<<v)-1,_>>>=v,f-=v),f<15&&(_+=S[i++]<<f,f+=8,_+=S[i++]<<f,f+=8),b=g[_&w];s:for(;;){if(_>>>=v=b>>>24,f-=v,!(16&(v=b>>>16&255))){if(0===(64&v)){b=g[(65535&b)+(_&(1<<v)-1)];continue s}t.msg="invalid distance code",s.mode=30;break t}if(y=65535&b,f<(v&=15)&&(_+=S[i++]<<f,(f+=8)<v&&(_+=S[i++]<<f,f+=8)),(y+=_&(1<<v)-1)>o){t.msg="invalid distance too far back",s.mode=30;break t}if(_>>>=v,f-=v,y>(v=r-a)){if((v=y-v)>c&&s.sane){t.msg="invalid distance too far back",s.mode=30;break t}if(C=0,x=u,0===d){if(C+=l-v,v<k){k-=v;do{Q[r++]=u[C++]}while(--v);C=r-y,x=Q}}else if(d<v){if(C+=l+d-v,(v-=d)<k){k-=v;do{Q[r++]=u[C++]}while(--v);if(C=0,d<k){k-=v=d;do{Q[r++]=u[C++]}while(--v);C=r-y,x=Q}}}else if(C+=d-v,v<k){k-=v;do{Q[r++]=u[C++]}while(--v);C=r-y,x=Q}for(;k>2;)Q[r++]=x[C++],Q[r++]=x[C++],Q[r++]=x[C++],k-=3;k&&(Q[r++]=x[C++],k>1&&(Q[r++]=x[C++]))}else{C=r-y;do{Q[r++]=Q[C++],Q[r++]=Q[C++],Q[r++]=Q[C++],k-=3}while(k>2);k&&(Q[r++]=Q[C++],k>1&&(Q[r++]=Q[C++]))}break}}break}}while(i<n&&r<h);i-=k=f>>3,_&=(1<<(f-=k<<3))-1,t.next_in=i,t.next_out=r,t.avail_in=i<n?n-i+5:5-(i-n),t.avail_out=r<h?h-r+257:257-(r-h),s.hold=_,s.bits=f}var V=15,H=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],K=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],X=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],O=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function Y(t,e,s,i,n,r,a,h){var o,l,c,d,u,_,f,p,g,m=h.bits,w=0,b=0,v=0,k=0,y=0,C=0,x=0,S=0,Q=0,A=0,E=null,M=0,T=new U(16),F=new U(16),L=null,D=0;for(w=0;w<=V;w++)T[w]=0;for(b=0;b<i;b++)T[e[s+b]]++;for(y=m,k=V;k>=1&&0===T[k];k--);if(y>k&&(y=k),0===k)return n[r++]=20971520,n[r++]=20971520,h.bits=1,0;for(v=1;v<k&&0===T[v];v++);for(y<v&&(y=v),S=1,w=1;w<=V;w++)if(S<<=1,(S-=T[w])<0)return-1;if(S>0&&(0===t||1!==k))return-1;for(F[1]=0,w=1;w<V;w++)F[w+1]=F[w]+T[w];for(b=0;b<i;b++)0!==e[s+b]&&(a[F[e[s+b]]++]=b);if(0===t?(E=L=a,_=19):1===t?(E=H,M-=257,L=K,D-=257,_=256):(E=X,L=O,_=-1),A=0,b=0,w=v,u=r,C=y,x=0,c=-1,d=(Q=1<<y)-1,1===t&&Q>852||2===t&&Q>592)return 1;for(;;){f=w-x,a[b]<_?(p=0,g=a[b]):a[b]>_?(p=L[D+a[b]],g=E[M+a[b]]):(p=96,g=0),o=1<<w-x,v=l=1<<C;do{n[u+(A>>x)+(l-=o)]=f<<24|p<<16|g|0}while(0!==l);for(o=1<<w-1;A&o;)o>>=1;if(0!==o?(A&=o-1,A+=o):A=0,b++,0===--T[w]){if(w===k)break;w=e[s+a[b]]}if(w>y&&(A&d)!==c){for(0===x&&(x=y),u+=v,S=1<<(C=w-x);C+x<k&&!((S-=T[C+x])<=0);)C++,S<<=1;if(Q+=1<<C,1===t&&Q>852||2===t&&Q>592)return 1;n[c=A&d]=y<<24|C<<16|u-r|0}}return 0!==A&&(n[u+A]=w-x<<24|64<<16|0),h.bits=y,0}const G=-2;var W=12,q=30;function j(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function Z(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new U(320),this.work=new U(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function J(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new I(852),e.distcode=e.distdyn=new I(592),e.sane=1,e.back=-1,0):G}(t)):G}function $(t,e){var s,i;return t?(i=new Z,t.state=i,i.window=null,0!==(s=function(t,e){var s,i;return t&&t.state?(i=t.state,e<0?(s=0,e=-e):(s=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?G:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=s,i.wbits=e,J(t))):G}(t,e))&&(t.state=null),s):G}var tt,et,st=!0;function it(t){if(st){var e;for(tt=new I(512),et=new I(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Y(1,t.lens,0,288,tt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Y(2,t.lens,0,32,et,0,t.work,{bits:5}),st=!1}t.lencode=tt,t.lenbits=9,t.distcode=et,t.distbits=5}function nt(t,e,s,i){var n,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new z(r.wsize)),i>=r.wsize?(B(r.window,e,s-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),B(r.window,e,s-i,n,r.wnext),(i-=n)?(B(r.window,e,s-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=n))),0}function rt(){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}class at{constructor(){var t;this.strm=new rt,this.chunkSize=102400,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,t=this.strm,this.windowBits,$(t,15)}setInput(t){t?(this.strm.input=t,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0):(this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0)}inflate(t){if(t>this.chunkSize&&(this.chunkSize=t,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=t,function(t,e){var s,i,n,r,a,h,o,l,c,d,u,_,f,p,g,m,w,b,v,k,y,C,x,S,Q=0,A=new z(4),E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return G;(s=t.state).mode===W&&(s.mode=13),a=t.next_out,n=t.output,o=t.avail_out,r=t.next_in,i=t.input,h=t.avail_in,l=s.hold,c=s.bits,d=h,u=o,C=0;t:for(;;)switch(s.mode){case 1:if(0===s.wrap){s.mode=13;break}for(;c<16;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(2&s.wrap&&35615===l){s.check=0,A[0]=255&l,A[1]=l>>>8&255,s.check=N(s.check),l=0,c=0,s.mode=2;break}if(s.flags=0,s.head&&(s.head.done=!1),!(1&s.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",s.mode=q;break}if(8!==(15&l)){t.msg="unknown compression method",s.mode=q;break}if(c-=4,y=8+(15&(l>>>=4)),0===s.wbits)s.wbits=y;else if(y>s.wbits){t.msg="invalid window size",s.mode=q;break}s.dmax=1<<y,t.adler=s.check=1,s.mode=512&l?10:W,l=0,c=0;break;case 2:for(;c<16;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(s.flags=l,8!==(255&s.flags)){t.msg="unknown compression method",s.mode=q;break}if(57344&s.flags){t.msg="unknown header flags set",s.mode=q;break}s.head&&(s.head.text=l>>8&1),512&s.flags&&(A[0]=255&l,A[1]=l>>>8&255,s.check=N(s.check)),l=0,c=0,s.mode=3;case 3:for(;c<32;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}s.head&&(s.head.time=l),512&s.flags&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,s.check=N(s.check)),l=0,c=0,s.mode=4;case 4:for(;c<16;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}s.head&&(s.head.xflags=255&l,s.head.os=l>>8),512&s.flags&&(A[0]=255&l,A[1]=l>>>8&255,s.check=N(s.check)),l=0,c=0,s.mode=5;case 5:if(1024&s.flags){for(;c<16;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}s.length=l,s.head&&(s.head.extra_len=l),512&s.flags&&(A[0]=255&l,A[1]=l>>>8&255,s.check=N(s.check)),l=0,c=0}else s.head&&(s.head.extra=null);s.mode=6;case 6:if(1024&s.flags&&((_=s.length)>h&&(_=h),_&&(s.head&&(y=s.head.extra_len-s.length,s.head.extra||(s.head.extra=new Array(s.head.extra_len)),B(s.head.extra,i,r,_,y)),512&s.flags&&(s.check=N(s.check)),h-=_,r+=_,s.length-=_),s.length))break t;s.length=0,s.mode=7;case 7:if(2048&s.flags){if(0===h)break t;_=0;do{y=i[r+_++],s.head&&y&&s.length<65536&&(s.head.name+=String.fromCharCode(y))}while(y&&_<h);if(512&s.flags&&(s.check=N(s.check)),h-=_,r+=_,y)break t}else s.head&&(s.head.name=null);s.length=0,s.mode=8;case 8:if(4096&s.flags){if(0===h)break t;_=0;do{y=i[r+_++],s.head&&y&&s.length<65536&&(s.head.comment+=String.fromCharCode(y))}while(y&&_<h);if(512&s.flags&&(s.check=N(s.check)),h-=_,r+=_,y)break t}else s.head&&(s.head.comment=null);s.mode=9;case 9:if(512&s.flags){for(;c<16;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(l!==(65535&s.check)){t.msg="header crc mismatch",s.mode=q;break}l=0,c=0}s.head&&(s.head.hcrc=s.flags>>9&1,s.head.done=!0),t.adler=s.check=0,s.mode=W;break;case 10:for(;c<32;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}t.adler=s.check=j(l),l=0,c=0,s.mode=11;case 11:if(0===s.havedict)return t.next_out=a,t.avail_out=o,t.next_in=r,t.avail_in=h,s.hold=l,s.bits=c,2;t.adler=s.check=1,s.mode=W;case W:if(5===e||6===e)break t;case 13:if(s.last){l>>>=7&c,c-=7&c,s.mode=27;break}for(;c<3;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}switch(s.last=1&l,c-=1,3&(l>>>=1)){case 0:s.mode=14;break;case 1:if(it(s),s.mode=20,6===e){l>>>=2,c-=2;break t}break;case 2:s.mode=17;break;case 3:t.msg="invalid block type",s.mode=q}l>>>=2,c-=2;break;case 14:for(l>>>=7&c,c-=7&c;c<32;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if((65535&l)!==(l>>>16^65535)){t.msg="invalid stored block lengths",s.mode=q;break}if(s.length=65535&l,l=0,c=0,s.mode=15,6===e)break t;case 15:s.mode=16;case 16:if(_=s.length){if(_>h&&(_=h),_>o&&(_=o),0===_)break t;B(n,i,r,_,a),h-=_,r+=_,o-=_,a+=_,s.length-=_;break}s.mode=W;break;case 17:for(;c<14;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(s.nlen=257+(31&l),l>>>=5,c-=5,s.ndist=1+(31&l),l>>>=5,c-=5,s.ncode=4+(15&l),l>>>=4,c-=4,s.nlen>286||s.ndist>30){t.msg="too many length or distance symbols",s.mode=q;break}s.have=0,s.mode=18;case 18:for(;s.have<s.ncode;){for(;c<3;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}s.lens[E[s.have++]]=7&l,l>>>=3,c-=3}for(;s.have<19;)s.lens[E[s.have++]]=0;if(s.lencode=s.lendyn,s.lenbits=7,x={bits:s.lenbits},C=Y(0,s.lens,0,19,s.lencode,0,s.work,x),s.lenbits=x.bits,C){t.msg="invalid code lengths set",s.mode=q;break}s.have=0,s.mode=19;case 19:for(;s.have<s.nlen+s.ndist;){for(;m=(Q=s.lencode[l&(1<<s.lenbits)-1])>>>16&255,w=65535&Q,!((g=Q>>>24)<=c);){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(w<16)l>>>=g,c-=g,s.lens[s.have++]=w;else{if(16===w){for(S=g+2;c<S;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(l>>>=g,c-=g,0===s.have){t.msg="invalid bit length repeat",s.mode=q;break}y=s.lens[s.have-1],_=3+(3&l),l>>>=2,c-=2}else if(17===w){for(S=g+3;c<S;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}c-=g,y=0,_=3+(7&(l>>>=g)),l>>>=3,c-=3}else{for(S=g+7;c<S;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}c-=g,y=0,_=11+(127&(l>>>=g)),l>>>=7,c-=7}if(s.have+_>s.nlen+s.ndist){t.msg="invalid bit length repeat",s.mode=q;break}for(;_--;)s.lens[s.have++]=y}}if(s.mode===q)break;if(0===s.lens[256]){t.msg="invalid code -- missing end-of-block",s.mode=q;break}if(s.lenbits=9,x={bits:s.lenbits},C=Y(1,s.lens,0,s.nlen,s.lencode,0,s.work,x),s.lenbits=x.bits,C){t.msg="invalid literal/lengths set",s.mode=q;break}if(s.distbits=6,s.distcode=s.distdyn,x={bits:s.distbits},C=Y(2,s.lens,s.nlen,s.ndist,s.distcode,0,s.work,x),s.distbits=x.bits,C){t.msg="invalid distances set",s.mode=q;break}if(s.mode=20,6===e)break t;case 20:s.mode=21;case 21:if(h>=6&&o>=258){t.next_out=a,t.avail_out=o,t.next_in=r,t.avail_in=h,s.hold=l,s.bits=c,P(t,u),a=t.next_out,n=t.output,o=t.avail_out,r=t.next_in,i=t.input,h=t.avail_in,l=s.hold,c=s.bits,s.mode===W&&(s.back=-1);break}for(s.back=0;m=(Q=s.lencode[l&(1<<s.lenbits)-1])>>>16&255,w=65535&Q,!((g=Q>>>24)<=c);){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(m&&0===(240&m)){for(b=g,v=m,k=w;m=(Q=s.lencode[k+((l&(1<<b+v)-1)>>b)])>>>16&255,w=65535&Q,!(b+(g=Q>>>24)<=c);){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}l>>>=b,c-=b,s.back+=b}if(l>>>=g,c-=g,s.back+=g,s.length=w,0===m){s.mode=26;break}if(32&m){s.back=-1,s.mode=W;break}if(64&m){t.msg="invalid literal/length code",s.mode=q;break}s.extra=15&m,s.mode=22;case 22:if(s.extra){for(S=s.extra;c<S;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}s.length+=l&(1<<s.extra)-1,l>>>=s.extra,c-=s.extra,s.back+=s.extra}s.was=s.length,s.mode=23;case 23:for(;m=(Q=s.distcode[l&(1<<s.distbits)-1])>>>16&255,w=65535&Q,!((g=Q>>>24)<=c);){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(0===(240&m)){for(b=g,v=m,k=w;m=(Q=s.distcode[k+((l&(1<<b+v)-1)>>b)])>>>16&255,w=65535&Q,!(b+(g=Q>>>24)<=c);){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}l>>>=b,c-=b,s.back+=b}if(l>>>=g,c-=g,s.back+=g,64&m){t.msg="invalid distance code",s.mode=q;break}s.offset=w,s.extra=15&m,s.mode=24;case 24:if(s.extra){for(S=s.extra;c<S;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}s.offset+=l&(1<<s.extra)-1,l>>>=s.extra,c-=s.extra,s.back+=s.extra}if(s.offset>s.dmax){t.msg="invalid distance too far back",s.mode=q;break}s.mode=25;case 25:if(0===o)break t;if(_=u-o,s.offset>_){if((_=s.offset-_)>s.whave&&s.sane){t.msg="invalid distance too far back",s.mode=q;break}_>s.wnext?(_-=s.wnext,f=s.wsize-_):f=s.wnext-_,_>s.length&&(_=s.length),p=s.window}else p=n,f=a-s.offset,_=s.length;_>o&&(_=o),o-=_,s.length-=_;do{n[a++]=p[f++]}while(--_);0===s.length&&(s.mode=21);break;case 26:if(0===o)break t;n[a++]=s.length,o--,s.mode=21;break;case 27:if(s.wrap){for(;c<32;){if(0===h)break t;h--,l|=i[r++]<<c,c+=8}if(u-=o,t.total_out+=u,s.total+=u,u&&(t.adler=s.check=s.flags?N(s.check):R(s.check,n,u,a-u)),u=o,(s.flags?l:j(l))!==s.check){t.msg="incorrect data check",s.mode=q;break}l=0,c=0}s.mode=28;case 28:if(s.wrap&&s.flags){for(;c<32;){if(0===h)break t;h--,l+=i[r++]<<c,c+=8}if(l!==(4294967295&s.total)){t.msg="incorrect length check",s.mode=q;break}l=0,c=0}s.mode=29;case 29:C=1;break t;case q:C=-3;break t;case 31:return-4;case 32:default:return G}return t.next_out=a,t.avail_out=o,t.next_in=r,t.avail_in=h,s.hold=l,s.bits=c,(s.wsize||u!==t.avail_out&&s.mode<q&&(s.mode<27||4!==e))&&nt(t,t.output,t.next_out,u-t.avail_out)?(s.mode=31,-4):(d-=t.avail_in,u-=t.avail_out,t.total_in+=d,t.total_out+=u,s.total+=u,s.wrap&&u&&(t.adler=s.check=s.flags?N(s.check,t.next_out):R(s.check,n,u,t.next_out-u)),t.data_type=s.bits+(s.last?64:0)+(s.mode===W?128:0)+(20===s.mode||15===s.mode?256:0),(0===d&&0===u||4===e)&&0===C&&(C=-5),C)}(this.strm,0)<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=t)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}reset(){J(this.strm)}}function ht(t){for(var e=t.length;--e>=0;)t[e]=0}var ot=256,lt=286,ct=30,dt=15,ut=[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],_t=[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],ft=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gt=new Array(576);ht(gt);var mt=new Array(60);ht(mt);var wt=new Array(512);ht(wt);var bt=new Array(256);ht(bt);var vt=new Array(29);ht(vt);var kt,yt,Ct,xt=new Array(ct);function St(t,e,s,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=s,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function Qt(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function At(t){return t<256?wt[t]:wt[256+(t>>>7)]}function Et(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Mt(t,e,s){t.bi_valid>16-s?(t.bi_buf|=e<<t.bi_valid&65535,Et(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=s-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=s)}function Tt(t,e,s){Mt(t,s[2*e],s[2*e+1])}function Ft(t,e){var s=0;do{s|=1&t,t>>>=1,s<<=1}while(--e>0);return s>>>1}function Lt(t,e,s){var i,n,r=new Array(16),a=0;for(i=1;i<=dt;i++)r[i]=a=a+s[i-1]<<1;for(n=0;n<=e;n++){var h=t[2*n+1];0!==h&&(t[2*n]=Ft(r[h]++,h))}}function Dt(t){var e;for(e=0;e<lt;e++)t.dyn_ltree[2*e]=0;for(e=0;e<ct;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Bt(t){t.bi_valid>8?Et(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function zt(t,e,s,i){var n=2*e,r=2*s;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[s]}function Ut(t,e,s){for(var i=t.heap[s],n=s<<1;n<=t.heap_len&&(n<t.heap_len&&zt(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!zt(e,i,t.heap[n],t.depth));)t.heap[s]=t.heap[n],s=n,n<<=1;t.heap[s]=i}function It(t,e,s){var i,n,r,a,h=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*h]<<8|t.pending_buf[t.d_buf+2*h+1],n=t.pending_buf[t.l_buf+h],h++,0===i?Tt(t,n,e):(Tt(t,(r=bt[n])+ot+1,e),0!==(a=ut[r])&&Mt(t,n-=vt[r],a),Tt(t,r=At(--i),s),0!==(a=_t[r])&&Mt(t,i-=xt[r],a))}while(h<t.last_lit);Tt(t,256,e)}function Rt(t,e){var s,i,n,r=e.dyn_tree,a=e.stat_desc.static_tree,h=e.stat_desc.has_stree,o=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(t.heap[++t.heap_len]=l=s,t.depth[s]=0):r[2*s+1]=0;for(;t.heap_len<2;)r[2*(n=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[n]=0,t.opt_len--,h&&(t.static_len-=a[2*n+1]);for(e.max_code=l,s=t.heap_len>>1;s>=1;s--)Ut(t,r,s);n=o;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Ut(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=i,r[2*n]=r[2*s]+r[2*i],t.depth[n]=(t.depth[s]>=t.depth[i]?t.depth[s]:t.depth[i])+1,r[2*s+1]=r[2*i+1]=n,t.heap[1]=n++,Ut(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var s,i,n,r,a,h,o=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,_=e.stat_desc.extra_base,f=e.stat_desc.max_length,p=0;for(r=0;r<=dt;r++)t.bl_count[r]=0;for(o[2*t.heap[t.heap_max]+1]=0,s=t.heap_max+1;s<573;s++)(r=o[2*o[2*(i=t.heap[s])+1]+1]+1)>f&&(r=f,p++),o[2*i+1]=r,i>l||(t.bl_count[r]++,a=0,i>=_&&(a=u[i-_]),h=o[2*i],t.opt_len+=h*(r+a),d&&(t.static_len+=h*(c[2*i+1]+a)));if(0!==p){do{for(r=f-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[f]--,p-=2}while(p>0);for(r=f;0!==r;r--)for(i=t.bl_count[r];0!==i;)(n=t.heap[--s])>l||(o[2*n+1]!==r&&(t.opt_len+=(r-o[2*n+1])*o[2*n],o[2*n+1]=r),i--)}}(t,e),Lt(r,l,t.bl_count)}function Nt(t,e,s){var i,n,r=-1,a=e[1],h=0,o=7,l=4;for(0===a&&(o=138,l=3),e[2*(s+1)+1]=65535,i=0;i<=s;i++)n=a,a=e[2*(i+1)+1],++h<o&&n===a||(h<l?t.bl_tree[2*n]+=h:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,r=n,0===a?(o=138,l=3):n===a?(o=6,l=3):(o=7,l=4))}function Pt(t,e,s){var i,n,r=-1,a=e[1],h=0,o=7,l=4;for(0===a&&(o=138,l=3),i=0;i<=s;i++)if(n=a,a=e[2*(i+1)+1],!(++h<o&&n===a)){if(h<l)do{Tt(t,n,t.bl_tree)}while(0!==--h);else 0!==n?(n!==r&&(Tt(t,n,t.bl_tree),h--),Tt(t,16,t.bl_tree),Mt(t,h-3,2)):h<=10?(Tt(t,17,t.bl_tree),Mt(t,h-3,3)):(Tt(t,18,t.bl_tree),Mt(t,h-11,7));h=0,r=n,0===a?(o=138,l=3):n===a?(o=6,l=3):(o=7,l=4)}}ht(xt);var Vt=!1;function Ht(t){Vt||(!function(){var t,e,s,i,n,r=new Array(16);for(s=0,i=0;i<28;i++)for(vt[i]=s,t=0;t<1<<ut[i];t++)bt[s++]=i;for(bt[s-1]=i,n=0,i=0;i<16;i++)for(xt[i]=n,t=0;t<1<<_t[i];t++)wt[n++]=i;for(n>>=7;i<ct;i++)for(xt[i]=n<<7,t=0;t<1<<_t[i]-7;t++)wt[256+n++]=i;for(e=0;e<=dt;e++)r[e]=0;for(t=0;t<=143;)gt[2*t+1]=8,t++,r[8]++;for(;t<=255;)gt[2*t+1]=9,t++,r[9]++;for(;t<=279;)gt[2*t+1]=7,t++,r[7]++;for(;t<=287;)gt[2*t+1]=8,t++,r[8]++;for(Lt(gt,287,r),t=0;t<ct;t++)mt[2*t+1]=5,mt[2*t]=Ft(t,5);kt=new St(gt,ut,257,lt,dt),yt=new St(mt,_t,0,ct,dt),Ct=new St(new Array(0),ft,0,19,7)}(),Vt=!0),t.l_desc=new Qt(t.dyn_ltree,kt),t.d_desc=new Qt(t.dyn_dtree,yt),t.bl_desc=new Qt(t.bl_tree,Ct),t.bi_buf=0,t.bi_valid=0,Dt(t)}function Kt(t,e,s,i){Mt(t,0+(i?1:0),3),function(t,e,s,i){Bt(t),i&&(Et(t,s),Et(t,~s)),B(t.pending_buf,t.window,e,s,t.pending),t.pending+=s}(t,e,s,!0)}function Xt(t){Mt(t,2,3),Tt(t,256,gt),function(t){16===t.bi_valid?(Et(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)}(t)}function Ot(t,e,s,i){var n,r,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,s=4093624447;for(e=0;e<=31;e++,s>>>=1)if(1&s&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<ot;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),Rt(t,t.l_desc),Rt(t,t.d_desc),a=function(t){var e;for(Nt(t,t.dyn_ltree,t.l_desc.max_code),Nt(t,t.dyn_dtree,t.d_desc.max_code),Rt(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*pt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(r=t.static_len+3+7>>>3)<=n&&(n=r)):n=r=s+5,s+4<=n&&-1!==e?Kt(t,e,s,i):4===t.strategy||r===n?(Mt(t,2+(i?1:0),3),It(t,gt,mt)):(Mt(t,4+(i?1:0),3),function(t,e,s,i){var n;for(Mt(t,e-257,5),Mt(t,s-1,5),Mt(t,i-4,4),n=0;n<i;n++)Mt(t,t.bl_tree[2*pt[n]+1],3);Pt(t,t.dyn_ltree,e-1),Pt(t,t.dyn_dtree,s-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),It(t,t.dyn_ltree,t.dyn_dtree)),Dt(t),i&&Bt(t)}function Yt(t,e,s){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&s,t.last_lit++,0===e?t.dyn_ltree[2*s]++:(t.matches++,e--,t.dyn_ltree[2*(bt[s]+ot+1)]++,t.dyn_dtree[2*At(e)]++),t.last_lit===t.lit_bufsize-1}var Gt={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"};const Wt=-2;var qt,jt=258,Zt=262,Jt=103,$t=113,te=666;function ee(t,e){return t.msg=Gt[e],e}function se(t){return(t<<1)-(t>4?9:0)}function ie(t){for(var e=t.length;--e>=0;)t[e]=0}function ne(t){var e=t.state,s=e.pending;s>t.avail_out&&(s=t.avail_out),0!==s&&(B(t.output,e.pending_buf,e.pending_out,s,t.next_out),t.next_out+=s,e.pending_out+=s,t.total_out+=s,t.avail_out-=s,e.pending-=s,0===e.pending&&(e.pending_out=0))}function re(t,e){Ot(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ne(t.strm)}function ae(t,e){t.pending_buf[t.pending++]=e}function he(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function oe(t,e,s,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,B(e,t.input,t.next_in,n,s),1===t.state.wrap?t.adler=R(t.adler,e,n,s):2===t.state.wrap&&(t.adler=N(t.adler)),t.next_in+=n,t.total_in+=n,n)}function le(t,e){var s,i,n=t.max_chain_length,r=t.strstart,a=t.prev_length,h=t.nice_match,o=t.strstart>t.w_size-Zt?t.strstart-(t.w_size-Zt):0,l=t.window,c=t.w_mask,d=t.prev,u=t.strstart+jt,_=l[r+a-1],f=l[r+a];t.prev_length>=t.good_match&&(n>>=2),h>t.lookahead&&(h=t.lookahead);do{if(l[(s=e)+a]===f&&l[s+a-1]===_&&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<u);if(i=jt-(u-r),r=u-jt,i>a){if(t.match_start=e,a=i,i>=h)break;_=l[r+a-1],f=l[r+a]}}}while((e=d[e&c])>o&&0!==--n);return a<=t.lookahead?a:t.lookahead}function ce(t){var e,s,i,n,r,a=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-Zt)){B(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,e=s=t.hash_size;do{i=t.head[--e],t.head[e]=i>=a?i-a:0}while(--s);e=s=a;do{i=t.prev[--e],t.prev[e]=i>=a?i-a:0}while(--s);n+=a}if(0===t.strm.avail_in)break;if(s=oe(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=s,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+3-1])&t.hash_mask,t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Zt&&0!==t.strm.avail_in)}function de(t,e){for(var s,i;;){if(t.lookahead<Zt){if(ce(t),t.lookahead<Zt&&0===e)return 1;if(0===t.lookahead)break}if(s=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,s=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==s&&t.strstart-s<=t.w_size-Zt&&(t.match_length=le(t,s)),t.match_length>=3)if(i=Yt(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,s=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=Yt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(re(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(re(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(re(t,!1),0===t.strm.avail_out)?1:2}function ue(t,e){for(var s,i,n;;){if(t.lookahead<Zt){if(ce(t),t.lookahead<Zt&&0===e)return 1;if(0===t.lookahead)break}if(s=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,s=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==s&&t.prev_length<t.max_lazy_match&&t.strstart-s<=t.w_size-Zt&&(t.match_length=le(t,s),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=Yt(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,s=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(re(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=Yt(t,0,t.window[t.strstart-1]))&&re(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Yt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(re(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(re(t,!1),0===t.strm.avail_out)?1:2}function _e(t,e,s,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=s,this.max_chain=i,this.func=n}function fe(){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=8,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 U(1146),this.dyn_dtree=new U(122),this.bl_tree=new U(78),ie(this.dyn_ltree),ie(this.dyn_dtree),ie(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new U(16),this.heap=new U(573),ie(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new U(573),ie(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}function pe(t){var e,s=function(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:$t,t.adler=2===e.wrap?0:1,e.last_flush=0,Ht(e),0):ee(t,Wt)}(t);return 0===s&&((e=t.state).window_size=2*e.w_size,ie(e.head),e.max_lazy_match=qt[e.level].max_lazy,e.good_match=qt[e.level].good_length,e.nice_match=qt[e.level].nice_length,e.max_chain_length=qt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),s}function ge(t,e){return function(t,e,s,i,n,r){if(!t)return Wt;var a=1;if(-1===e&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>9||8!==s||i<8||i>15||e<0||e>9||r<0||r>4)return ee(t,Wt);8===i&&(i=9);var h=new fe;return t.state=h,h.strm=t,h.wrap=a,h.gzhead=null,h.w_bits=i,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=n+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new z(2*h.w_size),h.head=new U(h.hash_size),h.prev=new U(h.w_size),h.lit_bufsize=1<<n+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new z(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=r,h.method=s,pe(t)}(t,e,8,15,8,0)}function me(t,e){var s,i,n,r;if(!t||!t.state||e>5||e<0)return t?ee(t,Wt):Wt;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===te&&4!==e)return ee(t,0===t.avail_out?-5:Wt);if(i.strm=t,s=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,ae(i,31),ae(i,139),ae(i,8),i.gzhead?(ae(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ae(i,255&i.gzhead.time),ae(i,i.gzhead.time>>8&255),ae(i,i.gzhead.time>>16&255),ae(i,i.gzhead.time>>24&255),ae(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ae(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(ae(i,255&i.gzhead.extra.length),ae(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=N(t.adler,i.pending_buf,i.pending)),i.gzindex=0,i.status=69):(ae(i,0),ae(i,0),ae(i,0),ae(i,0),ae(i,0),ae(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ae(i,3),i.status=$t);else{var a=8+(i.w_bits-8<<4)<<8;a|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=$t,he(i,a),0!==i.strstart&&(he(i,t.adler>>>16),he(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(t.adler=N(t.adler,i.pending_buf,i.pending)),ne(t),n=i.pending,i.pending!==i.pending_buf_size));)ae(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=N(t.adler,i.pending_buf,i.pending)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=N(t.adler,i.pending_buf,i.pending)),ne(t),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}r=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,ae(i,r)}while(0!==r);i.gzhead.hcrc&&i.pending>n&&(t.adler=N(t.adler,i.pending_buf,i.pending)),0===r&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=N(t.adler,i.pending_buf,i.pending)),ne(t),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}r=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,ae(i,r)}while(0!==r);i.gzhead.hcrc&&i.pending>n&&(t.adler=N(t.adler,i.pending_buf,i.pending)),0===r&&(i.status=Jt)}else i.status=Jt;if(i.status===Jt&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ne(t),i.pending+2<=i.pending_buf_size&&(ae(i,255&t.adler),ae(i,t.adler>>8&255),t.adler=0,i.status=$t)):i.status=$t),0!==i.pending){if(ne(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&se(e)<=se(s)&&4!==e)return ee(t,-5);if(i.status===te&&0!==t.avail_in)return ee(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&i.status!==te){var h=2===i.strategy?function(t,e){for(var s;;){if(0===t.lookahead&&(ce(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,s=Yt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,s&&(re(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(re(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(re(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var s,i,n,r,a=t.window;;){if(t.lookahead<=jt){if(ce(t),t.lookahead<=jt&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=a[n=t.strstart-1])===a[++n]&&i===a[++n]&&i===a[++n]){r=t.strstart+jt;do{}while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<r);t.match_length=jt-(r-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(s=Yt(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(s=Yt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),s&&(re(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(re(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(re(t,!1),0===t.strm.avail_out)?1:2}(i,e):qt[i.level].func(i,e);if(3!==h&&4!==h||(i.status=te),1===h||3===h)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===h&&(1===e?Xt(i):5!==e&&(Kt(i,0,0,!1),3===e&&(ie(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ne(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(ae(i,255&t.adler),ae(i,t.adler>>8&255),ae(i,t.adler>>16&255),ae(i,t.adler>>24&255),ae(i,255&t.total_in),ae(i,t.total_in>>8&255),ae(i,t.total_in>>16&255),ae(i,t.total_in>>24&255)):(he(i,t.adler>>>16),he(i,65535&t.adler)),ne(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)}qt=[new _e(0,0,0,0,(function(t,e){var s=65535;for(s>t.pending_buf_size-5&&(s=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ce(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+s;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,re(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-Zt&&(re(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(re(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(re(t,!1),t.strm.avail_out),1)})),new _e(4,4,8,4,de),new _e(4,5,16,8,de),new _e(4,6,32,32,de),new _e(4,4,16,16,ue),new _e(8,16,32,32,ue),new _e(8,16,128,128,ue),new _e(8,32,128,256,ue),new _e(32,128,258,1024,ue),new _e(32,258,258,4096,ue)];class we{constructor(){this.strm=new rt,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,ge(this.strm,this.windowBits)}deflate(t){this.strm.input=t,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0,this.strm.output=this.outputBuffer,this.strm.avail_out=this.chunkSize,this.strm.next_out=0;let e=me(this.strm,3),s=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(e<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){let t=[s],i=s.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,e=me(this.strm,3),e<0)throw new Error("zlib deflate failed");let s=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);i+=s.length,t.push(s)}while(this.strm.avail_in>0);let n=new Uint8Array(i),r=0;for(let e=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;s=n}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,s}}var be=65288,ve=65289,ke=65291,ye=65293,Ce=65299,xe=65300,Se=65307,Qe=65535,Ae=65312,Ee=65335,Me=65340,Te=65341,Fe=65342,Le=65313,De=65314,Be=65315,ze=65316,Ue=65317,Ie=65318,Re=65319,Ne=65320,Pe=65321,Ve=65322,He=65326,Ke=65327,Xe=65328,Oe=65360,Ye=65361,Ge=65362,We=65363,qe=65364,je=65365,Ze=65366,Je=65367,$e=65376,ts=65377,es=65378,ss=65379,is=65381,ns=65382,rs=65383,as=65384,hs=65385,os=65386,ls=65406,cs=65407,ds=65408,us=65421,_s=65429,fs=65430,ps=65431,gs=65432,ms=65433,ws=65434,bs=65435,vs=65436,ks=65437,ys=65438,Cs=65439,xs=65469,Ss=65450,Qs=65451,As=65452,Es=65453,Ms=65454,Ts=65455,Fs=65456,Ls=65457,Ds=65458,Bs=65459,zs=65460,Us=65461,Is=65462,Rs=65463,Ns=65464,Ps=65465,Vs=65470,Hs=65471,Ks=65472,Xs=65473,Os=65474,Ys=65475,Gs=65476,Ws=65477,qs=65478,js=65479,Zs=65480,Js=65481,$s=65482,ti=65483,ei=65484,si=65485,ii=65486,ni=65487,ri=65488,ai=65489,hi=65490,oi=65491,li=65492,ci=65493,di=65494,ui=65495,_i=65496,fi=65497,pi=65498,gi=65499,mi=65500,wi=65501,bi=65502,vi=65503,ki=65504,yi=65505,Ci=65506,xi=65507,Si=65508,Qi=65509,Ai=65511,Ei=65512,Mi=65513,Ti=65514,Fi=65515,Li=65516,Di=65027,Bi=65032,zi=65034,Ui=65036,Ii=65038,Ri=32,Ni=42,Pi=43,Vi=44,Hi=45,Ki=46,Xi=47,Oi=48,Yi=49,Gi=50,Wi=51,qi=52,ji=53,Zi=54,Ji=55,$i=56,tn=57,en=61,sn=65329,nn=65332,rn=65336,an=269025026,hn=269025027,on=269025040,ln=269025041,cn=269025042,dn=269025043,un=269025044,_n=269025045,fn=269025046,pn=269025047,gn=269025048,mn=269025049,wn=269025051,bn=269025052,vn=269025053,kn=269025056,yn=269025057,Cn=269025062,xn=269025063,Sn=269025064,Qn=269025065,An=269025066,En=269025067,Mn=269025068,Tn=269025069,Fn=269025070,Ln=269025072,Dn=269025073,Bn=269025074,zn=269025075,Un=269025083,In=269025086,Rn=269025110,Nn=269025111,Pn=269025112,Vn=269025116,Hn=269025121,Kn=269025128,Xn=269025131,On=269025133,Yn=269025134,Gn=269025138,Wn=269025143,qn=269025147,jn=269025148,Zn=269025149,Jn=269025161,$n=269025163,tr=269025164,er=269025167,sr=269025168,ir=269025170,nr=269025175,rr=269025177,ar=269025178,hr=269025179,or=269025192,lr=269025202,cr=269024802;const dr={256:960,257:992,258:451,259:483,260:417,261:433,262:454,263:486,264:710,265:742,266:709,267:741,268:456,269:488,270:463,271:495,272:464,273:496,274:938,275:954,278:972,279:1004,280:458,281:490,282:460,283:492,284:728,285:760,286:683,287:699,288:725,289:757,290:939,291:955,292:678,293:694,294:673,295:689,296:933,297:949,298:975,299:1007,302:967,303:999,304:681,305:697,308:684,309:700,310:979,311:1011,312:930,313:453,314:485,315:934,316:950,317:421,318:437,321:419,322:435,323:465,324:497,325:977,326:1009,327:466,328:498,330:957,331:959,332:978,333:1010,336:469,337:501,338:5052,339:5053,340:448,341:480,342:931,343:947,344:472,345:504,346:422,347:438,348:734,349:766,350:426,351:442,352:425,353:441,354:478,355:510,356:427,357:443,358:940,359:956,360:989,361:1021,362:990,363:1022,364:733,365:765,366:473,367:505,368:475,369:507,370:985,371:1017,376:5054,377:428,378:444,379:431,380:447,381:430,382:446,402:2294,466:16777681,711:439,728:418,729:511,731:434,733:445,901:1966,902:1953,904:1954,905:1955,906:1956,908:1959,910:1960,911:1963,912:1974,913:1985,914:1986,915:1987,916:1988,917:1989,918:1990,919:1991,920:1992,921:1993,922:1994,923:1995,924:1996,925:1997,926:1998,927:1999,928:2e3,929:2001,931:2002,932:2004,933:2005,934:2006,935:2007,936:2008,937:2009,938:1957,939:1961,940:1969,941:1970,942:1971,943:1972,944:1978,945:2017,946:2018,947:2019,948:2020,949:2021,950:2022,951:2023,952:2024,953:2025,954:2026,955:2027,956:2028,957:2029,958:2030,959:2031,960:2032,961:2033,962:2035,963:2034,964:2036,965:2037,966:2038,967:2039,968:2040,969:2041,970:1973,971:1977,972:1975,973:1976,974:1979,1025:1715,1026:1713,1027:1714,1028:1716,1029:1717,1030:1718,1031:1719,1032:1720,1033:1721,1034:1722,1035:1723,1036:1724,1038:1726,1039:1727,1040:1761,1041:1762,1042:1783,1043:1767,1044:1764,1045:1765,1046:1782,1047:1786,1048:1769,1049:1770,1050:1771,1051:1772,1052:1773,1053:1774,1054:1775,1055:1776,1056:1778,1057:1779,1058:1780,1059:1781,1060:1766,1061:1768,1062:1763,1063:1790,1064:1787,1065:1789,1066:1791,1067:1785,1068:1784,1069:1788,1070:1760,1071:1777,1072:1729,1073:1730,1074:1751,1075:1735,1076:1732,1077:1733,1078:1750,1079:1754,1080:1737,1081:1738,1082:1739,1083:1740,1084:1741,1085:1742,1086:1743,1087:1744,1088:1746,1089:1747,1090:1748,1091:1749,1092:1734,1093:1736,1094:1731,1095:1758,1096:1755,1097:1757,1098:1759,1099:1753,1100:1752,1101:1756,1102:1728,1103:1745,1105:1699,1106:1697,1107:1698,1108:1700,1109:1701,1110:1702,1111:1703,1112:1704,1113:1705,1114:1706,1115:1707,1116:1708,1118:1710,1119:1711,1168:1725,1169:1709,1488:3296,1489:3297,1490:3298,1491:3299,1492:3300,1493:3301,1494:3302,1495:3303,1496:3304,1497:3305,1498:3306,1499:3307,1500:3308,1501:3309,1502:3310,1503:3311,1504:3312,1505:3313,1506:3314,1507:3315,1508:3316,1509:3317,1510:3318,1511:3319,1512:3320,1513:3321,1514:3322,1548:1452,1563:1467,1567:1471,1569:1473,1570:1474,1571:1475,1572:1476,1573:1477,1574:1478,1575:1479,1576:1480,1577:1481,1578:1482,1579:1483,1580:1484,1581:1485,1582:1486,1583:1487,1584:1488,1585:1489,1586:1490,1587:1491,1588:1492,1589:1493,1590:1494,1591:1495,1592:1496,1593:1497,1594:1498,1600:1504,1601:1505,1602:1506,1603:1507,1604:1508,1605:1509,1606:1510,1607:1511,1608:1512,1609:1513,1610:1514,1611:1515,1612:1516,1613:1517,1614:1518,1615:1519,1616:1520,1617:1521,1618:1522,3585:3489,3586:3490,3587:3491,3588:3492,3589:3493,3590:3494,3591:3495,3592:3496,3593:3497,3594:3498,3595:3499,3596:3500,3597:3501,3598:3502,3599:3503,3600:3504,3601:3505,3602:3506,3603:3507,3604:3508,3605:3509,3606:3510,3607:3511,3608:3512,3609:3513,3610:3514,3611:3515,3612:3516,3613:3517,3614:3518,3615:3519,3616:3520,3617:3521,3618:3522,3619:3523,3620:3524,3621:3525,3622:3526,3623:3527,3624:3528,3625:3529,3626:3530,3627:3531,3628:3532,3629:3533,3630:3534,3631:3535,3632:3536,3633:3537,3634:3538,3635:3539,3636:3540,3637:3541,3638:3542,3639:3543,3640:3544,3641:3545,3642:3546,3647:3551,3648:3552,3649:3553,3650:3554,3651:3555,3652:3556,3653:3557,3654:3558,3655:3559,3656:3560,3657:3561,3658:3562,3659:3563,3660:3564,3661:3565,3664:3568,3665:3569,3666:3570,3667:3571,3668:3572,3669:3573,3670:3574,3671:3575,3672:3576,3673:3577,8194:2722,8195:2721,8196:2723,8197:2724,8199:2725,8200:2726,8201:2727,8202:2728,8210:2747,8211:2730,8212:2729,8213:1967,8215:3295,8216:2768,8217:2769,8218:2813,8220:2770,8221:2771,8222:2814,8224:2801,8225:2802,8226:2790,8229:2735,8230:2734,8240:2773,8242:2774,8243:2775,8248:2812,8254:1150,8361:3839,8364:8364,8453:2744,8470:1712,8471:2811,8478:2772,8482:2761,8531:2736,8532:2737,8533:2738,8534:2739,8535:2740,8536:2741,8537:2742,8538:2743,8539:2755,8540:2756,8541:2757,8542:2758,8592:2299,8593:2300,8594:2301,8595:2302,8658:2254,8660:2253,8706:2287,8711:2245,8728:3018,8730:2262,8733:2241,8734:2242,8743:2270,8744:2271,8745:2268,8746:2269,8747:2239,8756:2240,8764:2248,8771:2249,8773:16785992,8800:2237,8801:2255,8804:2236,8805:2238,8834:2266,8835:2267,8866:3068,8867:3036,8868:3010,8869:3022,8968:3027,8970:3012,8981:2810,8992:2212,8993:2213,9109:3020,9115:2219,9117:2220,9118:2221,9120:2222,9121:2215,9123:2216,9124:2217,9126:2218,9128:2223,9132:2224,9143:2209,9146:2543,9147:2544,9148:2546,9149:2547,9225:2530,9226:2533,9227:2537,9228:2531,9229:2532,9251:2732,9252:2536,9472:2211,9474:2214,9484:2210,9488:2539,9492:2541,9496:2538,9500:2548,9508:2549,9516:2551,9524:2550,9532:2542,9618:2529,9642:2791,9643:2785,9644:2779,9645:2786,9646:2783,9647:2767,9650:2792,9651:2787,9654:2781,9655:2765,9660:2793,9661:2788,9664:2780,9665:2764,9670:2528,9675:2766,9679:2782,9702:2784,9734:2789,9742:2809,9747:2762,9756:2794,9758:2795,9792:2808,9794:2807,9827:2796,9829:2798,9830:2797,9837:2806,9839:2805,10003:2803,10007:2804,10013:2777,10016:2800,10216:2748,10217:2750,12289:1188,12290:1185,12300:1186,12301:1187,12443:1246,12444:1247,12449:1191,12450:1201,12451:1192,12452:1202,12453:1193,12454:1203,12455:1194,12456:1204,12457:1195,12458:1205,12459:1206,12461:1207,12463:1208,12465:1209,12467:1210,12469:1211,12471:1212,12473:1213,12475:1214,12477:1215,12479:1216,12481:1217,12483:1199,12484:1218,12486:1219,12488:1220,12490:1221,12491:1222,12492:1223,12493:1224,12494:1225,12495:1226,12498:1227,12501:1228,12504:1229,12507:1230,12510:1231,12511:1232,12512:1233,12513:1234,12514:1235,12515:1196,12516:1236,12517:1197,12518:1237,12519:1198,12520:1238,12521:1239,12522:1240,12523:1241,12524:1242,12525:1243,12527:1244,12530:1190,12531:1245,12539:1189,12540:1200};var ur={lookup(t){if(t>=32&&t<=255)return t;const e=dr[t];return void 0!==e?e:16777216|t}},_r={8:"Backspace",9:"Tab",10:"NumpadClear",12:"Numpad5",13:"Enter",16:"ShiftLeft",17:"ControlLeft",18:"AltLeft",19:"Pause",20:"CapsLock",21:"Lang1",25:"Lang2",27:"Escape",28:"Convert",29:"NonConvert",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",44:"PrintScreen",45:"Insert",46:"Delete",47:"Help",48:"Digit0",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",91:"MetaLeft",92:"MetaRight",93:"ContextMenu",95:"Sleep",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",108:"NumpadDecimal",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",124:"F13",125:"F14",126:"F15",127:"F16",128:"F17",129:"F18",130:"F19",131:"F20",132:"F21",133:"F22",134:"F23",135:"F24",144:"NumLock",145:"ScrollLock",166:"BrowserBack",167:"BrowserForward",168:"BrowserRefresh",169:"BrowserStop",170:"BrowserSearch",171:"BrowserFavorites",172:"BrowserHome",173:"AudioVolumeMute",174:"AudioVolumeDown",175:"AudioVolumeUp",176:"MediaTrackNext",177:"MediaTrackPrevious",178:"MediaStop",179:"MediaPlayPause",180:"LaunchMail",181:"MediaSelect",182:"LaunchApp1",183:"LaunchApp2",225:"AltRight"},fr={Backspace:"Backspace",AltLeft:"Alt",AltRight:"Alt",CapsLock:"CapsLock",ContextMenu:"ContextMenu",ControlLeft:"Control",ControlRight:"Control",Enter:"Enter",MetaLeft:"Meta",MetaRight:"Meta",ShiftLeft:"Shift",ShiftRight:"Shift",Tab:"Tab",Delete:"Delete",End:"End",Help:"Help",Home:"Home",Insert:"Insert",PageDown:"PageDown",PageUp:"PageUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",NumLock:"NumLock",NumpadBackspace:"Backspace",NumpadClear:"Clear",Escape:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",F13:"F13",F14:"F14",F15:"F15",F16:"F16",F17:"F17",F18:"F18",F19:"F19",F20:"F20",F21:"F21",F22:"F22",F23:"F23",F24:"F24",F25:"F25",F26:"F26",F27:"F27",F28:"F28",F29:"F29",F30:"F30",F31:"F31",F32:"F32",F33:"F33",F34:"F34",F35:"F35",PrintScreen:"PrintScreen",ScrollLock:"ScrollLock",Pause:"Pause",BrowserBack:"BrowserBack",BrowserFavorites:"BrowserFavorites",BrowserForward:"BrowserForward",BrowserHome:"BrowserHome",BrowserRefresh:"BrowserRefresh",BrowserSearch:"BrowserSearch",BrowserStop:"BrowserStop",Eject:"Eject",LaunchApp1:"LaunchMyComputer",LaunchApp2:"LaunchCalendar",LaunchMail:"LaunchMail",MediaPlayPause:"MediaPlay",MediaStop:"MediaStop",MediaTrackNext:"MediaTrackNext",MediaTrackPrevious:"MediaTrackPrevious",Power:"Power",Sleep:"Sleep",AudioVolumeDown:"AudioVolumeDown",AudioVolumeMute:"AudioVolumeMute",AudioVolumeUp:"AudioVolumeUp",WakeUp:"WakeUp"};const pr={};function gr(t,e){if(void 0===e)throw new Error('Undefined keysym for key "'+t+'"');if(t in pr)throw new Error('Duplicate entry for key "'+t+'"');pr[t]=[e,e,e,e]}function mr(t,e,s){if(void 0===e)throw new Error('Undefined keysym for key "'+t+'"');if(void 0===s)throw new Error('Undefined keysym for key "'+t+'"');if(t in pr)throw new Error('Duplicate entry for key "'+t+'"');pr[t]=[e,e,s,e]}function wr(t,e,s){if(void 0===e)throw new Error('Undefined keysym for key "'+t+'"');if(void 0===s)throw new Error('Undefined keysym for key "'+t+'"');if(t in pr)throw new Error('Duplicate entry for key "'+t+'"');pr[t]=[e,e,e,s]}mr("Alt",Mi,Ti),gr("AltGraph",Di),gr("CapsLock",Qi),mr("Control",xi,Si),mr("Meta",Fi,Li),gr("NumLock",cs),gr("ScrollLock",xe),mr("Shift",yi,Ci),wr("Enter",ye,us),gr("Tab",ve),wr(" ",Ri,ds),wr("ArrowDown",qe,ms),wr("ArrowUp",Ge,ps),wr("ArrowLeft",Ye,fs),wr("ArrowRight",We,gs),wr("End",Je,vs),wr("Home",Oe,_s),wr("PageDown",Ze,bs),wr("PageUp",je,ws),gr("Backspace",be),wr("Clear",ke,ks),gr("Copy",Nn),gr("Cut",Pn),wr("Delete",Qe,Cs),wr("Insert",ss,ys),gr("Paste",On),gr("Redo",ns),gr("Undo",is),gr("Cancel",hs),gr("ContextMenu",rs),gr("Escape",Se),gr("Execute",es),gr("Find",as),gr("Help",os),gr("Pause",Ce),gr("Select",$e),gr("ZoomIn",$n),gr("ZoomOut",tr),gr("BrightnessDown",hn),gr("BrightnessUp",an),gr("Eject",Mn),gr("LogOff",Hn),gr("Power",An),gr("PowerOff",yn),gr("PrintScreen",ts),gr("Hibernate",or),gr("Standby",on),gr("WakeUp",En),gr("AllCandidates",Te),gr("Alphanumeric",Ke),gr("CodeInput",Ee),gr("Compose",Ae),gr("Convert",Be),gr("GroupFirst",Ui),gr("GroupLast",Ii),gr("GroupNext",Bi),gr("GroupPrevious",zi),gr("NonConvert",De),gr("PreviousCandidate",Fe),gr("SingleCandidate",Me),gr("HangulMode",sn),gr("HanjaMode",nn),gr("JunjuaMode",rn),gr("Eisu",Xe),gr("Hankaku",Pe),gr("Hiragana",Ue),gr("HiraganaKatakana",Re),gr("KanaMode",He),gr("KanjiMode",Le),gr("Katakana",Ie),gr("Romaji",ze),gr("Zenkaku",Ne),gr("ZenkakuHanaku",Ve),gr("F1",Vs),gr("F2",Hs),gr("F3",Ks),gr("F4",Xs),gr("F5",Os),gr("F6",Ys),gr("F7",Gs),gr("F8",Ws),gr("F9",qs),gr("F10",js),gr("F11",Zs),gr("F12",Js),gr("F13",$s),gr("F14",ti),gr("F15",ei),gr("F16",si),gr("F17",ii),gr("F18",ni),gr("F19",ri),gr("F20",ai),gr("F21",hi),gr("F22",oi),gr("F23",li),gr("F24",ci),gr("F25",di),gr("F26",ui),gr("F27",_i),gr("F28",fi),gr("F29",pi),gr("F30",gi),gr("F31",mi),gr("F32",wi),gr("F33",bi),gr("F34",vi),gr("F35",ki),gr("Close",Rn),gr("MailForward",sr),gr("MailReply",Gn),gr("MailSend",qn),gr("MediaFastForward",nr),gr("MediaPause",Dn),gr("MediaPlay",un),gr("MediaRecord",bn),gr("MediaRewind",In),gr("MediaStop",_n),gr("MediaTrackNext",pn),gr("MediaTrackPrevious",fn),gr("New",Kn),gr("Open",Xn),gr("Print",ts),gr("Save",Wn),gr("SpellCheck",jn),gr("AudioVolumeDown",ln),gr("AudioVolumeUp",dn),gr("AudioVolumeMute",cn),gr("MicrophoneVolumeMute",lr),gr("LaunchApplication1",zn),gr("LaunchApplication2",vn),gr("LaunchCalendar",kn),gr("LaunchMail",mn),gr("LaunchMediaPlayer",Bn),gr("LaunchMusicPlayer",ir),gr("LaunchPhone",Yn),gr("LaunchScreenSaver",Tn),gr("LaunchSpreadsheet",Vn),gr("LaunchWebBrowser",Fn),gr("LaunchWebCam",er),gr("LaunchWordProcessor",Jn),gr("BrowserBack",Cn),gr("BrowserFavorites",Ln),gr("BrowserForward",xn),gr("BrowserHome",gn),gr("BrowserRefresh",Qn),gr("BrowserSearch",wn),gr("BrowserStop",Sn),gr("Dimmer",Un),gr("MediaAudioTrack",hr),gr("RandomToggle",rr),gr("SplitScreenToggle",Zn),gr("Subtitle",ar),gr("VideoModeNext",cr),wr("=",en,xs),wr("+",Pi,Qs),wr("-",Hi,Es),wr("*",Ni,Ss),wr("/",Xi,Ts),wr(".",Ki,Ms),wr(",",Vi,As),wr("0",Oi,Fs),wr("1",Yi,Ls),wr("2",Gi,Ds),wr("3",Wi,Bs),wr("4",qi,zs),wr("5",ji,Us),wr("6",Zi,Is),wr("7",Ji,Rs),wr("8",$i,Ns),wr("9",tn,Ps);var br=pr;function vr(t){if(t.code){switch(t.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return t.code}if("keypress"!==t.type&&t.keyCode in _r){let e=_r[t.keyCode];if(w()&&"ContextMenu"===e&&(e="MetaRight"),2===t.location)switch(e){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(3===t.location)switch(e){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return e}return"Unidentified"}function kr(t){const e=function(t){if(void 0!==t.key){switch(t.key){case"Spacebar":return" ";case"Esc":return"Escape";case"Scroll":return"ScrollLock";case"Win":return"Meta";case"Apps":return"ContextMenu";case"Up":return"ArrowUp";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";case"Down":return"ArrowDown";case"Del":return"Delete";case"Divide":return"/";case"Multiply":return"*";case"Subtract":return"-";case"Add":return"+";case"Decimal":return t.char}switch(t.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(t.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if("\0"===t.key&&"NumpadDecimal"===t.code)return"Delete";if(!k()&&!y())return t.key;if(1!==t.key.length&&"Unidentified"!==t.key)return t.key}const e=vr(t);return e in fr?fr[e]:t.charCode?String.fromCharCode(t.charCode):"Unidentified"}(t);if("Unidentified"===e)return null;if(e in br){let s=t.location;if("Meta"===e&&0===s&&(s=2),"Clear"===e&&3===s){"NumLock"===vr(t)&&(s=0)}if((void 0===s||s>3)&&(s=0),"Meta"===e){let e=vr(t);if("AltLeft"===e)return Ai;if("AltRight"===e)return Ei}if("Clear"===e){if("NumLock"===vr(t))return cs}return br[e][s]}if(1!==e.length)return null;const s=e.charCodeAt();return s?ur.lookup(s):null}class yr{constructor(t){this._target=t||null,this._keyDownList={},this._pendingKey=null,this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),keypress:this._handleKeyPress.bind(this),blur:this._allKeysUp.bind(this),checkalt:this._checkAlt.bind(this)},this.onkeyevent=()=>{}}_sendKeyEvent(t,e,s){if(s)this._keyDownList[e]=t;else{if(!(e in this._keyDownList))return;delete this._keyDownList[e]}r("onkeyevent "+(s?"down":"up")+", keysym: "+t,", code: "+e),this.onkeyevent(t,e,s)}_getKeyCode(t){const e=vr(t);if("Unidentified"!==e)return e;if(t.keyCode&&"keypress"!==t.type&&229!==t.keyCode)return"Platform"+t.keyCode;if(t.keyIdentifier){if("U+"!==t.keyIdentifier.substr(0,2))return t.keyIdentifier;const e=parseInt(t.keyIdentifier.substr(2),16);return"Platform"+String.fromCharCode(e).toUpperCase().charCodeAt()}return"Unidentified"}_handleKeyDown(t){const e=this._getKeyCode(t);let s=kr(t);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===e&&t.timeStamp-this._altGrCtrlTime<50?s=Di:this._sendKeyEvent(xi,"ControlLeft",!0)),"Unidentified"===e)return s&&(this._sendKeyEvent(s,e,!0),this._sendKeyEvent(s,e,!1)),void S(t);if(w()||v())switch(s){case Fi:s=Mi;break;case Li:s=Fi;break;case Mi:s=ls;break;case Ti:s=Di}return e in this._keyDownList&&(s=this._keyDownList[e]),(w()||v())&&"CapsLock"===e?(this._sendKeyEvent(Qi,"CapsLock",!0),this._sendKeyEvent(Qi,"CapsLock",!1),void S(t)):s||t.key&&!k()&&!y()?(this._pendingKey=null,S(t),"ControlLeft"===e&&b()&&!("ControlLeft"in this._keyDownList)?(this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),void(this._altGrCtrlTime=t.timeStamp)):void this._sendKeyEvent(s,e,!0)):(this._pendingKey=e,void setTimeout(this._handleKeyPressTimeout.bind(this),10,t))}_handleKeyPress(t){if(S(t),null===this._pendingKey)return;let e=this._getKeyCode(t);const s=kr(t);"Unidentified"!==e&&e!=this._pendingKey||(e=this._pendingKey,this._pendingKey=null,s?this._sendKeyEvent(s,e,!0):a("keypress with no keysym:",t))}_handleKeyPressTimeout(t){if(null===this._pendingKey)return;let e;const s=this._pendingKey;if(this._pendingKey=null,t.keyCode>=48&&t.keyCode<=57)e=t.keyCode;else if(t.keyCode>=65&&t.keyCode<=90){let s=String.fromCharCode(t.keyCode);s=t.shiftKey?s.toUpperCase():s.toLowerCase(),e=s.charCodeAt()}else e=0;this._sendKeyEvent(e,s,!0)}_handleKeyUp(t){S(t);const e=this._getKeyCode(t);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(xi,"ControlLeft",!0)),(w()||v())&&"CapsLock"===e)return this._sendKeyEvent(Qi,"CapsLock",!0),void this._sendKeyEvent(Qi,"CapsLock",!1);this._sendKeyEvent(this._keyDownList[e],e,!1),!b()||"ShiftLeft"!==e&&"ShiftRight"!==e||("ShiftRight"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftRight,"ShiftRight",!1),"ShiftLeft"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftLeft,"ShiftLeft",!1))}_handleAltGrTimeout(){this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(xi,"ControlLeft",!0)}_allKeysUp(){r(">> Keyboard.allKeysUp");for(let t in this._keyDownList)this._sendKeyEvent(this._keyDownList[t],t,!1);r("<< Keyboard.allKeysUp")}_checkAlt(t){if(t.skipCheckAlt)return;if(t.altKey)return;const e=this._target,s=this._keyDownList;["AltLeft","AltRight"].forEach((t=>{if(!(t in s))return;const i=new KeyboardEvent("keyup",{key:s[t],code:t});i.skipCheckAlt=!0,e.dispatchEvent(i)}))}grab(){if(this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),this._target.addEventListener("keypress",this._eventHandlers.keypress),window.addEventListener("blur",this._eventHandlers.blur),b()&&C()){const t=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((e=>document.addEventListener(e,t,{capture:!0,passive:!0})))}}ungrab(){if(b()&&C()){const t=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((e=>document.removeEventListener(e,t)))}this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),this._target.removeEventListener("keypress",this._eventHandlers.keypress),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}const Cr=32,xr=64;class Sr{constructor(){this._target=null,this._state=127,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}attach(t){this.detach(),this._target=t,this._target.addEventListener("touchstart",this._boundEventHandler),this._target.addEventListener("touchmove",this._boundEventHandler),this._target.addEventListener("touchend",this._boundEventHandler),this._target.addEventListener("touchcancel",this._boundEventHandler)}detach(){this._target&&(this._stopLongpressTimeout(),this._stopTwoTouchTimeout(),this._target.removeEventListener("touchstart",this._boundEventHandler),this._target.removeEventListener("touchmove",this._boundEventHandler),this._target.removeEventListener("touchend",this._boundEventHandler),this._target.removeEventListener("touchcancel",this._boundEventHandler),this._target=null)}_eventHandler(t){let e;switch(t.stopPropagation(),t.preventDefault(),t.type){case"touchstart":e=this._touchStart;break;case"touchmove":e=this._touchMove;break;case"touchend":case"touchcancel":e=this._touchEnd}for(let s=0;s<t.changedTouches.length;s++){let i=t.changedTouches[s];e.call(this,i.identifier,i.clientX,i.clientY)}}_touchStart(t,e,s){if(this._hasDetectedGesture()||0===this._state)this._ignored.push(t);else{if(this._tracked.length>0&&Date.now()-this._tracked[0].started>250)return this._state=0,void this._ignored.push(t);if(this._waitingRelease)return this._state=0,void this._ignored.push(t);switch(this._tracked.push({id:t,started:Date.now(),active:!0,firstX:e,firstY:s,lastX:e,lastY:s,angle:0}),this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=-26,this._stopLongpressTimeout();break;case 3:this._state&=-99;break;default:this._state=0}}}_touchMove(t,e,s){let i=this._tracked.find((e=>e.id===t));if(void 0===i)return;i.lastX=e,i.lastY=s;let n=e-i.firstX,r=s-i.firstY;if(i.firstX===i.lastX&&i.firstY===i.lastY||(i.angle=180*Math.atan2(r,n)/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(n,r)<50)return;if(this._state&=-24,this._stopLongpressTimeout(),1!==this._tracked.length&&(this._state&=-9),2!==this._tracked.length&&(this._state&=-97),2===this._tracked.length){let e=this._tracked.find((e=>e.id!==t));if(Math.hypot(e.firstX-e.lastX,e.firstY-e.lastY)>50){let t=Math.abs(i.angle-e.angle);t=Math.abs((t+180)%360-180),this._state&=t>90?-33:-65,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}_touchEnd(t,e,s){if(-1!==this._ignored.indexOf(t))return this._ignored.splice(this._ignored.indexOf(t),1),void(0===this._ignored.length&&0===this._tracked.length&&(this._state=127,this._waitingRelease=!1));if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=0),!this._hasDetectedGesture()&&(this._state&=-105,this._state&=-17,this._stopLongpressTimeout(),!this._waitingRelease))switch(this._releaseStart=Date.now(),this._waitingRelease=!0,this._tracked.length){case 1:this._state&=-7;break;case 2:this._state&=-6}if(this._waitingRelease){if(Date.now()-this._releaseStart>250&&(this._state=0),this._tracked.some((t=>Date.now()-t.started>1e3))&&(this._state=0),this._tracked.find((e=>e.id===t)).active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(0!==this._state)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(let i=0;i<this._tracked.length;i++)this._tracked[i].active&&this._ignored.push(this._tracked[i].id);this._tracked=[],this._state=0,-1!==this._ignored.indexOf(t)&&this._ignored.splice(this._ignored.indexOf(t),1),0===this._ignored.length&&(this._state=127,this._waitingRelease=!1)}_hasDetectedGesture(){return 0!==this._state&&(!(this._state&this._state-1)&&!(7&this._state&&this._tracked.some((t=>t.active))))}_startLongpressTimeout(){this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout((()=>this._longpressTimeout()),1e3)}_stopLongpressTimeout(){clearTimeout(this._longpressTimeoutId),this._longpressTimeoutId=null}_longpressTimeout(){if(this._hasDetectedGesture())throw new Error("A longpress gesture failed, conflict with a different gesture");this._state=16,this._pushEvent("gesturestart")}_startTwoTouchTimeout(){this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout((()=>this._twoTouchTimeout()),50)}_stopTwoTouchTimeout(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}_isTwoTouchTimeoutRunning(){return null!==this._twoTouchTimeoutId}_twoTouchTimeout(){if(0===this._tracked.length)throw new Error("A pinch or two drag gesture failed, no tracked touches");let t=this._getAverageMovement(),e=Math.abs(t.x),s=Math.abs(t.y),i=this._getAverageDistance(),n=Math.abs(Math.hypot(i.first.x,i.first.y)-Math.hypot(i.last.x,i.last.y));this._state=s<n&&e<n?xr:Cr,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}_pushEvent(t){let e={type:this._stateToGesture(this._state)},s=this._getPosition(),i=s.last;switch("gesturestart"===t&&(i=s.first),this._state){case Cr:case xr:i=s.first}if(e.clientX=i.x,e.clientY=i.y,this._state===xr){let s=this._getAverageDistance();"gesturestart"===t?(e.magnitudeX=s.first.x,e.magnitudeY=s.first.y):(e.magnitudeX=s.last.x,e.magnitudeY=s.last.y)}else if(this._state===Cr)if("gesturestart"===t)e.magnitudeX=0,e.magnitudeY=0;else{let t=this._getAverageMovement();e.magnitudeX=t.x,e.magnitudeY=t.y}let n=new CustomEvent(t,{detail:e});this._target.dispatchEvent(n)}_stateToGesture(t){switch(t){case 1:return"onetap";case 2:return"twotap";case 4:return"threetap";case 8:return"drag";case 16:return"longpress";case Cr:return"twodrag";case xr:return"pinch"}throw new Error("Unknown gesture state: "+t)}_getPosition(){if(0===this._tracked.length)throw new Error("Failed to get gesture position, no tracked touches");let t=this._tracked.length,e=0,s=0,i=0,n=0;for(let r=0;r<this._tracked.length;r++)e+=this._tracked[r].firstX,s+=this._tracked[r].firstY,i+=this._tracked[r].lastX,n+=this._tracked[r].lastY;return{first:{x:e/t,y:s/t},last:{x:i/t,y:n/t}}}_getAverageMovement(){if(0===this._tracked.length)throw new Error("Failed to get gesture movement, no tracked touches");let t,e;t=e=0;let s=this._tracked.length;for(let i=0;i<this._tracked.length;i++)t+=this._tracked[i].lastX-this._tracked[i].firstX,e+=this._tracked[i].lastY-this._tracked[i].firstY;return{x:t/s,y:e/s}}_getAverageDistance(){if(0===this._tracked.length)throw new Error("Failed to get gesture distance, no tracked touches");let t=this._tracked[0],e=this._tracked[this._tracked.length-1];return{first:{x:Math.abs(e.firstX-t.firstX),y:Math.abs(e.firstY-t.firstY)},last:{x:Math.abs(e.lastX-t.lastX),y:Math.abs(e.lastY-t.lastY)}}}}const Qr=!f||d;class Ar{constructor(){this._target=null,this._canvas=document.createElement("canvas"),Qr&&(this._canvas.style.position="fixed",this._canvas.style.zIndex="65535",this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden"),this._position={x:0,y:0},this._hotSpot={x:0,y:0},this._eventHandlers={mouseover:this._handleMouseOver.bind(this),mouseleave:this._handleMouseLeave.bind(this),mousemove:this._handleMouseMove.bind(this),mouseup:this._handleMouseUp.bind(this)}}attach(t){if(this._target&&this.detach(),this._target=t,Qr){document.body.appendChild(this._canvas);const t={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,t),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,t),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,t),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,t)}this.clear()}detach(){if(this._target){if(Qr){const t={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,t),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,t),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,t),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,t),document.body.removeChild(this._canvas)}this._target=null}}change(t,e,s,i,n){if(0===i||0===n)return void this.clear();this._position.x=this._position.x+this._hotSpot.x-e,this._position.y=this._position.y+this._hotSpot.y-s,this._hotSpot.x=e,this._hotSpot.y=s;let r,a=this._canvas.getContext("2d");this._canvas.width=i,this._canvas.height=n;try{r=new ImageData(new Uint8ClampedArray(t),i,n)}catch(Aa){r=a.createImageData(i,n),r.data.set(new Uint8ClampedArray(t))}if(a.clearRect(0,0,i,n),a.putImageData(r,0,0),Qr)this._updatePosition();else{let t=this._canvas.toDataURL();this._target.style.cursor="url("+t+")"+e+" "+s+", default"}}clear(){this._target.style.cursor="none",this._canvas.width=0,this._canvas.height=0,this._position.x=this._position.x+this._hotSpot.x,this._position.y=this._position.y+this._hotSpot.y,this._hotSpot.x=0,this._hotSpot.y=0}move(t,e){if(!Qr)return;window.visualViewport?(this._position.x=t+window.visualViewport.offsetLeft,this._position.y=e+window.visualViewport.offsetTop):(this._position.x=t,this._position.y=e),this._updatePosition();let s=document.elementFromPoint(t,e);this._updateVisibility(s)}_handleMouseOver(t){this._handleMouseMove(t)}_handleMouseLeave(t){this._updateVisibility(t.relatedTarget)}_handleMouseMove(t){this._updateVisibility(t.target),this._position.x=t.clientX-this._hotSpot.x,this._position.y=t.clientY-this._hotSpot.y,this._updatePosition()}_handleMouseUp(t){let e=document.elementFromPoint(t.clientX,t.clientY);this._updateVisibility(e),this._captureIsActive()&&window.setTimeout((()=>{this._target&&(e=document.elementFromPoint(t.clientX,t.clientY),this._updateVisibility(e))}),0)}_showCursor(){"hidden"===this._canvas.style.visibility&&(this._canvas.style.visibility="")}_hideCursor(){"hidden"!==this._canvas.style.visibility&&(this._canvas.style.visibility="hidden")}_shouldShowCursor(t){return!!t&&(t===this._target||!!this._target.contains(t)&&"none"===window.getComputedStyle(t).cursor)}_updateVisibility(t){this._captureIsActive()&&(t=document.captureElement),this._shouldShowCursor(t)?this._showCursor():this._hideCursor()}_updatePosition(){this._canvas.style.left=this._position.x+"px",this._canvas.style.top=this._position.y+"px"}_captureIsActive(){return document.captureElement&&document.documentElement.contains(document.captureElement)}}const Er=41943040;class Mr{constructor(){this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=4194304,this._rQ=null,this._sQbufferSize=10240,this._sQlen=0,this._sQ=null,this._eventHandlers={message:()=>{},open:()=>{},close:()=>{},error:()=>{}}}get sQ(){return this._sQ}get rQ(){return this._rQ}get rQi(){return this._rQi}set rQi(t){this._rQi=t}get rQlen(){return this._rQlen-this._rQi}rQpeek8(){return this._rQ[this._rQi]}rQskipBytes(t){this._rQi+=t}rQshift8(){return this._rQshift(1)}rQshift16(){return this._rQshift(2)}rQshift32(){return this._rQshift(4)}_rQshift(t){let e=0;for(let s=t-1;s>=0;s--)e+=this._rQ[this._rQi++]<<8*s;return e}rQshiftStr(t){"undefined"===typeof t&&(t=this.rQlen);let e="";for(let s=0;s<t;s+=4096){let i=this.rQshiftBytes(Math.min(4096,t-s));e+=String.fromCharCode.apply(null,i)}return e}rQshiftBytes(t){return"undefined"===typeof t&&(t=this.rQlen),this._rQi+=t,new Uint8Array(this._rQ.buffer,this._rQi-t,t)}rQshiftTo(t,e){void 0===e&&(e=this.rQlen),t.set(new Uint8Array(this._rQ.buffer,this._rQi,e)),this._rQi+=e}rQslice(t,e=this.rQlen){return new Uint8Array(this._rQ.buffer,this._rQi+t,e-t)}rQwait(t,e,s){if(this.rQlen<e){if(s){if(this._rQi<s)throw new Error("rQwait cannot backup "+s+" bytes");this._rQi-=s}return!0}return!1}flush(){this._sQlen>0&&this._websocket.readyState===WebSocket.OPEN&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}send(t){this._sQ.set(t,this._sQlen),this._sQlen+=t.length,this.flush()}sendString(t){this.send(t.split("").map((t=>t.charCodeAt(0))))}off(t){this._eventHandlers[t]=()=>{}}on(t,e){this._eventHandlers[t]=e}_allocateBuffers(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}init(){this._allocateBuffers(),this._rQi=0,this._websocket=null}open(t,e){this.init(),this._websocket=new WebSocket(t,e),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=()=>{r(">> WebSock.onopen"),this._websocket.protocol&&a("Server choose sub-protocol: "+this._websocket.protocol),this._eventHandlers.open(),r("<< WebSock.onopen")},this._websocket.onclose=t=>{r(">> WebSock.onclose"),this._eventHandlers.close(t),r("<< WebSock.onclose")},this._websocket.onerror=t=>{r(">> WebSock.onerror: "+t),this._eventHandlers.error(t),r("<< WebSock.onerror: "+t)}}close(){this._websocket&&(this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(a("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=()=>{})}_encodeMessage(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}_expandCompactRQ(t){const e=8*(this._rQlen-this._rQi+t),s=this._rQbufferSize<e;if(s&&(this._rQbufferSize=Math.max(2*this._rQbufferSize,e)),this._rQbufferSize>Er&&(this._rQbufferSize=Er,this._rQbufferSize-this.rQlen<t))throw new Error("Receive Queue buffer exceeded 41943040 bytes, and the new message could not fit");if(s){const t=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(t,this._rQi,this._rQlen-this._rQi))}else this._rQ.set(new Uint8Array(this._rQ.buffer,this._rQi,this._rQlen-this._rQi));this._rQlen=this._rQlen-this._rQi,this._rQi=0}_DecodeMessage(t){const e=new Uint8Array(t);e.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(e.length),this._rQ.set(e,this._rQlen),this._rQlen+=e.length}_recvMessage(t){this._DecodeMessage(t.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):r("Ignoring empty message")}}const Tr=[13,16,10,23,0,4,2,27,14,5,20,9,22,18,11,3,25,7,15,6,26,19,12,1,40,51,30,36,46,54,29,39,50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31],Fr=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28];let Lr,Dr,Br,zr,Ur,Ir;Lr=65536,Dr=1<<24,Br=Lr|Dr,zr=4,Ur=1024,Ir=zr|Ur;const Rr=[Br|Ur,0,0|Lr,Br|Ir,Br|zr,Lr|Ir,0|zr,0|Lr,0|Ur,Br|Ur,Br|Ir,0|Ur,Dr|Ir,Br|zr,0|Dr,0|zr,0|Ir,Dr|Ur,Dr|Ur,Lr|Ur,Lr|Ur,0|Br,0|Br,Dr|Ir,Lr|zr,Dr|zr,Dr|zr,Lr|zr,0,0|Ir,Lr|Ir,0|Dr,0|Lr,Br|Ir,0|zr,0|Br,Br|Ur,0|Dr,0|Dr,0|Ur,Br|zr,0|Lr,Lr|Ur,Dr|zr,0|Ur,0|zr,Dr|Ir,Lr|Ir,Br|Ir,Lr|zr,0|Br,Dr|Ir,Dr|zr,0|Ir,Lr|Ir,Br|Ur,0|Ir,Dr|Ur,Dr|Ur,0,Lr|zr,Lr|Ur,0,Br|zr];Lr=1<<20,Dr=1<<31,Br=Lr|Dr,zr=32,Ur=32768,Ir=zr|Ur;const Nr=[Br|Ir,Dr|Ur,0|Ur,Lr|Ir,0|Lr,0|zr,Br|zr,Dr|Ir,Dr|zr,Br|Ir,Br|Ur,0|Dr,Dr|Ur,0|Lr,0|zr,Br|zr,Lr|Ur,Lr|zr,Dr|Ir,0,0|Dr,0|Ur,Lr|Ir,0|Br,Lr|zr,Dr|zr,0,Lr|Ur,0|Ir,Br|Ur,0|Br,0|Ir,0,Lr|Ir,Br|zr,0|Lr,Dr|Ir,0|Br,Br|Ur,0|Ur,0|Br,Dr|Ur,0|zr,Br|Ir,Lr|Ir,0|zr,0|Ur,0|Dr,0|Ir,Br|Ur,0|Lr,Dr|zr,Lr|zr,Dr|Ir,Dr|zr,Lr|zr,Lr|Ur,0,Dr|Ur,0|Ir,0|Dr,Br|zr,Br|Ir,Lr|Ur];Lr=1<<17,Dr=1<<27,Br=Lr|Dr,zr=8,Ur=512,Ir=zr|Ur;const Pr=[0|Ir,Br|Ur,0,Br|zr,Dr|Ur,0,Lr|Ir,Dr|Ur,Lr|zr,Dr|zr,Dr|zr,0|Lr,Br|Ir,Lr|zr,0|Br,0|Ir,0|Dr,0|zr,Br|Ur,0|Ur,Lr|Ur,0|Br,Br|zr,Lr|Ir,Dr|Ir,Lr|Ur,0|Lr,Dr|Ir,0|zr,Br|Ir,0|Ur,0|Dr,Br|Ur,0|Dr,Lr|zr,0|Ir,0|Lr,Br|Ur,Dr|Ur,0,0|Ur,Lr|zr,Br|Ir,Dr|Ur,Dr|zr,0|Ur,0,Br|zr,Dr|Ir,0|Lr,0|Dr,Br|Ir,0|zr,Lr|Ir,Lr|Ur,Dr|zr,0|Br,Dr|Ir,0|Ir,0|Br,Lr|Ir,0|zr,Br|zr,Lr|Ur];Lr=8192,Dr=1<<23,Br=Lr|Dr,zr=1,Ur=128,Ir=zr|Ur;const Vr=[Br|zr,Lr|Ir,Lr|Ir,0|Ur,Br|Ur,Dr|Ir,Dr|zr,Lr|zr,0,0|Br,0|Br,Br|Ir,0|Ir,0,Dr|Ur,Dr|zr,0|zr,0|Lr,0|Dr,Br|zr,0|Ur,0|Dr,Lr|zr,Lr|Ur,Dr|Ir,0|zr,Lr|Ur,Dr|Ur,0|Lr,Br|Ur,Br|Ir,0|Ir,Dr|Ur,Dr|zr,0|Br,Br|Ir,0|Ir,0,0,0|Br,Lr|Ur,Dr|Ur,Dr|Ir,0|zr,Br|zr,Lr|Ir,Lr|Ir,0|Ur,Br|Ir,0|Ir,0|zr,0|Lr,Dr|zr,Lr|zr,Br|Ur,Dr|Ir,Lr|zr,Lr|Ur,0|Dr,Br|zr,0|Ur,0|Dr,0|Lr,Br|Ur];Lr=1<<25,Dr=1<<30,Br=Lr|Dr,zr=256,Ur=1<<19,Ir=zr|Ur;const Hr=[0|zr,Lr|Ir,Lr|Ur,Br|zr,0|Ur,0|zr,0|Dr,Lr|Ur,Dr|Ir,0|Ur,Lr|zr,Dr|Ir,Br|zr,Br|Ur,0|Ir,0|Dr,0|Lr,Dr|Ur,Dr|Ur,0,Dr|zr,Br|Ir,Br|Ir,Lr|zr,Br|Ur,Dr|zr,0,0|Br,Lr|Ir,0|Lr,0|Br,0|Ir,0|Ur,Br|zr,0|zr,0|Lr,0|Dr,Lr|Ur,Br|zr,Dr|Ir,Lr|zr,0|Dr,Br|Ur,Lr|Ir,Dr|Ir,0|zr,0|Lr,Br|Ur,Br|Ir,0|Ir,0|Br,Br|Ir,Lr|Ur,0,Dr|Ur,0|Br,0|Ir,Lr|zr,Dr|zr,0|Ur,0,Dr|Ur,Lr|Ir,Dr|zr];Lr=1<<22,Dr=1<<29,Br=Lr|Dr,zr=16,Ur=16384,Ir=zr|Ur;const Kr=[Dr|zr,0|Br,0|Ur,Br|Ir,0|Br,0|zr,Br|Ir,0|Lr,Dr|Ur,Lr|Ir,0|Lr,Dr|zr,Lr|zr,Dr|Ur,0|Dr,0|Ir,0,Lr|zr,Dr|Ir,0|Ur,Lr|Ur,Dr|Ir,0|zr,Br|zr,Br|zr,0,Lr|Ir,Br|Ur,0|Ir,Lr|Ur,Br|Ur,0|Dr,Dr|Ur,0|zr,Br|zr,Lr|Ur,Br|Ir,0|Lr,0|Ir,Dr|zr,0|Lr,Dr|Ur,0|Dr,0|Ir,Dr|zr,Br|Ir,Lr|Ur,0|Br,Lr|Ir,Br|Ur,0,Br|zr,0|zr,0|Ur,0|Br,Lr|Ir,0|Ur,Lr|zr,Dr|Ir,0,Br|Ur,0|Dr,Lr|zr,Dr|Ir];Lr=1<<21,Dr=1<<26,Br=Lr|Dr,zr=2,Ur=2048,Ir=zr|Ur;const Xr=[0|Lr,Br|zr,Dr|Ir,0,0|Ur,Dr|Ir,Lr|Ir,Br|Ur,Br|Ir,0|Lr,0,Dr|zr,0|zr,0|Dr,Br|zr,0|Ir,Dr|Ur,Lr|Ir,Lr|zr,Dr|Ur,Dr|zr,0|Br,Br|Ur,Lr|zr,0|Br,0|Ur,0|Ir,Br|Ir,Lr|Ur,0|zr,0|Dr,Lr|Ur,0|Dr,Lr|Ur,0|Lr,Dr|Ir,Dr|Ir,Br|zr,Br|zr,0|zr,Lr|zr,0|Dr,Dr|Ur,0|Lr,Br|Ur,0|Ir,Lr|Ir,Br|Ur,0|Ir,Dr|zr,Br|Ir,0|Br,Lr|Ur,0,0|zr,Br|Ir,0,Lr|Ir,0|Br,0|Ur,Dr|zr,Dr|Ur,0|Ur,Lr|zr];Lr=1<<18,Dr=1<<28,Br=Lr|Dr,zr=64,Ur=4096,Ir=zr|Ur;const Or=[Dr|Ir,0|Ur,0|Lr,Br|Ir,0|Dr,Dr|Ir,0|zr,0|Dr,Lr|zr,0|Br,Br|Ir,Lr|Ur,Br|Ur,Lr|Ir,0|Ur,0|zr,0|Br,Dr|zr,Dr|Ur,0|Ir,Lr|Ur,Lr|zr,Br|zr,Br|Ur,0|Ir,0,0,Br|zr,Dr|zr,Dr|Ur,Lr|Ir,0|Lr,Lr|Ir,0|Lr,Br|Ur,0|Ur,0|zr,Br|zr,0|Ur,Lr|Ir,Dr|Ur,0|zr,Dr|zr,0|Br,Br|zr,0|Dr,0|Lr,Dr|Ir,0,Br|Ir,Lr|zr,Dr|zr,0|Br,Dr|Ur,Dr|Ir,0,Br|Ir,Lr|Ur,Lr|Ur,0|Ir,0|Ir,Lr|zr,0|Dr,Br|Ur];class Yr{constructor(t){this.keys=[];const e=[],s=[],i=[];for(let n=0,r=56;n<56;++n,r-=8){r+=r<-5?65:r<-3?31:r<-1?63:27===r?35:0;const s=7&r;e[n]=0!==(t[r>>>3]&1<<s)?1:0}for(let n=0;n<16;++n){const t=n<<1,r=t+1;i[t]=i[r]=0;for(let i=28;i<59;i+=28)for(let t=i-28;t<i;++t){const r=t+Fr[n];s[t]=r<i?e[r]:e[r-28]}for(let e=0;e<24;++e)0!==s[Tr[e]]&&(i[t]|=1<<23-e),0!==s[Tr[e+24]]&&(i[r]|=1<<23-e)}for(let n=0,r=0,a=0;n<16;++n){const t=i[r++],e=i[r++];this.keys[a]=(16515072&t)<<6,this.keys[a]|=(4032&t)<<10,this.keys[a]|=(16515072&e)>>>10,this.keys[a]|=(4032&e)>>>6,++a,this.keys[a]=(258048&t)<<12,this.keys[a]|=(63&t)<<16,this.keys[a]|=(258048&e)>>>4,this.keys[a]|=63&e,++a}}enc8(t){const e=t.slice();let s,i,n,r=0;s=e[r++]<<24|e[r++]<<16|e[r++]<<8|e[r++],i=e[r++]<<24|e[r++]<<16|e[r++]<<8|e[r++],n=252645135&(s>>>4^i),i^=n,s^=n<<4,n=65535&(s>>>16^i),i^=n,s^=n<<16,n=858993459&(i>>>2^s),s^=n,i^=n<<2,n=16711935&(i>>>8^s),s^=n,i^=n<<8,i=i<<1|i>>>31&1,n=2863311530&(s^i),s^=n,i^=n,s=s<<1|s>>>31&1;for(let a=0,h=0;a<8;++a){n=i<<28|i>>>4,n^=this.keys[h++];let t=Xr[63&n];t|=Hr[n>>>8&63],t|=Pr[n>>>16&63],t|=Rr[n>>>24&63],n=i^this.keys[h++],t|=Or[63&n],t|=Kr[n>>>8&63],t|=Vr[n>>>16&63],t|=Nr[n>>>24&63],s^=t,n=s<<28|s>>>4,n^=this.keys[h++],t=Xr[63&n],t|=Hr[n>>>8&63],t|=Pr[n>>>16&63],t|=Rr[n>>>24&63],n=s^this.keys[h++],t|=Or[63&n],t|=Kr[n>>>8&63],t|=Vr[n>>>16&63],t|=Nr[n>>>24&63],i^=t}for(i=i<<31|i>>>1,n=2863311530&(s^i),s^=n,i^=n,s=s<<31|s>>>1,n=16711935&(s>>>8^i),i^=n,s^=n<<8,n=858993459&(s>>>2^i),i^=n,s^=n<<2,n=65535&(i>>>16^s),s^=n,i^=n<<16,n=252645135&(i>>>4^s),s^=n,i^=n<<4,n=[i,s],r=0;r<8;r++)e[r]=(n[r>>>2]>>>8*(3-r%4))%256,e[r]<0&&(e[r]+=256);return e}encrypt(t){return this.enc8(t.slice(0,8)).concat(this.enc8(t.slice(8,16)))}}var Gr={Again:57349,AltLeft:56,AltRight:57400,ArrowDown:57424,ArrowLeft:57419,ArrowRight:57421,ArrowUp:57416,AudioVolumeDown:57390,AudioVolumeMute:57376,AudioVolumeUp:57392,Backquote:41,Backslash:43,Backspace:14,BracketLeft:26,BracketRight:27,BrowserBack:57450,BrowserFavorites:57446,BrowserForward:57449,BrowserHome:57394,BrowserRefresh:57447,BrowserSearch:57445,BrowserStop:57448,CapsLock:58,Comma:51,ContextMenu:57437,ControlLeft:29,ControlRight:57373,Convert:121,Copy:57464,Cut:57404,Delete:57427,Digit0:11,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Eject:57469,End:57423,Enter:28,Equal:13,Escape:1,F1:59,F10:68,F11:87,F12:88,F13:93,F14:94,F15:95,F16:85,F17:57347,F18:57463,F19:57348,F2:60,F20:90,F21:116,F22:57465,F23:109,F24:111,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,Find:57409,Help:57461,Hiragana:119,Home:57415,Insert:57426,IntlBackslash:86,IntlRo:115,IntlYen:125,KanaMode:112,Katakana:120,KeyA:30,KeyB:48,KeyC:46,KeyD:32,KeyE:18,KeyF:33,KeyG:34,KeyH:35,KeyI:23,KeyJ:36,KeyK:37,KeyL:38,KeyM:50,KeyN:49,KeyO:24,KeyP:25,KeyQ:16,KeyR:19,KeyS:31,KeyT:20,KeyU:22,KeyV:47,KeyW:17,KeyX:45,KeyY:21,KeyZ:44,Lang3:120,Lang4:119,Lang5:118,LaunchApp1:57451,LaunchApp2:57377,LaunchMail:57452,MediaPlayPause:57378,MediaSelect:57453,MediaStop:57380,MediaTrackNext:57369,MediaTrackPrevious:57360,MetaLeft:57435,MetaRight:57436,Minus:12,NonConvert:123,NumLock:69,Numpad0:82,Numpad1:79,Numpad2:80,Numpad3:81,Numpad4:75,Numpad5:76,Numpad6:77,Numpad7:71,Numpad8:72,Numpad9:73,NumpadAdd:78,NumpadComma:126,NumpadDecimal:83,NumpadDivide:57397,NumpadEnter:57372,NumpadEqual:89,NumpadMultiply:55,NumpadParenLeft:57462,NumpadParenRight:57467,NumpadSubtract:74,Open:100,PageDown:57425,PageUp:57417,Paste:101,Pause:57414,Period:52,Power:57438,PrintScreen:84,Props:57350,Quote:40,ScrollLock:70,Semicolon:39,ShiftLeft:42,ShiftRight:54,Slash:53,Sleep:57439,Space:57,Suspend:57381,Tab:15,Undo:57351,WakeUp:57443};const Wr=0,qr=1,jr=2,Zr=5,Jr=7,$r=-260,ta=-32,ea=-223,sa=-224,ia=-239,na=-258,ra=-307,aa=-308,ha=-309,oa=-312,la=-313,ca=-256,da=1464686180,ua=3231835598;s(2203);class _a{constructor(){this._lines=0}decodeRect(t,e,s,i,n,r,a){0===this._lines&&(this._lines=i);const h=s*(8==a?1:4);if(n.rQwait("RAW",h))return!1;const o=e+(i-this._lines),l=Math.min(this._lines,Math.floor(n.rQlen/h));let c=n.rQ,d=n.rQi;if(8==a){const t=s*l,e=new Uint8Array(4*t);for(let s=0;s<t;s++)e[4*s+0]=255*(c[d+s]>>0&3)/3,e[4*s+1]=255*(c[d+s]>>2&3)/3,e[4*s+2]=255*(c[d+s]>>4&3)/3,e[4*s+4]=0;c=e,d=0}return r.blitImage(t,o,s,l,c,d),n.rQskipBytes(l*h),this._lines-=l,!(this._lines>0)}}class fa{decodeRect(t,e,s,i,n,r,a){if(n.rQwait("COPYRECT",4))return!1;let h=n.rQshift16(),o=n.rQshift16();return r.copyImage(h,o,t,e,s,i),!0}}class pa{constructor(){this._subrects=0}decodeRect(t,e,s,i,n,r,a){if(0===this._subrects){if(n.rQwait("RRE",8))return!1;this._subrects=n.rQshift32();let a=n.rQshiftBytes(4);r.fillRect(t,e,s,i,a)}for(;this._subrects>0;){if(n.rQwait("RRE",12))return!1;let s=n.rQshiftBytes(4),i=n.rQshift16(),a=n.rQshift16(),h=n.rQshift16(),o=n.rQshift16();r.fillRect(t+i,e+a,h,o,s),this._subrects--}return!0}}class ga{constructor(){this._tiles=0,this._lastsubencoding=0}decodeRect(t,e,s,i,n,a,h){for(0===this._tiles&&(this._tilesX=Math.ceil(s/16),this._tilesY=Math.ceil(i/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){let h=1;if(n.rQwait("HEXTILE",h))return!1;let o=n.rQ,l=n.rQi,c=o[l];if(c>30)throw new Error("Illegal hextile subencoding (subencoding: "+c+")");const d=this._totalTiles-this._tiles,u=t+16*(d%this._tilesX),_=e+16*Math.floor(d/this._tilesX),f=Math.min(16,t+s-u),p=Math.min(16,e+i-_);if(1&c)h+=f*p*4;else if(2&c&&(h+=4),4&c&&(h+=4),8&c){if(h++,n.rQwait("HEXTILE",h))return!1;let t=o[l+h-1];h+=16&c?6*t:2*t}if(n.rQwait("HEXTILE",h))return!1;if(l++,0===c)1&this._lastsubencoding?r(" Ignoring blank after RAW"):a.fillRect(u,_,f,p,this._background);else if(1&c)a.blitImage(u,_,f,p,o,l),l+=h-1;else{if(2&c&&(this._background=[o[l],o[l+1],o[l+2],o[l+3]],l+=4),4&c&&(this._foreground=[o[l],o[l+1],o[l+2],o[l+3]],l+=4),a.startTile(u,_,f,p,this._background),8&c){let t=o[l];l++;for(let e=0;e<t;e++){let t;16&c?(t=[o[l],o[l+1],o[l+2],o[l+3]],l+=4):t=this._foreground;const e=o[l];l++;const s=e>>4,i=15&e,n=o[l];l++;const r=1+(n>>4),h=1+(15&n);a.subTile(s,i,r,h,t)}}a.finishTile()}n.rQi=l,this._lastsubencoding=c,this._tiles--}return!0}}class ma{constructor(){this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(let t=0;t<4;t++)this._zlibs[t]=new at}decodeRect(t,e,s,i,n,r,h){if(null===this._ctl){if(n.rQwait("TIGHT compression-control",1))return!1;this._ctl=n.rQshift8();for(let t=0;t<4;t++)this._ctl>>t&1&&(this._zlibs[t].reset(),a("Reset zlib stream "+t));this._ctl=this._ctl>>4}let o;if(8===this._ctl)o=this._fillRect(t,e,s,i,n,r,h);else if(9===this._ctl)o=this._jpegRect(t,e,s,i,n,r,h);else if(10===this._ctl)o=this._pngRect(t,e,s,i,n,r,h);else{if(0!=(128&this._ctl))throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");o=this._basicRect(this._ctl,t,e,s,i,n,r,h)}return o&&(this._ctl=null),o}_fillRect(t,e,s,i,n,r,a){if(n.rQwait("TIGHT",3))return!1;const h=n.rQi,o=n.rQ;return r.fillRect(t,e,s,i,[o[h+2],o[h+1],o[h]],!1),n.rQskipBytes(3),!0}_jpegRect(t,e,s,i,n,r,a){let h=this._readData(n);return null!==h&&(r.imageRect(t,e,s,i,"image/jpeg",h),!0)}_pngRect(t,e,s,i,n,r,a){throw new Error("PNG received in standard Tight rect")}_basicRect(t,e,s,i,n,r,a,h){if(null===this._filter)if(4&t){if(r.rQwait("TIGHT",1))return!1;this._filter=r.rQshift8()}else this._filter=0;let o,l=3&t;switch(this._filter){case 0:o=this._copyFilter(l,e,s,i,n,r,a,h);break;case 1:o=this._paletteFilter(l,e,s,i,n,r,a,h);break;case 2:o=this._gradientFilter(l,e,s,i,n,r,a,h);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return o&&(this._filter=null),o}_copyFilter(t,e,s,i,n,r,a,h){const o=i*n*3;let l;if(o<12){if(r.rQwait("TIGHT",o))return!1;l=r.rQshiftBytes(o)}else{if(l=this._readData(r),null===l)return!1;this._zlibs[t].setInput(l),l=this._zlibs[t].inflate(o),this._zlibs[t].setInput(null)}return a.blitRgbImage(e,s,i,n,l,0,!1),!0}_paletteFilter(t,e,s,i,n,r,a,h){if(0===this._numColors){if(r.rQwait("TIGHT palette",1))return!1;const t=r.rQpeek8()+1,e=3*t;if(r.rQwait("TIGHT palette",1+e))return!1;this._numColors=t,r.rQskipBytes(1),r.rQshiftTo(this._palette,e)}const o=this._numColors<=2?1:8,l=Math.floor((i*o+7)/8)*n;let c;if(l<12){if(r.rQwait("TIGHT",l))return!1;c=r.rQshiftBytes(l)}else{if(c=this._readData(r),null===c)return!1;this._zlibs[t].setInput(c),c=this._zlibs[t].inflate(l),this._zlibs[t].setInput(null)}return 2==this._numColors?this._monoRect(e,s,i,n,c,this._palette,a):this._paletteRect(e,s,i,n,c,this._palette,a),this._numColors=0,!0}_monoRect(t,e,s,i,n,r,a){const h=this._getScratchBuffer(s*i*4),o=Math.floor((s+7)/8),l=Math.floor(s/8);for(let c=0;c<i;c++){let t,e,i;for(i=0;i<l;i++)for(let a=7;a>=0;a--)t=4*(c*s+8*i+7-a),e=3*(n[c*o+i]>>a&1),h[t]=r[e],h[t+1]=r[e+1],h[t+2]=r[e+2],h[t+3]=255;for(let a=7;a>=8-s%8;a--)t=4*(c*s+8*i+7-a),e=3*(n[c*o+i]>>a&1),h[t]=r[e],h[t+1]=r[e+1],h[t+2]=r[e+2],h[t+3]=255}a.blitRgbxImage(t,e,s,i,h,0,!1)}_paletteRect(t,e,s,i,n,r,a){const h=this._getScratchBuffer(s*i*4),o=s*i*4;for(let l=0,c=0;l<o;l+=4,c++){const t=3*n[c];h[l]=r[t],h[l+1]=r[t+1],h[l+2]=r[t+2],h[l+3]=255}a.blitRgbxImage(t,e,s,i,h,0,!1)}_gradientFilter(t,e,s,i,n,r,a,h){throw new Error("Gradient filter not implemented")}_readData(t){if(0===this._len){if(t.rQwait("TIGHT",3))return null;let e;e=t.rQshift8(),this._len=127&e,128&e&&(e=t.rQshift8(),this._len|=(127&e)<<7,128&e&&(e=t.rQshift8(),this._len|=e<<14))}if(t.rQwait("TIGHT",this._len))return null;let e=t.rQshiftBytes(this._len);return this._len=0,e}_getScratchBuffer(t){return(!this._scratchBuffer||this._scratchBuffer.length<t)&&(this._scratchBuffer=new Uint8Array(t)),this._scratchBuffer}}class wa extends ma{_pngRect(t,e,s,i,n,r,a){let h=this._readData(n);return null!==h&&(r.imageRect(t,e,s,i,"image/png",h),!0)}_basicRect(t,e,s,i,n,r,a,h){throw new Error("BasicCompression received in TightPNG rect")}}const ba=50,va=1<<24,ka=1<<25,ya=1<<26,Ca=1<<27,xa=1<<28;class Sa extends class{constructor(){this._listeners=new Map}addEventListener(t,e){this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(e)}removeEventListener(t,e){this._listeners.has(t)&&this._listeners.get(t).delete(e)}dispatchEvent(t){return!this._listeners.has(t.type)||(this._listeners.get(t.type).forEach((e=>e.call(this,t))),!t.defaultPrevented)}}{constructor(t,e,s){if(!t)throw new Error("Must specify target");if(!e)throw new Error("Must specify URL");super(),this._target=t,this._url=e,s=s||{},this._rfbCredentials=s.credentials||{},this._shared=!("shared"in s)||!!s.shared,this._repeaterID=s.repeaterID||"",this._wsProtocols=s.wsProtocols||[],this._rfbConnectionState="",this._rfbInitState="",this._rfbAuthScheme=-1,this._rfbCleanDisconnect=!0,this._rfbVersion=0,this._rfbMaxVersion=3.8,this._rfbTightVNC=!1,this._rfbVeNCryptState=0,this._rfbXvpVer=0,this._fbWidth=0,this._fbHeight=0,this._fbName="",this._capabilities={power:!1},this._supportsFence=!1,this._supportsContinuousUpdates=!1,this._enabledContinuousUpdates=!1,this._supportsSetDesktopSize=!1,this._screenID=0,this._screenFlags=0,this._qemuExtKeyEventSupported=!1,this._clipboardText=null,this._clipboardServerCapabilitiesActions={},this._clipboardServerCapabilitiesFormats={},this._sock=null,this._display=null,this._flushing=!1,this._keyboard=null,this._gestures=null,this._disconnTimer=null,this._resizeTimeout=null,this._mouseMoveTimer=null,this._decoders={},this._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},this._mousePos={},this._mouseButtonMask=0,this._mouseLastMoveTime=0,this._viewportDragging=!1,this._viewportDragPos={},this._viewportHasMoved=!1,this._accumulatedWheelDeltaX=0,this._accumulatedWheelDeltaY=0,this._gestureLastTapTime=null,this._gestureFirstDoubleTapEv=null,this._gestureLastMagnitudeX=0,this._gestureLastMagnitudeY=0,this._eventHandlers={focusCanvas:this._focusCanvas.bind(this),windowResize:this._windowResize.bind(this),handleMouse:this._handleMouse.bind(this),handleWheel:this._handleWheel.bind(this),handleGesture:this._handleGesture.bind(this)},r(">> RFB.constructor"),this._screen=document.createElement("div"),this._screen.style.display="flex",this._screen.style.width="100%",this._screen.style.height="100%",this._screen.style.overflow="auto",this._screen.style.background="rgb(40, 40, 40)",this._canvas=document.createElement("canvas"),this._canvas.style.margin="auto",this._canvas.style.outline="none",this._canvas.style.flexShrink="0",this._canvas.width=0,this._canvas.height=0,this._canvas.tabIndex=-1,this._screen.appendChild(this._canvas),this._cursor=new Ar,this._cursorImage=Sa.cursors.none,this._decoders[Wr]=new _a,this._decoders[qr]=new fa,this._decoders[jr]=new pa,this._decoders[Zr]=new ga,this._decoders[Jr]=new ma,this._decoders[$r]=new wa;try{this._display=new D(this._canvas)}catch(Qa){throw o("Display exception: "+Qa),Qa}this._display.onflush=this._onFlush.bind(this),this._keyboard=new yr(this._canvas),this._keyboard.onkeyevent=this._handleKeyEvent.bind(this),this._gestures=new Sr,this._sock=new Mr,this._sock.on("message",(()=>{this._handleMessage()})),this._sock.on("open",(()=>{"connecting"===this._rfbConnectionState&&""===this._rfbInitState?(this._rfbInitState="ProtocolVersion",r("Starting VNC handshake")):this._fail("Unexpected server connection while "+this._rfbConnectionState)})),this._sock.on("close",(t=>{r("WebSocket on-close event");let e="";switch(t.code&&(e="(code: "+t.code,t.reason&&(e+=", reason: "+t.reason),e+=")"),this._rfbConnectionState){case"connecting":this._fail("Connection closed "+e);break;case"connected":this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected");break;case"disconnecting":this._updateConnectionState("disconnected");break;case"disconnected":this._fail("Unexpected server disconnect when already disconnected "+e);break;default:this._fail("Unexpected server disconnect before connecting "+e)}this._sock.off("close")})),this._sock.on("error",(t=>h("WebSocket on-error event"))),setTimeout(this._updateConnectionState.bind(this,"connecting")),r("<< RFB.constructor"),this.dragViewport=!1,this.focusOnClick=!0,this._viewOnly=!1,this._clipViewport=!1,this._scaleViewport=!1,this._resizeSession=!1,this._showDotCursor=!1,void 0!==s.showDotCursor&&(h("Specifying showDotCursor as a RFB constructor argument is deprecated"),this._showDotCursor=s.showDotCursor),this._qualityLevel=6,this._compressionLevel=2}get viewOnly(){return this._viewOnly}set viewOnly(t){this._viewOnly=t,"connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState||(t?this._keyboard.ungrab():this._keyboard.grab())}get capabilities(){return this._capabilities}get touchButton(){return 0}set touchButton(t){h("Using old API!")}get clipViewport(){return this._clipViewport}set clipViewport(t){this._clipViewport=t,this._updateClip()}get scaleViewport(){return this._scaleViewport}set scaleViewport(t){this._scaleViewport=t,t&&this._clipViewport&&this._updateClip(),this._updateScale(),!t&&this._clipViewport&&this._updateClip()}get resizeSession(){return this._resizeSession}set resizeSession(t){this._resizeSession=t,t&&this._requestRemoteResize()}get showDotCursor(){return this._showDotCursor}set showDotCursor(t){this._showDotCursor=t,this._refreshCursor()}get background(){return this._screen.style.background}set background(t){this._screen.style.background=t}get qualityLevel(){return this._qualityLevel}set qualityLevel(t){!Number.isInteger(t)||t<0||t>9?o("qualityLevel must be an integer between 0 and 9"):this._qualityLevel!==t&&(this._qualityLevel=t,"connected"===this._rfbConnectionState&&this._sendEncodings())}get compressionLevel(){return this._compressionLevel}set compressionLevel(t){!Number.isInteger(t)||t<0||t>9?o("compressionLevel must be an integer between 0 and 9"):this._compressionLevel!==t&&(this._compressionLevel=t,"connected"===this._rfbConnectionState&&this._sendEncodings())}disconnect(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}sendCredentials(t){this._rfbCredentials=t,setTimeout(this._initMsg.bind(this),0)}sendCtrlAltDel(){"connected"!==this._rfbConnectionState||this._viewOnly||(a("Sending Ctrl-Alt-Del"),this.sendKey(xi,"ControlLeft",!0),this.sendKey(Mi,"AltLeft",!0),this.sendKey(Qe,"Delete",!0),this.sendKey(Qe,"Delete",!1),this.sendKey(Mi,"AltLeft",!1),this.sendKey(xi,"ControlLeft",!1))}machineShutdown(){this._xvpOp(1,2)}machineReboot(){this._xvpOp(1,3)}machineReset(){this._xvpOp(1,4)}sendKey(t,e,s){if("connected"!==this._rfbConnectionState||this._viewOnly)return;if(void 0===s)return this.sendKey(t,e,!0),void this.sendKey(t,e,!1);const i=Gr[e];if(this._qemuExtKeyEventSupported&&i)a("Sending key ("+(s?"down":"up")+"): keysym "+(t=t||0)+", scancode "+i),Sa.messages.QEMUExtendedKeyEvent(this._sock,t,s,i);else{if(!t)return;a("Sending keysym ("+(s?"down":"up")+"): "+t),Sa.messages.keyEvent(this._sock,t,s?1:0)}}focus(){this._canvas.focus()}blur(){this._canvas.blur()}clipboardPasteFrom(t){if("connected"===this._rfbConnectionState&&!this._viewOnly)if(this._clipboardServerCapabilitiesFormats[1]&&this._clipboardServerCapabilitiesActions[134217728])this._clipboardText=t,Sa.messages.extendedClipboardNotify(this._sock,[1]);else{let e=new Uint8Array(t.length);for(let s=0;s<t.length;s++)e[s]=t.charCodeAt(s);Sa.messages.clientCutText(this._sock,e)}}_connect(){r(">> RFB.connect"),a("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(Ur){"SyntaxError"===Ur.name?this._fail("Invalid host or port ("+Ur+")"):this._fail("Error when opening socket ("+Ur+")")}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),window.addEventListener("resize",this._eventHandlers.windowResize),this._canvas.addEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.addEventListener("touchstart",this._eventHandlers.focusCanvas),this._canvas.addEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.addEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.addEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.addEventListener("click",this._eventHandlers.handleMouse),this._canvas.addEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.addEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.addEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.addEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.addEventListener("gestureend",this._eventHandlers.handleGesture),r("<< RFB.connect")}_disconnect(){r(">> RFB.disconnect"),this._cursor.detach(),this._canvas.removeEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gestureend",this._eventHandlers.handleGesture),this._canvas.removeEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.removeEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.removeEventListener("click",this._eventHandlers.handleMouse),this._canvas.removeEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.removeEventListener("touchstart",this._eventHandlers.focusCanvas),window.removeEventListener("resize",this._eventHandlers.windowResize),this._keyboard.ungrab(),this._gestures.detach(),this._sock.close();try{this._target.removeChild(this._screen)}catch(Ur){if("NotFoundError"!==Ur.name)throw Ur}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),r("<< RFB.disconnect")}_focusCanvas(t){this.focusOnClick&&this.focus()}_setDesktopName(t){this._fbName=t,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}_windowResize(t){window.requestAnimationFrame((()=>{this._updateClip(),this._updateScale()})),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}_updateClip(){const t=this._display.clipViewport;let e=this._clipViewport;if(this._scaleViewport&&(e=!1),t!==e&&(this._display.clipViewport=e),e){const t=this._screenSize();this._display.viewportChangeSize(t.w,t.h),this._fixScrollbars()}}_updateScale(){if(this._scaleViewport){const t=this._screenSize();this._display.autoscale(t.w,t.h)}else this._display.scale=1;this._fixScrollbars()}_requestRemoteResize(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;const t=this._screenSize();Sa.messages.setDesktopSize(this._sock,Math.floor(t.w),Math.floor(t.h),this._screenID,this._screenFlags),r("Requested new desktop size: "+t.w+"x"+t.h)}_screenSize(){let t=this._screen.getBoundingClientRect();return{w:t.width,h:t.height}}_fixScrollbars(){const t=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=t}_updateConnectionState(t){const e=this._rfbConnectionState;if(t!==e)if("disconnected"!==e){switch(t){case"connected":if("connecting"!==e)return void o("Bad transition to connected state, previous connection state: "+e);break;case"disconnected":if("disconnecting"!==e)return void o("Bad transition to disconnected state, previous connection state: "+e);break;case"connecting":if(""!==e)return void o("Bad transition to connecting state, previous connection state: "+e);break;case"disconnecting":if("connected"!==e&&"connecting"!==e)return void o("Bad transition to disconnecting state, previous connection state: "+e);break;default:return void o("Unknown connection state: "+t)}switch(this._rfbConnectionState=t,r("New state '"+t+"', was '"+e+"'."),this._disconnTimer&&"disconnecting"!==t&&(r("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close")),t){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout((()=>{o("Disconnection timed out."),this._updateConnectionState("disconnected")}),3e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}))}}else o("Tried changing state of a disconnected RFB object");else r("Already in state '"+t+"', ignoring")}_fail(t){switch(this._rfbConnectionState){case"disconnecting":o("Failed when disconnecting: "+t);break;case"connected":o("Failed while connected: "+t);break;case"connecting":o("Failed when connecting: "+t);break;default:o("RFB failure: "+t)}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}_setCapability(t,e){this._capabilities[t]=e,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}_handleMessage(){if(0!==this._sock.rQlen)switch(this._rfbConnectionState){case"disconnected":o("Got data while disconnected");break;case"connected":for(;!this._flushing&&this._normalMsg()&&0!==this._sock.rQlen;);break;default:this._initMsg()}else h("handleMessage called on an empty receive queue")}_handleKeyEvent(t,e,s){this.sendKey(t,e,s)}_handleMouse(t){if("click"===t.type&&t.target!==this._canvas)return;if(t.stopPropagation(),t.preventDefault(),"click"===t.type||"contextmenu"===t.type)return;let e=x(t.clientX,t.clientY,this._canvas);switch(t.type){case"mousedown":!function(t){if(t.setCapture)t.setCapture(),document.captureElement=t,t.addEventListener("mouseup",F);else{F();let e=document.getElementById("noVNC_mouse_capture_elem");null===e&&(e=document.createElement("div"),e.id="noVNC_mouse_capture_elem",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1e4,e.style.display="none",document.body.appendChild(e),e.addEventListener("contextmenu",E),e.addEventListener("mousemove",E),e.addEventListener("mouseup",E)),document.captureElement=t,T.observe(t,{attributes:!0}),M(),e.style.display="",window.addEventListener("mousemove",E),window.addEventListener("mouseup",E)}}(this._canvas),this._handleMouseButton(e.x,e.y,!0,1<<t.button);break;case"mouseup":this._handleMouseButton(e.x,e.y,!1,1<<t.button);break;case"mousemove":this._handleMouseMove(e.x,e.y)}}_handleMouseButton(t,e,s,i){if(this.dragViewport){if(s&&!this._viewportDragging)return this._viewportDragging=!0,this._viewportDragPos={x:t,y:e},void(this._viewportHasMoved=!1);if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(t,e,i)}null!==this._mouseMoveTimer&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(t,e,this._mouseButtonMask)),s?this._mouseButtonMask|=i:this._mouseButtonMask&=~i,this._sendMouse(t,e,this._mouseButtonMask)}_handleMouseMove(t,e){if(this._viewportDragging){const s=this._viewportDragPos.x-t,i=this._viewportDragPos.y-e;(this._viewportHasMoved||Math.abs(s)>u||Math.abs(i)>u)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:t,y:e},this._display.viewportChangePos(s,i))}else if(this._mousePos={x:t,y:e},null==this._mouseMoveTimer){const s=Date.now()-this._mouseLastMoveTime;s>17?(this._sendMouse(t,e,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout((()=>{this._handleDelayedMouseMove()}),17-s)}}_handleDelayedMouseMove(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}_sendMouse(t,e,s){"connected"===this._rfbConnectionState&&(this._viewOnly||Sa.messages.pointerEvent(this._sock,this._display.absX(t),this._display.absY(e),s))}_handleWheel(t){if("connected"!==this._rfbConnectionState)return;if(this._viewOnly)return;t.stopPropagation(),t.preventDefault();let e=x(t.clientX,t.clientY,this._canvas),s=t.deltaX,i=t.deltaY;0!==t.deltaMode&&(s*=19,i*=19),this._accumulatedWheelDeltaX+=s,this._accumulatedWheelDeltaY+=i,Math.abs(this._accumulatedWheelDeltaX)>=50&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(e.x,e.y,!0,32),this._handleMouseButton(e.x,e.y,!1,32)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(e.x,e.y,!0,64),this._handleMouseButton(e.x,e.y,!1,64)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=50&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(e.x,e.y,!0,8),this._handleMouseButton(e.x,e.y,!1,8)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(e.x,e.y,!0,16),this._handleMouseButton(e.x,e.y,!1,16)),this._accumulatedWheelDeltaY=0)}_fakeMouseMove(t,e,s){this._handleMouseMove(e,s),this._cursor.move(t.detail.clientX,t.detail.clientY)}_handleTapEvent(t,e){let s=x(t.detail.clientX,t.detail.clientY,this._canvas);if(null!==this._gestureLastTapTime&&Date.now()-this._gestureLastTapTime<1e3&&this._gestureFirstDoubleTapEv.detail.type===t.detail.type){let e=this._gestureFirstDoubleTapEv.detail.clientX-t.detail.clientX,i=this._gestureFirstDoubleTapEv.detail.clientY-t.detail.clientY;Math.hypot(e,i)<50?s=x(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=t}else this._gestureFirstDoubleTapEv=t;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,s.x,s.y),this._handleMouseButton(s.x,s.y,!0,e),this._handleMouseButton(s.x,s.y,!1,e)}_handleGesture(t){let e,s=x(t.detail.clientX,t.detail.clientY,this._canvas);switch(t.type){case"gesturestart":switch(t.detail.type){case"onetap":this._handleTapEvent(t,1);break;case"twotap":this._handleTapEvent(t,4);break;case"threetap":this._handleTapEvent(t,2);break;case"drag":this._fakeMouseMove(t,s.x,s.y),this._handleMouseButton(s.x,s.y,!0,1);break;case"longpress":this._fakeMouseMove(t,s.x,s.y),this._handleMouseButton(s.x,s.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=t.detail.magnitudeX,this._gestureLastMagnitudeY=t.detail.magnitudeY,this._fakeMouseMove(t,s.x,s.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(t.detail.magnitudeX,t.detail.magnitudeY),this._fakeMouseMove(t,s.x,s.y)}break;case"gesturemove":switch(t.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(t,s.x,s.y);break;case"twodrag":for(this._fakeMouseMove(t,s.x,s.y);t.detail.magnitudeY-this._gestureLastMagnitudeY>ba;)this._handleMouseButton(s.x,s.y,!0,8),this._handleMouseButton(s.x,s.y,!1,8),this._gestureLastMagnitudeY+=ba;for(;t.detail.magnitudeY-this._gestureLastMagnitudeY<-50;)this._handleMouseButton(s.x,s.y,!0,16),this._handleMouseButton(s.x,s.y,!1,16),this._gestureLastMagnitudeY-=ba;for(;t.detail.magnitudeX-this._gestureLastMagnitudeX>ba;)this._handleMouseButton(s.x,s.y,!0,32),this._handleMouseButton(s.x,s.y,!1,32),this._gestureLastMagnitudeX+=ba;for(;t.detail.magnitudeX-this._gestureLastMagnitudeX<-50;)this._handleMouseButton(s.x,s.y,!0,64),this._handleMouseButton(s.x,s.y,!1,64),this._gestureLastMagnitudeX-=ba;break;case"pinch":if(this._fakeMouseMove(t,s.x,s.y),e=Math.hypot(t.detail.magnitudeX,t.detail.magnitudeY),Math.abs(e-this._gestureLastMagnitudeX)>75){for(this._handleKeyEvent(xi,"ControlLeft",!0);e-this._gestureLastMagnitudeX>75;)this._handleMouseButton(s.x,s.y,!0,8),this._handleMouseButton(s.x,s.y,!1,8),this._gestureLastMagnitudeX+=75;for(;e-this._gestureLastMagnitudeX<-75;)this._handleMouseButton(s.x,s.y,!0,16),this._handleMouseButton(s.x,s.y,!1,16),this._gestureLastMagnitudeX-=75}this._handleKeyEvent(xi,"ControlLeft",!1)}break;case"gestureend":switch(t.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(t,s.x,s.y),this._handleMouseButton(s.x,s.y,!1,1);break;case"longpress":this._fakeMouseMove(t,s.x,s.y),this._handleMouseButton(s.x,s.y,!1,4)}}}_negotiateProtocolVersion(){if(this._sock.rQwait("version",12))return!1;const t=this._sock.rQshiftStr(12).substr(4,7);a("Server ProtocolVersion: "+t);let e=0;switch(t){case"000.000":e=1;break;case"003.003":case"003.006":case"003.889":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+t)}if(e){let t="ID:"+this._repeaterID;for(;t.length<250;)t+="\0";return this._sock.sendString(t),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);const s="00"+parseInt(this._rfbVersion,10)+".00"+10*this._rfbVersion%10;this._sock.sendString("RFB "+s+"\n"),r("Sent ProtocolVersion: "+s),this._rfbInitState="Security"}_negotiateSecurity(){function t(t,e){for(let s=0;s<e.length;s++)if(e[s]===t)return!0;return!1}if(this._rfbVersion>=3.7){const e=this._sock.rQshift8();if(this._sock.rQwait("security type",e,1))return!1;if(0===e)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();const s=this._sock.rQshiftBytes(e);if(r("Server security types: "+s),t(1,s))this._rfbAuthScheme=1;else if(t(22,s))this._rfbAuthScheme=22;else if(t(16,s))this._rfbAuthScheme=16;else if(t(2,s))this._rfbAuthScheme=2;else{if(!t(19,s))return this._fail("Unsupported security types (types: "+s+")");this._rfbAuthScheme=19}this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),0==this._rfbAuthScheme)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",r("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}_handleSecurityReason(){if(this._sock.rQwait("reason length",4))return!1;const t=this._sock.rQshift32();let e="";if(t>0){if(this._sock.rQwait("reason",t,4))return!1;e=this._sock.rQshiftStr(t)}return""!==e?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:e}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+e+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}_negotiateXvpAuth(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password||void 0===this._rfbCredentials.target)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;const t=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(t),this._rfbAuthScheme=2,this._negotiateAuthentication()}_negotiateVeNCryptAuth(){if(0==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt version",2))return!1;const t=this._sock.rQshift8(),e=this._sock.rQshift8();if(0!=t||2!=e)return this._fail("Unsupported VeNCrypt version "+t+"."+e);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(1==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt ack",1))return!1;const t=this._sock.rQshift8();if(0!=t)return this._fail("VeNCrypt failure "+t);this._rfbVeNCryptState=2}if(2==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;const t=this._sock.rQshift8();if(t<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=t,this._rfbVeNCryptState=3}if(3==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;const t=[];for(let e=0;e<this._rfbVeNCryptSubtypesLength;e++)t.push(this._sock.rQshift32());if(-1==t.indexOf(256))return this._fail("VeNCrypt Plain subtype not offered by server");this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4}if(4==this._rfbVeNCryptState){if(!this._rfbCredentials.username||!this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;const t=c(this._rfbCredentials.username),e=c(this._rfbCredentials.password);return this._sock.send([0,0,0,t.length]),this._sock.send([0,0,0,e.length]),this._sock.sendString(t),this._sock.sendString(e),this._rfbInitState="SecurityResult",!0}}_negotiateStdVNCAuth(){if(this._sock.rQwait("auth challenge",16))return!1;if(void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;const t=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),e=Sa.genDES(this._rfbCredentials.password,t);return this._sock.send(e),this._rfbInitState="SecurityResult",!0}_negotiateTightUnixAuth(){return void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password?(this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1):(this._sock.send([0,0,0,this._rfbCredentials.username.length]),this._sock.send([0,0,0,this._rfbCredentials.password.length]),this._sock.sendString(this._rfbCredentials.username),this._sock.sendString(this._rfbCredentials.password),this._rfbInitState="SecurityResult",!0)}_negotiateTightTunnels(t){const e={vendor:"TGHT",signature:"NOTUNNEL"},s={};for(let i=0;i<t;i++){const t=this._sock.rQshift32(),e=this._sock.rQshiftStr(4),i=this._sock.rQshiftStr(8);s[t]={vendor:e,signature:i}}return r("Server Tight tunnel types: "+s),s[1]&&"SICR"===s[1].vendor&&"SCHANNEL"===s[1].signature&&(r("Detected Siemens server. Assuming NOTUNNEL support."),s[0]={vendor:"TGHT",signature:"NOTUNNEL"}),s[0]?s[0].vendor!=e.vendor||s[0].signature!=e.signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(r("Selected tunnel type: "+e),this._sock.send([0,0,0,0]),!1):this._fail("Server wanted tunnels, but doesn't support the notunnel type")}_negotiateTightAuth(){if(!this._rfbTightVNC){if(this._sock.rQwait("num tunnels",4))return!1;const t=this._sock.rQshift32();if(t>0&&this._sock.rQwait("tunnel capabilities",16*t,4))return!1;if(this._rfbTightVNC=!0,t>0)return this._negotiateTightTunnels(t),!1}if(this._sock.rQwait("sub auth count",4))return!1;const t=this._sock.rQshift32();if(0===t)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*t,4))return!1;const e={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},s=[];for(let i=0;i<t;i++){this._sock.rQshift32();const t=this._sock.rQshiftStr(12);s.push(t)}r("Server Tight authentication types: "+s);for(let i in e)if(-1!=s.indexOf(i))switch(this._sock.send([0,0,0,e[i]]),r("Selected authentication type: "+i),i){case"STDVNOAUTH__":return this._rfbInitState="SecurityResult",!0;case"STDVVNCAUTH_":return this._rfbAuthScheme=2,this._initMsg();case"TGHTULGNAUTH":return this._rfbAuthScheme=129,this._initMsg();default:return this._fail("Unsupported tiny auth scheme (scheme: "+i+")")}return this._fail("No supported sub-auth types!")}_negotiateAuthentication(){switch(this._rfbAuthScheme){case 1:return this._rfbVersion>=3.8?(this._rfbInitState="SecurityResult",!0):(this._rfbInitState="ClientInitialisation",this._initMsg());case 22:return this._negotiateXvpAuth();case 2:return this._negotiateStdVNCAuth();case 16:return this._negotiateTightAuth();case 19:return this._negotiateVeNCryptAuth();case 129:return this._negotiateTightUnixAuth();default:return this._fail("Unsupported auth scheme (scheme: "+this._rfbAuthScheme+")")}}_handleSecurityResult(){if(this._sock.rQwait("VNC auth response ",4))return!1;const t=this._sock.rQshift32();return 0===t?(this._rfbInitState="ClientInitialisation",r("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=t,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:t}})),this._fail("Security handshake failed"))}_negotiateServerInit(){if(this._sock.rQwait("server initialization",24))return!1;const t=this._sock.rQshift16(),e=this._sock.rQshift16(),s=this._sock.rQshift8(),i=this._sock.rQshift8(),n=this._sock.rQshift8(),r=this._sock.rQshift8(),o=this._sock.rQshift16(),c=this._sock.rQshift16(),d=this._sock.rQshift16(),u=this._sock.rQshift8(),_=this._sock.rQshift8(),f=this._sock.rQshift8();this._sock.rQskipBytes(3);const p=this._sock.rQshift32();if(this._sock.rQwait("server init name",p,24))return!1;let g=this._sock.rQshiftStr(p);if(g=l(g,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+p))return!1;const t=this._sock.rQshift16(),e=this._sock.rQshift16(),s=this._sock.rQshift16();this._sock.rQskipBytes(2);const i=16*(t+e+s);if(this._sock.rQwait("TightVNC extended server init header",i,32+p))return!1;this._sock.rQskipBytes(16*t),this._sock.rQskipBytes(16*e),this._sock.rQskipBytes(16*s)}return a("Screen: "+t+"x"+e+", bpp: "+s+", depth: "+i+", bigEndian: "+n+", trueColor: "+r+", redMax: "+o+", greenMax: "+c+", blueMax: "+d+", redShift: "+u+", greenShift: "+_+", blueShift: "+f),this._setDesktopName(g),this._resize(t,e),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(h("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),Sa.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),Sa.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}_sendEncodings(){const t=[];t.push(qr),24==this._fbDepth&&(t.push(Jr),t.push($r),t.push(Zr),t.push(jr)),t.push(Wr),t.push(ta+this._qualityLevel),t.push(ca+this._compressionLevel),t.push(ea),t.push(sa),t.push(na),t.push(aa),t.push(ha),t.push(oa),t.push(la),t.push(ra),t.push(ua),24==this._fbDepth&&(t.push(da),t.push(ia)),Sa.messages.clientEncodings(this._sock,t)}_initMsg(){switch(this._rfbInitState){case"ProtocolVersion":return this._negotiateProtocolVersion();case"Security":return this._negotiateSecurity();case"Authentication":return this._negotiateAuthentication();case"SecurityResult":return this._handleSecurityResult();case"SecurityReason":return this._handleSecurityReason();case"ClientInitialisation":return this._sock.send([this._shared?1:0]),this._rfbInitState="ServerInitialisation",!0;case"ServerInitialisation":return this._negotiateServerInit();default:return this._fail("Unknown init state (state: "+this._rfbInitState+")")}}_handleSetColourMapMsg(){return r("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}_handleServerCutText(){if(r("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);let t=this._sock.rQshift32();if(t=i(t),this._sock.rQwait("ServerCutText content",Math.abs(t),8))return!1;if(t>=0){const e=this._sock.rQshiftStr(t);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:e}}))}else{t=Math.abs(t);const e=this._sock.rQshift32();let s=65535&e,i=4278190080&e;if(!!(i&va)){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(let e=0;e<=15;e++){let t=1<<e;s&t&&(this._clipboardServerCapabilitiesFormats[t]=!0,this._sock.rQshift32())}for(let e=24;e<=31;e++){let t=1<<e;this._clipboardServerCapabilitiesActions[t]=!!(i&t)}let t=[va,ka,ya,Ca,xa];Sa.messages.extendedClipboardCaps(this._sock,t,{extendedClipboardFormatText:0})}else if(i===ka){if(this._viewOnly)return!0;null!=this._clipboardText&&this._clipboardServerCapabilitiesActions[268435456]&&1&s&&Sa.messages.extendedClipboardProvide(this._sock,[1],[this._clipboardText])}else if(i===ya){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[134217728]&&(null!=this._clipboardText?Sa.messages.extendedClipboardNotify(this._sock,[1]):Sa.messages.extendedClipboardNotify(this._sock,[]))}else if(i===Ca){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[33554432]&&1&s&&Sa.messages.extendedClipboardRequest(this._sock,[1])}else{if(i!==xa)return this._fail("Unexpected action in extended clipboard message: "+i);{if(this._viewOnly)return!0;if(!(1&s))return!0;this._clipboardText=null;let e=this._sock.rQshiftBytes(t-4),i=new at,n=null;i.setInput(e);for(let t=0;t<=15;t++){let e=1<<t;if(s&e){let t=0,s=i.inflate(4);t|=s[0]<<24,t|=s[1]<<16,t|=s[2]<<8,t|=s[3];let r=i.inflate(t);1===e&&(n=r)}}if(i.setInput(null),null!==n){let t="";for(let e=0;e<n.length;e++)t+=String.fromCharCode(n[e]);n=t,n=l(n),n.length>0&&"\0"===n.charAt(n.length-1)&&(n=n.slice(0,-1)),n=n.replace("\r\n","\n"),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:n}}))}}}}return!0}_handleServerFenceMsg(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);let t=this._sock.rQshift32(),e=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",e,9))return!1;e>64&&(h("Bad payload length ("+e+") in fence response"),e=64);const s=this._sock.rQshiftStr(e);return this._supportsFence=!0,t&1<<31?(t&=3,Sa.messages.clientFence(this._sock,t,s),!0):this._fail("Unexpected fence response")}_handleXvpMsg(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);const t=this._sock.rQshift8(),e=this._sock.rQshift8();switch(e){case 0:o("XVP Operation Failed");break;case 1:this._rfbXvpVer=t,a("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+e+")")}return!0}_normalMsg(){let t,e,s;switch(t=this._FBU.rects>0?0:this._sock.rQshift8(),t){case 0:return s=this._framebufferUpdate(),s&&!this._enabledContinuousUpdates&&Sa.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),s;case 1:return this._handleSetColourMapMsg();case 2:return r("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return e=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,e&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),a("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+t+")"),r("sock.rQslice(0, 30): "+this._sock.rQslice(0,30)),!0}}_onFlush(){this._flushing=!1,this._sock.rQlen>0&&this._handleMessage()}_framebufferUpdate(){if(0===this._FBU.rects){if(this._sock.rQwait("FBU header",3,1))return!1;if(this._sock.rQskipBytes(1),this._FBU.rects=this._sock.rQshift16(),this._display.pending())return this._flushing=!0,this._display.flush(),!1}for(;this._FBU.rects>0;){if(null===this._FBU.encoding){if(this._sock.rQwait("rect header",12))return!1;const t=this._sock.rQshiftBytes(12);this._FBU.x=(t[0]<<8)+t[1],this._FBU.y=(t[2]<<8)+t[3],this._FBU.width=(t[4]<<8)+t[5],this._FBU.height=(t[6]<<8)+t[7],this._FBU.encoding=parseInt((t[8]<<24)+(t[9]<<16)+(t[10]<<8)+t[11],10)}if(!this._handleRect())return!1;this._FBU.rects--,this._FBU.encoding=null}return this._display.flip(),!0}_handleRect(){switch(this._FBU.encoding){case sa:return this._FBU.rects=1,!0;case da:return this._handleVMwareCursor();case ia:return this._handleCursor();case na:try{void 0!==document.createEvent("keyboardEvent").code&&(this._qemuExtKeyEventSupported=!0)}catch(ee){}return!0;case ra:return this._handleDesktopName();case ea:return this._resize(this._FBU.width,this._FBU.height),!0;case aa:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}_handleVMwareCursor(){const t=this._FBU.x,e=this._FBU.y,s=this._FBU.width,i=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;const n=this._sock.rQshift8();let r;this._sock.rQshift8();if(0==n){const t=-256;if(r=new Array(s*i*4),this._sock.rQwait("VMware cursor classic encoding",s*i*4*2,2))return!1;let e=new Array(s*i);for(let r=0;r<s*i;r++)e[r]=this._sock.rQshift32();let n=new Array(s*i);for(let r=0;r<s*i;r++)n[r]=this._sock.rQshift32();for(let a=0;a<s*i;a++)if(0==e[a]){let t=n[a],e=t>>8&255,s=t>>16&255,i=t>>24&255;r[4*a]=e,r[4*a+1]=s,r[4*a+2]=i,r[4*a+3]=255}else(e[a]&t)==t?0==n[a]?(r[4*a]=0,r[4*a+1]=0,r[4*a+2]=0,r[4*a+3]=0):(n[a],r[4*a]=0,r[4*a+1]=0,r[4*a+2]=0,r[4*a+3]=255):(r[4*a]=0,r[4*a+1]=0,r[4*a+2]=0,r[4*a+3]=255)}else{if(1!=n)return h("The given cursor type is not supported: "+n+" given."),!1;if(this._sock.rQwait("VMware cursor alpha encoding",s*i*4,2))return!1;r=new Array(s*i*4);for(let t=0;t<s*i;t++){let e=this._sock.rQshift32();r[4*t]=e>>24&255,r[4*t+1]=e>>16&255,r[4*t+2]=e>>8&255,r[4*t+3]=255&e}}return this._updateCursor(r,t,e,s,i),!0}_handleCursor(){const t=this._FBU.x,e=this._FBU.y,s=this._FBU.width,i=this._FBU.height,n=s*i*4,r=Math.ceil(s/8)*i;let a=n+r;if(this._sock.rQwait("cursor encoding",a))return!1;const h=this._sock.rQshiftBytes(n),o=this._sock.rQshiftBytes(r);let l=new Uint8Array(s*i*4),c=0;for(let d=0;d<i;d++)for(let t=0;t<s;t++){let e=o[d*Math.ceil(s/8)+Math.floor(t/8)]<<t%8&128?255:0;l[c]=h[c+2],l[c+1]=h[c+1],l[c+2]=h[c],l[c+3]=e,c+=4}return this._updateCursor(l,t,e,s,i),!0}_handleDesktopName(){if(this._sock.rQwait("DesktopName",4))return!1;let t=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",t,4))return!1;let e=this._sock.rQshiftStr(t);return e=l(e,!0),this._setDesktopName(e),!0}_handleExtendedDesktopSize(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;const t=this._sock.rQpeek8();let e=4+16*t;if(this._sock.rQwait("ExtendedDesktopSize",e))return!1;const s=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,s&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(let i=0;i<t;i+=1)0===i?(this._screenID=this._sock.rQshiftBytes(4),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._screenFlags=this._sock.rQshiftBytes(4)):this._sock.rQskipBytes(16);if(1===this._FBU.x&&0!==this._FBU.y){let t="";switch(this._FBU.y){case 1:t="Resize is administratively prohibited";break;case 2:t="Out of resources";break;case 3:t="Invalid screen layout";break;default:t="Unknown reason"}h("Server did not accept the resize request: "+t)}else this._resize(this._FBU.width,this._FBU.height);return!0}_handleDataRect(){let t=this._decoders[this._FBU.encoding];if(!t)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return t.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(ee){return this._fail("Error decoding rect: "+ee),!1}}_updateContinuousUpdates(){this._enabledContinuousUpdates&&Sa.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}_resize(t,e){this._fbWidth=t,this._fbHeight=e,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}_xvpOp(t,e){this._rfbXvpVer<t||(a("Sending XVP operation "+e+" (version "+t+")"),Sa.messages.xvpOp(this._sock,t,e))}_updateCursor(t,e,s,i,n){this._cursorImage={rgbaPixels:t,hotx:e,hoty:s,w:i,h:n},this._refreshCursor()}_shouldShowDotCursor(){if(!this._showDotCursor)return!1;for(let t=3;t<this._cursorImage.rgbaPixels.length;t+=4)if(this._cursorImage.rgbaPixels[t])return!1;return!0}_refreshCursor(){if("connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState)return;const t=this._shouldShowDotCursor()?Sa.cursors.dot:this._cursorImage;this._cursor.change(t.rgbaPixels,t.hotx,t.hoty,t.w,t.h)}static genDES(t,e){const s=t.split("").map((t=>t.charCodeAt(0)));return new Yr(s).encrypt(e)}}Sa.messages={keyEvent(t,e,s){const i=t._sQ,n=t._sQlen;i[n]=4,i[n+1]=s,i[n+2]=0,i[n+3]=0,i[n+4]=e>>24,i[n+5]=e>>16,i[n+6]=e>>8,i[n+7]=e,t._sQlen+=8,t.flush()},QEMUExtendedKeyEvent(t,e,s,i){const n=t._sQ,r=t._sQlen;n[r]=255,n[r+1]=0,n[r+2]=s>>8,n[r+3]=s,n[r+4]=e>>24,n[r+5]=e>>16,n[r+6]=e>>8,n[r+7]=e;const a=function(t){const e=255&i;return 224===i>>8&&e<127?128|e:t}(i);n[r+8]=a>>24,n[r+9]=a>>16,n[r+10]=a>>8,n[r+11]=a,t._sQlen+=12,t.flush()},pointerEvent(t,e,s,i){const n=t._sQ,r=t._sQlen;n[r]=5,n[r+1]=i,n[r+2]=e>>8,n[r+3]=e,n[r+4]=s>>8,n[r+5]=s,t._sQlen+=6,t.flush()},_buildExtendedClipboardFlags(t,e){let s=new Uint8Array(4),i=0,n=0;for(let r=0;r<t.length;r++)n|=t[r];for(let r=0;r<e.length;r++)i|=e[r];return s[0]=n>>24,s[1]=0,s[2]=0,s[3]=i,s},extendedClipboardProvide(t,e,s){let i=new we,n=[];for(let h=0;h<e.length;h++){if(1!=e[h])throw new Error("Unsupported extended clipboard format for Provide message.");s[h]=s[h].replace(/\r\n|\r|\n/gm,"\r\n");let t=c(s[h]+"\0");n.push(t.length>>24&255,t.length>>16&255,t.length>>8&255,255&t.length);for(let e=0;e<t.length;e++)n.push(t.charCodeAt(e))}let r=i.deflate(new Uint8Array(n)),a=new Uint8Array(4+r.length);a.set(Sa.messages._buildExtendedClipboardFlags([xa],e)),a.set(r,4),Sa.messages.clientCutText(t,a,!0)},extendedClipboardNotify(t,e){let s=Sa.messages._buildExtendedClipboardFlags([Ca],e);Sa.messages.clientCutText(t,s,!0)},extendedClipboardRequest(t,e){let s=Sa.messages._buildExtendedClipboardFlags([ka],e);Sa.messages.clientCutText(t,s,!0)},extendedClipboardCaps(t,e,s){let i=Object.keys(s),n=new Uint8Array(4+4*i.length);i.map((t=>parseInt(t))),i.sort(((t,e)=>t-e)),n.set(Sa.messages._buildExtendedClipboardFlags(e,[]));let r=4;for(let a=0;a<i.length;a++)n[r]=s[i[a]]>>24,n[r+1]=s[i[a]]>>16,n[r+2]=s[i[a]]>>8,n[r+3]=s[i[a]]>>0,r+=4,n[3]|=1<<i[a];Sa.messages.clientCutText(t,n,!0)},clientCutText(t,e,s=!1){const i=t._sQ,n=t._sQlen;let r;i[n]=6,i[n+1]=0,i[n+2]=0,i[n+3]=0,r=s?-e.length>>>0:e.length,i[n+4]=r>>24,i[n+5]=r>>16,i[n+6]=r>>8,i[n+7]=r,t._sQlen+=8;let a=0,h=e.length;for(;h>0;){let s=Math.min(h,t._sQbufferSize-t._sQlen);for(let n=0;n<s;n++)i[t._sQlen+n]=e[a+n];t._sQlen+=s,t.flush(),h-=s,a+=s}},setDesktopSize(t,e,s,i,n){const r=t._sQ,a=t._sQlen;r[a]=251,r[a+1]=0,r[a+2]=e>>8,r[a+3]=e,r[a+4]=s>>8,r[a+5]=s,r[a+6]=1,r[a+7]=0,r[a+8]=i>>24,r[a+9]=i>>16,r[a+10]=i>>8,r[a+11]=i,r[a+12]=0,r[a+13]=0,r[a+14]=0,r[a+15]=0,r[a+16]=e>>8,r[a+17]=e,r[a+18]=s>>8,r[a+19]=s,r[a+20]=n>>24,r[a+21]=n>>16,r[a+22]=n>>8,r[a+23]=n,t._sQlen+=24,t.flush()},clientFence(t,e,s){const i=t._sQ,n=t._sQlen;i[n]=248,i[n+1]=0,i[n+2]=0,i[n+3]=0,i[n+4]=e>>24,i[n+5]=e>>16,i[n+6]=e>>8,i[n+7]=e;const r=s.length;i[n+8]=r;for(let a=0;a<r;a++)i[n+9+a]=s.charCodeAt(a);t._sQlen+=9+r,t.flush()},enableContinuousUpdates(t,e,s,i,n,r){const a=t._sQ,h=t._sQlen;a[h]=150,a[h+1]=e,a[h+2]=s>>8,a[h+3]=s,a[h+4]=i>>8,a[h+5]=i,a[h+6]=n>>8,a[h+7]=n,a[h+8]=r>>8,a[h+9]=r,t._sQlen+=10,t.flush()},pixelFormat(t,e,s){const i=t._sQ,n=t._sQlen;let r;r=e>16?32:e>8?16:8;const a=Math.floor(e/3);i[n]=0,i[n+1]=0,i[n+2]=0,i[n+3]=0,i[n+4]=r,i[n+5]=e,i[n+6]=0,i[n+7]=s?1:0,i[n+8]=0,i[n+9]=(1<<a)-1,i[n+10]=0,i[n+11]=(1<<a)-1,i[n+12]=0,i[n+13]=(1<<a)-1,i[n+14]=2*a,i[n+15]=1*a,i[n+16]=0*a,i[n+17]=0,i[n+18]=0,i[n+19]=0,t._sQlen+=20,t.flush()},clientEncodings(t,e){const s=t._sQ,i=t._sQlen;s[i]=2,s[i+1]=0,s[i+2]=e.length>>8,s[i+3]=e.length;let n=i+4;for(let r=0;r<e.length;r++){const t=e[r];s[n]=t>>24,s[n+1]=t>>16,s[n+2]=t>>8,s[n+3]=t,n+=4}t._sQlen+=n-i,t.flush()},fbUpdateRequest(t,e,s,i,n,r){const a=t._sQ,h=t._sQlen;"undefined"===typeof s&&(s=0),"undefined"===typeof i&&(i=0),a[h]=3,a[h+1]=e?1:0,a[h+2]=s>>8&255,a[h+3]=255&s,a[h+4]=i>>8&255,a[h+5]=255&i,a[h+6]=n>>8&255,a[h+7]=255&n,a[h+8]=r>>8&255,a[h+9]=255&r,t._sQlen+=10,t.flush()},xvpOp(t,e,s){const i=t._sQ,n=t._sQlen;i[n]=250,i[n+1]=0,i[n+2]=e,i[n+3]=s,t._sQlen+=4,t.flush()}},Sa.cursors={none:{rgbaPixels:new Uint8Array,w:0,h:0,hotx:0,hoty:0},dot:{rgbaPixels:new Uint8Array([255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,255,255,255,255]),w:3,h:3,hotx:1,hoty:1}}},2203:function(){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");const s=Object(t);for(let i=1;i<arguments.length;i++){const t=arguments[i];if(null!=t)for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=t[e])}return s},writable:!0,configurable:!0}),(()=>{function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};const s=document.createEvent("CustomEvent");return s.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),s}t.prototype=window.Event.prototype,"function"!==typeof window.CustomEvent&&(window.CustomEvent=t)})(),Number.isInteger=Number.isInteger||function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t}}}]); |