Local modifications to ClusterLabs/Anvil by Alteeve
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
136 KiB

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[460],{4460:function(t,e,s){function i(t){return 0|t}s.d(e,{Z:function(){return Sa}});let n="warn",r=()=>{},a=()=>{},o=()=>{},h=()=>{};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=o=h=()=>{},"undefined"!==typeof window.console)switch(t){case"debug":r=console.debug.bind(window.console);case"info":a=console.info.bind(window.console);case"warn":o=console.warn.bind(window.console);case"error":h=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 _=10*(window.devicePixelRatio||1),u=!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"),u=!0):o("Data URI scheme cursor not supported")}catch(Qa){h("Data URI scheme cursor test exception: "+Qa)}const f=u;let p=!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),p=0!=s}catch(Qa){h("Scrollbar test exception: "+Qa)}function g(){return navigator&&!!/mac/i.exec(navigator.platform)}function m(){return navigator&&!!/win/i.exec(navigator.platform)}function w(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function b(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 v(t){t.stopPropagation(),t.preventDefault()}let k=!1,y=null;function C(t){if(k)return;const e=new t.constructor(t.type,t);k=!0,document.captureElement?document.captureElement.dispatchEvent(e):y.dispatchEvent(e),k=!1,t.stopPropagation(),e.defaultPrevented&&t.preventDefault(),"mouseup"===t.type&&Q()}function x(){document.getElementById("noVNC_mouse_capture_elem").style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;const S=new MutationObserver(x);function Q(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;y=document.captureElement,document.captureElement=null,S.disconnect();document.getElementById("noVNC_mouse_capture_elem").style.display="none",window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",C)}}var M={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 o=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[o++]=a>>r&255),a&=(1<<r)-1)):h("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 E{constructor(t){if(this._drawCtx=null,this._renderQ=[],this._flushing=!1,this._fbWidth=0,this._fbHeight=0,this._prevDrawStyle="",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");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),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,"+M.encode(r),this._renderQPush({type:"img",img:a,x:t,y:e,width:s,height:i})}blitImage(t,e,s,i,n,r,a){if(0===this._renderQ.length||a){let a=new Uint8ClampedArray(n.buffer,n.byteOffset+r,s*i*4),o=new ImageData(a,s,i);this._drawCtx.putImageData(o,t,e),this._damage(t,e,s,i)}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})}}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[0]+","+t[1]+","+t[2]+")";e!==this._prevDrawStyle&&(this._drawCtx.fillStyle=e,this._prevDrawStyle=e)}_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"img":if(e.img.complete){if(e.img.width!==e.width||e.img.height!==e.height)return void h("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 A(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 T=Uint8Array,F=Uint16Array,L=Int32Array;function B(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 D(){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}D();function z(t,e){var s,i,n,r,a,o,h,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),o=r+(t.avail_out-257),h=s.dmax,l=s.wsize,c=s.whave,d=s.wnext,_=s.window,u=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&&(u+=S[i++]<<f,f+=8,u+=S[i++]<<f,f+=8),b=p[u&m];e:for(;;){if(u>>>=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)+(u&(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&&(u+=S[i++]<<f,f+=8),k+=u&(1<<v)-1,u>>>=v,f-=v),f<15&&(u+=S[i++]<<f,f+=8,u+=S[i++]<<f,f+=8),b=g[u&w];s:for(;;){if(u>>>=v=b>>>24,f-=v,!(16&(v=b>>>16&255))){if(0===(64&v)){b=g[(65535&b)+(u&(1<<v)-1)];continue s}t.msg="invalid distance code",s.mode=30;break t}if(y=65535&b,f<(v&=15)&&(u+=S[i++]<<f,(f+=8)<v&&(u+=S[i++]<<f,f+=8)),(y+=u&(1<<v)-1)>h){t.msg="invalid distance too far back",s.mode=30;break t}if(u>>>=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=_,0===d){if(C+=l-v,v<k){k-=v;do{Q[r++]=_[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++]=_[C++]}while(--v);if(C=0,d<k){k-=v=d;do{Q[r++]=_[C++]}while(--v);C=r-y,x=Q}}}else if(C+=d-v,v<k){k-=v;do{Q[r++]=_[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<o);i-=k=f>>3,u&=(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<o?o-r+257:257-(r-o),s.hold=u,s.bits=f}var U=15,R=[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],I=[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],N=[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],P=[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 V(t,e,s,i,n,r,a,o){var h,l,c,d,_,u,f,p,g,m=o.bits,w=0,b=0,v=0,k=0,y=0,C=0,x=0,S=0,Q=0,M=0,E=null,A=0,T=new F(16),L=new F(16),B=null,D=0;for(w=0;w<=U;w++)T[w]=0;for(b=0;b<i;b++)T[e[s+b]]++;for(y=m,k=U;k>=1&&0===T[k];k--);if(y>k&&(y=k),0===k)return n[r++]=20971520,n[r++]=20971520,o.bits=1,0;for(v=1;v<k&&0===T[v];v++);for(y<v&&(y=v),S=1,w=1;w<=U;w++)if(S<<=1,(S-=T[w])<0)return-1;if(S>0&&(0===t||1!==k))return-1;for(L[1]=0,w=1;w<U;w++)L[w+1]=L[w]+T[w];for(b=0;b<i;b++)0!==e[s+b]&&(a[L[e[s+b]]++]=b);if(0===t?(E=B=a,u=19):1===t?(E=R,A-=257,B=I,D-=257,u=256):(E=N,B=P,u=-1),M=0,b=0,w=v,_=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]<u?(p=0,g=a[b]):a[b]>u?(p=B[D+a[b]],g=E[A+a[b]]):(p=96,g=0),h=1<<w-x,v=l=1<<C;do{n[_+(M>>x)+(l-=h)]=f<<24|p<<16|g|0}while(0!==l);for(h=1<<w-1;M&h;)h>>=1;if(0!==h?(M&=h-1,M+=h):M=0,b++,0===--T[w]){if(w===k)break;w=e[s+a[b]]}if(w>y&&(M&d)!==c){for(0===x&&(x=y),_+=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=M&d]=y<<24|C<<16|_-r|0}}return 0!==M&&(n[_+M]=w-x<<24|64<<16|0),o.bits=y,0}const H=-2;var K=12,X=30;function O(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function G(){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 F(320),this.work=new F(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function W(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 L(852),e.distcode=e.distdyn=new L(592),e.sane=1,e.back=-1,0):H}(t)):H}function Y(t,e){var s,i;return t?(i=new G,t.state=i,i.window=null,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)?H:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=s,i.wbits=e,W(t))):H}(t,e),0!==s&&(t.state=null),s):H}var q,j,Z=!0;function J(t){if(Z){var e;for(q=new L(512),j=new L(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(V(1,t.lens,0,288,q,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;V(2,t.lens,0,32,j,0,t.work,{bits:5}),Z=!1}t.lencode=q,t.lenbits=9,t.distcode=j,t.distbits=5}function $(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 T(r.wsize)),i>=r.wsize?(A(r.window,e,s-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),A(r.window,e,s-i,n,r.wnext),(i-=n)?(A(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 tt(){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 et{constructor(){var t;this.strm=new tt,this.chunkSize=102400,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,t=this.strm,this.windowBits,Y(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,o,h,l,c,d,_,u,f,p,g,m,w,b,v,k,y,C,x,S,Q=0,M=new T(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 H;(s=t.state).mode===K&&(s.mode=13),a=t.next_out,n=t.output,h=t.avail_out,r=t.next_in,i=t.input,o=t.avail_in,l=s.hold,c=s.bits,d=o,_=h,C=0;t:for(;;)switch(s.mode){case 1:if(0===s.wrap){s.mode=13;break}for(;c<16;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}if(2&s.wrap&&35615===l){s.check=0,M[0]=255&l,M[1]=l>>>8&255,s.check=D(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=X;break}if(8!==(15&l)){t.msg="unknown compression method",s.mode=X;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=X;break}s.dmax=1<<y,t.adler=s.check=1,s.mode=512&l?10:K,l=0,c=0;break;case 2:for(;c<16;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}if(s.flags=l,8!==(255&s.flags)){t.msg="unknown compression method",s.mode=X;break}if(57344&s.flags){t.msg="unknown header flags set",s.mode=X;break}s.head&&(s.head.text=l>>8&1),512&s.flags&&(M[0]=255&l,M[1]=l>>>8&255,s.check=D(s.check)),l=0,c=0,s.mode=3;case 3:for(;c<32;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}s.head&&(s.head.time=l),512&s.flags&&(M[0]=255&l,M[1]=l>>>8&255,M[2]=l>>>16&255,M[3]=l>>>24&255,s.check=D(s.check)),l=0,c=0,s.mode=4;case 4:for(;c<16;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}s.head&&(s.head.xflags=255&l,s.head.os=l>>8),512&s.flags&&(M[0]=255&l,M[1]=l>>>8&255,s.check=D(s.check)),l=0,c=0,s.mode=5;case 5:if(1024&s.flags){for(;c<16;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}s.length=l,s.head&&(s.head.extra_len=l),512&s.flags&&(M[0]=255&l,M[1]=l>>>8&255,s.check=D(s.check)),l=0,c=0}else s.head&&(s.head.extra=null);s.mode=6;case 6:if(1024&s.flags&&((u=s.length)>o&&(u=o),u&&(s.head&&(y=s.head.extra_len-s.length,s.head.extra||(s.head.extra=new Array(s.head.extra_len)),A(s.head.extra,i,r,u,y)),512&s.flags&&(s.check=D(s.check)),o-=u,r+=u,s.length-=u),s.length))break t;s.length=0,s.mode=7;case 7:if(2048&s.flags){if(0===o)break t;u=0;do{y=i[r+u++],s.head&&y&&s.length<65536&&(s.head.name+=String.fromCharCode(y))}while(y&&u<o);if(512&s.flags&&(s.check=D(s.check)),o-=u,r+=u,y)break t}else s.head&&(s.head.name=null);s.length=0,s.mode=8;case 8:if(4096&s.flags){if(0===o)break t;u=0;do{y=i[r+u++],s.head&&y&&s.length<65536&&(s.head.comment+=String.fromCharCode(y))}while(y&&u<o);if(512&s.flags&&(s.check=D(s.check)),o-=u,r+=u,y)break t}else s.head&&(s.head.comment=null);s.mode=9;case 9:if(512&s.flags){for(;c<16;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}if(l!==(65535&s.check)){t.msg="header crc mismatch",s.mode=X;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=K;break;case 10:for(;c<32;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}t.adler=s.check=O(l),l=0,c=0,s.mode=11;case 11:if(0===s.havedict)return t.next_out=a,t.avail_out=h,t.next_in=r,t.avail_in=o,s.hold=l,s.bits=c,2;t.adler=s.check=1,s.mode=K;case K: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===o)break t;o--,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(J(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=X}l>>>=2,c-=2;break;case 14:for(l>>>=7&c,c-=7&c;c<32;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}if((65535&l)!==(l>>>16^65535)){t.msg="invalid stored block lengths",s.mode=X;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(u=s.length){if(u>o&&(u=o),u>h&&(u=h),0===u)break t;A(n,i,r,u,a),o-=u,r+=u,h-=u,a+=u,s.length-=u;break}s.mode=K;break;case 17:for(;c<14;){if(0===o)break t;o--,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=X;break}s.have=0,s.mode=18;case 18:for(;s.have<s.ncode;){for(;c<3;){if(0===o)break t;o--,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=V(0,s.lens,0,19,s.lencode,0,s.work,x),s.lenbits=x.bits,C){t.msg="invalid code lengths set",s.mode=X;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===o)break t;o--,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===o)break t;o--,l+=i[r++]<<c,c+=8}if(l>>>=g,c-=g,0===s.have){t.msg="invalid bit length repeat",s.mode=X;break}y=s.lens[s.have-1],u=3+(3&l),l>>>=2,c-=2}else if(17===w){for(S=g+3;c<S;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}c-=g,y=0,u=3+(7&(l>>>=g)),l>>>=3,c-=3}else{for(S=g+7;c<S;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}c-=g,y=0,u=11+(127&(l>>>=g)),l>>>=7,c-=7}if(s.have+u>s.nlen+s.ndist){t.msg="invalid bit length repeat",s.mode=X;break}for(;u--;)s.lens[s.have++]=y}}if(s.mode===X)break;if(0===s.lens[256]){t.msg="invalid code -- missing end-of-block",s.mode=X;break}if(s.lenbits=9,x={bits:s.lenbits},C=V(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=X;break}if(s.distbits=6,s.distcode=s.distdyn,x={bits:s.distbits},C=V(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=X;break}if(s.mode=20,6===e)break t;case 20:s.mode=21;case 21:if(o>=6&&h>=258){t.next_out=a,t.avail_out=h,t.next_in=r,t.avail_in=o,s.hold=l,s.bits=c,z(t,_),a=t.next_out,n=t.output,h=t.avail_out,r=t.next_in,i=t.input,o=t.avail_in,l=s.hold,c=s.bits,s.mode===K&&(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===o)break t;o--,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===o)break t;o--,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=K;break}if(64&m){t.msg="invalid literal/length code",s.mode=X;break}s.extra=15&m,s.mode=22;case 22:if(s.extra){for(S=s.extra;c<S;){if(0===o)break t;o--,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===o)break t;o--,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===o)break t;o--,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=X;break}s.offset=w,s.extra=15&m,s.mode=24;case 24:if(s.extra){for(S=s.extra;c<S;){if(0===o)break t;o--,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=X;break}s.mode=25;case 25:if(0===h)break t;if(u=_-h,s.offset>u){if((u=s.offset-u)>s.whave&&s.sane){t.msg="invalid distance too far back",s.mode=X;break}u>s.wnext?(u-=s.wnext,f=s.wsize-u):f=s.wnext-u,u>s.length&&(u=s.length),p=s.window}else p=n,f=a-s.offset,u=s.length;u>h&&(u=h),h-=u,s.length-=u;do{n[a++]=p[f++]}while(--u);0===s.length&&(s.mode=21);break;case 26:if(0===h)break t;n[a++]=s.length,h--,s.mode=21;break;case 27:if(s.wrap){for(;c<32;){if(0===o)break t;o--,l|=i[r++]<<c,c+=8}if(_-=h,t.total_out+=_,s.total+=_,_&&(t.adler=s.check=s.flags?D(s.check):B(s.check,n,_,a-_)),_=h,(s.flags?l:O(l))!==s.check){t.msg="incorrect data check",s.mode=X;break}l=0,c=0}s.mode=28;case 28:if(s.wrap&&s.flags){for(;c<32;){if(0===o)break t;o--,l+=i[r++]<<c,c+=8}if(l!==(4294967295&s.total)){t.msg="incorrect length check",s.mode=X;break}l=0,c=0}s.mode=29;case 29:C=1;break t;case X:C=-3;break t;case 31:return-4;default:return H}return t.next_out=a,t.avail_out=h,t.next_in=r,t.avail_in=o,s.hold=l,s.bits=c,(s.wsize||_!==t.avail_out&&s.mode<X&&(s.mode<27||4!==e))&&$(t,t.output,t.next_out,_-t.avail_out)?(s.mode=31,-4):(d-=t.avail_in,_-=t.avail_out,t.total_in+=d,t.total_out+=_,s.total+=_,s.wrap&&_&&(t.adler=s.check=s.flags?D(s.check,t.next_out):B(s.check,n,_,t.next_out-_)),t.data_type=s.bits+(s.last?64:0)+(s.mode===K?128:0)+(20===s.mode||15===s.mode?256:0),(0===d&&0===_||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(){W(this.strm)}}function st(t){for(var e=t.length;--e>=0;)t[e]=0}var it=256,nt=286,rt=30,at=15,ot=[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],ht=[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],lt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ct=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],dt=new Array(576);st(dt);var _t=new Array(60);st(_t);var ut=new Array(512);st(ut);var ft=new Array(256);st(ft);var pt=new Array(29);st(pt);var gt,mt,wt,bt=new Array(rt);function vt(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 kt(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function yt(t){return t<256?ut[t]:ut[256+(t>>>7)]}function Ct(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function xt(t,e,s){t.bi_valid>16-s?(t.bi_buf|=e<<t.bi_valid&65535,Ct(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 St(t,e,s){xt(t,s[2*e],s[2*e+1])}function Qt(t,e){var s=0;do{s|=1&t,t>>>=1,s<<=1}while(--e>0);return s>>>1}function Mt(t,e,s){var i,n,r=new Array(16),a=0;for(i=1;i<=at;i++)r[i]=a=a+s[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=Qt(r[o]++,o))}}function Et(t){var e;for(e=0;e<nt;e++)t.dyn_ltree[2*e]=0;for(e=0;e<rt;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 At(t){t.bi_valid>8?Ct(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 Tt(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 Ft(t,e,s){for(var i=t.heap[s],n=s<<1;n<=t.heap_len&&(n<t.heap_len&&Tt(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!Tt(e,i,t.heap[n],t.depth));)t.heap[s]=t.heap[n],s=n,n<<=1;t.heap[s]=i}function Lt(t,e,s){var i,n,r,a,o=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],n=t.pending_buf[t.l_buf+o],o++,0===i?St(t,n,e):(St(t,(r=ft[n])+it+1,e),0!==(a=ot[r])&&xt(t,n-=pt[r],a),St(t,r=yt(--i),s),0!==(a=ht[r])&&xt(t,i-=bt[r],a))}while(o<t.last_lit);St(t,256,e)}function Bt(t,e){var s,i,n,r=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,h=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<h;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--,o&&(t.static_len-=a[2*n+1]);for(e.max_code=l,s=t.heap_len>>1;s>=1;s--)Ft(t,r,s);n=h;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Ft(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++,Ft(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,o,h=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,d=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,f=e.stat_desc.max_length,p=0;for(r=0;r<=at;r++)t.bl_count[r]=0;for(h[2*t.heap[t.heap_max]+1]=0,s=t.heap_max+1;s<573;s++)(r=h[2*h[2*(i=t.heap[s])+1]+1]+1)>f&&(r=f,p++),h[2*i+1]=r,i>l||(t.bl_count[r]++,a=0,i>=u&&(a=_[i-u]),o=h[2*i],t.opt_len+=o*(r+a),d&&(t.static_len+=o*(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||(h[2*n+1]!==r&&(t.opt_len+=(r-h[2*n+1])*h[2*n],h[2*n+1]=r),i--)}}(t,e),Mt(r,l,t.bl_count)}function Dt(t,e,s){var i,n,r=-1,a=e[1],o=0,h=7,l=4;for(0===a&&(h=138,l=3),e[2*(s+1)+1]=65535,i=0;i<=s;i++)n=a,a=e[2*(i+1)+1],++o<h&&n===a||(o<l?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=n,0===a?(h=138,l=3):n===a?(h=6,l=3):(h=7,l=4))}function zt(t,e,s){var i,n,r=-1,a=e[1],o=0,h=7,l=4;for(0===a&&(h=138,l=3),i=0;i<=s;i++)if(n=a,a=e[2*(i+1)+1],!(++o<h&&n===a)){if(o<l)do{St(t,n,t.bl_tree)}while(0!==--o);else 0!==n?(n!==r&&(St(t,n,t.bl_tree),o--),St(t,16,t.bl_tree),xt(t,o-3,2)):o<=10?(St(t,17,t.bl_tree),xt(t,o-3,3)):(St(t,18,t.bl_tree),xt(t,o-11,7));o=0,r=n,0===a?(h=138,l=3):n===a?(h=6,l=3):(h=7,l=4)}}st(bt);var Ut=!1;function Rt(t){Ut||(!function(){var t,e,s,i,n,r=new Array(16);for(s=0,i=0;i<28;i++)for(pt[i]=s,t=0;t<1<<ot[i];t++)ft[s++]=i;for(ft[s-1]=i,n=0,i=0;i<16;i++)for(bt[i]=n,t=0;t<1<<ht[i];t++)ut[n++]=i;for(n>>=7;i<rt;i++)for(bt[i]=n<<7,t=0;t<1<<ht[i]-7;t++)ut[256+n++]=i;for(e=0;e<=at;e++)r[e]=0;for(t=0;t<=143;)dt[2*t+1]=8,t++,r[8]++;for(;t<=255;)dt[2*t+1]=9,t++,r[9]++;for(;t<=279;)dt[2*t+1]=7,t++,r[7]++;for(;t<=287;)dt[2*t+1]=8,t++,r[8]++;for(Mt(dt,287,r),t=0;t<rt;t++)_t[2*t+1]=5,_t[2*t]=Qt(t,5);gt=new vt(dt,ot,257,nt,at),mt=new vt(_t,ht,0,rt,at),wt=new vt(new Array(0),lt,0,19,7)}(),Ut=!0),t.l_desc=new kt(t.dyn_ltree,gt),t.d_desc=new kt(t.dyn_dtree,mt),t.bl_desc=new kt(t.bl_tree,wt),t.bi_buf=0,t.bi_valid=0,Et(t)}function It(t,e,s,i){xt(t,0+(i?1:0),3),function(t,e,s,i){At(t),i&&(Ct(t,s),Ct(t,~s)),A(t.pending_buf,t.window,e,s,t.pending),t.pending+=s}(t,e,s,!0)}function Nt(t){xt(t,2,3),St(t,256,dt),function(t){16===t.bi_valid?(Ct(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 Pt(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<it;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),Bt(t,t.l_desc),Bt(t,t.d_desc),a=function(t){var e;for(Dt(t,t.dyn_ltree,t.l_desc.max_code),Dt(t,t.dyn_dtree,t.d_desc.max_code),Bt(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*ct[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?It(t,e,s,i):4===t.strategy||r===n?(xt(t,2+(i?1:0),3),Lt(t,dt,_t)):(xt(t,4+(i?1:0),3),function(t,e,s,i){var n;for(xt(t,e-257,5),xt(t,s-1,5),xt(t,i-4,4),n=0;n<i;n++)xt(t,t.bl_tree[2*ct[n]+1],3);zt(t,t.dyn_ltree,e-1),zt(t,t.dyn_dtree,s-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),Lt(t,t.dyn_ltree,t.dyn_dtree)),Et(t),i&&At(t)}function Vt(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*(ft[s]+it+1)]++,t.dyn_dtree[2*yt(e)]++),t.last_lit===t.lit_bufsize-1}var Ht={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 Kt=-2;var Xt,Ot=258,Gt=262,Wt=103,Yt=113,qt=666;function jt(t,e){return t.msg=Ht[e],e}function Zt(t){return(t<<1)-(t>4?9:0)}function Jt(t){for(var e=t.length;--e>=0;)t[e]=0}function $t(t){var e=t.state,s=e.pending;s>t.avail_out&&(s=t.avail_out),0!==s&&(A(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 te(t,e){Pt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,$t(t.strm)}function ee(t,e){t.pending_buf[t.pending++]=e}function se(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function ie(t,e,s,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,A(e,t.input,t.next_in,n,s),1===t.state.wrap?t.adler=B(t.adler,e,n,s):2===t.state.wrap&&(t.adler=D(t.adler)),t.next_in+=n,t.total_in+=n,n)}function ne(t,e){var s,i,n=t.max_chain_length,r=t.strstart,a=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-Gt?t.strstart-(t.w_size-Gt):0,l=t.window,c=t.w_mask,d=t.prev,_=t.strstart+Ot,u=l[r+a-1],f=l[r+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(l[(s=e)+a]===f&&l[s+a-1]===u&&l[s]===l[r]&&l[++s]===l[r+1]){r+=2,s++;do{}while(l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&l[++r]===l[++s]&&r<_);if(i=Ot-(_-r),r=_-Ot,i>a){if(t.match_start=e,a=i,i>=o)break;u=l[r+a-1],f=l[r+a]}}}while((e=d[e&c])>h&&0!==--n);return a<=t.lookahead?a:t.lookahead}function re(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-Gt)){A(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=ie(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<Gt&&0!==t.strm.avail_in)}function ae(t,e){for(var s,i;;){if(t.lookahead<Gt){if(re(t),t.lookahead<Gt&&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-Gt&&(t.match_length=ne(t,s)),t.match_length>=3)if(i=Vt(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=Vt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2}function oe(t,e){for(var s,i,n;;){if(t.lookahead<Gt){if(re(t),t.lookahead<Gt&&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-Gt&&(t.match_length=ne(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=Vt(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&&(te(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=Vt(t,0,t.window[t.strstart-1]))&&te(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=Vt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2}function he(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 le(){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 F(1146),this.dyn_dtree=new F(122),this.bl_tree=new F(78),Jt(this.dyn_ltree),Jt(this.dyn_dtree),Jt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new F(16),this.heap=new F(573),Jt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new F(573),Jt(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 ce(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:Yt,t.adler=2===e.wrap?0:1,e.last_flush=0,Rt(e),0):jt(t,Kt)}(t);return 0===s&&((e=t.state).window_size=2*e.w_size,Jt(e.head),e.max_lazy_match=Xt[e.level].max_lazy,e.good_match=Xt[e.level].good_length,e.nice_match=Xt[e.level].nice_length,e.max_chain_length=Xt[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 de(t,e){return function(t,e,s,i,n,r){if(!t)return Kt;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 jt(t,Kt);8===i&&(i=9);var o=new le;return t.state=o,o.strm=t,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new T(2*o.w_size),o.head=new F(o.hash_size),o.prev=new F(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new T(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=r,o.method=s,ce(t)}(t,e,8,15,8,0)}function _e(t,e){var s,i,n,r;if(!t||!t.state||e>5||e<0)return t?jt(t,Kt):Kt;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===qt&&4!==e)return jt(t,0===t.avail_out?-5:Kt);if(i.strm=t,s=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,ee(i,31),ee(i,139),ee(i,8),i.gzhead?(ee(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)),ee(i,255&i.gzhead.time),ee(i,i.gzhead.time>>8&255),ee(i,i.gzhead.time>>16&255),ee(i,i.gzhead.time>>24&255),ee(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ee(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(ee(i,255&i.gzhead.extra.length),ee(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=D(t.adler,i.pending_buf,i.pending)),i.gzindex=0,i.status=69):(ee(i,0),ee(i,0),ee(i,0),ee(i,0),ee(i,0),ee(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ee(i,3),i.status=Yt);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=Yt,se(i,a),0!==i.strstart&&(se(i,t.adler>>>16),se(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=D(t.adler,i.pending_buf,i.pending)),$t(t),n=i.pending,i.pending!==i.pending_buf_size));)ee(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=D(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=D(t.adler,i.pending_buf,i.pending)),$t(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,ee(i,r)}while(0!==r);i.gzhead.hcrc&&i.pending>n&&(t.adler=D(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=D(t.adler,i.pending_buf,i.pending)),$t(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,ee(i,r)}while(0!==r);i.gzhead.hcrc&&i.pending>n&&(t.adler=D(t.adler,i.pending_buf,i.pending)),0===r&&(i.status=Wt)}else i.status=Wt;if(i.status===Wt&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&$t(t),i.pending+2<=i.pending_buf_size&&(ee(i,255&t.adler),ee(i,t.adler>>8&255),t.adler=0,i.status=Yt)):i.status=Yt),0!==i.pending){if($t(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&Zt(e)<=Zt(s)&&4!==e)return jt(t,-5);if(i.status===qt&&0!==t.avail_in)return jt(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&i.status!==qt){var o=2===i.strategy?function(t,e){for(var s;;){if(0===t.lookahead&&(re(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,s=Vt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,s&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(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<=Ot){if(re(t),t.lookahead<=Ot&&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+Ot;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=Ot-(r-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(s=Vt(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(s=Vt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),s&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2}(i,e):Xt[i.level].func(i,e);if(3!==o&&4!==o||(i.status=qt),1===o||3===o)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===o&&(1===e?Nt(i):5!==e&&(It(i,0,0,!1),3===e&&(Jt(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),$t(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(ee(i,255&t.adler),ee(i,t.adler>>8&255),ee(i,t.adler>>16&255),ee(i,t.adler>>24&255),ee(i,255&t.total_in),ee(i,t.total_in>>8&255),ee(i,t.total_in>>16&255),ee(i,t.total_in>>24&255)):(se(i,t.adler>>>16),se(i,65535&t.adler)),$t(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)}Xt=[new he(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(re(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,te(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-Gt&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(te(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(te(t,!1),t.strm.avail_out),1)})),new he(4,4,8,4,ae),new he(4,5,16,8,ae),new he(4,6,32,32,ae),new he(4,4,16,16,oe),new he(8,16,32,32,oe),new he(8,16,128,128,oe),new he(8,32,128,256,oe),new he(32,128,258,1024,oe),new he(32,258,258,4096,oe)];class ue{constructor(){this.strm=new tt,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,de(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=_e(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=_e(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 fe=65288,pe=65289,ge=65291,me=65293,we=65299,be=65300,ve=65307,ke=65535,ye=65312,Ce=65335,xe=65340,Se=65341,Qe=65342,Me=65313,Ee=65314,Ae=65315,Te=65316,Fe=65317,Le=65318,Be=65319,De=65320,ze=65321,Ue=65322,Re=65326,Ie=65328,Ne=65360,Pe=65361,Ve=65362,He=65363,Ke=65364,Xe=65365,Oe=65366,Ge=65367,We=65376,Ye=65377,qe=65378,je=65379,Ze=65381,Je=65382,$e=65383,ts=65384,es=65385,ss=65386,is=65406,ns=65407,rs=65408,as=65421,os=65429,hs=65430,ls=65431,cs=65432,ds=65433,_s=65434,us=65435,fs=65436,ps=65437,gs=65438,ms=65439,ws=65469,bs=65450,vs=65451,ks=65452,ys=65453,Cs=65454,xs=65455,Ss=65456,Qs=65457,Ms=65458,Es=65459,As=65460,Ts=65461,Fs=65462,Ls=65463,Bs=65464,Ds=65465,zs=65470,Us=65471,Rs=65472,Is=65473,Ns=65474,Ps=65475,Vs=65476,Hs=65477,Ks=65478,Xs=65479,Os=65480,Gs=65481,Ws=65482,Ys=65483,qs=65484,js=65485,Zs=65486,Js=65487,$s=65488,ti=65489,ei=65490,si=65491,ii=65492,ni=65493,ri=65494,ai=65495,oi=65496,hi=65497,li=65498,ci=65499,di=65500,_i=65501,ui=65502,fi=65503,pi=65504,gi=65505,mi=65506,wi=65507,bi=65508,vi=65509,ki=65511,yi=65512,Ci=65513,xi=65514,Si=65515,Qi=65516,Mi=65027,Ei=65032,Ai=65034,Ti=65036,Fi=65038,Li=32,Bi=42,Di=43,zi=44,Ui=45,Ri=46,Ii=47,Ni=48,Pi=49,Vi=50,Hi=51,Ki=52,Xi=53,Oi=54,Gi=55,Wi=56,Yi=57,qi=61,ji=65329,Zi=65332,Ji=65336,$i=269025026,tn=269025027,en=269025040,sn=269025041,nn=269025042,rn=269025043,an=269025044,on=269025045,hn=269025046,ln=269025047,cn=269025048,dn=269025049,_n=269025051,un=269025052,fn=269025053,pn=269025056,gn=269025057,mn=269025062,wn=269025063,bn=269025064,vn=269025065,kn=269025066,yn=269025067,Cn=269025068,xn=269025069,Sn=269025070,Qn=269025072,Mn=269025073,En=269025074,An=269025075,Tn=269025083,Fn=269025086,Ln=269025110,Bn=269025111,Dn=269025112,zn=269025116,Un=269025121,Rn=269025128,In=269025131,Nn=269025133,Pn=269025134,Vn=269025138,Hn=269025143,Kn=269025147,Xn=269025148,On=269025149,Gn=269025161,Wn=269025163,Yn=269025164,qn=269025167,jn=269025168,Zn=269025170,Jn=269025175,$n=269025177,tr=269025178,er=269025179,sr=269025192,ir=269025202,nr=269024802;const rr={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 ar={lookup(t){if(t>=32&&t<=255)return t;const e=rr[t];return void 0!==e?e:16777216|t}},or={8:"Backspace",9:"Tab",10:"NumpadClear",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"},hr={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 lr={};function cr(t,e){if(void 0===e)throw new Error('Undefined keysym for key "'+t+'"');if(t in lr)throw new Error('Duplicate entry for key "'+t+'"');lr[t]=[e,e,e,e]}function dr(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 lr)throw new Error('Duplicate entry for key "'+t+'"');lr[t]=[e,e,s,e]}function _r(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 lr)throw new Error('Duplicate entry for key "'+t+'"');lr[t]=[e,e,e,s]}dr("Alt",Ci,xi),cr("AltGraph",Mi),cr("CapsLock",vi),dr("Control",wi,bi),dr("Meta",Si,Qi),cr("NumLock",ns),cr("ScrollLock",be),dr("Shift",gi,mi),_r("Enter",me,as),cr("Tab",pe),_r(" ",Li,rs),_r("ArrowDown",Ke,ds),_r("ArrowLeft",Pe,hs),_r("ArrowRight",He,cs),_r("ArrowUp",Ve,ls),_r("End",Ge,fs),_r("Home",Ne,os),_r("PageDown",Oe,us),_r("PageUp",Xe,_s),cr("Backspace",fe),_r("Clear",ge,ps),cr("Copy",Bn),cr("Cut",Dn),_r("Delete",ke,ms),_r("Insert",je,gs),cr("Paste",Nn),cr("Redo",Je),cr("Undo",Ze),cr("Cancel",es),cr("ContextMenu",$e),cr("Escape",ve),cr("Execute",qe),cr("Find",ts),cr("Help",ss),cr("Pause",we),cr("Select",We),cr("ZoomIn",Wn),cr("ZoomOut",Yn),cr("BrightnessDown",tn),cr("BrightnessUp",$i),cr("Eject",Cn),cr("LogOff",Un),cr("Power",kn),cr("PowerOff",gn),cr("PrintScreen",Ye),cr("Hibernate",sr),cr("Standby",en),cr("WakeUp",yn),cr("AllCandidates",Se),cr("Alphanumeric",Ie),cr("CodeInput",Ce),cr("Compose",ye),cr("Convert",Ae),cr("GroupFirst",Ti),cr("GroupLast",Fi),cr("GroupNext",Ei),cr("GroupPrevious",Ai),cr("NonConvert",Ee),cr("PreviousCandidate",Qe),cr("SingleCandidate",xe),cr("HangulMode",ji),cr("HanjaMode",Zi),cr("JunjaMode",Ji),cr("Eisu",Ie),cr("Hankaku",ze),cr("Hiragana",Fe),cr("HiraganaKatakana",Be),cr("KanaMode",Re),cr("KanjiMode",Me),cr("Katakana",Le),cr("Romaji",Te),cr("Zenkaku",De),cr("ZenkakuHankaku",Ue),cr("F1",zs),cr("F2",Us),cr("F3",Rs),cr("F4",Is),cr("F5",Ns),cr("F6",Ps),cr("F7",Vs),cr("F8",Hs),cr("F9",Ks),cr("F10",Xs),cr("F11",Os),cr("F12",Gs),cr("F13",Ws),cr("F14",Ys),cr("F15",qs),cr("F16",js),cr("F17",Zs),cr("F18",Js),cr("F19",$s),cr("F20",ti),cr("F21",ei),cr("F22",si),cr("F23",ii),cr("F24",ni),cr("F25",ri),cr("F26",ai),cr("F27",oi),cr("F28",hi),cr("F29",li),cr("F30",ci),cr("F31",di),cr("F32",_i),cr("F33",ui),cr("F34",fi),cr("F35",pi),cr("Close",Ln),cr("MailForward",jn),cr("MailReply",Vn),cr("MailSend",Kn),cr("MediaFastForward",Jn),cr("MediaPause",Mn),cr("MediaPlay",an),cr("MediaRecord",un),cr("MediaRewind",Fn),cr("MediaStop",on),cr("MediaTrackNext",ln),cr("MediaTrackPrevious",hn),cr("New",Rn),cr("Open",In),cr("Print",Ye),cr("Save",Hn),cr("SpellCheck",Xn),cr("AudioVolumeDown",sn),cr("AudioVolumeUp",rn),cr("AudioVolumeMute",nn),cr("MicrophoneVolumeMute",ir),cr("LaunchApplication1",An),cr("LaunchApplication2",fn),cr("LaunchCalendar",pn),cr("LaunchMail",dn),cr("LaunchMediaPlayer",En),cr("LaunchMusicPlayer",Zn),cr("LaunchPhone",Pn),cr("LaunchScreenSaver",xn),cr("LaunchSpreadsheet",zn),cr("LaunchWebBrowser",Sn),cr("LaunchWebCam",qn),cr("LaunchWordProcessor",Gn),cr("BrowserBack",mn),cr("BrowserFavorites",Qn),cr("BrowserForward",wn),cr("BrowserHome",cn),cr("BrowserRefresh",vn),cr("BrowserSearch",_n),cr("BrowserStop",bn),cr("Dimmer",Tn),cr("MediaAudioTrack",er),cr("RandomToggle",$n),cr("SplitScreenToggle",On),cr("Subtitle",tr),cr("VideoModeNext",nr),_r("=",qi,ws),_r("+",Di,vs),_r("-",Ui,ys),_r("*",Bi,bs),_r("/",Ii,xs),_r(".",Ri,Cs),_r(",",zi,ks),_r("0",Ni,Ss),_r("1",Pi,Qs),_r("2",Vi,Ms),_r("3",Hi,Es),_r("4",Ki,As),_r("5",Xi,Ts),_r("6",Oi,Fs),_r("7",Gi,Ls),_r("8",Wi,Bs),_r("9",Yi,Ds);var ur=lr;function fr(t){if(t.code){switch(t.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return t.code}if(t.keyCode in or){let e=or[t.keyCode];if(g()&&"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 pr(t){const e=function(t){if(void 0!==t.key){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"}return"\0"===t.key&&"NumpadDecimal"===t.code?"Delete":t.key}const e=fr(t);return e in hr?hr[e]:t.charCode?String.fromCharCode(t.charCode):"Unidentified"}(t);if("Unidentified"===e)return null;if(e in ur){let s=t.location;if("Meta"===e&&0===s&&(s=2),"Clear"===e&&3===s){"NumLock"===fr(t)&&(s=0)}if((void 0===s||s>3)&&(s=0),"Meta"===e){let e=fr(t);if("AltLeft"===e)return ki;if("AltRight"===e)return yi}if("Clear"===e){if("NumLock"===fr(t))return ns}if(m())switch(e){case"Zenkaku":case"Hankaku":return Ue;case"Romaji":case"KanaMode":return Te}return ur[e][s]}if(1!==e.length)return null;const s=e.charCodeAt();return s?ar.lookup(s):null}class gr{constructor(t){this._target=t||null,this._keyDownList={},this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),blur:this._allKeysUp.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=fr(t);if("Unidentified"!==e)return e;if(t.keyCode&&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=pr(t);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===e&&t.timeStamp-this._altGrCtrlTime<50?s=Mi:this._sendKeyEvent(wi,"ControlLeft",!0)),"Unidentified"===e)return s&&(this._sendKeyEvent(s,e,!0),this._sendKeyEvent(s,e,!1)),void v(t);if(g()||w())switch(s){case Si:s=Ci;break;case Qi:s=Si;break;case Ci:s=is;break;case xi:s=Mi}if(e in this._keyDownList&&(s=this._keyDownList[e]),(g()||w())&&"CapsLock"===e)return this._sendKeyEvent(vi,"CapsLock",!0),this._sendKeyEvent(vi,"CapsLock",!1),void v(t);const i=[Ue,Ie,Le,Fe,Te];return m()&&i.includes(s)?(this._sendKeyEvent(s,e,!0),this._sendKeyEvent(s,e,!1),void v(t)):(v(t),"ControlLeft"===e&&m()&&!("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))}_handleKeyUp(t){v(t);const e=this._getKeyCode(t);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(wi,"ControlLeft",!0)),(g()||w())&&"CapsLock"===e)return this._sendKeyEvent(vi,"CapsLock",!0),void this._sendKeyEvent(vi,"CapsLock",!1);this._sendKeyEvent(this._keyDownList[e],e,!1),!m()||"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(wi,"ControlLeft",!0)}_allKeysUp(){r(">> Keyboard.allKeysUp");for(let t in this._keyDownList)this._sendKeyEvent(this._keyDownList[t],t,!1);r("<< Keyboard.allKeysUp")}grab(){this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),window.addEventListener("blur",this._eventHandlers.blur)}ungrab(){this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}const mr=32,wr=64;class br{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?wr:mr,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 mr:case wr:i=s.first}if(e.clientX=i.x,e.clientY=i.y,this._state===wr){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===mr)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 mr:return"twodrag";case wr: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 vr=!f||d;class kr{constructor(){this._target=null,this._canvas=document.createElement("canvas"),vr&&(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,vr){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(vr){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=this._canvas.getContext("2d");this._canvas.width=i,this._canvas.height=n;let a=new ImageData(new Uint8ClampedArray(t),i,n);if(r.clearRect(0,0,i,n),r.putImageData(a,0,0),vr)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(!vr)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 yr=41943040,Cr="connecting",xr="open",Sr="closing",Qr="closed",Mr={CONNECTING:[WebSocket.CONNECTING,Cr],OPEN:[WebSocket.OPEN,xr],CLOSING:[WebSocket.CLOSING,Sr],CLOSED:[WebSocket.CLOSED,Qr]},Er=["send","close","binaryType","onerror","onmessage","onopen","protocol","readyState"];class Ar{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 readyState(){let t;return null===this._websocket?"unused":(t=this._websocket.readyState,Mr.CONNECTING.includes(t)?"connecting":Mr.OPEN.includes(t)?"open":Mr.CLOSING.includes(t)?"closing":Mr.CLOSED.includes(t)?"closed":"unknown")}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&&"open"===this.readyState&&(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.attach(new WebSocket(t,e))}attach(t){this.init();const e=[...Object.keys(t),...Object.getOwnPropertyNames(Object.getPrototypeOf(t))];for(let s=0;s<Er.length;s++){const t=Er[s];if(e.indexOf(t)<0)throw new Error("Raw channel missing property: "+t)}this._websocket=t,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&&("connecting"!==this.readyState&&"open"!==this.readyState||(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>yr&&(this._rQbufferSize=yr,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.copyWithin(0,this._rQi,this._rQlen);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,Br,Dr,zr,Ur,Rr;Lr=65536,Br=1<<24,Dr=Lr|Br,zr=4,Ur=1024,Rr=zr|Ur;const Ir=[Dr|Ur,0,0|Lr,Dr|Rr,Dr|zr,Lr|Rr,0|zr,0|Lr,0|Ur,Dr|Ur,Dr|Rr,0|Ur,Br|Rr,Dr|zr,0|Br,0|zr,0|Rr,Br|Ur,Br|Ur,Lr|Ur,Lr|Ur,0|Dr,0|Dr,Br|Rr,Lr|zr,Br|zr,Br|zr,Lr|zr,0,0|Rr,Lr|Rr,0|Br,0|Lr,Dr|Rr,0|zr,0|Dr,Dr|Ur,0|Br,0|Br,0|Ur,Dr|zr,0|Lr,Lr|Ur,Br|zr,0|Ur,0|zr,Br|Rr,Lr|Rr,Dr|Rr,Lr|zr,0|Dr,Br|Rr,Br|zr,0|Rr,Lr|Rr,Dr|Ur,0|Rr,Br|Ur,Br|Ur,0,Lr|zr,Lr|Ur,0,Dr|zr];Lr=1<<20,Br=1<<31,Dr=Lr|Br,zr=32,Ur=32768,Rr=zr|Ur;const Nr=[Dr|Rr,Br|Ur,0|Ur,Lr|Rr,0|Lr,0|zr,Dr|zr,Br|Rr,Br|zr,Dr|Rr,Dr|Ur,0|Br,Br|Ur,0|Lr,0|zr,Dr|zr,Lr|Ur,Lr|zr,Br|Rr,0,0|Br,0|Ur,Lr|Rr,0|Dr,Lr|zr,Br|zr,0,Lr|Ur,0|Rr,Dr|Ur,0|Dr,0|Rr,0,Lr|Rr,Dr|zr,0|Lr,Br|Rr,0|Dr,Dr|Ur,0|Ur,0|Dr,Br|Ur,0|zr,Dr|Rr,Lr|Rr,0|zr,0|Ur,0|Br,0|Rr,Dr|Ur,0|Lr,Br|zr,Lr|zr,Br|Rr,Br|zr,Lr|zr,Lr|Ur,0,Br|Ur,0|Rr,0|Br,Dr|zr,Dr|Rr,Lr|Ur];Lr=1<<17,Br=1<<27,Dr=Lr|Br,zr=8,Ur=512,Rr=zr|Ur;const Pr=[0|Rr,Dr|Ur,0,Dr|zr,Br|Ur,0,Lr|Rr,Br|Ur,Lr|zr,Br|zr,Br|zr,0|Lr,Dr|Rr,Lr|zr,0|Dr,0|Rr,0|Br,0|zr,Dr|Ur,0|Ur,Lr|Ur,0|Dr,Dr|zr,Lr|Rr,Br|Rr,Lr|Ur,0|Lr,Br|Rr,0|zr,Dr|Rr,0|Ur,0|Br,Dr|Ur,0|Br,Lr|zr,0|Rr,0|Lr,Dr|Ur,Br|Ur,0,0|Ur,Lr|zr,Dr|Rr,Br|Ur,Br|zr,0|Ur,0,Dr|zr,Br|Rr,0|Lr,0|Br,Dr|Rr,0|zr,Lr|Rr,Lr|Ur,Br|zr,0|Dr,Br|Rr,0|Rr,0|Dr,Lr|Rr,0|zr,Dr|zr,Lr|Ur];Lr=8192,Br=1<<23,Dr=Lr|Br,zr=1,Ur=128,Rr=zr|Ur;const Vr=[Dr|zr,Lr|Rr,Lr|Rr,0|Ur,Dr|Ur,Br|Rr,Br|zr,Lr|zr,0,0|Dr,0|Dr,Dr|Rr,0|Rr,0,Br|Ur,Br|zr,0|zr,0|Lr,0|Br,Dr|zr,0|Ur,0|Br,Lr|zr,Lr|Ur,Br|Rr,0|zr,Lr|Ur,Br|Ur,0|Lr,Dr|Ur,Dr|Rr,0|Rr,Br|Ur,Br|zr,0|Dr,Dr|Rr,0|Rr,0,0,0|Dr,Lr|Ur,Br|Ur,Br|Rr,0|zr,Dr|zr,Lr|Rr,Lr|Rr,0|Ur,Dr|Rr,0|Rr,0|zr,0|Lr,Br|zr,Lr|zr,Dr|Ur,Br|Rr,Lr|zr,Lr|Ur,0|Br,Dr|zr,0|Ur,0|Br,0|Lr,Dr|Ur];Lr=1<<25,Br=1<<30,Dr=Lr|Br,zr=256,Ur=1<<19,Rr=zr|Ur;const Hr=[0|zr,Lr|Rr,Lr|Ur,Dr|zr,0|Ur,0|zr,0|Br,Lr|Ur,Br|Rr,0|Ur,Lr|zr,Br|Rr,Dr|zr,Dr|Ur,0|Rr,0|Br,0|Lr,Br|Ur,Br|Ur,0,Br|zr,Dr|Rr,Dr|Rr,Lr|zr,Dr|Ur,Br|zr,0,0|Dr,Lr|Rr,0|Lr,0|Dr,0|Rr,0|Ur,Dr|zr,0|zr,0|Lr,0|Br,Lr|Ur,Dr|zr,Br|Rr,Lr|zr,0|Br,Dr|Ur,Lr|Rr,Br|Rr,0|zr,0|Lr,Dr|Ur,Dr|Rr,0|Rr,0|Dr,Dr|Rr,Lr|Ur,0,Br|Ur,0|Dr,0|Rr,Lr|zr,Br|zr,0|Ur,0,Br|Ur,Lr|Rr,Br|zr];Lr=1<<22,Br=1<<29,Dr=Lr|Br,zr=16,Ur=16384,Rr=zr|Ur;const Kr=[Br|zr,0|Dr,0|Ur,Dr|Rr,0|Dr,0|zr,Dr|Rr,0|Lr,Br|Ur,Lr|Rr,0|Lr,Br|zr,Lr|zr,Br|Ur,0|Br,0|Rr,0,Lr|zr,Br|Rr,0|Ur,Lr|Ur,Br|Rr,0|zr,Dr|zr,Dr|zr,0,Lr|Rr,Dr|Ur,0|Rr,Lr|Ur,Dr|Ur,0|Br,Br|Ur,0|zr,Dr|zr,Lr|Ur,Dr|Rr,0|Lr,0|Rr,Br|zr,0|Lr,Br|Ur,0|Br,0|Rr,Br|zr,Dr|Rr,Lr|Ur,0|Dr,Lr|Rr,Dr|Ur,0,Dr|zr,0|zr,0|Ur,0|Dr,Lr|Rr,0|Ur,Lr|zr,Br|Rr,0,Dr|Ur,0|Br,Lr|zr,Br|Rr];Lr=1<<21,Br=1<<26,Dr=Lr|Br,zr=2,Ur=2048,Rr=zr|Ur;const Xr=[0|Lr,Dr|zr,Br|Rr,0,0|Ur,Br|Rr,Lr|Rr,Dr|Ur,Dr|Rr,0|Lr,0,Br|zr,0|zr,0|Br,Dr|zr,0|Rr,Br|Ur,Lr|Rr,Lr|zr,Br|Ur,Br|zr,0|Dr,Dr|Ur,Lr|zr,0|Dr,0|Ur,0|Rr,Dr|Rr,Lr|Ur,0|zr,0|Br,Lr|Ur,0|Br,Lr|Ur,0|Lr,Br|Rr,Br|Rr,Dr|zr,Dr|zr,0|zr,Lr|zr,0|Br,Br|Ur,0|Lr,Dr|Ur,0|Rr,Lr|Rr,Dr|Ur,0|Rr,Br|zr,Dr|Rr,0|Dr,Lr|Ur,0,0|zr,Dr|Rr,0,Lr|Rr,0|Dr,0|Ur,Br|zr,Br|Ur,0|Ur,Lr|zr];Lr=1<<18,Br=1<<28,Dr=Lr|Br,zr=64,Ur=4096,Rr=zr|Ur;const Or=[Br|Rr,0|Ur,0|Lr,Dr|Rr,0|Br,Br|Rr,0|zr,0|Br,Lr|zr,0|Dr,Dr|Rr,Lr|Ur,Dr|Ur,Lr|Rr,0|Ur,0|zr,0|Dr,Br|zr,Br|Ur,0|Rr,Lr|Ur,Lr|zr,Dr|zr,Dr|Ur,0|Rr,0,0,Dr|zr,Br|zr,Br|Ur,Lr|Rr,0|Lr,Lr|Rr,0|Lr,Dr|Ur,0|Ur,0|zr,Dr|zr,0|Ur,Lr|Rr,Br|Ur,0|zr,Br|zr,0|Dr,Dr|zr,0|Br,0|Lr,Br|Rr,0,Dr|Rr,Lr|zr,Br|zr,0|Dr,Br|Ur,Br|Rr,0,Dr|Rr,Lr|Ur,Lr|Ur,0|Rr,0|Rr,Lr|zr,0|Br,Dr|Ur];class Gr{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,o=0;a<8;++a){n=i<<28|i>>>4,n^=this.keys[o++];let t=Xr[63&n];t|=Hr[n>>>8&63],t|=Pr[n>>>16&63],t|=Ir[n>>>24&63],n=i^this.keys[o++],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[o++],t=Xr[63&n],t|=Hr[n>>>8&63],t|=Pr[n>>>16&63],t|=Ir[n>>>24&63],n=s^this.keys[o++],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 Wr={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,Lang1:114,Lang2:113,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 Yr=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,oa=-309,ha=-312,la=-313,ca=-256,da=1464686180,_a=3231835598;class ua{constructor(){this._lines=0}decodeRect(t,e,s,i,n,r,a){if(0===s||0===i)return!0;0===this._lines&&(this._lines=i);const o=s*(8==a?1:4);if(n.rQwait("RAW",o))return!1;const h=e+(i-this._lines),l=Math.min(this._lines,Math.floor(n.rQlen/o)),c=s*l;let d=n.rQ,_=n.rQi;if(8==a){const t=new Uint8Array(4*c);for(let e=0;e<c;e++)t[4*e+0]=255*(d[_+e]>>0&3)/3,t[4*e+1]=255*(d[_+e]>>2&3)/3,t[4*e+2]=255*(d[_+e]>>4&3)/3,t[4*e+3]=255;d=t,_=0}for(let u=0;u<c;u++)d[4*u+3]=255;return r.blitImage(t,h,s,l,d,_),n.rQskipBytes(l*o),this._lines-=l,!(this._lines>0)}}class fa{decodeRect(t,e,s,i,n,r,a){if(n.rQwait("COPYRECT",4))return!1;let o=n.rQshift16(),h=n.rQshift16();return 0===s||0===i||r.copyImage(o,h,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(),o=n.rQshift16(),h=n.rQshift16();r.fillRect(t+i,e+a,o,h,s),this._subrects--}return!0}}class ga{constructor(){this._tiles=0,this._lastsubencoding=0,this._tileBuffer=new Uint8Array(1024)}decodeRect(t,e,s,i,n,a,o){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 o=1;if(n.rQwait("HEXTILE",o))return!1;let h=n.rQ,l=n.rQi,c=h[l];if(c>30)throw new Error("Illegal hextile subencoding (subencoding: "+c+")");const d=this._totalTiles-this._tiles,_=t+16*(d%this._tilesX),u=e+16*Math.floor(d/this._tilesX),f=Math.min(16,t+s-_),p=Math.min(16,e+i-u);if(1&c)o+=f*p*4;else if(2&c&&(o+=4),4&c&&(o+=4),8&c){if(o++,n.rQwait("HEXTILE",o))return!1;let t=h[l+o-1];o+=16&c?6*t:2*t}if(n.rQwait("HEXTILE",o))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){let t=f*p;for(let e=0;e<t;e++)h[l+4*e+3]=255;a.blitImage(_,u,f,p,h,l),l+=o-1}else{if(2&c&&(this._background=[h[l],h[l+1],h[l+2],h[l+3]],l+=4),4&c&&(this._foreground=[h[l],h[l+1],h[l+2],h[l+3]],l+=4),this._startTile(_,u,f,p,this._background),8&c){let t=h[l];l++;for(let e=0;e<t;e++){let t;16&c?(t=[h[l],h[l+1],h[l+2],h[l+3]],l+=4):t=this._foreground;const e=h[l];l++;const s=e>>4,i=15&e,n=h[l];l++;const r=1+(n>>4),a=1+(15&n);this._subTile(s,i,r,a,t)}}this._finishTile(a)}n.rQi=l,this._lastsubencoding=c,this._tiles--}return!0}_startTile(t,e,s,i,n){this._tileX=t,this._tileY=e,this._tileW=s,this._tileH=i;const r=n[0],a=n[1],o=n[2],h=this._tileBuffer;for(let l=0;l<s*i*4;l+=4)h[l]=r,h[l+1]=a,h[l+2]=o,h[l+3]=255}_subTile(t,e,s,i,n){const r=n[0],a=n[1],o=n[2],h=t+s,l=e+i,c=this._tileBuffer,d=this._tileW;for(let _=e;_<l;_++)for(let e=t;e<h;e++){const t=4*(e+_*d);c[t]=r,c[t+1]=a,c[t+2]=o,c[t+3]=255}}_finishTile(t){t.blitImage(this._tileX,this._tileY,this._tileW,this._tileH,this._tileBuffer,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 et}decodeRect(t,e,s,i,n,r,o){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 h;if(8===this._ctl)h=this._fillRect(t,e,s,i,n,r,o);else if(9===this._ctl)h=this._jpegRect(t,e,s,i,n,r,o);else if(10===this._ctl)h=this._pngRect(t,e,s,i,n,r,o);else{if(0!=(8&this._ctl))throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");h=this._basicRect(this._ctl,t,e,s,i,n,r,o)}return h&&(this._ctl=null),h}_fillRect(t,e,s,i,n,r,a){if(n.rQwait("TIGHT",3))return!1;const o=n.rQi,h=n.rQ;return r.fillRect(t,e,s,i,[h[o],h[o+1],h[o+2]],!1),n.rQskipBytes(3),!0}_jpegRect(t,e,s,i,n,r,a){let o=this._readData(n);return null!==o&&(r.imageRect(t,e,s,i,"image/jpeg",o),!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,o){if(null===this._filter)if(4&t){if(r.rQwait("TIGHT",1))return!1;this._filter=r.rQshift8()}else this._filter=0;let h,l=3&t;switch(this._filter){case 0:h=this._copyFilter(l,e,s,i,n,r,a,o);break;case 1:h=this._paletteFilter(l,e,s,i,n,r,a,o);break;case 2:h=this._gradientFilter(l,e,s,i,n,r,a,o);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return h&&(this._filter=null),h}_copyFilter(t,e,s,i,n,r,a,o){const h=i*n*3;let l;if(0===h)return!0;if(h<12){if(r.rQwait("TIGHT",h))return!1;l=r.rQshiftBytes(h)}else{if(l=this._readData(r),null===l)return!1;this._zlibs[t].setInput(l),l=this._zlibs[t].inflate(h),this._zlibs[t].setInput(null)}let c=new Uint8Array(i*n*4);for(let d=0,_=0;d<i*n*4;d+=4,_+=3)c[d]=l[_],c[d+1]=l[_+1],c[d+2]=l[_+2],c[d+3]=255;return a.blitImage(e,s,i,n,c,0,!1),!0}_paletteFilter(t,e,s,i,n,r,a,o){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 h=this._numColors<=2?1:8,l=Math.floor((i*h+7)/8)*n;let c;if(0===l)return!0;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 o=this._getScratchBuffer(s*i*4),h=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*h+i]>>a&1),o[t]=r[e],o[t+1]=r[e+1],o[t+2]=r[e+2],o[t+3]=255;for(let a=7;a>=8-s%8;a--)t=4*(c*s+8*i+7-a),e=3*(n[c*h+i]>>a&1),o[t]=r[e],o[t+1]=r[e+1],o[t+2]=r[e+2],o[t+3]=255}a.blitImage(t,e,s,i,o,0,!1)}_paletteRect(t,e,s,i,n,r,a){const o=this._getScratchBuffer(s*i*4),h=s*i*4;for(let l=0,c=0;l<h;l+=4,c++){const t=3*n[c];o[l]=r[t],o[l+1]=r[t+1],o[l+2]=r[t+2],o[l+3]=255}a.blitImage(t,e,s,i,o,0,!1)}_gradientFilter(t,e,s,i,n,r,a,o){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 o=this._readData(n);return null!==o&&(r.imageRect(t,e,s,i,"image/png",o),!0)}_basicRect(t,e,s,i,n,r,a,o){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, WebSocket or RTCDataChannel");super(),this._target=t,"string"===typeof e?this._url=e:(this._url=null,this._rawChannel=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._resizeObserver=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),handleResize:this._handleResize.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.width=0,this._canvas.height=0,this._canvas.tabIndex=-1,this._screen.appendChild(this._canvas),this._cursor=new kr,this._cursorImage=Sa.cursors.none,this._decoders[Yr]=new ua,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 E(this._canvas)}catch(Qa){throw h("Display exception: "+Qa),Qa}this._display.onflush=this._onFlush.bind(this),this._keyboard=new gr(this._canvas),this._keyboard.onkeyevent=this._handleKeyEvent.bind(this),this._gestures=new br,this._sock=new Ar,this._sock.on("open",this._socketOpen.bind(this)),this._sock.on("close",this._socketClose.bind(this)),this._sock.on("message",this._handleMessage.bind(this)),this._sock.on("error",this._socketError.bind(this)),this._resizeObserver=new ResizeObserver(this._eventHandlers.handleResize),this._updateConnectionState("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&&(o("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){o("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?h("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?h("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(wi,"ControlLeft",!0),this.sendKey(Ci,"AltLeft",!0),this.sendKey(ke,"Delete",!0),this.sendKey(ke,"Delete",!1),this.sendKey(Ci,"AltLeft",!1),this.sendKey(wi,"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=Wr[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(){if(r(">> RFB.connect"),this._url)a(`connecting to ${this._url}`),this._sock.open(this._url,this._wsProtocols);else{if(a(`attaching ${this._rawChannel} to Websock`),this._sock.attach(this._rawChannel),"closed"===this._sock.readyState)throw Error("Cannot use already closed WebSocket/RTCDataChannel");"open"===this._sock.readyState&&this._socketOpen()}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),this._resizeObserver.observe(this._screen),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),this._resizeObserver.disconnect(),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")}_socketOpen(){"connecting"===this._rfbConnectionState&&""===this._rfbInitState?(this._rfbInitState="ProtocolVersion",r("Starting VNC handshake")):this._fail("Unexpected server connection while "+this._rfbConnectionState)}_socketClose(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._rawChannel=null}_socketError(t){o("WebSocket on-error event")}_focusCanvas(t){this.focusOnClick&&this.focus()}_setDesktopName(t){this._fbName=t,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}_handleResize(){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 h("Bad transition to connected state, previous connection state: "+e);break;case"disconnected":if("disconnecting"!==e)return void h("Bad transition to disconnected state, previous connection state: "+e);break;case"connecting":if(""!==e)return void h("Bad transition to connecting state, previous connection state: "+e);break;case"disconnecting":if("connected"!==e&&"connecting"!==e)return void h("Bad transition to disconnecting state, previous connection state: "+e);break;default:return void h("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((()=>{h("Disconnection timed out."),this._updateConnectionState("disconnected")}),3e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}))}}else h("Tried changing state of a disconnected RFB object");else r("Already in state '"+t+"', ignoring")}_fail(t){switch(this._rfbConnectionState){case"disconnecting":h("Failed when disconnecting: "+t);break;case"connected":h("Failed while connected: "+t);break;case"connecting":h("Failed when connecting: "+t);break;default:h("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":h("Got data while disconnected");break;case"connected":for(;!this._flushing&&this._normalMsg()&&0!==this._sock.rQlen;);break;default:this._initMsg()}else o("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=b(t.clientX,t.clientY,this._canvas);switch(t.type){case"mousedown":!function(t){if(t.setCapture)t.setCapture(),document.captureElement=t;else{Q();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",C),e.addEventListener("mousemove",C),e.addEventListener("mouseup",C)),document.captureElement=t,S.observe(t,{attributes:!0}),x(),e.style.display="",window.addEventListener("mousemove",C),window.addEventListener("mouseup",C)}}(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)>_||Math.abs(i)>_)&&(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=b(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=b(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=b(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=b(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(wi,"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(wi,"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(){if(this._rfbVersion>=3.7){const t=this._sock.rQshift8();if(this._sock.rQwait("security type",t,1))return!1;if(0===t)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();const e=this._sock.rQshiftBytes(t);if(r("Server security types: "+e),e.includes(1))this._rfbAuthScheme=1;else if(e.includes(22))this._rfbAuthScheme=22;else if(e.includes(16))this._rfbAuthScheme=16;else if(e.includes(2))this._rfbAuthScheme=2;else{if(!e.includes(19))return this._fail("Unsupported security types (types: "+e+")");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(void 0===this._rfbCredentials.username||void 0===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([t.length>>24&255,t.length>>16&255,t.length>>8&255,255&t.length]),this._sock.send([e.length>>24&255,e.length>>16&255,e.length>>8&255,255&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(),h=this._sock.rQshift16(),c=this._sock.rQshift16(),d=this._sock.rQshift16(),_=this._sock.rQshift8(),u=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: "+h+", greenMax: "+c+", blueMax: "+d+", redShift: "+_+", greenShift: "+u+", blueShift: "+f),this._setDesktopName(g),this._resize(t,e),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(o("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(Yr),t.push(ta+this._qualityLevel),t.push(ca+this._compressionLevel),t.push(ea),t.push(sa),t.push(na),t.push(aa),t.push(oa),t.push(ha),t.push(la),t.push(ra),t.push(_a),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 et,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&&(o("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:h("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:return this._qemuExtKeyEventSupported=!0,!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 o("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 o=this._sock.rQshiftBytes(n),h=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=h[d*Math.ceil(s/8)+Math.floor(t/8)]<<t%8&128?255:0;l[c]=o[c+2],l[c+1]=o[c+1],l[c+2]=o[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"}o("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(jt){return this._fail("Error decoding rect: "+jt),!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 Gr(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 ue,n=[];for(let o=0;o<e.length;o++){if(1!=e[o])throw new Error("Unsupported extended clipboard format for Provide message.");s[o]=s[o].replace(/\r\n|\r|\n/gm,"\r\n");let t=c(s[o]+"\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,o=e.length;for(;o>0;){let s=Math.min(o,t._sQbufferSize-t._sQlen);for(let n=0;n<s;n++)i[t._sQlen+n]=e[a+n];t._sQlen+=s,t.flush(),o-=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,o=t._sQlen;a[o]=150,a[o+1]=e,a[o+2]=s>>8,a[o+3]=s,a[o+4]=i>>8,a[o+5]=i,a[o+6]=n>>8,a[o+7]=n,a[o+8]=r>>8,a[o+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]=0*a,i[n+15]=1*a,i[n+16]=2*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,o=t._sQlen;"undefined"===typeof s&&(s=0),"undefined"===typeof i&&(i=0),a[o]=3,a[o+1]=e?1:0,a[o+2]=s>>8&255,a[o+3]=255&s,a[o+4]=i>>8&255,a[o+5]=255&i,a[o+6]=n>>8&255,a[o+7]=255&n,a[o+8]=r>>8&255,a[o+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}}}}]);