From d8ffcc4eecfd01ffd8711feee5504c28766ec2c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 2 Sep 2024 15:40:01 +0000 Subject: [PATCH] CI Build Artifacts --- assets/index.yaml | 24 +++++++++++++++++- .../kubevirt-dashboard-extension-1.1.0.tgz | Bin 1531 -> 1535 bytes .../1.1.0/Chart.yaml | 2 +- .../1.1.0/values.yaml | 1 + ...evirt-dashboard-extension-1.1.0.umd.min.js | 2 +- ...t-dashboard-extension-1.1.0.umd.min.js.map | 2 +- index.yaml | 24 +++++++++++++++++- 7 files changed, 50 insertions(+), 5 deletions(-) diff --git a/assets/index.yaml b/assets/index.yaml index 51aba9d..55a5203 100644 --- a/assets/index.yaml +++ b/assets/index.yaml @@ -130,6 +130,28 @@ entries: - https://github.com/suse-edge/dashboard-extensions/releases/download/akri-dashboard-extension-0.1.0/akri-dashboard-extension-0.1.0.tgz version: 0.1.0 kubevirt-dashboard-extension: + - annotations: + catalog.cattle.io/certified: rancher + catalog.cattle.io/display-name: KubeVirt + catalog.cattle.io/kube-version: '>= v1.26.0-0' + catalog.cattle.io/namespace: cattle-ui-plugin-system + catalog.cattle.io/os: linux + catalog.cattle.io/permits-os: linux, windows + catalog.cattle.io/rancher-version: '>= v2.9.0' + catalog.cattle.io/scope: management + catalog.cattle.io/ui-component: plugins + catalog.cattle.io/ui-extensions-version: '>= 2.0.1' + apiVersion: v2 + appVersion: 1.1.0 + created: "2024-09-02T15:39:37.391239552Z" + description: 'SUSE Edge: KubeVirt extension for Rancher Dashboard' + digest: fab864450105e8ca07a59bbd0e0244fa3d91ec89554f5d8cf713b4342c6e6d84 + icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/kubevirt/icon/color/kubevirt-icon-color.svg + name: kubevirt-dashboard-extension + type: application + urls: + - assets/kubevirt-dashboard-extension/kubevirt-dashboard-extension-1.1.0.tgz + version: 1.1.0 - annotations: catalog.cattle.io/certified: rancher catalog.cattle.io/display-name: KubeVirt @@ -278,4 +300,4 @@ entries: urls: - assets/kubevirt-dashboard-extension/kubevirt-dashboard-extension-0.1.0.tgz version: 0.1.0 -generated: "2024-09-02T14:27:18.547160003Z" +generated: "2024-09-02T15:39:37.39009612Z" diff --git a/assets/kubevirt-dashboard-extension/kubevirt-dashboard-extension-1.1.0.tgz b/assets/kubevirt-dashboard-extension/kubevirt-dashboard-extension-1.1.0.tgz index 9537a7750b28ddb2afce0d49284d440281d095cd..3ff845fa720cb3cc9b438369e018957bbe25eb84 100644 GIT binary patch delta 1494 zcmV;{1u6Rb3;zp{JAYYiZ`(c&?`wYw!ndK@Zhpu^GhBcjP;5P5*zEx;wtI8HpvX+D ze`U#&7niV4n{GC@LgI*~*r0bUvunn@A8 zNr^Jyl4ShoAuEpKcr+ZAf8#iA|LqNi!=v7CG&&iajN(_lqkp*fDvtX{5I^YDJy)R( zQAhEE&uSa@hb$t5G{i6|^wlQAeFXo{+nEMYq5WElvO z;TYZ*6a2=M=_Iuw7tB%F5F5kszhA?=7xqVC9K^?+3|6Mj3B@tE&7fdG&WjlnfnI8Z zStpy+W8h2_mw%mab5t2KI%ud~!h(rJE_5e(WqV8Se)zBO7Ns?nIgTMCg3K^O(d~B)MkL2uIy*=-HB+r|Fdton(y#zH?EH{qv{OkD{ zoF%i3>w@M4m`Vj-oXzmIhK6I0QOlbelk0I5DY6J>%zvcCq|m6S6b6L}smvlO=rkhA zETp=KGNKKtC|B|?q((TL{GStEpnh-xxC8&=lim&d?+-=?{C|vP^XtFK46vr?nTw}R$T9|bGe};x6#1Jd;UgcyjZ1x*$_HSXi z1x@`LO>g7du3i3S?ehOfoY|TG2D6+KgF5=2BF|Cj(B$`rf;;kmFc|i>^S|F4yc!~eo@gKnfwPPmOu$Gm zDSy-OY_cp}^7iAorDb9UI!F3E^xjQDAxEMs-`OsRFrl6I+#WNqV4TAQq0m-O4Wv}Q z()Ml-*QmVqGMhF|Z9{hLyj$Pz<9MzcIZsL>#;^Ck*|m<1JDia4i}RJ^t@Yg6yr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-system catalog.cattle.io/os: linux catalog.cattle.io/permits-os: linux, windows diff --git a/charts/kubevirt-dashboard-extension/1.1.0/values.yaml b/charts/kubevirt-dashboard-extension/1.1.0/values.yaml index 082567e..e911f15 100644 --- a/charts/kubevirt-dashboard-extension/1.1.0/values.yaml +++ b/charts/kubevirt-dashboard-extension/1.1.0/values.yaml @@ -9,3 +9,4 @@ plugin: catalog.cattle.io/display-name: KubeVirt catalog.cattle.io/rancher-version: ">= v2.9.0" catalog.cattle.io/ui-extensions-version: ">= 2.0.1" + catalog.cattle.io/kube-version: ">= v1.26.0-0" diff --git a/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js b/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js index 1244ff6..482cb09 100644 --- a/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js +++ b/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js @@ -1,4 +1,4 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("__jszip"),require("__jsyaml"),require("vue")):"function"===typeof define&&define.amd?define(["__jszip","__jsyaml"],t):"object"===typeof exports?exports["kubevirt-dashboard-extension-1.1.0"]=t(require("__jszip"),require("__jsyaml"),require("vue")):e["kubevirt-dashboard-extension-1.1.0"]=t(e["__jszip"],e["__jsyaml"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){function t(t){for(var n,r,s=t[0],o=t[1],a=0,c=[];a-1}e.exports=r},"0e19":function(e,t,n){var i=n("4b2c"),r=n("2822"),s=n("907a"),o="[object Null]",a="[object Undefined]",c=i?i.toStringTag:void 0;function l(e){return null==e?void 0===e?a:o:c&&c in Object(e)?r(e):s(e)}e.exports=l},"0e30":function(e,t){function n(){return!1}e.exports=n},"0ed3":function(e,t,n){"use strict";function i(e,t){for(var n=[],i={},r=0;rn.parts.length&&(i.parts.length=n.parts.length)}else{var o=[];for(r=0;r{this.showMessage=!0},250)},beforeDestroy(){clearTimeout(this.timer)}},o=s,a=(n("959e"),n("d802")),c=Object(a["a"])(o,i,r,!1,null,"23723280",null);t["a"]=c.exports},1722:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("7083"),r=n("98d3"),s=n("2cb5"),o=n("da25");function a(e){var t;let n=null===(t=e.params)||void 0===t?void 0:t.product;if(!n){var i;const t=null===(i=e.name)||void 0===i?void 0:i.match(/^c-cluster-([^-]+)/);t&&(n=t[1])}return n||(n=c(e,"product")),n}function c(e,t){if(null!==e&&void 0!==e&&e.meta){const n=Array.isArray(e.meta)?e.meta:[e.meta];for(let e=0;e{if(d(o,e.locationConfig,c||{})){if(t===i["c"].CARD)n===i["b"].CLUSTER_DASHBOARD_CARD&&e.labelKey&&(l[h].label=a.t(e.labelKey));else if(t===i["c"].ACTION&&(n===i["a"].TABLE&&(e.labelKey&&(l[h].label=a.t(e.labelKey)),l[h].bulkable=l[h].multiple||l[h].bulkable,l[h].action||(l[h].action="custom-table-action-"+Object(s["h"])(10).toLowerCase())),n===i["a"].HEADER&&e.shortcut))if("string"===typeof e.shortcut)l[h].shortcutLabel=()=>r["b"]?`(⌘-${e.shortcut.toUpperCase()})`:`(Ctrl-${e.shortcut.toUpperCase()})`,l[h].shortcutKey={windows:["ctrl",e.shortcut],mac:["meta",e.shortcut]};else if("object"===typeof e.shortcut&&!Array.isArray(e.shortcut)&&null!==e.shortcut){l[h].shortcutKey=e.shortcut;const t=r["b"]?l[h].shortcut.mac:l[h].shortcut.windows?l[h].shortcut.windows:[];let n="";t.forEach((e,i)=>{i`(${n})`}u.push(l[h])}})}return u}},"1ab6":function(e,t,n){(function(e){var i=n("201b"),r=t&&!t.nodeType&&t,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o?i.Buffer:void 0,c=a?a.allocUnsafe:void 0;function l(e,t){if(t)return e.slice();var n=e.length,i=c?c(n):new e.constructor(n);return e.copy(i),i}e.exports=l}).call(this,n("6984")(e))},"1b8e":function(e,t,n){e.exports=n.p+"img/banner.a83d2a9b.svg"},"1c25":function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var i=window.document.currentScript,r=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}function s(e){e.register("list","kubevirt.io.virtualmachine",()=>Promise.all([n.e(4),n.e(2)]).then(n.bind(null,"984b"))),e.register("models","kubevirt.io.virtualmachine",()=>n("44f6")),e.register("models","kubevirt.io.virtualmachineinstance",()=>n("0606")),e.register("l10n","en-us",()=>n.e(7).then(n.t.bind(null,"1bb6",7))),e.register("formatters","IPAddress",()=>Promise.all([n.e(3),n.e(0)]).then(n.bind(null,"a09e"))),e.register("formatters","VMState",()=>Promise.all([n.e(3),n.e(0)]).then(n.bind(null,"ec8b")))}var o=n("7083"),a=n("377f");const c=function(e,t){t.map(e=>{e.spec.running=!0,e.save()})},l=function(e,t){t.map(e=>{e.spec.running=!1,e.save()})},u=e=>e.canStop,h=e=>e.canStart,d={label:"Start",icon:"icon icon-play",invoke:c,enabled:h,multiple:!0},f={label:"Stop",icon:"icon icon-close",invoke:l,enabled:u,multiple:!0};var p=function(){var e=this,t=e._self._c;return t("div",[e.$fetchState.pending?t("Loading"):t("SerialConsole",{ref:"serialConsole",model:{value:e.vmi,callback:function(t){e.vmi=t},expression:"vmi"}})],1)},_=[],g=n("15ca"),m=function(){var e=this,t=e._self._c;return t("div",{staticClass:"console-shell-container"},[t("div",{ref:"xterm",staticClass:"shell-body"}),t("resize-observer",{on:{notify:e.fit}})],1)},v=[],b=n("a8b9"),y=n("44db"),w=n.n(y);const k=new WeakMap,E=new WeakMap;function S(e){const t=k.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function A(e){null==e.passiveListener?e.event.cancelable&&(e.canceled=!0,"function"===typeof e.event.preventDefault&&e.event.preventDefault()):"undefined"!==typeof console&&"function"===typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener)}function X(e,t){k.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=Object.keys(t);for(let i=0;i0){const e=new Array(arguments.length);for(let t=0;tnull===e?""+encodeURIComponent(t):`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"),i}function $(e){const t=$.options,n=t.parser[t.strictMode?"strict":"loose"].exec(e);if(!n)throw new Error("Cannot parse as uri: "+e);const i={};let r=14;while(r--)i[t.key[r]]=n[r]||"";return i.query={},i.queryStr.replace(t.q.parser,(e,n,r)=>(n&&(i[t.q.name][n]=r),"")),i}function q(e,t,n){return t=W(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(e){var t=Y(e,"string");return"symbol"===typeof t?t:String(t)}function Y(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}$.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","queryStr","anchor"],q:{name:"query",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};let J=1,Z=!1,ee=!1;const te="ws://",ne="wss://",ie="disconnected",re=(V.addEventListener,"connecting"),se="connected",oe="closing",ae="reconnecting",ce=re,le=se,ue=ie,he="message",de="frame_timeout",fe="connect_error",pe="disconnect_error";class _e extends V{constructor(e,t=!0,n=null,i=null,r=null,s=!1){super(),q(this,"url",void 0),q(this,"autoReconnect",!0),q(this,"frameTimeout",35e3),q(this,"metadata",{}),q(this,"hasBeenOpen",!1),q(this,"hasReconnected",!1),q(this,"protocol",null),q(this,"maxTries",null),q(this,"tries",0),q(this,"idAsTimestamp",!1),q(this,"socket",null),q(this,"state",ie),q(this,"framesReceived",0),q(this,"frameTimer",void 0),q(this,"reconnectTimer",void 0),q(this,"disconnectCallBacks",[]),q(this,"disconnectedAt",0),q(this,"closingId",0),q(this,"autoReconnectUrl",null),this.setUrl(e),this.autoReconnect=t,this.protocol=i,this.maxTries=r,this.idAsTimestamp=s,null!==n&&(this.frameTimeout=n)}setUrl(e){e.match(/wss?:\/\//)||(e=self.location.origin.replace(/^http/,"ws")+e),"https:"===self.location.protocol&&e.startsWith(te)&&(e=ne+e.substr(te.length)),this.url=e}connect(e={}){if(this.socket)return void console.error("Socket refusing to connect while another socket exists");this.state!==ae&&(this.state=re),Object.assign(this.metadata,e);const t=this.idAsTimestamp?(new Date).getTime():J++,n=z(this.url,"sockId",t);let i;this._baseLog("connecting",{id:t,url:n.replace(/\?.*/,"")}),this.tries++,i=this.protocol?new WebSocket(n,this.protocol):new WebSocket(n),i.sockId=t,i.metadata=this.metadata,i.onmessage=this._onmessage.bind(this),i.onopen=this._opened.bind(this),i.onerror=this._error.bind(this),i.onclose=this._closed.bind(this),this.socket=i,this.state=re,this.dispatchEvent(new CustomEvent(ce))}send(e){return!(!this.socket||this.state!==se)&&(this.socket.send(e),!0)}disconnect(e){e&&this.disconnectCallBacks.push(e);const t=this,n=new Promise((e,n)=>{function i(e){n(e),t.removeEventListener(fe,i)}this.state===ie&&e(),this.addEventListener(fe,i),this.disconnectCallBacks.push(()=>{this.removeEventListener(fe,i),e()})});return this.autoReconnect=!1,this._close(),n}reconnect(e={}){Object.assign(this.metadata,e),this.state!==re?this.socket?this._close():this.connect(e):this._log("Ignoring reconnect for socket in connecting")}getMetadata(){return this.socket?this.socket.metadata:{}}getId(){return this.socket?this.socket.sockId:0}isConnected(){return this.state===se}setAutoReconnect(e){this.autoReconnect=e}setAutoReconnectUrl(e){this.autoReconnectUrl=e}_close(){const e=this.socket;if(e){try{this._log("closing"),this.closingId=e.sockId,e.onopen=null,e.onerror=null,e.onmessage=null,e.close()}catch(t){this._log("exception",{e:t.toString()})}this.state=oe}}_opened(){this._log("opened");const e=(new Date).getTime(),t=this.disconnectedAt;let n=0;t&&(n=e-t),this.hasBeenOpen&&(this.hasReconnected=!0),this.hasBeenOpen=!0,this.state=se,this.framesReceived=0,this.disconnectedAt=0,this.dispatchEvent(new CustomEvent(le,{detail:{tries:this.tries,afterMilliseconds:n}})),this.tries=0,this._resetWatchdog(),clearTimeout(this.reconnectTimer)}_onmessage(e){this._resetWatchdog(),this.tries=0,this.framesReceived++,this.dispatchEvent(new CustomEvent(he,{detail:e}))}_resetWatchdog(){clearTimeout(this.frameTimer);const e=this.frameTimeout;e&&this.state===se&&(this.frameTimer=setTimeout(()=>{this._log(`watchdog expired after${e}. Closing`),this._close(),this.dispatchEvent(new CustomEvent(de))},e))}_error(){this.closingId=this.socket?this.socket.sockId:0,this._log("error")}_closed(e){var t;const{code:n,reason:i,wasClean:r}=e;this._baseLog("closed",{id:this.closingId||(null===(t=this.socket)||void 0===t?void 0:t.sockId)||"unknown",code:n,reason:i,clean:r}),this.closingId=0,this.socket=null,clearTimeout(this.reconnectTimer),clearTimeout(this.frameTimer);const s=this.disconnectCallBacks;while(s.length){const e=s.pop();e&&e.apply(this)}if([se,oe].includes(this.state)&&(ee=!0),this.disconnectedAt||(this.disconnectedAt=(new Date).getTime()),Z||ee)if(this.autoReconnect){if(this.state=ae,this.maxTries&&this.tries>1&&this.tries<=this.maxTries){const e=new CustomEvent(fe);this.dispatchEvent(e)}if(this.maxTries&&this.tries>this.maxTries)this._log("closed. Will not reconnect (hit max attempts)"),this.state=ie,this.dispatchEvent(new CustomEvent(pe));else{const e=()=>{this._log("closed. Attempting to reconnect");const e=Math.max(1e3,Math.min(1e3*this.tries,3e4));this.reconnectTimer=setTimeout(()=>{this.connect()},e)};this.autoReconnectUrl?this.autoReconnectUrl().then(t=>{this.setUrl(t),e()}).catch(e=>{console.error("Failed to fetch socket auto reconnect url",e)}):e()}}else this.state=ie;else{this.autoReconnect=!1,this.state=ie;const e=new CustomEvent(fe,{detail:{isSafari:H["e"]}});this.dispatchEvent(e),Z=!0}this.state===ie?this.dispatchEvent(new CustomEvent(ue)):this.state===ae&&this.dispatchEvent(new CustomEvent(ce))}_log(e,t){var n;this._baseLog(e,{state:this.state,id:(null===(n=this.socket)||void 0===n?void 0:n.sockId)||0,...t})}_baseLog(e,t){const n=[e],i=Object.entries(t||{});n.unshift("Socket "),i.length&&(n.push(" ("),i.forEach(([e,t],i)=>{0!==i&&n.push(", "),n.push(`${e}=${t}`)}),n.push(")")),console.log(n.join(""))}}var ge={props:{value:{type:Object,required:!0}},data(){return{socket:null,terminal:null,fitAddon:null,searchAddon:null,webglAddon:null,isOpen:!1,isOpening:!1,backlog:[],firstTime:!0,queue:[]}},computed:{xtermConfig(){return{allowProposedApi:!0,cursorBlink:!0,useStyle:!0,fontSize:12}}},watch:{queue:{handler:w()((async function(e){if(0===e.length)return;const t=await Promise.all(e);(t||[]).forEach(e=>{this.terminal.write(e)}),this.queue=[]}),5)}},beforeDestroy(){this.close()},async mounted(){await this.setupTerminal(),await this.connect()},methods:{async setupTerminal(){const e=getComputedStyle(document.querySelector("body")),t=await n.e(5).then(n.t.bind(null,"2b0c",7)),i=await Object(b["a"])({fit:n.e(5).then(n.t.bind(null,"2b02",7)),webgl:n.e(5).then(n.t.bind(null,"be90",7)),weblinks:n.e(5).then(n.t.bind(null,"c257",7)),search:n.e(5).then(n.t.bind(null,"5d77",7))}),r=new t.Terminal({theme:{background:e.getPropertyValue("--terminal-bg").trim(),cursor:e.getPropertyValue("--terminal-cursor").trim(),foreground:e.getPropertyValue("--terminal-text").trim()},...this.xtermConfig});this.fitAddon=new i.fit.FitAddon,this.searchAddon=new i.search.SearchAddon;try{this.webglAddon=new i.webgl.WebGlAddon}catch(s){this.webglAddon=null}r.loadAddon(this.fitAddon),r.loadAddon(this.searchAddon),r.loadAddon(new i.weblinks.WebLinksAddon),r.open(this.$refs.xterm),this.webglAddon&&r.loadAddon(this.webglAddon),this.fit(),this.flush(),r.onData(e=>{const t=this.str2ab(e);this.write(t)}),this.terminal=r},str2ab(e){const t=new TextEncoder;return t.encode(e)},write(e){this.isOpen?this.socket.send(e):this.backlog.push(e)},clear(){this.terminal.clear()},getSocketUrl(){var e;return""+(null===(e=this.value)||void 0===e?void 0:e.getSerialConsolePath)},async connect(){this.socket&&(await this.socket.disconnect(),this.socket=null,this.terminal.reset());const e=this.getSocketUrl();e&&(this.socket=new _e(e),this.socket.addEventListener(ce,()=>{this.isOpen=!1,this.isOpening=!0}),this.socket.addEventListener(fe,e=>{this.isOpen=!1,this.isOpening=!1,console.error("Connect Error",e)}),this.socket.addEventListener(le,()=>{this.isOpen=!0,this.isOpening=!1,this.show&&(this.fit(),this.flush()),this.firstTime&&(this.socket.send(this.str2ab("\n")),this.firstTime=!1)}),this.socket.addEventListener(ue,()=>{this.isOpen=!1,this.isOpening=!1,this.$emit("close")}),this.socket.addEventListener(he,e=>{this.queue.push(e.detail.data.text())}),this.socket.connect(),this.terminal.focus())},flush(){const e=this.backlog.slice();this.backlog=[];for(const t of e)this.socket.send(t)},fit(){if(!this.fitAddon)return;this.fitAddon.fit();const{rows:e,cols:t}=this.fitAddon.proposeDimensions();if(!this.isOpen)return;const n=JSON.stringify({Width:t,Height:e});this.socket.send(this.str2ab(n))},close(){this.socket&&this.socket.disconnect(),this.terminal&&this.terminal.dispose()}}},me=ge,ve=(n("d1b6"),n("d802")),be=Object(ve["a"])(me,m,v,!1,null,null,null),ye=be.exports,we={components:{SerialConsole:ye,Loading:g["a"]},layout:"blank",data(){return{id:`${this.$route.params.namespace}/${this.$route.params.vm}`}},async fetch(){await this.$store.dispatch("cluster/find",{type:a["c"],id:this.id})},head(){var e;return{title:null===(e=this.vmi)||void 0===e||null===(e=e.metadata)||void 0===e?void 0:e.name}},computed:{vmi(){return this.$store.getters["cluster/byId"](a["c"],this.id)||[]}},mounted(){window.addEventListener("beforeunload",()=>{this.$refs.serialConsole.close()})}},ke=we,Ee=(n("72d8"),Object(ve["a"])(ke,p,_,!1,null,"3bf18937",null)),Se=Ee.exports,Ae=function(){var e=this,t=e._self._c;return e.$fetchState.pending?t("Loading"):t("NovncConsoleWrapper",{ref:"console",staticClass:"novnc-wrapper",model:{value:e.vmi,callback:function(t){e.vmi=t},expression:"vmi"}})},Xe=[],xe=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("div",{staticClass:"vm-console"},[t("div",{staticClass:"combination-keys"},[t("v-popover",{ref:"popover",attrs:{placement:"top",trigger:"click",container:!1},on:{"auto-hide":function(t){e.keysRecord=[]}}},[t("button",{staticClass:"btn btn-sm bg-primary"},[e._v(" "+e._s(e.t("kubevirt.virtualMachine.detail.console.shortKeys"))+" ")]),t("template",{slot:"popover"},[t("novnc-console-item",{attrs:{items:e.keymap,path:e.keysRecord,pos:0},on:{update:e.update,sendKeys:e.sendKeys}})],1)],2),e.hasSoftRebootAction?t("button",{staticClass:"btn btn-sm bg-primary",on:{click:e.softReboot}},[e._v(" "+e._s(e.t("kubevirt.action.softreboot"))+" ")]):e._e()],1),e.url&&!e.isDown?t("NovncConsole",{ref:"novncConsole",attrs:{url:e.url}}):e._e(),e.isDown?t("p",[e._v(" "+e._s(e.t("kubevirt.virtualMachine.detail.console.down"))+" ")]):e._e()],1)])},Ke=[],Ce={XK_VoidSymbol:16777215,XK_BackSpace:65288,XK_Tab:65289,XK_Linefeed:65290,XK_Clear:65291,XK_Return:65293,XK_Pause:65299,XK_Scroll_Lock:65300,XK_Sys_Req:65301,XK_Escape:65307,XK_Delete:65535,XK_Multi_key:65312,XK_Codeinput:65335,XK_SingleCandidate:65340,XK_MultipleCandidate:65341,XK_PreviousCandidate:65342,XK_Kanji:65313,XK_Muhenkan:65314,XK_Henkan_Mode:65315,XK_Henkan:65315,XK_Romaji:65316,XK_Hiragana:65317,XK_Katakana:65318,XK_Hiragana_Katakana:65319,XK_Zenkaku:65320,XK_Hankaku:65321,XK_Zenkaku_Hankaku:65322,XK_Touroku:65323,XK_Massyo:65324,XK_Kana_Lock:65325,XK_Kana_Shift:65326,XK_Eisu_Shift:65327,XK_Eisu_toggle:65328,XK_Kanji_Bangou:65335,XK_Zen_Koho:65341,XK_Mae_Koho:65342,XK_Home:65360,XK_Left:65361,XK_Up:65362,XK_Right:65363,XK_Down:65364,XK_Prior:65365,XK_Page_Up:65365,XK_Next:65366,XK_Page_Down:65366,XK_End:65367,XK_Begin:65368,XK_Select:65376,XK_Print:65377,XK_Execute:65378,XK_Insert:65379,XK_Undo:65381,XK_Redo:65382,XK_Menu:65383,XK_Find:65384,XK_Cancel:65385,XK_Help:65386,XK_Break:65387,XK_Mode_switch:65406,XK_script_switch:65406,XK_Num_Lock:65407,XK_KP_Space:65408,XK_KP_Tab:65417,XK_KP_Enter:65421,XK_KP_F1:65425,XK_KP_F2:65426,XK_KP_F3:65427,XK_KP_F4:65428,XK_KP_Home:65429,XK_KP_Left:65430,XK_KP_Up:65431,XK_KP_Right:65432,XK_KP_Down:65433,XK_KP_Prior:65434,XK_KP_Page_Up:65434,XK_KP_Next:65435,XK_KP_Page_Down:65435,XK_KP_End:65436,XK_KP_Begin:65437,XK_KP_Insert:65438,XK_KP_Delete:65439,XK_KP_Equal:65469,XK_KP_Multiply:65450,XK_KP_Add:65451,XK_KP_Separator:65452,XK_KP_Subtract:65453,XK_KP_Decimal:65454,XK_KP_Divide:65455,XK_KP_0:65456,XK_KP_1:65457,XK_KP_2:65458,XK_KP_3:65459,XK_KP_4:65460,XK_KP_5:65461,XK_KP_6:65462,XK_KP_7:65463,XK_KP_8:65464,XK_KP_9:65465,XK_F1:65470,XK_F2:65471,XK_F3:65472,XK_F4:65473,XK_F5:65474,XK_F6:65475,XK_F7:65476,XK_F8:65477,XK_F9:65478,XK_F10:65479,XK_F11:65480,XK_L1:65480,XK_F12:65481,XK_L2:65481,XK_F13:65482,XK_L3:65482,XK_F14:65483,XK_L4:65483,XK_F15:65484,XK_L5:65484,XK_F16:65485,XK_L6:65485,XK_F17:65486,XK_L7:65486,XK_F18:65487,XK_L8:65487,XK_F19:65488,XK_L9:65488,XK_F20:65489,XK_L10:65489,XK_F21:65490,XK_R1:65490,XK_F22:65491,XK_R2:65491,XK_F23:65492,XK_R3:65492,XK_F24:65493,XK_R4:65493,XK_F25:65494,XK_R5:65494,XK_F26:65495,XK_R6:65495,XK_F27:65496,XK_R7:65496,XK_F28:65497,XK_R8:65497,XK_F29:65498,XK_R9:65498,XK_F30:65499,XK_R10:65499,XK_F31:65500,XK_R11:65500,XK_F32:65501,XK_R12:65501,XK_F33:65502,XK_R13:65502,XK_F34:65503,XK_R14:65503,XK_F35:65504,XK_R15:65504,XK_Shift_L:65505,XK_Shift_R:65506,XK_Control_L:65507,XK_Control_R:65508,XK_Caps_Lock:65509,XK_Shift_Lock:65510,XK_Meta_L:65511,XK_Meta_R:65512,XK_Alt_L:65513,XK_Alt_R:65514,XK_Super_L:65515,XK_Super_R:65516,XK_Hyper_L:65517,XK_Hyper_R:65518,XK_ISO_Level3_Shift:65027,XK_ISO_Next_Group:65032,XK_ISO_Prev_Group:65034,XK_ISO_First_Group:65036,XK_ISO_Last_Group:65038,XK_space:32,XK_exclam:33,XK_quotedbl:34,XK_numbersign:35,XK_dollar:36,XK_percent:37,XK_ampersand:38,XK_apostrophe:39,XK_quoteright:39,XK_parenleft:40,XK_parenright:41,XK_asterisk:42,XK_plus:43,XK_comma:44,XK_minus:45,XK_period:46,XK_slash:47,XK_0:48,XK_1:49,XK_2:50,XK_3:51,XK_4:52,XK_5:53,XK_6:54,XK_7:55,XK_8:56,XK_9:57,XK_colon:58,XK_semicolon:59,XK_less:60,XK_equal:61,XK_greater:62,XK_question:63,XK_at:64,XK_A:65,XK_B:66,XK_C:67,XK_D:68,XK_E:69,XK_F:70,XK_G:71,XK_H:72,XK_I:73,XK_J:74,XK_K:75,XK_L:76,XK_M:77,XK_N:78,XK_O:79,XK_P:80,XK_Q:81,XK_R:82,XK_S:83,XK_T:84,XK_U:85,XK_V:86,XK_W:87,XK_X:88,XK_Y:89,XK_Z:90,XK_bracketleft:91,XK_backslash:92,XK_bracketright:93,XK_asciicircum:94,XK_underscore:95,XK_grave:96,XK_quoteleft:96,XK_a:97,XK_b:98,XK_c:99,XK_d:100,XK_e:101,XK_f:102,XK_g:103,XK_h:104,XK_i:105,XK_j:106,XK_k:107,XK_l:108,XK_m:109,XK_n:110,XK_o:111,XK_p:112,XK_q:113,XK_r:114,XK_s:115,XK_t:116,XK_u:117,XK_v:118,XK_w:119,XK_x:120,XK_y:121,XK_z:122,XK_braceleft:123,XK_bar:124,XK_braceright:125,XK_asciitilde:126,XK_nobreakspace:160,XK_exclamdown:161,XK_cent:162,XK_sterling:163,XK_currency:164,XK_yen:165,XK_brokenbar:166,XK_section:167,XK_diaeresis:168,XK_copyright:169,XK_ordfeminine:170,XK_guillemotleft:171,XK_notsign:172,XK_hyphen:173,XK_registered:174,XK_macron:175,XK_degree:176,XK_plusminus:177,XK_twosuperior:178,XK_threesuperior:179,XK_acute:180,XK_mu:181,XK_paragraph:182,XK_periodcentered:183,XK_cedilla:184,XK_onesuperior:185,XK_masculine:186,XK_guillemotright:187,XK_onequarter:188,XK_onehalf:189,XK_threequarters:190,XK_questiondown:191,XK_Agrave:192,XK_Aacute:193,XK_Acircumflex:194,XK_Atilde:195,XK_Adiaeresis:196,XK_Aring:197,XK_AE:198,XK_Ccedilla:199,XK_Egrave:200,XK_Eacute:201,XK_Ecircumflex:202,XK_Ediaeresis:203,XK_Igrave:204,XK_Iacute:205,XK_Icircumflex:206,XK_Idiaeresis:207,XK_ETH:208,XK_Eth:208,XK_Ntilde:209,XK_Ograve:210,XK_Oacute:211,XK_Ocircumflex:212,XK_Otilde:213,XK_Odiaeresis:214,XK_multiply:215,XK_Oslash:216,XK_Ooblique:216,XK_Ugrave:217,XK_Uacute:218,XK_Ucircumflex:219,XK_Udiaeresis:220,XK_Yacute:221,XK_THORN:222,XK_Thorn:222,XK_ssharp:223,XK_agrave:224,XK_aacute:225,XK_acircumflex:226,XK_atilde:227,XK_adiaeresis:228,XK_aring:229,XK_ae:230,XK_ccedilla:231,XK_egrave:232,XK_eacute:233,XK_ecircumflex:234,XK_ediaeresis:235,XK_igrave:236,XK_iacute:237,XK_icircumflex:238,XK_idiaeresis:239,XK_eth:240,XK_ntilde:241,XK_ograve:242,XK_oacute:243,XK_ocircumflex:244,XK_otilde:245,XK_odiaeresis:246,XK_division:247,XK_oslash:248,XK_ooblique:248,XK_ugrave:249,XK_uacute:250,XK_ucircumflex:251,XK_udiaeresis:252,XK_yacute:253,XK_thorn:254,XK_ydiaeresis:255,XK_Hangul:65329,XK_Hangul_Hanja:65332,XK_Hangul_Jeonja:65336,XF86XK_ModeLock:269025025,XF86XK_MonBrightnessUp:269025026,XF86XK_MonBrightnessDown:269025027,XF86XK_KbdLightOnOff:269025028,XF86XK_KbdBrightnessUp:269025029,XF86XK_KbdBrightnessDown:269025030,XF86XK_Standby:269025040,XF86XK_AudioLowerVolume:269025041,XF86XK_AudioMute:269025042,XF86XK_AudioRaiseVolume:269025043,XF86XK_AudioPlay:269025044,XF86XK_AudioStop:269025045,XF86XK_AudioPrev:269025046,XF86XK_AudioNext:269025047,XF86XK_HomePage:269025048,XF86XK_Mail:269025049,XF86XK_Start:269025050,XF86XK_Search:269025051,XF86XK_AudioRecord:269025052,XF86XK_Calculator:269025053,XF86XK_Memo:269025054,XF86XK_ToDoList:269025055,XF86XK_Calendar:269025056,XF86XK_PowerDown:269025057,XF86XK_ContrastAdjust:269025058,XF86XK_RockerUp:269025059,XF86XK_RockerDown:269025060,XF86XK_RockerEnter:269025061,XF86XK_Back:269025062,XF86XK_Forward:269025063,XF86XK_Stop:269025064,XF86XK_Refresh:269025065,XF86XK_PowerOff:269025066,XF86XK_WakeUp:269025067,XF86XK_Eject:269025068,XF86XK_ScreenSaver:269025069,XF86XK_WWW:269025070,XF86XK_Sleep:269025071,XF86XK_Favorites:269025072,XF86XK_AudioPause:269025073,XF86XK_AudioMedia:269025074,XF86XK_MyComputer:269025075,XF86XK_VendorHome:269025076,XF86XK_LightBulb:269025077,XF86XK_Shop:269025078,XF86XK_History:269025079,XF86XK_OpenURL:269025080,XF86XK_AddFavorite:269025081,XF86XK_HotLinks:269025082,XF86XK_BrightnessAdjust:269025083,XF86XK_Finance:269025084,XF86XK_Community:269025085,XF86XK_AudioRewind:269025086,XF86XK_BackForward:269025087,XF86XK_Launch0:269025088,XF86XK_Launch1:269025089,XF86XK_Launch2:269025090,XF86XK_Launch3:269025091,XF86XK_Launch4:269025092,XF86XK_Launch5:269025093,XF86XK_Launch6:269025094,XF86XK_Launch7:269025095,XF86XK_Launch8:269025096,XF86XK_Launch9:269025097,XF86XK_LaunchA:269025098,XF86XK_LaunchB:269025099,XF86XK_LaunchC:269025100,XF86XK_LaunchD:269025101,XF86XK_LaunchE:269025102,XF86XK_LaunchF:269025103,XF86XK_ApplicationLeft:269025104,XF86XK_ApplicationRight:269025105,XF86XK_Book:269025106,XF86XK_CD:269025107,XF86XK_Calculater:269025108,XF86XK_Clear:269025109,XF86XK_Close:269025110,XF86XK_Copy:269025111,XF86XK_Cut:269025112,XF86XK_Display:269025113,XF86XK_DOS:269025114,XF86XK_Documents:269025115,XF86XK_Excel:269025116,XF86XK_Explorer:269025117,XF86XK_Game:269025118,XF86XK_Go:269025119,XF86XK_iTouch:269025120,XF86XK_LogOff:269025121,XF86XK_Market:269025122,XF86XK_Meeting:269025123,XF86XK_MenuKB:269025125,XF86XK_MenuPB:269025126,XF86XK_MySites:269025127,XF86XK_New:269025128,XF86XK_News:269025129,XF86XK_OfficeHome:269025130,XF86XK_Open:269025131,XF86XK_Option:269025132,XF86XK_Paste:269025133,XF86XK_Phone:269025134,XF86XK_Q:269025136,XF86XK_Reply:269025138,XF86XK_Reload:269025139,XF86XK_RotateWindows:269025140,XF86XK_RotationPB:269025141,XF86XK_RotationKB:269025142,XF86XK_Save:269025143,XF86XK_ScrollUp:269025144,XF86XK_ScrollDown:269025145,XF86XK_ScrollClick:269025146,XF86XK_Send:269025147,XF86XK_Spell:269025148,XF86XK_SplitScreen:269025149,XF86XK_Support:269025150,XF86XK_TaskPane:269025151,XF86XK_Terminal:269025152,XF86XK_Tools:269025153,XF86XK_Travel:269025154,XF86XK_UserPB:269025156,XF86XK_User1KB:269025157,XF86XK_User2KB:269025158,XF86XK_Video:269025159,XF86XK_WheelButton:269025160,XF86XK_Word:269025161,XF86XK_Xfer:269025162,XF86XK_ZoomIn:269025163,XF86XK_ZoomOut:269025164,XF86XK_Away:269025165,XF86XK_Messenger:269025166,XF86XK_WebCam:269025167,XF86XK_MailForward:269025168,XF86XK_Pictures:269025169,XF86XK_Music:269025170,XF86XK_Battery:269025171,XF86XK_Bluetooth:269025172,XF86XK_WLAN:269025173,XF86XK_UWB:269025174,XF86XK_AudioForward:269025175,XF86XK_AudioRepeat:269025176,XF86XK_AudioRandomPlay:269025177,XF86XK_Subtitle:269025178,XF86XK_AudioCycleTrack:269025179,XF86XK_CycleAngle:269025180,XF86XK_FrameBack:269025181,XF86XK_FrameForward:269025182,XF86XK_Time:269025183,XF86XK_Select:269025184,XF86XK_View:269025185,XF86XK_TopMenu:269025186,XF86XK_Red:269025187,XF86XK_Green:269025188,XF86XK_Yellow:269025189,XF86XK_Blue:269025190,XF86XK_Suspend:269025191,XF86XK_Hibernate:269025192,XF86XK_TouchpadToggle:269025193,XF86XK_TouchpadOn:269025200,XF86XK_TouchpadOff:269025201,XF86XK_AudioMicMute:269025202,XF86XK_Switch_VT_1:269024769,XF86XK_Switch_VT_2:269024770,XF86XK_Switch_VT_3:269024771,XF86XK_Switch_VT_4:269024772,XF86XK_Switch_VT_5:269024773,XF86XK_Switch_VT_6:269024774,XF86XK_Switch_VT_7:269024775,XF86XK_Switch_VT_8:269024776,XF86XK_Switch_VT_9:269024777,XF86XK_Switch_VT_10:269024778,XF86XK_Switch_VT_11:269024779,XF86XK_Switch_VT_12:269024780,XF86XK_Ungrab:269024800,XF86XK_ClearGrab:269024801,XF86XK_Next_VMode:269024802,XF86XK_Prev_VMode:269024803,XF86XK_LogWindowTree:269024804,XF86XK_LogGrabInfo:269024805},Te=function(){var e=this,t=e._self._c;return t("div",[e.connected&&e.disconnected?t("div",[t("main",{staticClass:"main-layout error"},[t("div",{staticClass:"text-center"},[t("BrandImage",{attrs:{"file-name":"error-desert-landscape.svg",width:"900",height:"300"}}),t("h1",[e._v(" "+e._s(e.t("generic.notification.title.warning"))+" ")]),t("h2",{staticClass:"text-secondary mt-20"},[e._v(" "+e._s(e.t("vncConsole.error.message"))+" ")])],1)])]):e._e(),t("div",{ref:"view"})])},Fe=[];function Re(e){return e>>>0}function Ie(e){return 0|e}let Oe="warn",Le=()=>{},De=()=>{},Me=()=>{},Ne=()=>{};function Pe(e){if("undefined"===typeof e?e=Oe:Oe=e,Le=De=Me=Ne=()=>{},"undefined"!==typeof window.console)switch(e){case"debug":Le=console.debug.bind(window.console);case"info":De=console.info.bind(window.console);case"warn":Me=console.warn.bind(window.console);case"error":Ne=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+e+"'")}}function Ue(e,t=!1){try{return decodeURIComponent(escape(e))}catch(n){if(n instanceof URIError&&t)return e;throw n}}function Be(e){return unescape(encodeURIComponent(e))}Pe();let je="ontouchstart"in document.documentElement||void 0!==document.ontouchstart||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.addEventListener("touchstart",(function e(){je=!0,window.removeEventListener("touchstart",e,!1)}),!1);let Qe=10*(window.devicePixelRatio||1),Ge=!1;try{const e=document.createElement("canvas");e.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',0===e.style.cursor.indexOf("url")?(De("Data URI scheme cursor supported"),Ge=!0):Me("Data URI scheme cursor not supported")}catch(Ua){Ne("Data URI scheme cursor test exception: "+Ua)}const Ve=Ge;let He=!0;try{const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;e.parentNode.removeChild(e),He=0!=n}catch(Ua){Ne("Scrollbar test exception: "+Ua)}function ze(){return!!/mac/i.exec(navigator.platform)}function $e(){return!!/win/i.exec(navigator.platform)}function qe(){return!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform)}function We(e,t,n){const i=n.getBoundingClientRect();let r={x:0,y:0};return e=i.right?r.x=i.width-1:r.x=e-i.left,t=i.bottom?r.y=i.height-1:r.y=t-i.top,r}function Ye(e){e.stopPropagation(),e.preventDefault()}let Je=!1,Ze=null;function et(e){if(Je)return;const t=new e.constructor(e.type,e);Je=!0,document.captureElement?document.captureElement.dispatchEvent(t):Ze.dispatchEvent(t),Je=!1,e.stopPropagation(),t.defaultPrevented&&e.preventDefault(),"mouseup"===e.type&&rt()}function tt(){const e=document.getElementById("noVNC_mouse_capture_elem");e.style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;const nt=new MutationObserver(tt);function it(e){if(e.setCapture)e.setCapture(),document.captureElement=e;else{rt();let t=document.getElementById("noVNC_mouse_capture_elem");null===t&&(t=document.createElement("div"),t.id="noVNC_mouse_capture_elem",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.zIndex=1e4,t.style.display="none",document.body.appendChild(t),t.addEventListener("contextmenu",et),t.addEventListener("mousemove",et),t.addEventListener("mouseup",et)),document.captureElement=e,nt.observe(e,{attributes:!0}),tt(),t.style.display="",window.addEventListener("mousemove",et),window.addEventListener("mouseup",et)}}function rt(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;Ze=document.captureElement,document.captureElement=null,nt.disconnect();const e=document.getElementById("noVNC_mouse_capture_elem");e.style.display="none",window.removeEventListener("mousemove",et),window.removeEventListener("mouseup",et)}}class st{constructor(){this._listeners=new Map}addEventListener(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}removeEventListener(e,t){this._listeners.has(e)&&this._listeners.get(e).delete(t)}dispatchEvent(e){return!this._listeners.has(e.type)||(this._listeners.get(e.type).forEach(t=>t.call(this,e)),!e.defaultPrevented)}}var ot={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode(e){let t="";const n=e.length,i=n%3;for(let s=0;s>2],t+=this.toBase64Table[((3&e[s])<<4)+(e[s+1]>>4)],t+=this.toBase64Table[((15&e[s+1])<<2)+(e[s+2]>>6)],t+=this.toBase64Table[63&e[s+2]];const r=n-i;return 2===i?(t+=this.toBase64Table[e[r]>>2],t+=this.toBase64Table[((3&e[r])<<4)+(e[r+1]>>4)],t+=this.toBase64Table[(15&e[r+1])<<2],t+=this.toBase64Table[64]):1===i&&(t+=this.toBase64Table[e[r]>>2],t+=this.toBase64Table[(3&e[r])<<4],t+=this.toBase64Table[64],t+=this.toBase64Table[64]),t},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(e,t=0){let n=e.indexOf("=")-t;n<0&&(n=e.length-t);const i=3*(n>>2)+Math.floor(n%4/1.5),r=new Array(i);let s=0,o=0;for(let a=0,c=t;c=8&&(s-=8,n||(r[a++]=o>>s&255),o&=(1<> Display.constructor"),this._target=e,!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},Le("User Agent: "+navigator.userAgent),Le("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=()=>{}}get scale(){return this._scale}set scale(e){this._rescale(e)}get clipViewport(){return this._clipViewport}set clipViewport(e){this._clipViewport=e;const t=this._viewportLoc;this.viewportChangeSize(t.w,t.h),this.viewportChangePos(0,0)}get width(){return this._fbWidth}get height(){return this._fbHeight}viewportChangePos(e,t){const n=this._viewportLoc;e=Math.floor(e),t=Math.floor(t),this._clipViewport||(e=-n.w,t=-n.h);const i=n.x+n.w-1,r=n.y+n.h-1;e<0&&n.x+e<0&&(e=-n.x),i+e>=this._fbWidth&&(e-=i+e-this._fbWidth+1),n.y+t<0&&(t=-n.y),r+t>=this._fbHeight&&(t-=r+t-this._fbHeight+1),0===e&&0===t||(Le("viewportChange deltaX: "+e+", deltaY: "+t),n.x+=e,n.y+=t,this._damage(n.x,n.y,n.w,n.h),this.flip())}viewportChangeSize(e,t){this._clipViewport&&"undefined"!==typeof e&&"undefined"!==typeof t||(Le("Setting viewport to full display region"),e=this._fbWidth,t=this._fbHeight),e=Math.floor(e),t=Math.floor(t),e>this._fbWidth&&(e=this._fbWidth),t>this._fbHeight&&(t=this._fbHeight);const n=this._viewportLoc;if(n.w!==e||n.h!==t){n.w=e,n.h=t;const i=this._target;i.width=e,i.height=t,this.viewportChangePos(0,0),this._damage(n.x,n.y,n.w,n.h),this.flip(),this._rescale(this._scale)}}absX(e){return 0===this._scale?0:Ie(e/this._scale+this._viewportLoc.x)}absY(e){return 0===this._scale?0:Ie(e/this._scale+this._viewportLoc.y)}resize(e,t){this._prevDrawStyle="",this._fbWidth=e,this._fbHeight=t;const n=this._backbuffer;if(n.width!==e||n.height!==t){let i=null;n.width>0&&n.height>0&&(i=this._drawCtx.getImageData(0,0,n.width,n.height)),n.width!==e&&(n.width=e),n.height!==t&&(n.height=t),i&&this._drawCtx.putImageData(i,0,0)}const i=this._viewportLoc;this.viewportChangeSize(i.w,i.h),this.viewportChangePos(0,0)}getImageData(){return this._drawCtx.getImageData(0,0,this.width,this.height)}toDataURL(e,t){return this._backbuffer.toDataURL(e,t)}toBlob(e,t,n){return this._backbuffer.toBlob(e,t,n)}_damage(e,t,n,i){ethis._damageBounds.right&&(this._damageBounds.right=e+n),t+i>this._damageBounds.bottom&&(this._damageBounds.bottom=t+i)}flip(e){if(0===this._renderQ.length||e){let e=this._damageBounds.left,t=this._damageBounds.top,n=this._damageBounds.right-e,i=this._damageBounds.bottom-t,r=e-this._viewportLoc.x,s=t-this._viewportLoc.y;r<0&&(n+=r,e-=r,r=0),s<0&&(i+=s,t-=s,s=0),r+n>this._viewportLoc.w&&(n=this._viewportLoc.w-r),s+i>this._viewportLoc.h&&(i=this._viewportLoc.h-s),n>0&&i>0&&this._targetCtx.drawImage(this._backbuffer,e,t,n,i,r,s,n,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(e,t,n,i,r,s){0===this._renderQ.length||s?(this._setFillColor(r),this._drawCtx.fillRect(e,t,n,i),this._damage(e,t,n,i)):this._renderQPush({type:"fill",x:e,y:t,width:n,height:i,color:r})}copyImage(e,t,n,i,r,s,o){0===this._renderQ.length||o?(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,e,t,r,s,n,i,r,s),this._damage(n,i,r,s)):this._renderQPush({type:"copy",oldX:e,oldY:t,x:n,y:i,width:r,height:s})}imageRect(e,t,n,i,r,s){if(0===n||0===i)return;const o=new Image;o.src="data: "+r+";base64,"+ot.encode(s),this._renderQPush({type:"img",img:o,x:e,y:t,width:n,height:i})}blitImage(e,t,n,i,r,s,o){if(0===this._renderQ.length||o){let o=new Uint8ClampedArray(r.buffer,r.byteOffset+s,n*i*4),a=new ImageData(o,n,i);this._drawCtx.putImageData(a,e,t),this._damage(e,t,n,i)}else{const s=new Uint8Array(n*i*4);s.set(new Uint8Array(r.buffer,0,s.length)),this._renderQPush({type:"blit",data:s,x:e,y:t,width:n,height:i})}}drawImage(e,t,n){this._drawCtx.drawImage(e,t,n),this._damage(t,n,e.width,e.height)}autoscale(e,t){let n;if(0===e||0===t)n=0;else{const i=this._viewportLoc,r=e/t,s=i.w/i.h;n=s>=r?e/i.w:t/i.h}this._rescale(n)}_rescale(e){this._scale=e;const t=this._viewportLoc,n=e*t.w+"px",i=e*t.h+"px";this._target.style.width===n&&this._target.style.height===i||(this._target.style.width=n,this._target.style.height=i)}_setFillColor(e){const t="rgb("+e[0]+","+e[1]+","+e[2]+")";t!==this._prevDrawStyle&&(this._drawCtx.fillStyle=t,this._prevDrawStyle=t)}_renderQPush(e){this._renderQ.push(e),1===this._renderQ.length&&this._scanRenderQ()}_resumeRenderQ(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}_scanRenderQ(){let e=!0;while(e&&this._renderQ.length>0){const t=this._renderQ[0];switch(t.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(t.oldX,t.oldY,t.x,t.y,t.width,t.height,!0);break;case"fill":this.fillRect(t.x,t.y,t.width,t.height,t.color,!0);break;case"blit":this.blitImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"img":if(t.img.complete){if(t.img.width!==t.width||t.img.height!==t.height)return void Ne("Decoded image has incorrect dimensions. Got "+t.img.width+"x"+t.img.height+". Expected "+t.width+"x"+t.height+".");this.drawImage(t.img,t.x,t.y)}else t.img._noVNCDisplay=this,t.img.addEventListener("load",this._resumeRenderQ),e=!1;break}e&&this._renderQ.shift()}0===this._renderQ.length&&this._flushing&&(this._flushing=!1,this.onflush())}}function ct(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var s=0;s>>16&65535|0,o=0;while(0!==n){o=n>2e3?2e3:n,n-=o;do{r=r+t[i++]|0,s=s+r|0}while(--o);r%=65521,s%=65521}return r|s<<16|0}function ft(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}ft();var pt=30,_t=12;function gt(e,t){var n,i,r,s,o,a,c,l,u,h,d,f,p,_,g,m,v,b,y,w,k,E,S,A,X;n=e.state,i=e.next_in,A=e.input,r=i+(e.avail_in-5),s=e.next_out,X=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,h=n.wnext,d=n.window,f=n.hold,p=n.bits,_=n.lencode,g=n.distcode,m=(1<>>24,f>>>=y,p-=y,y=b>>>16&255,0===y)X[s++]=65535&b;else{if(!(16&y)){if(0===(64&y)){b=_[(65535&b)+(f&(1<>>=y,p-=y),p<15&&(f+=A[i++]<>>24,f>>>=y,p-=y,y=b>>>16&255,!(16&y)){if(0===(64&y)){b=g[(65535&b)+(f&(1<c){e.msg="invalid distance too far back",n.mode=pt;break e}if(f>>>=y,p-=y,y=s-o,k>y){if(y=k-y,y>u&&n.sane){e.msg="invalid distance too far back",n.mode=pt;break e}if(E=0,S=d,0===h){if(E+=l-y,y2)X[s++]=S[E++],X[s++]=S[E++],X[s++]=S[E++],w-=3;w&&(X[s++]=S[E++],w>1&&(X[s++]=S[E++]))}else{E=s-k;do{X[s++]=X[E++],X[s++]=X[E++],X[s++]=X[E++],w-=3}while(w>2);w&&(X[s++]=X[E++],w>1&&(X[s++]=X[E++]))}break}}break}}while(i>3,i-=w,p-=w<<3,f&=(1<=1;w--)if(0!==T[w])break;if(k>w&&(k=w),0===w)return r[s++]=20971520,r[s++]=20971520,a.bits=1,0;for(y=1;y0&&(e===yt||1!==w))return-1;for(F[1]=0,v=1;vvt||e===kt&&X>bt)return 1;for(;;){p=v-S,o[b]f?(_=R[I+o[b]],g=K[C+o[b]]):(_=96,g=0),c=1<>S)+l]=p<<24|_<<16|g|0}while(0!==l);c=1<>=1;if(0!==c?(x&=c-1,x+=c):x=0,b++,0===--T[v]){if(v===w)break;v=t[n+o[b]]}if(v>k&&(x&h)!==u){0===S&&(S=k),d+=y,E=v-S,A=1<vt||e===kt&&X>bt)return 1;u=x&h,r[u]=k<<24|E<<16|d-s|0}}return 0!==x&&(r[d+x]=v-S<<24|64<<16|0),a.bits=k,0}var Kt=0,Ct=1,Tt=2;const Ft=4,Rt=5,It=6,Ot=0,Lt=1,Dt=2,Mt=-2,Nt=-3,Pt=-4,Ut=-5,Bt=8;var jt=1,Qt=2,Gt=3,Vt=4,Ht=5,zt=6,$t=7,qt=8,Wt=9,Yt=10,Jt=11,Zt=12,en=13,tn=14,nn=15,rn=16,sn=17,on=18,an=19,cn=20,ln=21,un=22,hn=23,dn=24,fn=25,pn=26,_n=27,gn=28,mn=29,vn=30,bn=31,yn=32,wn=852,kn=592,En=15,Sn=En;function An(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Xn(){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 ut(320),this.work=new ut(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function xn(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=jt,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new ht(wn),t.distcode=t.distdyn=new ht(kn),t.sane=1,t.back=-1,Ot):Mt}function Kn(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,xn(e)):Mt}function Cn(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Mt:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,Kn(e))):Mt}function Tn(e,t){var n,i;return e?(i=new Xn,e.state=i,i.window=null,n=Cn(e,t),n!==Ot&&(e.state=null),n):Mt}function Fn(e){return Tn(e,Sn)}var Rn,In,On=!0;function Ln(e){if(On){var t;Rn=new ht(512),In=new ht(32),t=0;while(t<144)e.lens[t++]=8;while(t<256)e.lens[t++]=9;while(t<280)e.lens[t++]=7;while(t<288)e.lens[t++]=8;xt(Ct,e.lens,0,288,Rn,0,e.work,{bits:9}),t=0;while(t<32)e.lens[t++]=5;xt(Tt,e.lens,0,32,In,0,e.work,{bits:5}),On=!1}e.lencode=Rn,e.lenbits=9,e.distcode=In,e.distbits=5}function Dn(e,t,n,i){var r,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(ct(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),ct(s.window,t,n-i,r,s.wnext),i-=r,i?(ct(s.window,t,n-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=ft(n.check,x,2,0),l=0,u=0,n.mode=Qt;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=vn;break}if((15&l)!==Bt){e.msg="unknown compression method",n.mode=vn;break}if(l>>>=4,u-=4,k=8+(15&l),0===n.wbits)n.wbits=k;else if(k>n.wbits){e.msg="invalid window size",n.mode=vn;break}n.dmax=1<>8&1),512&n.flags&&(x[0]=255&l,x[1]=l>>>8&255,n.check=ft(n.check,x,2,0)),l=0,u=0,n.mode=Gt;case Gt:while(u<32){if(0===a)break e;a--,l+=i[s++]<>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,n.check=ft(n.check,x,4,0)),l=0,u=0,n.mode=Vt;case Vt:while(u<16){if(0===a)break e;a--,l+=i[s++]<>8),512&n.flags&&(x[0]=255&l,x[1]=l>>>8&255,n.check=ft(n.check,x,2,0)),l=0,u=0,n.mode=Ht;case Ht:if(1024&n.flags){while(u<16){if(0===a)break e;a--,l+=i[s++]<>>8&255,n.check=ft(n.check,x,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=zt;case zt:if(1024&n.flags&&(f=n.length,f>a&&(f=a),f&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),ct(n.head.extra,i,s,f,k)),512&n.flags&&(n.check=ft(n.check,i,f,s)),a-=f,s+=f,n.length-=f),n.length))break e;n.length=0,n.mode=$t;case $t:if(2048&n.flags){if(0===a)break e;f=0;do{k=i[s+f++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&f>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Zt;break;case Yt:while(u<32){if(0===a)break e;a--,l+=i[s++]<>>=7&u,u-=7&u,n.mode=_n;break}while(u<3){if(0===a)break e;a--,l+=i[s++]<>>=1,u-=1,3&l){case 0:n.mode=tn;break;case 1:if(Ln(n),n.mode=cn,t===It){l>>>=2,u-=2;break e}break;case 2:n.mode=sn;break;case 3:e.msg="invalid block type",n.mode=vn}l>>>=2,u-=2;break;case tn:l>>>=7&u,u-=7&u;while(u<32){if(0===a)break e;a--,l+=i[s++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=vn;break}if(n.length=65535&l,l=0,u=0,n.mode=nn,t===It)break e;case nn:n.mode=rn;case rn:if(f=n.length,f){if(f>a&&(f=a),f>c&&(f=c),0===f)break e;ct(r,i,s,f,o),a-=f,s+=f,c-=f,o+=f,n.length-=f;break}n.mode=Zt;break;case sn:while(u<14){if(0===a)break e;a--,l+=i[s++]<>>=5,u-=5,n.ndist=1+(31&l),l>>>=5,u-=5,n.ncode=4+(15&l),l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=vn;break}n.have=0,n.mode=on;case on:while(n.have>>=3,u-=3}while(n.have<19)n.lens[K[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},E=xt(Kt,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,E){e.msg="invalid code lengths set",n.mode=vn;break}n.have=0,n.mode=an;case an:while(n.have>>24,m=X>>>16&255,v=65535&X,g<=u)break;if(0===a)break e;a--,l+=i[s++]<>>=g,u-=g,n.lens[n.have++]=v;else{if(16===v){A=g+2;while(u>>=g,u-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=vn;break}k=n.lens[n.have-1],f=3+(3&l),l>>>=2,u-=2}else if(17===v){A=g+3;while(u>>=g,u-=g,k=0,f=3+(7&l),l>>>=3,u-=3}else{A=g+7;while(u>>=g,u-=g,k=0,f=11+(127&l),l>>>=7,u-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=vn;break}while(f--)n.lens[n.have++]=k}}if(n.mode===vn)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=vn;break}if(n.lenbits=9,S={bits:n.lenbits},E=xt(Ct,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,E){e.msg="invalid literal/lengths set",n.mode=vn;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},E=xt(Tt,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,E){e.msg="invalid distances set",n.mode=vn;break}if(n.mode=cn,t===It)break e;case cn:n.mode=ln;case ln:if(a>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,n.hold=l,n.bits=u,gt(e,d),o=e.next_out,r=e.output,c=e.avail_out,s=e.next_in,i=e.input,a=e.avail_in,l=n.hold,u=n.bits,n.mode===Zt&&(n.back=-1);break}for(n.back=0;;){if(X=n.lencode[l&(1<>>24,m=X>>>16&255,v=65535&X,g<=u)break;if(0===a)break e;a--,l+=i[s++]<>b)],g=X>>>24,m=X>>>16&255,v=65535&X,b+g<=u)break;if(0===a)break e;a--,l+=i[s++]<>>=b,u-=b,n.back+=b}if(l>>>=g,u-=g,n.back+=g,n.length=v,0===m){n.mode=pn;break}if(32&m){n.back=-1,n.mode=Zt;break}if(64&m){e.msg="invalid literal/length code",n.mode=vn;break}n.extra=15&m,n.mode=un;case un:if(n.extra){A=n.extra;while(u>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=hn;case hn:for(;;){if(X=n.distcode[l&(1<>>24,m=X>>>16&255,v=65535&X,g<=u)break;if(0===a)break e;a--,l+=i[s++]<>b)],g=X>>>24,m=X>>>16&255,v=65535&X,b+g<=u)break;if(0===a)break e;a--,l+=i[s++]<>>=b,u-=b,n.back+=b}if(l>>>=g,u-=g,n.back+=g,64&m){e.msg="invalid distance code",n.mode=vn;break}n.offset=v,n.extra=15&m,n.mode=dn;case dn:if(n.extra){A=n.extra;while(u>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=vn;break}n.mode=fn;case fn:if(0===c)break e;if(f=d-c,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=vn;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),_=n.window}else _=r,p=o-n.offset,f=n.length;f>c&&(f=c),c-=f,n.length-=f;do{r[o++]=_[p++]}while(--f);0===n.length&&(n.mode=ln);break;case pn:if(0===c)break e;r[o++]=n.length,c--,n.mode=ln;break;case _n:if(n.wrap){while(u<32){if(0===a)break e;a--,l|=i[s++]<this.chunkSize&&(this.chunkSize=e,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=e;let t=Mn(this.strm,0);if(t<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=e)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}reset(){Kn(this.strm)}}var Un=4,Bn=0,jn=1,Qn=2;function Gn(e){var t=e.length;while(--t>=0)e[t]=0}var Vn=0,Hn=1,zn=2,$n=3,qn=258,Wn=29,Yn=256,Jn=Yn+1+Wn,Zn=30,ei=19,ti=2*Jn+1,ni=15,ii=16,ri=7,si=256,oi=16,ai=17,ci=18,li=[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],ui=[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],hi=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],di=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fi=512,pi=new Array(2*(Jn+2));Gn(pi);var _i=new Array(2*Zn);Gn(_i);var gi=new Array(fi);Gn(gi);var mi=new Array(qn-$n+1);Gn(mi);var vi=new Array(Wn);Gn(vi);var bi,yi,wi,ki=new Array(Zn);function Ei(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function Si(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Ai(e){return e<256?gi[e]:gi[256+(e>>>7)]}function Xi(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function xi(e,t,n){e.bi_valid>ii-n?(e.bi_buf|=t<>ii-e.bi_valid,e.bi_valid+=n-ii):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function Ti(e){16===e.bi_valid?(Xi(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function Fi(e,t){var n,i,r,s,o,a,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,h=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(s=0;s<=ni;s++)e.bl_count[s]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;np&&(s=p,_++),c[2*i+1]=s,i>l||(e.bl_count[s]++,o=0,i>=f&&(o=d[i-f]),a=c[2*i],e.opt_len+=a*(s+o),h&&(e.static_len+=a*(u[2*i+1]+o)));if(0!==_){do{s=p-1;while(0===e.bl_count[s])s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(s=p;0!==s;s--){i=e.bl_count[s];while(0!==i)r=e.heap[--n],r>l||(c[2*r+1]!==s&&(e.opt_len+=(s-c[2*r+1])*c[2*r],c[2*r+1]=s),i--)}}}function Ri(e,t,n){var i,r,s=new Array(ni+1),o=0;for(i=1;i<=ni;i++)s[i]=o=o+n[i-1]<<1;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=Ci(s[a]++,a))}}function Ii(){var e,t,n,i,r,s=new Array(ni+1);for(n=0,i=0;i>=7;i8?Xi(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Di(e,t,n,i){Li(e),i&&(Xi(e,n),Xi(e,~n)),ct(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function Mi(e,t,n,i){var r=2*t,s=2*n;return e[r]>1;n>=1;n--)Ni(e,s,n);r=c;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ni(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,s[2*r]=s[2*n]+s[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,s[2*n+1]=s[2*i+1]=r,e.heap[1]=r++,Ni(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Fi(e,t),Ri(s,l,e.bl_count)}function Bi(e,t,n){var i,r,s=-1,o=t[1],a=0,c=7,l=4;for(0===o&&(c=138,l=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=o,o=t[2*(i+1)+1],++a=3;t--)if(0!==e.bl_tree[2*di[t]+1])break;return e.opt_len+=3*(t+1)+5+5+4,t}function Gi(e,t,n,i){var r;for(xi(e,t-257,5),xi(e,n-1,5),xi(e,i-4,4),r=0;r>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return Bn;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return jn;for(t=32;t0?(e.strm.data_type===Qn&&(e.strm.data_type=Vi(e)),Ui(e,e.l_desc),Ui(e,e.d_desc),o=Qi(e),r=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==t?$i(e,t,n,i):e.strategy===Un||s===r?(xi(e,(Hn<<1)+(i?1:0),3),Pi(e,pi,_i)):(xi(e,(zn<<1)+(i?1:0),3),Gi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Pi(e,e.dyn_ltree,e.dyn_dtree)),Oi(e),i&&Li(e)}function Yi(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(mi[n]+Yn+1)]++,e.dyn_dtree[2*Ai(t)]++),e.last_lit===e.lit_bufsize-1}var Ji={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 Zi=0,er=1,tr=3,nr=4,ir=5,rr=0,sr=1,or=-2,ar=-5,cr=-1,lr=1,ur=2,hr=3,dr=4,fr=0,pr=2,_r=8;var gr,mr=9,vr=15,br=8,yr=29,wr=256,kr=wr+1+yr,Er=30,Sr=19,Ar=2*kr+1,Xr=15,xr=3,Kr=258,Cr=Kr+xr+1,Tr=32,Fr=42,Rr=69,Ir=73,Or=91,Lr=103,Dr=113,Mr=666,Nr=1,Pr=2,Ur=3,Br=4,jr=3;function Qr(e,t){return e.msg=Ji[t],t}function Gr(e){return(e<<1)-(e>4?9:0)}function Vr(e){var t=e.length;while(--t>=0)e[t]=0}function Hr(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(ct(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function zr(e,t){Wi(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Hr(e.strm)}function $r(e,t){e.pending_buf[e.pending++]=t}function qr(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Wr(e,t,n,i){var r=e.avail_in;return r>i&&(r=i),0===r?0:(e.avail_in-=r,ct(t,e.input,e.next_in,r,n),1===e.state.wrap?e.adler=dt(e.adler,t,r,n):2===e.state.wrap&&(e.adler=ft(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)}function Yr(e,t){var n,i,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-Cr?e.strstart-(e.w_size-Cr):0,l=e.window,u=e.w_mask,h=e.prev,d=e.strstart+Kr,f=l[s+o-1],p=l[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(n=t,l[n+o]===p&&l[n+o-1]===f&&l[n]===l[s]&&l[++n]===l[s+1]){s+=2,n++;do{}while(l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&so){if(e.match_start=t,o=i,i>=a)break;f=l[s+o-1],p=l[s+o]}}}while((t=h[t&u])>c&&0!==--r);return o<=e.lookahead?o:e.lookahead}function Jr(e){var t,n,i,r,s,o=e.w_size;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-Cr)){ct(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,n=e.hash_size,t=n;do{i=e.head[--t],e.head[t]=i>=o?i-o:0}while(--n);n=o,t=n;do{i=e.prev[--t],e.prev[t]=i>=o?i-o:0}while(--n);r+=o}if(0===e.strm.avail_in)break;if(n=Wr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=xr){s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Jr(e),0===e.lookahead&&t===Zi)return Nr;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,zr(e,!1),0===e.strm.avail_out))return Nr;if(e.strstart-e.block_start>=e.w_size-Cr&&(zr(e,!1),0===e.strm.avail_out))return Nr}return e.insert=0,t===nr?(zr(e,!0),0===e.strm.avail_out?Ur:Br):(e.strstart>e.block_start&&(zr(e,!1),e.strm.avail_out),Nr)}function es(e,t){for(var n,i;;){if(e.lookahead=xr&&(e.ins_h=(e.ins_h<=xr)if(i=Yi(e,e.strstart-e.match_start,e.match_length-xr),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=xr){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=xr&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=xr-1)),e.prev_length>=xr&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-xr,i=Yi(e,e.strstart-1-e.prev_match,e.prev_length-xr),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=(e.ins_h<=xr&&e.strstart>0&&(r=e.strstart-1,i=o[r],i===o[++r]&&i===o[++r]&&i===o[++r])){s=e.strstart+Kr;do{}while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=xr?(n=Yi(e,1,e.match_length-xr),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Yi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(zr(e,!1),0===e.strm.avail_out))return Nr}return e.insert=0,t===nr?(zr(e,!0),0===e.strm.avail_out?Ur:Br):e.last_lit&&(zr(e,!1),0===e.strm.avail_out)?Nr:Pr}function is(e,t){for(var n;;){if(0===e.lookahead&&(Jr(e),0===e.lookahead)){if(t===Zi)return Nr;break}if(e.match_length=0,n=Yi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(zr(e,!1),0===e.strm.avail_out))return Nr}return e.insert=0,t===nr?(zr(e,!0),0===e.strm.avail_out?Ur:Br):e.last_lit&&(zr(e,!1),0===e.strm.avail_out)?Nr:Pr}function rs(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}function ss(e){e.window_size=2*e.w_size,Vr(e.head),e.max_lazy_match=gr[e.level].max_lazy,e.good_match=gr[e.level].good_length,e.nice_match=gr[e.level].nice_length,e.max_chain_length=gr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=xr-1,e.match_available=0,e.ins_h=0}function os(){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=_r,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 ut(2*Ar),this.dyn_dtree=new ut(2*(2*Er+1)),this.bl_tree=new ut(2*(2*Sr+1)),Vr(this.dyn_ltree),Vr(this.dyn_dtree),Vr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ut(Xr+1),this.heap=new ut(2*kr+1),Vr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ut(2*kr+1),Vr(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 as(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=pr,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Fr:Dr,e.adler=2===t.wrap?0:1,t.last_flush=Zi,zi(t),rr):Qr(e,or)}function cs(e){var t=as(e);return t===rr&&ss(e.state),t}function ls(e,t,n,i,r,s){if(!e)return or;var o=1;if(t===cr&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),r<1||r>mr||n!==_r||i<8||i>15||t<0||t>9||s<0||s>dr)return Qr(e,or);8===i&&(i=9);var a=new os;return e.state=a,a.strm=e,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<ir||t<0)return e?Qr(e,or):or;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===Mr&&t!==nr)return Qr(e,0===e.avail_out?ar:or);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===Fr)if(2===i.wrap)e.adler=0,$r(i,31),$r(i,139),$r(i,8),i.gzhead?($r(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)),$r(i,255&i.gzhead.time),$r(i,i.gzhead.time>>8&255),$r(i,i.gzhead.time>>16&255),$r(i,i.gzhead.time>>24&255),$r(i,9===i.level?2:i.strategy>=ur||i.level<2?4:0),$r(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&($r(i,255&i.gzhead.extra.length),$r(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=ft(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Rr):($r(i,0),$r(i,0),$r(i,0),$r(i,0),$r(i,0),$r(i,9===i.level?2:i.strategy>=ur||i.level<2?4:0),$r(i,jr),i.status=Dr);else{var o=_r+(i.w_bits-8<<4)<<8,a=-1;a=i.strategy>=ur||i.level<2?0:i.level<6?1:6===i.level?2:3,o|=a<<6,0!==i.strstart&&(o|=Tr),o+=31-o%31,i.status=Dr,qr(i,o),0!==i.strstart&&(qr(i,e.adler>>>16),qr(i,65535&e.adler)),e.adler=1}if(i.status===Rr)if(i.gzhead.extra){r=i.pending;while(i.gzindex<(65535&i.gzhead.extra.length)){if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),Hr(e),r=i.pending,i.pending===i.pending_buf_size))break;$r(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++}i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Ir)}else i.status=Ir;if(i.status===Ir)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),Hr(e),r=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexr&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),0===s&&(i.gzindex=0,i.status=Or)}else i.status=Or;if(i.status===Or)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),Hr(e),r=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexr&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),0===s&&(i.status=Lr)}else i.status=Lr;if(i.status===Lr&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Hr(e),i.pending+2<=i.pending_buf_size&&($r(i,255&e.adler),$r(i,e.adler>>8&255),e.adler=0,i.status=Dr)):i.status=Dr),0!==i.pending){if(Hr(e),0===e.avail_out)return i.last_flush=-1,rr}else if(0===e.avail_in&&Gr(t)<=Gr(n)&&t!==nr)return Qr(e,ar);if(i.status===Mr&&0!==e.avail_in)return Qr(e,ar);if(0!==e.avail_in||0!==i.lookahead||t!==Zi&&i.status!==Mr){var c=i.strategy===ur?is(i,t):i.strategy===hr?ns(i,t):gr[i.level].func(i,t);if(c!==Ur&&c!==Br||(i.status=Mr),c===Nr||c===Ur)return 0===e.avail_out&&(i.last_flush=-1),rr;if(c===Pr&&(t===er?qi(i):t!==ir&&($i(i,0,0,!1),t===tr&&(Vr(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Hr(e),0===e.avail_out))return i.last_flush=-1,rr}return t!==nr?rr:i.wrap<=0?sr:(2===i.wrap?($r(i,255&e.adler),$r(i,e.adler>>8&255),$r(i,e.adler>>16&255),$r(i,e.adler>>24&255),$r(i,255&e.total_in),$r(i,e.total_in>>8&255),$r(i,e.total_in>>16&255),$r(i,e.total_in>>24&255)):(qr(i,e.adler>>>16),qr(i,65535&e.adler)),Hr(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?rr:sr)}gr=[new rs(0,0,0,0,Zr),new rs(4,4,8,4,es),new rs(4,5,16,8,es),new rs(4,6,32,32,es),new rs(4,4,16,16,ts),new rs(8,16,32,32,ts),new rs(8,16,128,128,ts),new rs(8,32,128,256,ts),new rs(32,128,258,1024,ts),new rs(32,258,258,4096,ts)];class ds{constructor(){this.strm=new Nn,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,us(this.strm,this.windowBits)}deflate(e){this.strm.input=e,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 t=hs(this.strm,tr),n=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(t<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){let e=[n],i=n.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,t=hs(this.strm,tr),t<0)throw new Error("zlib deflate failed");let n=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);i+=n.length,e.push(n)}while(this.strm.avail_in>0);let r=new Uint8Array(i),s=0;for(let t=0;t=32&&e<=255)return e;const t=fs[e];return void 0!==t?t:16777216|e}},_s={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"},gs={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 ms={};function vs(e,t){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(e in ms)throw new Error('Duplicate entry for key "'+e+'"');ms[e]=[t,t,t,t]}function bs(e,t,n){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===n)throw new Error('Undefined keysym for key "'+e+'"');if(e in ms)throw new Error('Duplicate entry for key "'+e+'"');ms[e]=[t,t,n,t]}function ys(e,t,n){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===n)throw new Error('Undefined keysym for key "'+e+'"');if(e in ms)throw new Error('Duplicate entry for key "'+e+'"');ms[e]=[t,t,t,n]}bs("Alt",Ce.XK_Alt_L,Ce.XK_Alt_R),vs("AltGraph",Ce.XK_ISO_Level3_Shift),vs("CapsLock",Ce.XK_Caps_Lock),bs("Control",Ce.XK_Control_L,Ce.XK_Control_R),bs("Meta",Ce.XK_Super_L,Ce.XK_Super_R),vs("NumLock",Ce.XK_Num_Lock),vs("ScrollLock",Ce.XK_Scroll_Lock),bs("Shift",Ce.XK_Shift_L,Ce.XK_Shift_R),ys("Enter",Ce.XK_Return,Ce.XK_KP_Enter),vs("Tab",Ce.XK_Tab),ys(" ",Ce.XK_space,Ce.XK_KP_Space),ys("ArrowDown",Ce.XK_Down,Ce.XK_KP_Down),ys("ArrowLeft",Ce.XK_Left,Ce.XK_KP_Left),ys("ArrowRight",Ce.XK_Right,Ce.XK_KP_Right),ys("ArrowUp",Ce.XK_Up,Ce.XK_KP_Up),ys("End",Ce.XK_End,Ce.XK_KP_End),ys("Home",Ce.XK_Home,Ce.XK_KP_Home),ys("PageDown",Ce.XK_Next,Ce.XK_KP_Next),ys("PageUp",Ce.XK_Prior,Ce.XK_KP_Prior),vs("Backspace",Ce.XK_BackSpace),ys("Clear",Ce.XK_Clear,Ce.XK_KP_Begin),vs("Copy",Ce.XF86XK_Copy),vs("Cut",Ce.XF86XK_Cut),ys("Delete",Ce.XK_Delete,Ce.XK_KP_Delete),ys("Insert",Ce.XK_Insert,Ce.XK_KP_Insert),vs("Paste",Ce.XF86XK_Paste),vs("Redo",Ce.XK_Redo),vs("Undo",Ce.XK_Undo),vs("Cancel",Ce.XK_Cancel),vs("ContextMenu",Ce.XK_Menu),vs("Escape",Ce.XK_Escape),vs("Execute",Ce.XK_Execute),vs("Find",Ce.XK_Find),vs("Help",Ce.XK_Help),vs("Pause",Ce.XK_Pause),vs("Select",Ce.XK_Select),vs("ZoomIn",Ce.XF86XK_ZoomIn),vs("ZoomOut",Ce.XF86XK_ZoomOut),vs("BrightnessDown",Ce.XF86XK_MonBrightnessDown),vs("BrightnessUp",Ce.XF86XK_MonBrightnessUp),vs("Eject",Ce.XF86XK_Eject),vs("LogOff",Ce.XF86XK_LogOff),vs("Power",Ce.XF86XK_PowerOff),vs("PowerOff",Ce.XF86XK_PowerDown),vs("PrintScreen",Ce.XK_Print),vs("Hibernate",Ce.XF86XK_Hibernate),vs("Standby",Ce.XF86XK_Standby),vs("WakeUp",Ce.XF86XK_WakeUp),vs("AllCandidates",Ce.XK_MultipleCandidate),vs("Alphanumeric",Ce.XK_Eisu_toggle),vs("CodeInput",Ce.XK_Codeinput),vs("Compose",Ce.XK_Multi_key),vs("Convert",Ce.XK_Henkan),vs("GroupFirst",Ce.XK_ISO_First_Group),vs("GroupLast",Ce.XK_ISO_Last_Group),vs("GroupNext",Ce.XK_ISO_Next_Group),vs("GroupPrevious",Ce.XK_ISO_Prev_Group),vs("NonConvert",Ce.XK_Muhenkan),vs("PreviousCandidate",Ce.XK_PreviousCandidate),vs("SingleCandidate",Ce.XK_SingleCandidate),vs("HangulMode",Ce.XK_Hangul),vs("HanjaMode",Ce.XK_Hangul_Hanja),vs("JunjaMode",Ce.XK_Hangul_Jeonja),vs("Eisu",Ce.XK_Eisu_toggle),vs("Hankaku",Ce.XK_Hankaku),vs("Hiragana",Ce.XK_Hiragana),vs("HiraganaKatakana",Ce.XK_Hiragana_Katakana),vs("KanaMode",Ce.XK_Kana_Shift),vs("KanjiMode",Ce.XK_Kanji),vs("Katakana",Ce.XK_Katakana),vs("Romaji",Ce.XK_Romaji),vs("Zenkaku",Ce.XK_Zenkaku),vs("ZenkakuHankaku",Ce.XK_Zenkaku_Hankaku),vs("F1",Ce.XK_F1),vs("F2",Ce.XK_F2),vs("F3",Ce.XK_F3),vs("F4",Ce.XK_F4),vs("F5",Ce.XK_F5),vs("F6",Ce.XK_F6),vs("F7",Ce.XK_F7),vs("F8",Ce.XK_F8),vs("F9",Ce.XK_F9),vs("F10",Ce.XK_F10),vs("F11",Ce.XK_F11),vs("F12",Ce.XK_F12),vs("F13",Ce.XK_F13),vs("F14",Ce.XK_F14),vs("F15",Ce.XK_F15),vs("F16",Ce.XK_F16),vs("F17",Ce.XK_F17),vs("F18",Ce.XK_F18),vs("F19",Ce.XK_F19),vs("F20",Ce.XK_F20),vs("F21",Ce.XK_F21),vs("F22",Ce.XK_F22),vs("F23",Ce.XK_F23),vs("F24",Ce.XK_F24),vs("F25",Ce.XK_F25),vs("F26",Ce.XK_F26),vs("F27",Ce.XK_F27),vs("F28",Ce.XK_F28),vs("F29",Ce.XK_F29),vs("F30",Ce.XK_F30),vs("F31",Ce.XK_F31),vs("F32",Ce.XK_F32),vs("F33",Ce.XK_F33),vs("F34",Ce.XK_F34),vs("F35",Ce.XK_F35),vs("Close",Ce.XF86XK_Close),vs("MailForward",Ce.XF86XK_MailForward),vs("MailReply",Ce.XF86XK_Reply),vs("MailSend",Ce.XF86XK_Send),vs("MediaFastForward",Ce.XF86XK_AudioForward),vs("MediaPause",Ce.XF86XK_AudioPause),vs("MediaPlay",Ce.XF86XK_AudioPlay),vs("MediaRecord",Ce.XF86XK_AudioRecord),vs("MediaRewind",Ce.XF86XK_AudioRewind),vs("MediaStop",Ce.XF86XK_AudioStop),vs("MediaTrackNext",Ce.XF86XK_AudioNext),vs("MediaTrackPrevious",Ce.XF86XK_AudioPrev),vs("New",Ce.XF86XK_New),vs("Open",Ce.XF86XK_Open),vs("Print",Ce.XK_Print),vs("Save",Ce.XF86XK_Save),vs("SpellCheck",Ce.XF86XK_Spell),vs("AudioVolumeDown",Ce.XF86XK_AudioLowerVolume),vs("AudioVolumeUp",Ce.XF86XK_AudioRaiseVolume),vs("AudioVolumeMute",Ce.XF86XK_AudioMute),vs("MicrophoneVolumeMute",Ce.XF86XK_AudioMicMute),vs("LaunchApplication1",Ce.XF86XK_MyComputer),vs("LaunchApplication2",Ce.XF86XK_Calculator),vs("LaunchCalendar",Ce.XF86XK_Calendar),vs("LaunchMail",Ce.XF86XK_Mail),vs("LaunchMediaPlayer",Ce.XF86XK_AudioMedia),vs("LaunchMusicPlayer",Ce.XF86XK_Music),vs("LaunchPhone",Ce.XF86XK_Phone),vs("LaunchScreenSaver",Ce.XF86XK_ScreenSaver),vs("LaunchSpreadsheet",Ce.XF86XK_Excel),vs("LaunchWebBrowser",Ce.XF86XK_WWW),vs("LaunchWebCam",Ce.XF86XK_WebCam),vs("LaunchWordProcessor",Ce.XF86XK_Word),vs("BrowserBack",Ce.XF86XK_Back),vs("BrowserFavorites",Ce.XF86XK_Favorites),vs("BrowserForward",Ce.XF86XK_Forward),vs("BrowserHome",Ce.XF86XK_HomePage),vs("BrowserRefresh",Ce.XF86XK_Refresh),vs("BrowserSearch",Ce.XF86XK_Search),vs("BrowserStop",Ce.XF86XK_Stop),vs("Dimmer",Ce.XF86XK_BrightnessAdjust),vs("MediaAudioTrack",Ce.XF86XK_AudioCycleTrack),vs("RandomToggle",Ce.XF86XK_AudioRandomPlay),vs("SplitScreenToggle",Ce.XF86XK_SplitScreen),vs("Subtitle",Ce.XF86XK_Subtitle),vs("VideoModeNext",Ce.XF86XK_Next_VMode),ys("=",Ce.XK_equal,Ce.XK_KP_Equal),ys("+",Ce.XK_plus,Ce.XK_KP_Add),ys("-",Ce.XK_minus,Ce.XK_KP_Subtract),ys("*",Ce.XK_asterisk,Ce.XK_KP_Multiply),ys("/",Ce.XK_slash,Ce.XK_KP_Divide),ys(".",Ce.XK_period,Ce.XK_KP_Decimal),ys(",",Ce.XK_comma,Ce.XK_KP_Separator),ys("0",Ce.XK_0,Ce.XK_KP_0),ys("1",Ce.XK_1,Ce.XK_KP_1),ys("2",Ce.XK_2,Ce.XK_KP_2),ys("3",Ce.XK_3,Ce.XK_KP_3),ys("4",Ce.XK_4,Ce.XK_KP_4),ys("5",Ce.XK_5,Ce.XK_KP_5),ys("6",Ce.XK_6,Ce.XK_KP_6),ys("7",Ce.XK_7,Ce.XK_KP_7),ys("8",Ce.XK_8,Ce.XK_KP_8),ys("9",Ce.XK_9,Ce.XK_KP_9);var ws=ms;function ks(e){if(e.code){switch(e.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return e.code}if(e.keyCode in _s){let t=_s[e.keyCode];if(ze()&&"ContextMenu"===t&&(t="MetaRight"),2===e.location)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(3===e.location)switch(t){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 t}return"Unidentified"}function Es(e){if(void 0!==e.key){switch(e.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(e.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}return"\0"===e.key&&"NumpadDecimal"===e.code?"Delete":e.key}const t=ks(e);return t in gs?gs[t]:e.charCode?String.fromCharCode(e.charCode):"Unidentified"}function Ss(e){const t=Es(e);if("Unidentified"===t)return null;if(t in ws){let n=e.location;if("Meta"===t&&0===n&&(n=2),"Clear"===t&&3===n){let t=ks(e);"NumLock"===t&&(n=0)}if((void 0===n||n>3)&&(n=0),"Meta"===t){let t=ks(e);if("AltLeft"===t)return Ce.XK_Meta_L;if("AltRight"===t)return Ce.XK_Meta_R}if("Clear"===t){let t=ks(e);if("NumLock"===t)return Ce.XK_Num_Lock}if($e())switch(t){case"Zenkaku":case"Hankaku":return Ce.XK_Zenkaku_Hankaku;case"Romaji":case"KanaMode":return Ce.XK_Romaji}return ws[t][n]}if(1!==t.length)return null;const n=t.charCodeAt();return n?ps.lookup(n):null}class As{constructor(e){this._target=e||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(e,t,n){if(n)this._keyDownList[t]=e;else{if(!(t in this._keyDownList))return;delete this._keyDownList[t]}Le("onkeyevent "+(n?"down":"up")+", keysym: "+e,", code: "+t),this.onkeyevent(e,t,n)}_getKeyCode(e){const t=ks(e);if("Unidentified"!==t)return t;if(e.keyCode&&229!==e.keyCode)return"Platform"+e.keyCode;if(e.keyIdentifier){if("U+"!==e.keyIdentifier.substr(0,2))return e.keyIdentifier;const t=parseInt(e.keyIdentifier.substr(2),16),n=String.fromCharCode(t).toUpperCase();return"Platform"+n.charCodeAt()}return"Unidentified"}_handleKeyDown(e){const t=this._getKeyCode(e);let n=Ss(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===t&&e.timeStamp-this._altGrCtrlTime<50?n=Ce.XK_ISO_Level3_Shift:this._sendKeyEvent(Ce.XK_Control_L,"ControlLeft",!0)),"Unidentified"===t)return n&&(this._sendKeyEvent(n,t,!0),this._sendKeyEvent(n,t,!1)),void Ye(e);if(ze()||qe())switch(n){case Ce.XK_Super_L:n=Ce.XK_Alt_L;break;case Ce.XK_Super_R:n=Ce.XK_Super_L;break;case Ce.XK_Alt_L:n=Ce.XK_Mode_switch;break;case Ce.XK_Alt_R:n=Ce.XK_ISO_Level3_Shift;break}if(t in this._keyDownList&&(n=this._keyDownList[t]),(ze()||qe())&&e.metaKey&&"MetaLeft"!==t&&"MetaRight"!==t)return this._sendKeyEvent(n,t,!0),this._sendKeyEvent(n,t,!1),void Ye(e);if((ze()||qe())&&"CapsLock"===t)return this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!1),void Ye(e);const i=[Ce.XK_Zenkaku_Hankaku,Ce.XK_Eisu_toggle,Ce.XK_Katakana,Ce.XK_Hiragana,Ce.XK_Romaji];return $e()&&i.includes(n)?(this._sendKeyEvent(n,t,!0),this._sendKeyEvent(n,t,!1),void Ye(e)):(Ye(e),"ControlLeft"===t&&$e()&&!("ControlLeft"in this._keyDownList)?(this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),void(this._altGrCtrlTime=e.timeStamp)):void this._sendKeyEvent(n,t,!0))}_handleKeyUp(e){Ye(e);const t=this._getKeyCode(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(Ce.XK_Control_L,"ControlLeft",!0)),(ze()||qe())&&"CapsLock"===t)return this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!0),void this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!1);this._sendKeyEvent(this._keyDownList[t],t,!1),!$e()||"ShiftLeft"!==t&&"ShiftRight"!==t||("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(Ce.XK_Control_L,"ControlLeft",!0)}_allKeysUp(){Le(">> Keyboard.allKeysUp");for(let e in this._keyDownList)this._sendKeyEvent(this._keyDownList[e],e,!1);Le("<< 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 Xs=0,xs=1,Ks=2,Cs=4,Ts=8,Fs=16,Rs=32,Is=64,Os=127,Ls=50,Ds=90,Ms=250,Ns=1e3,Ps=1e3,Us=50;class Bs{constructor(){this._target=null,this._state=Os,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}attach(e){this.detach(),this._target=e,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(e){let t;switch(e.stopPropagation(),e.preventDefault(),e.type){case"touchstart":t=this._touchStart;break;case"touchmove":t=this._touchMove;break;case"touchend":case"touchcancel":t=this._touchEnd;break}for(let n=0;n0&&Date.now()-this._tracked[0].started>Ms)return this._state=Xs,void this._ignored.push(e);if(this._waitingRelease)return this._state=Xs,void this._ignored.push(e);switch(this._tracked.push({id:e,started:Date.now(),active:!0,firstX:t,firstY:n,lastX:t,lastY:n,angle:0}),this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(xs|Ts|Fs),this._stopLongpressTimeout();break;case 3:this._state&=~(Ks|Rs|Is);break;default:this._state=Xs}}}_touchMove(e,t,n){let i=this._tracked.find(t=>t.id===e);if(void 0===i)return;i.lastX=t,i.lastY=n;let r=t-i.firstX,s=n-i.firstY;if(i.firstX===i.lastX&&i.firstY===i.lastY||(i.angle=180*Math.atan2(s,r)/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(r,s)t.id!==e),n=Math.hypot(t.firstX-t.lastX,t.firstY-t.lastY);if(n>Ls){let e=Math.abs(i.angle-t.angle);e=Math.abs((e+180)%360-180),this._state&=e>Ds?~Rs:~Is,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}_touchEnd(e,t,n){if(-1!==this._ignored.indexOf(e))return this._ignored.splice(this._ignored.indexOf(e),1),void(0===this._ignored.length&&0===this._tracked.length&&(this._state=Os,this._waitingRelease=!1));if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=Xs),!this._hasDetectedGesture()&&(this._state&=~(Ts|Rs|Is),this._state&=~Fs,this._stopLongpressTimeout(),!this._waitingRelease))switch(this._releaseStart=Date.now(),this._waitingRelease=!0,this._tracked.length){case 1:this._state&=~(Ks|Cs);break;case 2:this._state&=~(xs|Cs);break}if(this._waitingRelease){Date.now()-this._releaseStart>Ms&&(this._state=Xs),this._tracked.some(e=>Date.now()-e.started>Ns)&&(this._state=Xs);let t=this._tracked.find(t=>t.id===e);if(t.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==Xs)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(let i=0;ie.active)))}_startLongpressTimeout(){this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout(()=>this._longpressTimeout(),Ps)}_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=Fs,this._pushEvent("gesturestart")}_startTwoTouchTimeout(){this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(()=>this._twoTouchTimeout(),Us)}_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 e=this._getAverageMovement(),t=Math.abs(e.x),n=Math.abs(e.y),i=this._getAverageDistance(),r=Math.abs(Math.hypot(i.first.x,i.first.y)-Math.hypot(i.last.x,i.last.y));this._state=n{this._target&&(t=document.elementFromPoint(e.clientX,e.clientY),this._updateVisibility(t))},0)}_showCursor(){"hidden"===this._canvas.style.visibility&&(this._canvas.style.visibility="")}_hideCursor(){"hidden"!==this._canvas.style.visibility&&(this._canvas.style.visibility="hidden")}_shouldShowCursor(e){return!!e&&(e===this._target||!!this._target.contains(e)&&"none"===window.getComputedStyle(e).cursor)}_updateVisibility(e){this._captureIsActive()&&(e=document.captureElement),this._shouldShowCursor(e)?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 Gs=41943040,Vs={CONNECTING:"connecting",OPEN:"open",CLOSING:"closing",CLOSED:"closed"},Hs={CONNECTING:[WebSocket.CONNECTING,Vs.CONNECTING],OPEN:[WebSocket.OPEN,Vs.OPEN],CLOSING:[WebSocket.CLOSING,Vs.CLOSING],CLOSED:[WebSocket.CLOSED,Vs.CLOSED]},zs=["send","close","binaryType","onerror","onmessage","onopen","protocol","readyState"];class $s{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 e;return null===this._websocket?"unused":(e=this._websocket.readyState,Hs.CONNECTING.includes(e)?"connecting":Hs.OPEN.includes(e)?"open":Hs.CLOSING.includes(e)?"closing":Hs.CLOSED.includes(e)?"closed":"unknown")}get sQ(){return this._sQ}get rQ(){return this._rQ}get rQi(){return this._rQi}set rQi(e){this._rQi=e}get rQlen(){return this._rQlen-this._rQi}rQpeek8(){return this._rQ[this._rQi]}rQskipBytes(e){this._rQi+=e}rQshift8(){return this._rQshift(1)}rQshift16(){return this._rQshift(2)}rQshift32(){return this._rQshift(4)}_rQshift(e){let t=0;for(let n=e-1;n>=0;n--)t+=this._rQ[this._rQi++]<<8*n;return t}rQshiftStr(e){"undefined"===typeof e&&(e=this.rQlen);let t="";for(let n=0;n0&&"open"===this.readyState&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}send(e){this._sQ.set(e,this._sQlen),this._sQlen+=e.length,this.flush()}sendString(e){this.send(e.split("").map(e=>e.charCodeAt(0)))}off(e){this._eventHandlers[e]=()=>{}}on(e,t){this._eventHandlers[e]=t}_allocateBuffers(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}init(){this._allocateBuffers(),this._rQi=0,this._websocket=null}open(e,t){this.attach(new WebSocket(e,t))}attach(e){this.init();const t=[...Object.keys(e),...Object.getOwnPropertyNames(Object.getPrototypeOf(e))];for(let n=0;n{Le(">> WebSock.onopen"),this._websocket.protocol&&De("Server choose sub-protocol: "+this._websocket.protocol),this._eventHandlers.open(),Le("<< WebSock.onopen")},this._websocket.onclose=e=>{Le(">> WebSock.onclose"),this._eventHandlers.close(e),Le("<< WebSock.onclose")},this._websocket.onerror=e=>{Le(">> WebSock.onerror: "+e),this._eventHandlers.error(e),Le("<< WebSock.onerror: "+e)}}close(){this._websocket&&("connecting"!==this.readyState&&"open"!==this.readyState||(De("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=()=>{})}_encodeMessage(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}_expandCompactRQ(e){const t=8*(this._rQlen-this._rQi+e),n=this._rQbufferSizeGs&&(this._rQbufferSize=Gs,this._rQbufferSize-this.rQlenthis._rQbufferSize-this._rQlen&&this._expandCompactRQ(t.length),this._rQ.set(t,this._rQlen),this._rQlen+=t.length}_recvMessage(e){this._DecodeMessage(e.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):Le("Ignoring empty message")}}const qs=[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],Ws=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],Ys=0;let Js,Zs,eo,to,no,io;Js=65536,Zs=1<<24,eo=Js|Zs,to=4,no=1024,io=to|no;const ro=[eo|no,Ys|Ys,Js|Ys,eo|io,eo|to,Js|io,Ys|to,Js|Ys,Ys|no,eo|no,eo|io,Ys|no,Zs|io,eo|to,Zs|Ys,Ys|to,Ys|io,Zs|no,Zs|no,Js|no,Js|no,eo|Ys,eo|Ys,Zs|io,Js|to,Zs|to,Zs|to,Js|to,Ys|Ys,Ys|io,Js|io,Zs|Ys,Js|Ys,eo|io,Ys|to,eo|Ys,eo|no,Zs|Ys,Zs|Ys,Ys|no,eo|to,Js|Ys,Js|no,Zs|to,Ys|no,Ys|to,Zs|io,Js|io,eo|io,Js|to,eo|Ys,Zs|io,Zs|to,Ys|io,Js|io,eo|no,Ys|io,Zs|no,Zs|no,Ys|Ys,Js|to,Js|no,Ys|Ys,eo|to];Js=1<<20,Zs=1<<31,eo=Js|Zs,to=32,no=32768,io=to|no;const so=[eo|io,Zs|no,Ys|no,Js|io,Js|Ys,Ys|to,eo|to,Zs|io,Zs|to,eo|io,eo|no,Zs|Ys,Zs|no,Js|Ys,Ys|to,eo|to,Js|no,Js|to,Zs|io,Ys|Ys,Zs|Ys,Ys|no,Js|io,eo|Ys,Js|to,Zs|to,Ys|Ys,Js|no,Ys|io,eo|no,eo|Ys,Ys|io,Ys|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ys|io,Zs|no,Js|io,Js|to,Zs|no,Zs|to,eo|Ys,eo|no,Js|to,eo|Ys,Ys|no,Ys|io,eo|io,Js|no,Ys|to,Zs|Ys,Js|no,Zs|Ys,Js|no,Js|Ys,Zs|io,Zs|io,eo|to,eo|to,Ys|to,Js|to,Zs|Ys,Zs|no,Js|Ys,eo|no,Ys|io,Js|io,eo|no,Ys|io,Zs|to,eo|io,eo|Ys,Js|no,Ys|Ys,Ys|to,eo|io,Ys|Ys,Js|io,eo|Ys,Ys|no,Zs|to,Zs|no,Ys|no,Js|to];Js=1<<18,Zs=1<<28,eo=Js|Zs,to=64,no=4096,io=to|no;const ho=[Zs|io,Ys|no,Js|Ys,eo|io,Zs|Ys,Zs|io,Ys|to,Zs|Ys,Js|to,eo|Ys,eo|io,Js|no,eo|no,Js|io,Ys|no,Ys|to,eo|Ys,Zs|to,Zs|no,Ys|io,Js|no,Js|to,eo|to,eo|no,Ys|io,Ys|Ys,Ys|Ys,eo|to,Zs|to,Zs|no,Js|io,Js|Ys,Js|io,Js|Ys,eo|no,Ys|no,Ys|to,eo|to,Ys|no,Js|io,Zs|no,Ys|to,Zs|to,eo|Ys,eo|to,Zs|Ys,Js|Ys,Zs|io,Ys|Ys,eo|io,Js|to,Zs|to,eo|Ys,Zs|no,Zs|io,Ys|Ys,eo|io,Js|no,Js|no,Ys|io,Ys|io,Js|to,Zs|Ys,eo|no];class fo{constructor(e){this.keys=[];const t=[],n=[],i=[];for(let r=0,s=56;r<56;++r,s-=8){s+=s<-5?65:s<-3?31:s<-1?63:27===s?35:0;const n=7&s;t[r]=0!==(e[s>>>3]&1<>>10,this.keys[o]|=(4032&t)>>>6,++o,this.keys[o]=(258048&e)<<12,this.keys[o]|=(63&e)<<16,this.keys[o]|=(258048&t)>>>4,this.keys[o]|=63&t,++o}}enc8(e){const t=e.slice();let n,i,r,s=0;n=t[s++]<<24|t[s++]<<16|t[s++]<<8|t[s++],i=t[s++]<<24|t[s++]<<16|t[s++]<<8|t[s++],r=252645135&(n>>>4^i),i^=r,n^=r<<4,r=65535&(n>>>16^i),i^=r,n^=r<<16,r=858993459&(i>>>2^n),n^=r,i^=r<<2,r=16711935&(i>>>8^n),n^=r,i^=r<<8,i=i<<1|i>>>31&1,r=2863311530&(n^i),n^=r,i^=r,n=n<<1|n>>>31&1;for(let o=0,a=0;o<8;++o){r=i<<28|i>>>4,r^=this.keys[a++];let e=uo[63&r];e|=co[r>>>8&63],e|=oo[r>>>16&63],e|=ro[r>>>24&63],r=i^this.keys[a++],e|=ho[63&r],e|=lo[r>>>8&63],e|=ao[r>>>16&63],e|=so[r>>>24&63],n^=e,r=n<<28|n>>>4,r^=this.keys[a++],e=uo[63&r],e|=co[r>>>8&63],e|=oo[r>>>16&63],e|=ro[r>>>24&63],r=n^this.keys[a++],e|=ho[63&r],e|=lo[r>>>8&63],e|=ao[r>>>16&63],e|=so[r>>>24&63],i^=e}for(i=i<<31|i>>>1,r=2863311530&(n^i),n^=r,i^=r,n=n<<31|n>>>1,r=16711935&(n>>>8^i),i^=r,n^=r<<8,r=858993459&(n>>>2^i),i^=r,n^=r<<2,r=65535&(i>>>16^n),n^=r,i^=r<<16,r=252645135&(i>>>4^n),n^=r,i^=r<<4,r=[i,n],s=0;s<8;s++)t[s]=(r[s>>>2]>>>8*(3-s%4))%256,t[s]<0&&(t[s]+=256);return t}encrypt(e){return this.enc8(e.slice(0,8)).concat(this.enc8(e.slice(8,16)))}}var po={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 _o={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingZRLE:16,encodingTightPNG:-260,encodingJPEG:21,pseudoEncodingQualityLevel9:-23,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel9:-247,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};class go{constructor(){this._rawKey=null,this._ctrKey=null,this._cbcKey=null,this._zeroBlock=new Uint8Array(16),this._prefixBlock0=this._zeroBlock,this._prefixBlock1=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]),this._prefixBlock2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2])}async _encryptBlock(e){const t=await window.crypto.subtle.encrypt({name:"AES-CBC",iv:this._zeroBlock},this._cbcKey,e);return new Uint8Array(t).slice(0,16)}async _initCMAC(){const e=await this._encryptBlock(this._zeroBlock),t=new Uint8Array(16),n=e[0]>>>6;for(let r=0;r<15;r++)t[r]=e[r+1]>>6|e[r]<<2,e[r]=e[r+1]>>7|e[r]<<1;const i=[0,135,14,137];t[14]^=n>>>1,t[15]=e[15]<<2^i[n],e[15]=e[15]<<1^i[n>>1],this._k1=e,this._k2=t}async _encryptCTR(e,t){const n=await window.crypto.subtle.encrypt({name:"AES-CTR",counter:t,length:128},this._ctrKey,e);return new Uint8Array(n)}async _decryptCTR(e,t){const n=await window.crypto.subtle.decrypt({name:"AES-CTR",counter:t,length:128},this._ctrKey,e);return new Uint8Array(n)}async _computeCMAC(e,t){if(16!==t.length)return null;const n=Math.floor(e.length/16),i=Math.ceil(e.length/16),r=e.length-16*n,s=new Uint8Array(16*(i+1));if(s.set(t),s.set(e,16),0===r)for(let c=0;c<16;c++)s[16*n+c]^=this._k1[c];else{s[16*(n+1)+r]=128;for(let e=0;e<16;e++)s[16*(n+1)+e]^=this._k2[e]}let o=await window.crypto.subtle.encrypt({name:"AES-CBC",iv:this._zeroBlock},this._cbcKey,s);o=new Uint8Array(o);const a=o.slice(o.length-32,o.length-16);return a}async setKey(e){this._rawKey=e,this._ctrKey=await window.crypto.subtle.importKey("raw",e,{name:"AES-CTR"},!1,["encrypt","decrypt"]),this._cbcKey=await window.crypto.subtle.importKey("raw",e,{name:"AES-CBC"},!1,["encrypt","decrypt"]),await this._initCMAC()}async encrypt(e,t,n){const i=await this._computeCMAC(n,this._prefixBlock0),r=await this._encryptCTR(e,i),s=await this._computeCMAC(t,this._prefixBlock1),o=await this._computeCMAC(r,this._prefixBlock2);for(let c=0;c<16;c++)o[c]^=i[c]^s[c];const a=new Uint8Array(16+r.length);return a.set(r),a.set(o,r.length),a}async decrypt(e,t,n,i){const r=await this._computeCMAC(n,this._prefixBlock0),s=await this._computeCMAC(t,this._prefixBlock1),o=await this._computeCMAC(e,this._prefixBlock2);for(let c=0;c<16;c++)o[c]^=r[c]^s[c];if(o.length!==i.length)return null;for(let c=0;c>>8,255&e.length]),n=await this._cipher.encrypt(e,t,this._counter);for(let r=0;r<16&&255===this._counter[r]++;r++);const i=new Uint8Array(e.length+2+16);return i.set(t),i.set(n,2),i}async receiveMessage(e,t,n){const i=new Uint8Array([(65280&e)>>>8,255&e]),r=await this._cipher.decrypt(t,i,this._counter,n);for(let s=0;s<16&&255===this._counter[s]++;s++);return r}}class vo{constructor(e){this._key=null,this._keyLength=e,this._keyBytes=Math.ceil(e/8),this._n=null,this._e=null,this._d=null,this._nBigInt=null,this._eBigInt=null,this._dBigInt=null}_base64urlDecode(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.padEnd(4*Math.ceil(e.length/4),"="),ot.decode(e)}_u8ArrayToBigInt(e){let t="0x";for(let n=0;n0)t%2n===1n&&(i=i*e%n),t/=2n,e=e*e%n;return i}async generateKey(){this._key=await window.crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:this._keyLength,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["encrypt","decrypt"]);const e=await window.crypto.subtle.exportKey("jwk",this._key.privateKey);this._n=this._padArray(this._base64urlDecode(e.n),this._keyBytes),this._nBigInt=this._u8ArrayToBigInt(this._n),this._e=this._padArray(this._base64urlDecode(e.e),this._keyBytes),this._eBigInt=this._u8ArrayToBigInt(this._e),this._d=this._padArray(this._base64urlDecode(e.d),this._keyBytes),this._dBigInt=this._u8ArrayToBigInt(this._d)}setPublicKey(e,t){e.length===this._keyBytes&&t.length===this._keyBytes&&(this._n=new Uint8Array(this._keyBytes),this._e=new Uint8Array(this._keyBytes),this._n.set(e),this._e.set(t),this._nBigInt=this._u8ArrayToBigInt(this._n),this._eBigInt=this._u8ArrayToBigInt(this._e))}encrypt(e){if(e.length>this._keyBytes-11)return null;const t=new Uint8Array(this._keyBytes-e.length-3);window.crypto.getRandomValues(t);for(let s=0;s{const i=()=>!this._sock.rQwait("RA2",e);i()?t():(this._checkSock=()=>{i()&&(t(),this._checkSock=null,this._sockReject=null)},this._sockReject=n)})}_waitApproveKeyAsync(){return new Promise((e,t)=>{this._approveServerResolve=e,this._approveServerReject=t})}_waitCredentialsAsync(e){const t=()=>1===e&&void 0!==this._getCredentials().username&&void 0!==this._getCredentials().password||2===e&&void 0!==this._getCredentials().password;return new Promise((e,n)=>{t()?e():(this._checkCredentials=()=>{t()&&(e(),this._checkCredentials=null,this._credentialsReject=null)},this._credentialsReject=n)})}checkInternalEvents(){null!==this._checkSock&&this._checkSock(),null!==this._checkCredentials&&this._checkCredentials()}approveServer(){null!==this._approveServerResolve&&(this._approveServerResolve(),this._approveServerResolve=null)}disconnect(){null!==this._sockReject&&(this._sockReject(new Error("disconnect normally")),this._sockReject=null),null!==this._credentialsReject&&(this._credentialsReject(new Error("disconnect normally")),this._credentialsReject=null),null!==this._approveServerReject&&(this._approveServerReject(new Error("disconnect normally")),this._approveServerReject=null)}async negotiateRA2neAuthAsync(){this._hasStarted=!0,await this._waitSockAsync(4);const e=this._sock.rQslice(0,4),t=this._sock.rQshift32();if(t<1024)throw new Error("RA2: server public key is too short: "+t);if(t>8192)throw new Error("RA2: server public key is too long: "+t);const n=Math.ceil(t/8);await this._waitSockAsync(2*n);const i=this._sock.rQshiftBytes(n),r=this._sock.rQshiftBytes(n),s=new vo(t);s.setPublicKey(i,r);const o=new Uint8Array(4+2*n);o.set(e),o.set(i,4),o.set(r,4+n),this.dispatchEvent(new CustomEvent("serververification",{detail:{type:"RSA",publickey:o}})),await this._waitApproveKeyAsync();const a=2048,c=Math.ceil(a/8),l=new vo(a);await l.generateKey();const u=l.n,h=l.e,d=new Uint8Array(4+2*c);d[0]=(4278190080&a)>>>24,d[1]=(16711680&a)>>>16,d[2]=(65280&a)>>>8,d[3]=255&a,d.set(u,4),d.set(h,4+c),this._sock.send(d);const f=new Uint8Array(16);window.crypto.getRandomValues(f);const p=s.encrypt(f),_=new Uint8Array(2+n);if(_[0]=(65280&n)>>>8,_[1]=255&n,_.set(p,2),this._sock.send(_),await this._waitSockAsync(2),this._sock.rQshift16()!==c)throw new Error("RA2: wrong encrypted message length");const g=this._sock.rQshiftBytes(c),m=l.decrypt(g);if(null===m||16!==m.length)throw new Error("RA2: corrupted server encrypted random");let v=new Uint8Array(32),b=new Uint8Array(32);v.set(m),v.set(f,16),b.set(f),b.set(m,16),v=await window.crypto.subtle.digest("SHA-1",v),v=new Uint8Array(v).slice(0,16),b=await window.crypto.subtle.digest("SHA-1",b),b=new Uint8Array(b).slice(0,16);const y=new mo;await y.setKey(v);const w=new mo;await w.setKey(b);let k=new Uint8Array(8+2*n+2*c),E=new Uint8Array(8+2*n+2*c);if(k.set(o),k.set(d,4+2*n),E.set(d),E.set(o,4+2*c),k=await window.crypto.subtle.digest("SHA-1",k),E=await window.crypto.subtle.digest("SHA-1",E),k=new Uint8Array(k),E=new Uint8Array(E),this._sock.send(await y.makeMessage(E)),await this._waitSockAsync(38),20!==this._sock.rQshift16())throw new Error("RA2: wrong server hash");const S=await w.receiveMessage(20,this._sock.rQshiftBytes(20),this._sock.rQshiftBytes(16));if(null===S)throw new Error("RA2: failed to authenticate the message");for(let C=0;C<20;C++)if(S[C]!==k[C])throw new Error("RA2: wrong server hash");if(await this._waitSockAsync(19),1!==this._sock.rQshift16())throw new Error("RA2: wrong subtype");let A,X=await w.receiveMessage(1,this._sock.rQshiftBytes(1),this._sock.rQshiftBytes(16));if(null===X)throw new Error("RA2: failed to authenticate the message");if(X=X[0],1===X)void 0!==this._getCredentials().username&&void 0!==this._getCredentials().password||this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}}));else{if(2!==X)throw new Error("RA2: wrong subtype");void 0===this._getCredentials().password&&this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}}))}await this._waitCredentialsAsync(X),A=1===X?Be(this._getCredentials().username).slice(0,255):"";const x=Be(this._getCredentials().password).slice(0,255),K=new Uint8Array(A.length+x.length+2);K[0]=A.length,K[A.length+1]=x.length;for(let C=0;C>2);for(let n=0;n>5]|=(255&e.charCodeAt(n/8))<>5]>>>n%32&255);return t}function So(e,t){e[t>>5]|=128<>>9<<4)]=t;let n=1732584193,i=-271733879,r=-1732584194,s=271733878;for(let o=0;o>16)+(t>>16)+(n>>16)<<16|65535&n}function Fo(e,t){return e<>>32-t}class Ro{constructor(){this._lines=0}decodeRect(e,t,n,i,r,s,o){if(0===n||0===i)return!0;0===this._lines&&(this._lines=i);const a=8==o?1:4,c=n*a;if(r.rQwait("RAW",c))return!1;const l=t+(i-this._lines),u=Math.min(this._lines,Math.floor(r.rQlen/c)),h=n*u;let d=r.rQ,f=r.rQi;if(8==o){const e=new Uint8Array(4*h);for(let t=0;t>0&3)/3,e[4*t+1]=255*(d[f+t]>>2&3)/3,e[4*t+2]=255*(d[f+t]>>4&3)/3,e[4*t+3]=255;d=e,f=0}for(let p=0;p0)}}class Io{decodeRect(e,t,n,i,r,s,o){if(r.rQwait("COPYRECT",4))return!1;let a=r.rQshift16(),c=r.rQshift16();return 0===n||0===i||s.copyImage(a,c,e,t,n,i),!0}}class Oo{constructor(){this._subrects=0}decodeRect(e,t,n,i,r,s,o){if(0===this._subrects){if(r.rQwait("RRE",8))return!1;this._subrects=r.rQshift32();let o=r.rQshiftBytes(4);s.fillRect(e,t,n,i,o)}while(this._subrects>0){if(r.rQwait("RRE",12))return!1;let n=r.rQshiftBytes(4),i=r.rQshift16(),o=r.rQshift16(),a=r.rQshift16(),c=r.rQshift16();s.fillRect(e+i,t+o,a,c,n),this._subrects--}return!0}}class Lo{constructor(){this._tiles=0,this._lastsubencoding=0,this._tileBuffer=new Uint8Array(1024)}decodeRect(e,t,n,i,r,s,o){0===this._tiles&&(this._tilesX=Math.ceil(n/16),this._tilesY=Math.ceil(i/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);while(this._tiles>0){let o=1;if(r.rQwait("HEXTILE",o))return!1;let a=r.rQ,c=r.rQi,l=a[c];if(l>30)throw new Error("Illegal hextile subencoding (subencoding: "+l+")");const u=this._totalTiles-this._tiles,h=u%this._tilesX,d=Math.floor(u/this._tilesX),f=e+16*h,p=t+16*d,_=Math.min(16,e+n-f),g=Math.min(16,t+i-p);if(1&l)o+=_*g*4;else if(2&l&&(o+=4),4&l&&(o+=4),8&l){if(o++,r.rQwait("HEXTILE",o))return!1;let e=a[c+o-1];o+=16&l?6*e:2*e}if(r.rQwait("HEXTILE",o))return!1;if(c++,0===l)1&this._lastsubencoding?Le(" Ignoring blank after RAW"):s.fillRect(f,p,_,g,this._background);else if(1&l){let e=_*g;for(let t=0;t>4,i=15&t,r=a[c];c++;const s=1+(r>>4),o=1+(15&r);this._subTile(n,i,s,o,e)}}this._finishTile(s)}r.rQi=c,this._lastsubencoding=l,this._tiles--}return!0}_startTile(e,t,n,i,r){this._tileX=e,this._tileY=t,this._tileW=n,this._tileH=i;const s=r[0],o=r[1],a=r[2],c=this._tileBuffer;for(let l=0;l>e&1&&(this._zlibs[e].reset(),De("Reset zlib stream "+e));this._ctl=this._ctl>>4}let a;if(8===this._ctl)a=this._fillRect(e,t,n,i,r,s,o);else if(9===this._ctl)a=this._jpegRect(e,t,n,i,r,s,o);else if(10===this._ctl)a=this._pngRect(e,t,n,i,r,s,o);else{if(0!=(8&this._ctl))throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");a=this._basicRect(this._ctl,e,t,n,i,r,s,o)}return a&&(this._ctl=null),a}_fillRect(e,t,n,i,r,s,o){if(r.rQwait("TIGHT",3))return!1;const a=r.rQi,c=r.rQ;return s.fillRect(e,t,n,i,[c[a],c[a+1],c[a+2]],!1),r.rQskipBytes(3),!0}_jpegRect(e,t,n,i,r,s,o){let a=this._readData(r);return null!==a&&(s.imageRect(e,t,n,i,"image/jpeg",a),!0)}_pngRect(e,t,n,i,r,s,o){throw new Error("PNG received in standard Tight rect")}_basicRect(e,t,n,i,r,s,o,a){if(null===this._filter)if(4&e){if(s.rQwait("TIGHT",1))return!1;this._filter=s.rQshift8()}else this._filter=0;let c,l=3&e;switch(this._filter){case 0:c=this._copyFilter(l,t,n,i,r,s,o,a);break;case 1:c=this._paletteFilter(l,t,n,i,r,s,o,a);break;case 2:c=this._gradientFilter(l,t,n,i,r,s,o,a);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return c&&(this._filter=null),c}_copyFilter(e,t,n,i,r,s,o,a){const c=i*r*3;let l;if(0===c)return!0;if(c<12){if(s.rQwait("TIGHT",c))return!1;l=s.rQshiftBytes(c)}else{if(l=this._readData(s),null===l)return!1;this._zlibs[e].setInput(l),l=this._zlibs[e].inflate(c),this._zlibs[e].setInput(null)}let u=new Uint8Array(i*r*4);for(let h=0,d=0;h=0;o--)e=4*(u*n+8*i+7-o),t=3*(r[u*c+i]>>o&1),a[e]=s[t],a[e+1]=s[t+1],a[e+2]=s[t+2],a[e+3]=255;for(let o=7;o>=8-n%8;o--)e=4*(u*n+8*i+7-o),t=3*(r[u*c+i]>>o&1),a[e]=s[t],a[e+1]=s[t+1],a[e+2]=s[t+2],a[e+3]=255}o.blitImage(e,t,n,i,a,0,!1)}_paletteRect(e,t,n,i,r,s,o){const a=this._getScratchBuffer(n*i*4),c=n*i*4;for(let l=0,u=0;l=2&&a<=16){const e=this._decodePaletteTile(a,o,i,r);s.blitImage(t,c,i,r,e,0,!1)}else if(128===a){const e=this._decodeRLETile(o);s.blitImage(t,c,i,r,e,0,!1)}else{if(!(a>=130&&a<=255))throw new Error("Unknown subencoding: "+a);{const e=this._decodeRLEPaletteTile(a-128,o);s.blitImage(t,c,i,r,e,0,!1)}}}}return this._length=0,!0}_getBitsPerPixelInPalette(e){return e<=2?1:e<=4?2:e<=16?4:void 0}_readPixels(e){let t=this._pixelBuffer;const n=this._inflator.inflate(3*e);for(let i=0,r=0;i<4*e;i+=4,r+=3)t[i]=n[r],t[i+1]=n[r+1],t[i+2]=n[r+2],t[i+3]=255;return t}_decodePaletteTile(e,t,n,i){const r=this._tileBuffer,s=this._readPixels(e),o=this._getBitsPerPixelInPalette(e),a=(1<>e&a;r[c]=s[4*t],r[c+1]=s[4*t+1],r[c+2]=s[4*t+2],r[c+3]=s[4*t+3],c+=4,e-=o}e<8-o&&u=128&&(s-=128,o=this._readRLELength()),s>e)throw new Error("Too big index in palette: "+s+", palette size: "+e);if(r+o>t)throw new Error("Too big rle length in palette mode: "+o+", allowed length is: "+(t-r));for(let e=0;e192==e[1]||194==e[1]);if(-1==r)throw new Error("Illegal JPEG image without SOF");let o=this._segments.slice(0,r);o=o.concat(this._quantTables.length?this._quantTables:this._cachedQuantTables),o.push(this._segments[r]),o=o.concat(this._huffmanTables.length?this._huffmanTables:this._cachedHuffmanTables,this._segments.slice(r+1));let a=0;for(let e=0;en)return!1;if(255!=e[i])throw new Error("Illegal JPEG marker received (byte: "+e[i]+")");const r=e[i+1];if(i+=2,217==r)return this._jpegLength=i,this._segments.push(e.slice(t,i)),!0;if(218==r){let r=!1;for(let t=i+3;t+1=208&&e[t+1]<=215)){i=t,r=!0;break}if(!r)return!1;this._segments.push(e.slice(t,i)),t=i;continue}if(r>=208&&r<217||1==r){this._segments.push(e.slice(t,i)),t=i;continue}if(i+2>n)return!1;const s=(e[i]<<8)+e[i+1]-2;if(s<0)throw new Error("Illegal JPEG length received (length: "+s+")");if(i+=2,i+s>n)return!1;i+=s;const o=e.slice(t,i);196==r?this._huffmanTables.push(o):219==r&&this._quantTables.push(o),this._segments.push(o),t=i}}}const jo=3,Qo="rgb(40, 40, 40)",Go=17,Vo=50,Ho=19,zo=75,$o=50,qo=1e3,Wo=50,Yo=1,Jo=2,Zo=6,ea=16,ta=19,na=22,ia=30,ra=113,sa=129,oa=256,aa=1,ca=1<<24,la=1<<25,ua=1<<26,ha=1<<27,da=1<<28;class fa extends st{constructor(e,t,n){if(!e)throw new Error("Must specify target");if(!t)throw new Error("Must specify URL, WebSocket or RTCDataChannel");window.isSecureContext||Ne("noVNC requires a secure context (TLS). Expect crashes!"),super(),this._target=e,"string"===typeof t?this._url=t:(this._url=null,this._rawChannel=t),n=n||{},this._rfbCredentials=n.credentials||{},this._shared=!("shared"in n)||!!n.shared,this._repeaterID=n.repeaterID||"",this._wsProtocols=n.wsProtocols||[],this._rfbConnectionState="",this._rfbInitState="",this._rfbAuthScheme=-1,this._rfbCleanDisconnect=!0,this._rfbRSAAESAuthenticationState=null,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),handleRSAAESCredentialsRequired:this._handleRSAAESCredentialsRequired.bind(this),handleRSAAESServerVerification:this._handleRSAAESServerVerification.bind(this)},Le(">> 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=Qo,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 Qs,this._cursorImage=fa.cursors.none,this._decoders[_o.encodingRaw]=new Ro,this._decoders[_o.encodingCopyRect]=new Io,this._decoders[_o.encodingRRE]=new Oo,this._decoders[_o.encodingHextile]=new Lo,this._decoders[_o.encodingTight]=new Do,this._decoders[_o.encodingTightPNG]=new Mo,this._decoders[_o.encodingZRLE]=new Uo,this._decoders[_o.encodingJPEG]=new Bo;try{this._display=new at(this._canvas)}catch(Ua){throw Ne("Display exception: "+Ua),Ua}this._display.onflush=this._onFlush.bind(this),this._keyboard=new As(this._canvas),this._keyboard.onkeyevent=this._handleKeyEvent.bind(this),this._gestures=new Bs,this._sock=new $s,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._expectedClientWidth=null,this._expectedClientHeight=null,this._resizeObserver=new ResizeObserver(this._eventHandlers.handleResize),this._updateConnectionState("connecting"),Le("<< RFB.constructor"),this.dragViewport=!1,this.focusOnClick=!0,this._viewOnly=!1,this._clipViewport=!1,this._clippingViewport=!1,this._scaleViewport=!1,this._resizeSession=!1,this._showDotCursor=!1,void 0!==n.showDotCursor&&(Me("Specifying showDotCursor as a RFB constructor argument is deprecated"),this._showDotCursor=n.showDotCursor),this._qualityLevel=6,this._compressionLevel=2}get viewOnly(){return this._viewOnly}set viewOnly(e){this._viewOnly=e,"connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState||(e?this._keyboard.ungrab():this._keyboard.grab())}get capabilities(){return this._capabilities}get clippingViewport(){return this._clippingViewport}_setClippingViewport(e){e!==this._clippingViewport&&(this._clippingViewport=e,this.dispatchEvent(new CustomEvent("clippingviewport",{detail:this._clippingViewport})))}get touchButton(){return 0}set touchButton(e){Me("Using old API!")}get clipViewport(){return this._clipViewport}set clipViewport(e){this._clipViewport=e,this._updateClip()}get scaleViewport(){return this._scaleViewport}set scaleViewport(e){this._scaleViewport=e,e&&this._clipViewport&&this._updateClip(),this._updateScale(),!e&&this._clipViewport&&this._updateClip()}get resizeSession(){return this._resizeSession}set resizeSession(e){this._resizeSession=e,e&&this._requestRemoteResize()}get showDotCursor(){return this._showDotCursor}set showDotCursor(e){this._showDotCursor=e,this._refreshCursor()}get background(){return this._screen.style.background}set background(e){this._screen.style.background=e}get qualityLevel(){return this._qualityLevel}set qualityLevel(e){!Number.isInteger(e)||e<0||e>9?Ne("qualityLevel must be an integer between 0 and 9"):this._qualityLevel!==e&&(this._qualityLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}get compressionLevel(){return this._compressionLevel}set compressionLevel(e){!Number.isInteger(e)||e<0||e>9?Ne("compressionLevel must be an integer between 0 and 9"):this._compressionLevel!==e&&(this._compressionLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}disconnect(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open"),null!==this._rfbRSAAESAuthenticationState&&this._rfbRSAAESAuthenticationState.disconnect()}approveServer(){null!==this._rfbRSAAESAuthenticationState&&this._rfbRSAAESAuthenticationState.approveServer()}sendCredentials(e){this._rfbCredentials=e,this._resumeAuthentication()}sendCtrlAltDel(){"connected"!==this._rfbConnectionState||this._viewOnly||(De("Sending Ctrl-Alt-Del"),this.sendKey(Ce.XK_Control_L,"ControlLeft",!0),this.sendKey(Ce.XK_Alt_L,"AltLeft",!0),this.sendKey(Ce.XK_Delete,"Delete",!0),this.sendKey(Ce.XK_Delete,"Delete",!1),this.sendKey(Ce.XK_Alt_L,"AltLeft",!1),this.sendKey(Ce.XK_Control_L,"ControlLeft",!1))}machineShutdown(){this._xvpOp(1,2)}machineReboot(){this._xvpOp(1,3)}machineReset(){this._xvpOp(1,4)}sendKey(e,t,n){if("connected"!==this._rfbConnectionState||this._viewOnly)return;if(void 0===n)return this.sendKey(e,t,!0),void this.sendKey(e,t,!1);const i=po[t];if(this._qemuExtKeyEventSupported&&i)e=e||0,De("Sending key ("+(n?"down":"up")+"): keysym "+e+", scancode "+i),fa.messages.QEMUExtendedKeyEvent(this._sock,e,n,i);else{if(!e)return;De("Sending keysym ("+(n?"down":"up")+"): "+e),fa.messages.keyEvent(this._sock,e,n?1:0)}}focus(e){this._canvas.focus(e)}blur(){this._canvas.blur()}clipboardPasteFrom(e){if("connected"===this._rfbConnectionState&&!this._viewOnly)if(this._clipboardServerCapabilitiesFormats[aa]&&this._clipboardServerCapabilitiesActions[ha])this._clipboardText=e,fa.messages.extendedClipboardNotify(this._sock,[aa]);else{let t,n,i;t=0;for(let r of e)t++;i=new Uint8Array(t),n=0;for(let r of e){let e=r.codePointAt(0);e>255&&(e=63),i[n++]=e}fa.messages.clientCutText(this._sock,i)}}getImageData(){return this._display.getImageData()}toDataURL(e,t){return this._display.toDataURL(e,t)}toBlob(e,t,n){return this._display.toBlob(e,t,n)}_connect(){if(Le(">> RFB.connect"),this._url)De("connecting to "+this._url),this._sock.open(this._url,this._wsProtocols);else{if(De(`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),Le("<< RFB.connect")}_disconnect(){Le(">> 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(e){if("NotFoundError"!==e.name)throw e}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),Le("<< RFB.disconnect")}_socketOpen(){"connecting"===this._rfbConnectionState&&""===this._rfbInitState?(this._rfbInitState="ProtocolVersion",Le("Starting VNC handshake")):this._fail("Unexpected server connection while "+this._rfbConnectionState)}_socketClose(e){Le("WebSocket on-close event");let t="";switch(e.code&&(t="(code: "+e.code,e.reason&&(t+=", reason: "+e.reason),t+=")"),this._rfbConnectionState){case"connecting":this._fail("Connection closed "+t);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 "+t);break;default:this._fail("Unexpected server disconnect before connecting "+t);break}this._sock.off("close"),this._rawChannel=null}_socketError(e){Me("WebSocket on-error event")}_focusCanvas(e){this.focusOnClick&&this.focus({preventScroll:!0})}_setDesktopName(e){this._fbName=e,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}_saveExpectedClientSize(){this._expectedClientWidth=this._screen.clientWidth,this._expectedClientHeight=this._screen.clientHeight}_currentClientSize(){return[this._screen.clientWidth,this._screen.clientHeight]}_clientHasExpectedSize(){const[e,t]=this._currentClientSize();return e==this._expectedClientWidth&&t==this._expectedClientHeight}_handleResize(){this._clientHasExpectedSize()||(window.requestAnimationFrame(()=>{this._updateClip(),this._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500)))}_updateClip(){const e=this._display.clipViewport;let t=this._clipViewport;if(this._scaleViewport&&(t=!1),e!==t&&(this._display.clipViewport=t),t){const e=this._screenSize();this._display.viewportChangeSize(e.w,e.h),this._fixScrollbars(),this._setClippingViewport(e.w{Ne("Disconnection timed out."),this._updateConnectionState("disconnected")},1e3*jo);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}else Ne("Tried changing state of a disconnected RFB object");else Le("Already in state '"+e+"', ignoring")}_fail(e){switch(this._rfbConnectionState){case"disconnecting":Ne("Failed when disconnecting: "+e);break;case"connected":Ne("Failed while connected: "+e);break;case"connecting":Ne("Failed when connecting: "+e);break;default:Ne("RFB failure: "+e);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}_setCapability(e,t){this._capabilities[e]=t,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}_handleMessage(){if(0!==this._sock.rQlen)switch(this._rfbConnectionState){case"disconnected":Ne("Got data while disconnected");break;case"connected":while(1){if(this._flushing)break;if(!this._normalMsg())break;if(0===this._sock.rQlen)break}break;case"connecting":while("connecting"===this._rfbConnectionState)if(!this._initMsg())break;break;default:Ne("Got data while in an invalid state");break}else Me("handleMessage called on an empty receive queue")}_handleKeyEvent(e,t,n){this.sendKey(e,t,n)}_handleMouse(e){if("click"===e.type&&e.target!==this._canvas)return;if(e.stopPropagation(),e.preventDefault(),"click"===e.type||"contextmenu"===e.type)return;let t=We(e.clientX,e.clientY,this._canvas);switch(e.type){case"mousedown":it(this._canvas),this._handleMouseButton(t.x,t.y,!0,1<Qe||Math.abs(i)>Qe)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:e,y:t},this._display.viewportChangePos(n,i))}else if(this._mousePos={x:e,y:t},null==this._mouseMoveTimer){const n=Date.now()-this._mouseLastMoveTime;n>Go?(this._sendMouse(e,t,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(()=>{this._handleDelayedMouseMove()},Go-n)}}_handleDelayedMouseMove(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}_sendMouse(e,t,n){"connected"===this._rfbConnectionState&&(this._viewOnly||fa.messages.pointerEvent(this._sock,this._display.absX(e),this._display.absY(t),n))}_handleWheel(e){if("connected"!==this._rfbConnectionState)return;if(this._viewOnly)return;e.stopPropagation(),e.preventDefault();let t=We(e.clientX,e.clientY,this._canvas),n=e.deltaX,i=e.deltaY;0!==e.deltaMode&&(n*=Ho,i*=Ho),this._accumulatedWheelDeltaX+=n,this._accumulatedWheelDeltaY+=i,Math.abs(this._accumulatedWheelDeltaX)>=Vo&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(t.x,t.y,!0,32),this._handleMouseButton(t.x,t.y,!1,32)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(t.x,t.y,!0,64),this._handleMouseButton(t.x,t.y,!1,64)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=Vo&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(t.x,t.y,!0,8),this._handleMouseButton(t.x,t.y,!1,8)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(t.x,t.y,!0,16),this._handleMouseButton(t.x,t.y,!1,16)),this._accumulatedWheelDeltaY=0)}_fakeMouseMove(e,t,n){this._handleMouseMove(t,n),this._cursor.move(e.detail.clientX,e.detail.clientY)}_handleTapEvent(e,t){let n=We(e.detail.clientX,e.detail.clientY,this._canvas);if(null!==this._gestureLastTapTime&&Date.now()-this._gestureLastTapTime$o)this._handleMouseButton(n.x,n.y,!0,8),this._handleMouseButton(n.x,n.y,!1,8),this._gestureLastMagnitudeY+=$o;while(e.detail.magnitudeY-this._gestureLastMagnitudeY<-$o)this._handleMouseButton(n.x,n.y,!0,16),this._handleMouseButton(n.x,n.y,!1,16),this._gestureLastMagnitudeY-=$o;while(e.detail.magnitudeX-this._gestureLastMagnitudeX>$o)this._handleMouseButton(n.x,n.y,!0,32),this._handleMouseButton(n.x,n.y,!1,32),this._gestureLastMagnitudeX+=$o;while(e.detail.magnitudeX-this._gestureLastMagnitudeX<-$o)this._handleMouseButton(n.x,n.y,!0,64),this._handleMouseButton(n.x,n.y,!1,64),this._gestureLastMagnitudeX-=$o;break;case"pinch":if(this._fakeMouseMove(e,n.x,n.y),t=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),Math.abs(t-this._gestureLastMagnitudeX)>zo){this._handleKeyEvent(Ce.XK_Control_L,"ControlLeft",!0);while(t-this._gestureLastMagnitudeX>zo)this._handleMouseButton(n.x,n.y,!0,8),this._handleMouseButton(n.x,n.y,!1,8),this._gestureLastMagnitudeX+=zo;while(t-this._gestureLastMagnitudeX<-zo)this._handleMouseButton(n.x,n.y,!0,16),this._handleMouseButton(n.x,n.y,!1,16),this._gestureLastMagnitudeX-=zo}this._handleKeyEvent(Ce.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(e.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(e,n.x,n.y),this._handleMouseButton(n.x,n.y,!1,1);break;case"longpress":this._fakeMouseMove(e,n.x,n.y),this._handleMouseButton(n.x,n.y,!1,4);break}break}}_negotiateProtocolVersion(){if(this._sock.rQwait("version",12))return!1;const e=this._sock.rQshiftStr(12).substr(4,7);De("Server ProtocolVersion: "+e);let t=0;switch(e){case"000.000":t=1;break;case"003.003":case"003.006":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"003.889":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+e)}if(t){let e="ID:"+this._repeaterID;while(e.length<250)e+="\0";return this._sock.sendString(e),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);const n="00"+parseInt(this._rfbVersion,10)+".00"+10*this._rfbVersion%10;this._sock.sendString("RFB "+n+"\n"),Le("Sent ProtocolVersion: "+n),this._rfbInitState="Security"}_isSupportedSecurityType(e){const t=[Yo,Jo,Zo,ea,ta,na,ia,ra,oa];return t.includes(e)}_negotiateSecurity(){if(this._rfbVersion>=3.7){const e=this._sock.rQshift8();if(this._sock.rQwait("security type",e,1))return!1;if(0===e)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,!0;const t=this._sock.rQshiftBytes(e);Le("Server security types: "+t),this._rfbAuthScheme=-1;for(let n of t)if(this._isSupportedSecurityType(n)){this._rfbAuthScheme=n;break}if(-1===this._rfbAuthScheme)return this._fail("Unsupported security types (types: "+t+")");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,!0}return this._rfbInitState="Authentication",Le("Authenticating using scheme: "+this._rfbAuthScheme),!0}_handleSecurityReason(){if(this._sock.rQwait("reason length",4))return!1;const e=this._sock.rQshift32();let t="";if(e>0){if(this._sock.rQwait("reason",e,4))return!1;t=this._sock.rQshiftStr(e)}return""!==t?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:t}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+t+")")):(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 e=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(e),this._rfbAuthScheme=Jo,this._negotiateAuthentication()}_negotiateVeNCryptAuth(){if(0==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt version",2))return!1;const e=this._sock.rQshift8(),t=this._sock.rQshift8();if(0!=e||2!=t)return this._fail("Unsupported VeNCrypt version "+e+"."+t);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(1==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt ack",1))return!1;const e=this._sock.rQshift8();if(0!=e)return this._fail("VeNCrypt failure "+e);this._rfbVeNCryptState=2}if(2==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;const e=this._sock.rQshift8();if(e<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=e,this._rfbVeNCryptState=3}if(3==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;const e=[];for(let t=0;t>24,this._rfbAuthScheme>>16,this._rfbAuthScheme>>8,this._rfbAuthScheme]),this._rfbVeNCryptState,!0)}}_negotiatePlainAuth(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;const e=Be(this._rfbCredentials.username),t=Be(this._rfbCredentials.password);return this._sock.send([e.length>>24&255,e.length>>16&255,e.length>>8&255,255&e.length]),this._sock.send([t.length>>24&255,t.length>>16&255,t.length>>8&255,255&t.length]),this._sock.sendString(e),this._sock.sendString(t),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 e=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),t=fa.genDES(this._rfbCredentials.password,e);return this._sock.send(t),this._rfbInitState="SecurityResult",!0}_negotiateARDAuth(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;if(void 0!=this._rfbCredentials.ardPublicKey&&void 0!=this._rfbCredentials.ardCredentials)return this._sock.send(this._rfbCredentials.ardCredentials),this._sock.send(this._rfbCredentials.ardPublicKey),this._rfbCredentials.ardCredentials=null,this._rfbCredentials.ardPublicKey=null,this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("read ard",4))return!1;let e=this._sock.rQshiftBytes(2),t=this._sock.rQshift16();if(this._sock.rQwait("read ard keylength",2*t,4))return!1;let n=this._sock.rQshiftBytes(t),i=this._sock.rQshiftBytes(t),r=window.crypto.getRandomValues(new Uint8Array(t)),s=Array.from(window.crypto.getRandomValues(new Uint8Array(64)),e=>String.fromCharCode(65+e%26)).join("");return this._negotiateARDAuthAsync(e,t,n,i,r,s),!1}_modPow(e,t,n){let i="0x"+Array.from(e,e=>("0"+(255&e).toString(16)).slice(-2)).join(""),r="0x"+Array.from(t,e=>("0"+(255&e).toString(16)).slice(-2)).join(""),s="0x"+Array.from(n,e=>("0"+(255&e).toString(16)).slice(-2)).join(""),o=BigInt(i),a=BigInt(r),c=BigInt(s),l=1n;o%=c;while(a>0)a%2n===1n&&(l=l*o%c),a/=2n,o=o*o%c;let u=l.toString(16);while(u.length/2String.fromCharCode(e)).join(""),i=await window.crypto.subtle.importKey("raw",yo(n),{name:"AES-CBC"},!1,["encrypt"]),r=new Uint8Array(e.length);for(let o=0;o0&&this._sock.rQwait("tunnel capabilities",16*e,4))return!1;if(this._rfbTightVNC=!0,e>0)return this._negotiateTightTunnels(e),!1}if(this._sock.rQwait("sub auth count",4))return!1;const e=this._sock.rQshift32();if(0===e)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*e,4))return!1;const t={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},n=[];for(let i=0;ithis._rfbCredentials),this._rfbRSAAESAuthenticationState.addEventListener("serververification",this._eventHandlers.handleRSAAESServerVerification),this._rfbRSAAESAuthenticationState.addEventListener("credentialsrequired",this._eventHandlers.handleRSAAESCredentialsRequired)),this._rfbRSAAESAuthenticationState.checkInternalEvents(),this._rfbRSAAESAuthenticationState.hasStarted||this._rfbRSAAESAuthenticationState.negotiateRA2neAuthAsync().catch(e=>{"disconnect normally"!==e.message&&this._fail(e.message)}).then(()=>(this.dispatchEvent(new CustomEvent("securityresult")),this._rfbInitState="SecurityResult",!0)).finally(()=>{this._rfbRSAAESAuthenticationState.removeEventListener("serververification",this._eventHandlers.handleRSAAESServerVerification),this._rfbRSAAESAuthenticationState.removeEventListener("credentialsrequired",this._eventHandlers.handleRSAAESCredentialsRequired),this._rfbRSAAESAuthenticationState=null}),!1}_negotiateMSLogonIIAuth(){if(this._sock.rQwait("mslogonii dh param",24))return!1;if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;const e=this._sock.rQshiftBytes(8),t=this._sock.rQshiftBytes(8),n=this._sock.rQshiftBytes(8),i=window.crypto.getRandomValues(new Uint8Array(8)),r=new Uint8Array(this._modPow(e,i,t)),s=new Uint8Array(this._modPow(n,i,t)),o=new fo(s),a=Be(this._rfbCredentials.username).substring(0,255),c=Be(this._rfbCredentials.password).substring(0,63),l=new Uint8Array(256),u=new Uint8Array(64);window.crypto.getRandomValues(l),window.crypto.getRandomValues(u);for(let d=0;d=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=e,!0):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:e}})),this._fail("Security handshake failed"))}_negotiateServerInit(){if(this._sock.rQwait("server initialization",24))return!1;const e=this._sock.rQshift16(),t=this._sock.rQshift16(),n=this._sock.rQshift8(),i=this._sock.rQshift8(),r=this._sock.rQshift8(),s=this._sock.rQshift8(),o=this._sock.rQshift16(),a=this._sock.rQshift16(),c=this._sock.rQshift16(),l=this._sock.rQshift8(),u=this._sock.rQshift8(),h=this._sock.rQshift8();this._sock.rQskipBytes(3);const d=this._sock.rQshift32();if(this._sock.rQwait("server init name",d,24))return!1;let f=this._sock.rQshiftStr(d);if(f=Ue(f,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+d))return!1;const e=this._sock.rQshift16(),t=this._sock.rQshift16(),n=this._sock.rQshift16();this._sock.rQskipBytes(2);const i=16*(e+t+n);if(this._sock.rQwait("TightVNC extended server init header",i,32+d))return!1;this._sock.rQskipBytes(16*e),this._sock.rQskipBytes(16*t),this._sock.rQskipBytes(16*n)}return De("Screen: "+e+"x"+t+", bpp: "+n+", depth: "+i+", bigEndian: "+r+", trueColor: "+s+", redMax: "+o+", greenMax: "+a+", blueMax: "+c+", redShift: "+l+", greenShift: "+u+", blueShift: "+h),this._setDesktopName(f),this._resize(e,t),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(Me("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),fa.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),fa.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}_sendEncodings(){const e=[];e.push(_o.encodingCopyRect),24==this._fbDepth&&(e.push(_o.encodingTight),e.push(_o.encodingTightPNG),e.push(_o.encodingZRLE),e.push(_o.encodingJPEG),e.push(_o.encodingHextile),e.push(_o.encodingRRE)),e.push(_o.encodingRaw),e.push(_o.pseudoEncodingQualityLevel0+this._qualityLevel),e.push(_o.pseudoEncodingCompressLevel0+this._compressionLevel),e.push(_o.pseudoEncodingDesktopSize),e.push(_o.pseudoEncodingLastRect),e.push(_o.pseudoEncodingQEMUExtendedKeyEvent),e.push(_o.pseudoEncodingExtendedDesktopSize),e.push(_o.pseudoEncodingXvp),e.push(_o.pseudoEncodingFence),e.push(_o.pseudoEncodingContinuousUpdates),e.push(_o.pseudoEncodingDesktopName),e.push(_o.pseudoEncodingExtendedClipboard),24==this._fbDepth&&(e.push(_o.pseudoEncodingVMwareCursor),e.push(_o.pseudoEncodingCursor)),fa.messages.clientEncodings(this._sock,e)}_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+")")}}_resumeAuthentication(){setTimeout(this._initMsg.bind(this),0)}_handleSetColourMapMsg(){return Le("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}_handleServerCutText(){if(Le("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);let e=this._sock.rQshift32();if(e=Ie(e),this._sock.rQwait("ServerCutText content",Math.abs(e),8))return!1;if(e>=0){const t=this._sock.rQshiftStr(e);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:t}}))}else{e=Math.abs(e);const t=this._sock.rQshift32();let n=65535&t,i=4278190080&t,r=!!(i&ca);if(r){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(let t=0;t<=15;t++){let e=1<0&&"\0"===r.charAt(r.length-1)&&(r=r.slice(0,-1)),r=r.replace("\r\n","\n"),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:r}}))}}}}return!0}_handleServerFenceMsg(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);let e=this._sock.rQshift32(),t=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",t,9))return!1;t>64&&(Me("Bad payload length ("+t+") in fence response"),t=64);const n=this._sock.rQshiftStr(t);return this._supportsFence=!0,e&1<<31?(e&=3,fa.messages.clientFence(this._sock,e,n),!0):this._fail("Unexpected fence response")}_handleXvpMsg(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);const e=this._sock.rQshift8(),t=this._sock.rQshift8();switch(t){case 0:Ne("XVP Operation Failed");break;case 1:this._rfbXvpVer=e,De("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+t+")");break}return!0}_normalMsg(){let e,t,n;switch(e=this._FBU.rects>0?0:this._sock.rQshift8(),e){case 0:return n=this._framebufferUpdate(),n&&!this._enabledContinuousUpdates&&fa.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),n;case 1:return this._handleSetColourMapMsg();case 2:return Le("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return t=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,t&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),De("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+e+")"),Le("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}while(this._FBU.rects>0){if(null===this._FBU.encoding){if(this._sock.rQwait("rect header",12))return!1;const e=this._sock.rQshiftBytes(12);this._FBU.x=(e[0]<<8)+e[1],this._FBU.y=(e[2]<<8)+e[3],this._FBU.width=(e[4]<<8)+e[5],this._FBU.height=(e[6]<<8)+e[7],this._FBU.encoding=parseInt((e[8]<<24)+(e[9]<<16)+(e[10]<<8)+e[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 _o.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case _o.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case _o.pseudoEncodingCursor:return this._handleCursor();case _o.pseudoEncodingQEMUExtendedKeyEvent:return this._qemuExtKeyEventSupported=!0,!0;case _o.pseudoEncodingDesktopName:return this._handleDesktopName();case _o.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case _o.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}_handleVMwareCursor(){const e=this._FBU.x,t=this._FBU.y,n=this._FBU.width,i=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;const r=this._sock.rQshift8();let s;this._sock.rQshift8();const o=4;if(0==r){const e=-256;if(s=new Array(n*i*o),this._sock.rQwait("VMware cursor classic encoding",n*i*o*2,2))return!1;let t=new Array(n*i);for(let s=0;s>8&255,n=e>>16&255,i=e>>24&255;s[a*o]=t,s[a*o+1]=n,s[a*o+2]=i,s[a*o+3]=255}else(t[a]&e)==e?0==r[a]?(s[a*o]=0,s[a*o+1]=0,s[a*o+2]=0,s[a*o+3]=0):(r[a],s[a*o]=0,s[a*o+1]=0,s[a*o+2]=0,s[a*o+3]=255):(s[a*o]=0,s[a*o+1]=0,s[a*o+2]=0,s[a*o+3]=255)}else{if(1!=r)return Me("The given cursor type is not supported: "+r+" given."),!1;if(this._sock.rQwait("VMware cursor alpha encoding",n*i*4,2))return!1;s=new Array(n*i*o);for(let e=0;e>24&255,s[4*e+1]=t>>16&255,s[4*e+2]=t>>8&255,s[4*e+3]=255&t}}return this._updateCursor(s,e,t,n,i),!0}_handleCursor(){const e=this._FBU.x,t=this._FBU.y,n=this._FBU.width,i=this._FBU.height,r=n*i*4,s=Math.ceil(n/8)*i;let o=r+s;if(this._sock.rQwait("cursor encoding",o))return!1;const a=this._sock.rQshiftBytes(r),c=this._sock.rQshiftBytes(s);let l=new Uint8Array(n*i*4),u=0;for(let h=0;he.charCodeAt(0));return new fo(n).encrypt(t)}}fa.messages={keyEvent(e,t,n){const i=e._sQ,r=e._sQlen;i[r]=4,i[r+1]=n,i[r+2]=0,i[r+3]=0,i[r+4]=t>>24,i[r+5]=t>>16,i[r+6]=t>>8,i[r+7]=t,e._sQlen+=8,e.flush()},QEMUExtendedKeyEvent(e,t,n,i){function r(e){const t=i>>8,n=255&i;return 224===t&&n<127?128|n:e}const s=e._sQ,o=e._sQlen;s[o]=255,s[o+1]=0,s[o+2]=n>>8,s[o+3]=n,s[o+4]=t>>24,s[o+5]=t>>16,s[o+6]=t>>8,s[o+7]=t;const a=r(i);s[o+8]=a>>24,s[o+9]=a>>16,s[o+10]=a>>8,s[o+11]=a,e._sQlen+=12,e.flush()},pointerEvent(e,t,n,i){const r=e._sQ,s=e._sQlen;r[s]=5,r[s+1]=i,r[s+2]=t>>8,r[s+3]=t,r[s+4]=n>>8,r[s+5]=n,e._sQlen+=6,e.flush()},_buildExtendedClipboardFlags(e,t){let n=new Uint8Array(4),i=0,r=0;for(let s=0;s>24,n[1]=0,n[2]=0,n[3]=i,n},extendedClipboardProvide(e,t,n){let i=new ds,r=[];for(let a=0;a>24&255,e.length>>16&255,e.length>>8&255,255&e.length);for(let t=0;tparseInt(e)),i.sort((e,t)=>e-t),r.set(fa.messages._buildExtendedClipboardFlags(t,[]));let s=4;for(let o=0;o>24,r[s+1]=n[i[o]]>>16,r[s+2]=n[i[o]]>>8,r[s+3]=n[i[o]]>>0,s+=4,r[3]|=1<>24,i[r+5]=s>>16,i[r+6]=s>>8,i[r+7]=s,e._sQlen+=8;let o=0,a=t.length;while(a>0){let n=Math.min(a,e._sQbufferSize-e._sQlen);for(let r=0;r>8,s[o+3]=t,s[o+4]=n>>8,s[o+5]=n,s[o+6]=1,s[o+7]=0,s[o+8]=i>>24,s[o+9]=i>>16,s[o+10]=i>>8,s[o+11]=i,s[o+12]=0,s[o+13]=0,s[o+14]=0,s[o+15]=0,s[o+16]=t>>8,s[o+17]=t,s[o+18]=n>>8,s[o+19]=n,s[o+20]=r>>24,s[o+21]=r>>16,s[o+22]=r>>8,s[o+23]=r,e._sQlen+=24,e.flush()},clientFence(e,t,n){const i=e._sQ,r=e._sQlen;i[r]=248,i[r+1]=0,i[r+2]=0,i[r+3]=0,i[r+4]=t>>24,i[r+5]=t>>16,i[r+6]=t>>8,i[r+7]=t;const s=n.length;i[r+8]=s;for(let o=0;o>8,o[a+3]=n,o[a+4]=i>>8,o[a+5]=i,o[a+6]=r>>8,o[a+7]=r,o[a+8]=s>>8,o[a+9]=s,e._sQlen+=10,e.flush()},pixelFormat(e,t,n){const i=e._sQ,r=e._sQlen;let s;s=t>16?32:t>8?16:8;const o=Math.floor(t/3);i[r]=0,i[r+1]=0,i[r+2]=0,i[r+3]=0,i[r+4]=s,i[r+5]=t,i[r+6]=0,i[r+7]=n?1:0,i[r+8]=0,i[r+9]=(1<>8,n[i+3]=t.length;let r=i+4;for(let s=0;s>24,n[r+1]=e>>16,n[r+2]=e>>8,n[r+3]=e,r+=4}e._sQlen+=r-i,e.flush()},fbUpdateRequest(e,t,n,i,r,s){const o=e._sQ,a=e._sQlen;"undefined"===typeof n&&(n=0),"undefined"===typeof i&&(i=0),o[a]=3,o[a+1]=t?1:0,o[a+2]=n>>8&255,o[a+3]=255&n,o[a+4]=i>>8&255,o[a+5]=255&i,o[a+6]=r>>8&255,o[a+7]=255&r,o[a+8]=s>>8&255,o[a+9]=255&s,e._sQlen+=10,e.flush()},xvpOp(e,t,n){const i=e._sQ,r=e._sQlen;i[r]=250,i[r+1]=0,i[r+2]=t,i[r+3]=n,e._sQlen+=4,e.flush()}},fa.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}};var pa=function(){var e=this,t=e._self._c;return t("img",e._b({attrs:{src:e.pathToBrandedImage}},"img",e.$attrs,!1))},_a=[],ga=n("9ce4"),ma=n("907c"),va=n("8535"),ba={props:{fileName:{type:String,required:!0},dark:{type:Boolean,default:!1}},data(){var e,t;const n=this.$store.getters["management/all"](ma["a"].SETTING),i=null===n||void 0===n||null===(e=n.filter(e=>e.id===va["a"].LOGIN_BACKGROUND_LIGHT))||void 0===e||null===(e=e[0])||void 0===e?void 0:e.value,r=null===n||void 0===n||null===(t=n.filter(e=>e.id===va["a"].LOGIN_BACKGROUND_DARK))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.value;return{managementSettings:n,uiLoginBackgroundLight:i,uiLoginBackgroundDark:r}},computed:{...Object(ga["a"])({theme:"prefs/theme"}),brand(){const e=this.managementSettings.filter(e=>e.id===va["a"].BRAND)[0]||{};return e.value},uiLogoLight(){const e=this.managementSettings.filter(e=>e.id===va["a"].LOGO_LIGHT)[0]||{};return e.value},uiLogoDark(){const e=this.managementSettings.filter(e=>e.id===va["a"].LOGO_DARK)[0]||{};return e.value},uiBannerLight(){const e=this.managementSettings.filter(e=>e.id===va["a"].BANNER_LIGHT)[0]||{};return e.value},uiBannerDark(){const e=this.managementSettings.filter(e=>e.id===va["a"].BANNER_DARK)[0]||{};return e.value},defaultPathToBrandedImage(){const e="dark"===this.theme?"dark/":"";try{return n("bfed")(`./${e}${this.fileName}`)}catch{return n("fe4c")("./"+this.fileName)}},pathToBrandedImage(){if("rancher-logo.svg"===this.fileName){if("dark"===this.theme&&this.uiLogoDark)return this.uiLogoDark;if(this.uiLogoLight)return this.uiLogoLight}if("banner.svg"===this.fileName){if("dark"===this.theme&&this.uiBannerDark)return this.uiBannerDark;if(this.uiBannerLight)return this.uiBannerLight}if("login-landscape.svg"===this.fileName){if("dark"===this.theme&&this.uiLoginBackgroundDark)return this.uiLoginBackgroundDark;if(this.uiLoginBackgroundLight)return this.uiLoginBackgroundLight}if(this.brand){if("dark"===this.theme||this.dark)try{return n("78ef")(`./${this.brand}/dark/${this.fileName}`)}catch{}try{return n("21de")(`./${this.brand}/${this.fileName}`)}catch{}return this.defaultPathToBrandedImage}return this.defaultPathToBrandedImage}}},ya=ba,wa=Object(ve["a"])(ya,pa,_a,!1,null,null,null),ka=wa.exports,Ea={components:{BrandImage:ka},props:{url:{type:String,default:""}},data(){return{rfb:null,connected:!1,disconnected:!1}},mounted(){this.$nextTick(()=>{const e=new fa(this.$refs.view,this.url);e.addEventListener("connect",()=>{this.connected=!0}),e.addEventListener("disconnect",()=>{this.disconnected=!0}),this.rfb=e})},methods:{disconnect(){this.rfb.disconnect()},ctrlAltDelete(){this.rfb.sendCtrlAltDel()},sendKey(e,t,n){this.rfb.sendKey(e,t,n)}}},Sa=Ea,Aa=(n("0247"),Object(ve["a"])(Sa,Te,Fe,!1,null,"d269b192",null)),Xa=Aa.exports;const xa={ControlLeft:{label:"Ctrl",value:Ce.XK_Control_L},AltLeft:{label:"Alt",value:Ce.XK_Alt_L}},Ka={Delete:{label:"Del",value:Ce.XK_Delete},PrintScreen:{label:"Print Screen",value:Ce.XK_Print}},Ca={KeyN:{label:"N",value:Ce.XK_n},KeyT:{label:"T",value:Ce.XK_t},KeyW:{label:"W",value:Ce.XK_w},KeyY:{label:"Y",value:Ce.XK_y}},Ta={F1:{label:"F1",value:Ce.XK_F1},F2:{label:"F2",value:Ce.XK_F2},F3:{label:"F3",value:Ce.XK_F3},F4:{label:"F4",value:Ce.XK_F4},F5:{label:"F5",value:Ce.XK_F5},F6:{label:"F6",value:Ce.XK_F6},F7:{label:"F7",value:Ce.XK_F7},F8:{label:"F8",value:Ce.XK_F8},F9:{label:"F9",value:Ce.XK_F9},F10:{label:"F10",value:Ce.XK_F10},F11:{label:"F11",value:Ce.XK_F11},F12:{label:"F12",value:Ce.XK_F12}};var Fa={components:{NovncConsole:Xa},props:{value:{type:Object,required:!0,default:()=>({})}},data(){return{keysRecord:[],vmResource:{}}},async fetch(){this.vmResource=await this.$store.dispatch("cluster/find",{type:a["d"],id:this.id})},computed:{isDown(){return this.isEmpty(this.value)},url(){var e;const t=`${window.location.hostname}:${window.location.port}`;return`wss://${t}${null===(e=this.value)||void 0===e?void 0:e.getVMIApiPath}`},allKeys(){return{...xa,...Ka,...Ca,...Ta}},keymap(){const e={...xa,PrintScreen:Ka.PrintScreen,...Ta};return e.AltLeft.keys={PrintScreen:Ka.PrintScreen,...Ta},e.ControlLeft.keys={AltLeft:{...Object.assign(xa.AltLeft,{}),keys:{Delete:Ka.Delete}},...Ca},e},hasSoftRebootAction(){var e;return!(null===(e=this.vmResource)||void 0===e||null===(e=e.actions)||void 0===e||!e.softreboot)}},methods:{isEmpty(e){return void 0!==e&&0===Object.keys(e).length},close(){this.$refs.novncConsole.disconnect()},update({key:e,pos:t}){this.keysRecord.splice(t,this.keysRecord.length-t,e)},sendKeys(){this.keysRecord.forEach(e=>{this.$refs.novncConsole.sendKey(this.allKeys[e].value,e,!0)}),this.keysRecord.reverse().forEach(e=>{this.$refs.novncConsole.sendKey(this.allKeys[e].value,e,!1)}),this.$refs.popover.isOpen=!1,this.keysRecord=[]},softReboot(){this.vmResource.softrebootVM()}}},Ra=Fa,Ia=(n("6089"),Object(ve["a"])(Ra,xe,Ke,!1,null,"c325098a",null)),Oa=Ia.exports,La={components:{NovncConsoleWrapper:Oa,Loading:g["a"]},layout:"blank",data(){return{id:`${this.$route.params.namespace}/${this.$route.params.vm}`}},async fetch(){await this.$store.dispatch("cluster/find",{type:a["c"],id:this.id})},head(){var e;return{title:null===(e=this.vmi)||void 0===e||null===(e=e.metadata)||void 0===e?void 0:e.name}},computed:{vmi(){return this.$store.getters["cluster/byId"](a["c"],this.id)||[]}},mounted(){window.addEventListener("beforeunload",()=>{this.$refs.console.close()})}},Da=La,Ma=(n("1472"),Object(ve["a"])(Da,Ae,Xe,!1,null,null,null)),Na=Ma.exports,Pa=function(e){s(e),e.metadata=n("9224"),e.addProduct(n("85d6")),e.addAction(o["a"].TABLE,{resource:[a["d"]]},d),e.addAction(o["a"].TABLE,{resource:[a["d"]]},f),e.addRoute({name:a["b"]+"-c-cluster-vm-serialconsole",path:"/:product/c/:cluster/console/:namespace/:vm/serial",component:Se,meta:{product:a["b"]}}),e.addRoute({name:a["b"]+"-c-cluster-vm-vncconsole",path:"/:product/c/:cluster/console/:namespace/:vm/vnc",component:Na,meta:{product:a["b"]}})};t["default"]=Pa},"1d19":function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return _}));var i=n("e24b"),r=n("2cb5");const s={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object","[object FileList]":"filelist"},{toString:o}=Object.prototype;function a(e){if(null===e)return"null";if(void 0===e)return"undefined";let t=s[o.call(e)]||"object";return"object"===t&&(e instanceof Error?t="error":e instanceof Date&&(t="date")),t}function c(e,t){const n=e-t;return(n>0)-(n<0)}const l={undefined:0,null:1,boolean:2,number:3,string:4,array:5,object:6,instance:7,function:8,class:9,date:10};function u(e,t){const n=a(e),i=a(t),r=c(l[n],l[i]);if(r)return r;switch(n){case"boolean":case"number":return c(e,t);case"string":return c(e.localeCompare(t),0);case"array":{const n=e.length,i=t.length,r=Math.min(n,i);for(let s=0;s{for(let s=0;se.match(p)?Object(r["j"])(e,10,"0"):e).join("").trim()}},"1d5f":function(e){e.exports=JSON.parse('{"hasStylesheet":"true"}')},"1ec9":function(e,t,n){var i=n("fa8a"),r=n("44d9"),s=n("1386"),o=n("052a"),a=n("2fab"),c=n("e3f8");function l(e){var t=this.__data__=new i(e);this.size=t.size}l.prototype.clear=r,l.prototype["delete"]=s,l.prototype.get=o,l.prototype.has=a,l.prototype.set=c,e.exports=l},"1fce":function(e,t){function n(e,t){var n=-1,i=null==e?0:e.length,r=Array(i);while(++n-1)||n.indexOf(",")>-1||n.indexOf("/")>-1||i.StringUtilities.containsAny(r,e.specialCharacters))if(!t&&r.indexOf(",")>-1&&-1==r.indexOf("-")&&-1==r.indexOf("/")&&!i.StringUtilities.containsAny(n,e.specialCharacters)){var o=r.split(",");s+=this.i18n.at();for(var a=0;a0&&l.length>0&&(s+=", "),s+=l,s.length>0&&u.length>0&&(s+=", "),s+=u}else{var h=n.split("-");s+=i.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(r,h[0],""),this.formatTime(r,h[1],""))}else s+=this.i18n.atSpace()+this.formatTime(r,n,t);return s},e.prototype.getSecondsDescription=function(){var e=this,t=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),(function(e){return e}),(function(t){return i.StringUtilities.format(e.i18n.everyX0Seconds(),t)}),(function(t){return e.i18n.secondsX0ThroughX1PastTheMinute()}),(function(t){return"0"==t?"":parseInt(t)<20?e.i18n.atX0SecondsPastTheMinute():e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute()}));return t},e.prototype.getMinutesDescription=function(){var e=this,t=this.expressionParts[0],n=this.expressionParts[2],r=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),(function(e){return e}),(function(t){return i.StringUtilities.format(e.i18n.everyX0Minutes(),t)}),(function(t){return e.i18n.minutesX0ThroughX1PastTheHour()}),(function(i){try{return"0"==i&&-1==n.indexOf("/")&&""==t?e.i18n.everyHour():parseInt(i)<20?e.i18n.atX0MinutesPastTheHour():e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour()}catch(r){return e.i18n.atX0MinutesPastTheHour()}}));return r},e.prototype.getHoursDescription=function(){var e=this,t=this.expressionParts[2],n=this.getSegmentDescription(t,this.i18n.everyHour(),(function(t){return e.formatTime(t,"0","")}),(function(t){return i.StringUtilities.format(e.i18n.everyX0Hours(),t)}),(function(t){return e.i18n.betweenX0AndX1()}),(function(t){return e.i18n.atX0()}));return n},e.prototype.getDayOfWeekDescription=function(){var e=this,t=this.i18n.daysOfTheWeek(),n=null;return n="*"==this.expressionParts[5]?"":this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),(function(e){var n=e;return e.indexOf("#")>-1?n=e.substr(0,e.indexOf("#")):e.indexOf("L")>-1&&(n=n.replace("L","")),t[parseInt(n)]}),(function(t){return 1==parseInt(t)?"":i.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(),t)}),(function(t){return e.i18n.commaX0ThroughX1()}),(function(t){var n=null;if(t.indexOf("#")>-1){var i=t.substring(t.indexOf("#")+1),r=null;switch(i){case"1":r=e.i18n.first();break;case"2":r=e.i18n.second();break;case"3":r=e.i18n.third();break;case"4":r=e.i18n.fourth();break;case"5":r=e.i18n.fifth();break}n=e.i18n.commaOnThe()+r+e.i18n.spaceX0OfTheMonth()}else if(t.indexOf("L")>-1)n=e.i18n.commaOnTheLastX0OfTheMonth();else{var s="*"!=e.expressionParts[3];n=s?e.i18n.commaAndOnX0():e.i18n.commaOnlyOnX0()}return n})),n},e.prototype.getMonthDescription=function(){var e=this,t=this.i18n.monthsOfTheYear(),n=this.getSegmentDescription(this.expressionParts[4],"",(function(e){return t[parseInt(e)-1]}),(function(t){return 1==parseInt(t)?"":i.StringUtilities.format(e.i18n.commaEveryX0Months(),t)}),(function(t){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()}),(function(t){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()}));return n},e.prototype.getDayOfMonthDescription=function(){var e=this,t=null,n=this.expressionParts[3];switch(n){case"L":t=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":t=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var r=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(r){var s=parseInt(r[0].replace("W","")),o=1==s?this.i18n.firstWeekday():i.StringUtilities.format(this.i18n.weekdayNearestDayX0(),s.toString());t=i.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),o);break}var a=n.match(/L-(\d{1,2})/);if(a){var c=a[1];t=i.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(),c);break}if("*"==n&&"*"!=this.expressionParts[5])return"";t=this.getSegmentDescription(n,this.i18n.commaEveryDay(),(function(t){return"L"==t?e.i18n.lastDay():e.i18n.dayX0?i.StringUtilities.format(e.i18n.dayX0(),t):t}),(function(t){return"1"==t?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days()}),(function(t){return e.i18n.commaBetweenDayX0AndX1OfTheMonth()}),(function(t){return e.i18n.commaOnDayX0OfTheMonth()}));break}return t},e.prototype.getYearDescription=function(){var e=this,t=this.getSegmentDescription(this.expressionParts[6],"",(function(e){return/^\d+$/.test(e)?new Date(parseInt(e),1).getFullYear().toString():e}),(function(t){return i.StringUtilities.format(e.i18n.commaEveryX0Years(),t)}),(function(t){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()}),(function(t){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()}));return t},e.prototype.getSegmentDescription=function(e,t,n,r,s,o){var a=this,c=null;if(e)if("*"===e)c=t;else if(i.StringUtilities.containsAny(e,["/","-",","]))if(e.indexOf("/")>-1){var l=e.split("/");if(c=i.StringUtilities.format(r(l[1]),l[1]),l[0].indexOf("-")>-1){var u=this.generateBetweenSegmentDescription(l[0],s,n);0!=u.indexOf(", ")&&(c+=", "),c+=u}else if(!i.StringUtilities.containsAny(l[0],["*",","])){var h=i.StringUtilities.format(o(l[0]),n(l[0]));h=h.replace(", ",""),c+=i.StringUtilities.format(this.i18n.commaStartingX0(),h)}}else if(e.indexOf(",")>-1){l=e.split(",");for(var d="",f=0;f0&&l.length>2&&(d+=",",f0&&l.length>1&&(f==l.length-1||2==l.length)&&(d+=this.i18n.spaceAnd()+" "),l[f].indexOf("-")>-1){u=this.generateBetweenSegmentDescription(l[f],(function(e){return a.i18n.commaX0ThroughX1()}),n);u=u.replace(", ",""),d+=u}else d+=n(l[f]);c=i.StringUtilities.format(o(e),d)}else e.indexOf("-")>-1&&(c=this.generateBetweenSegmentDescription(e,s,n));else c=i.StringUtilities.format(o(e),n(e));else c="";return c},e.prototype.generateBetweenSegmentDescription=function(e,t,n){var r="",s=e.split("-"),o=n(s[0]),a=n(s[1]);a=a.replace(":00",":59");var c=t(e);return r+=i.StringUtilities.format(c,o,a),r},e.prototype.formatTime=function(e,t,n){var i=parseInt(e),r="",s=!1;this.options.use24HourTimeFormat||(s=this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime(),r=s?this.getPeriod(i)+" ":" "+this.getPeriod(i),i>12&&(i-=12),0===i&&(i=12));var o=t,a="";return n&&(a=":"+("00"+n).substring(n.length)),""+(s?r:"")+("00"+i.toString()).substring(i.toString().length)+":"+("00"+o.toString()).substring(o.toString().length)+a+(s?"":r)},e.prototype.transformVerbosity=function(e,t){return t||(e=e.replace(new RegExp(", "+this.i18n.everyMinute(),"g"),""),e=e.replace(new RegExp(", "+this.i18n.everyHour(),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,"")),e},e.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},e.locales={},e}();t.ExpressionDescriptor=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.format=function(e){for(var t=[],n=1;n-1}))},e}();t.StringUtilities=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){void 0===t&&(t=!0),this.expression=e,this.dayOfWeekStartIndexZero=t}return e.prototype.parse=function(){var e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},e.prototype.extractParts=function(e){if(!this.expression)throw new Error("Expression is empty");var t=e.trim().split(/[ ]+/);if(t.length<5)throw new Error("Expression has only "+t.length+" part"+(1==t.length?"":"s")+". At least 5 parts are required.");if(5==t.length)t.unshift(""),t.push("");else if(6==t.length)/\d{4}$/.test(t[5])?t.unshift(""):t.push("");else if(t.length>7)throw new Error("Expression has "+t.length+" parts; too many!");return t},e.prototype.normalize=function(e){var t=this;if(e[3]=e[3].replace("?","*"),e[5]=e[5].replace("?","*"),e[2]=e[2].replace("?","*"),0==e[0].indexOf("0/")&&(e[0]=e[0].replace("0/","*/")),0==e[1].indexOf("0/")&&(e[1]=e[1].replace("0/","*/")),0==e[2].indexOf("0/")&&(e[2]=e[2].replace("0/","*/")),0==e[3].indexOf("1/")&&(e[3]=e[3].replace("1/","*/")),0==e[4].indexOf("1/")&&(e[4]=e[4].replace("1/","*/")),0==e[5].indexOf("1/")&&(e[5]=e[5].replace("1/","*/")),0==e[6].indexOf("1/")&&(e[6]=e[6].replace("1/","*/")),e[5]=e[5].replace(/(^\d)|([^#/\s]\d)/g,(function(e){var n=e.replace(/\D/,""),i=n;return t.dayOfWeekStartIndexZero?"7"==n&&(i="0"):i=(parseInt(n)-1).toString(),e.replace(n,i)})),"L"==e[5]&&(e[5]="6"),"?"==e[3]&&(e[3]="*"),e[3].indexOf("W")>-1&&(e[3].indexOf(",")>-1||e[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var i in n)e[5]=e[5].replace(new RegExp(i,"gi"),n[i].toString());var r={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var s in r)e[4]=e[4].replace(new RegExp(s,"gi"),r[s].toString());"0"==e[0]&&(e[0]=""),/\*|\-|\,|\//.test(e[2])||!/\*|\//.test(e[1])&&!/\*|\//.test(e[0])||(e[2]+="-"+e[2]);for(var o=0;o-1&&!/^\*|\-|\,/.test(e[o])){var a=null;switch(o){case 4:a="12";break;case 5:a="6";break;case 6:a="9999";break;default:a=null;break}if(null!=a){var c=e[o].split("/");e[o]=c[0]+"-"+a+"/"+c[1]}}},e.prototype.validate=function(e){this.assertNoInvalidCharacters("DOW",e[5]),this.assertNoInvalidCharacters("DOM",e[3])},e.prototype.assertNoInvalidCharacters=function(e,t){var n=t.match(/[A-KM-VX-Z]+/gi);if(n&&n.length)throw new Error(e+" part contains invalid values: '"+n.toString()+"'")},e}();t.CronParser=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},e.prototype.atX0MinutesPastTheHourGt20=function(){return null},e.prototype.commaMonthX0ThroughMonthX1=function(){return null},e.prototype.commaYearX0ThroughYearX1=function(){return null},e.prototype.use24HourTimeFormatByDefault=function(){return!1},e.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},e.prototype.everyMinute=function(){return"every minute"},e.prototype.everyHour=function(){return"every hour"},e.prototype.atSpace=function(){return"At "},e.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},e.prototype.at=function(){return"At"},e.prototype.spaceAnd=function(){return" and"},e.prototype.everySecond=function(){return"every second"},e.prototype.everyX0Seconds=function(){return"every %s seconds"},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},e.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},e.prototype.everyX0Minutes=function(){return"every %s minutes"},e.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},e.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},e.prototype.everyX0Hours=function(){return"every %s hours"},e.prototype.betweenX0AndX1=function(){return"between %s and %s"},e.prototype.atX0=function(){return"at %s"},e.prototype.commaEveryDay=function(){return", every day"},e.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},e.prototype.commaX0ThroughX1=function(){return", %s through %s"},e.prototype.first=function(){return"first"},e.prototype.second=function(){return"second"},e.prototype.third=function(){return"third"},e.prototype.fourth=function(){return"fourth"},e.prototype.fifth=function(){return"fifth"},e.prototype.commaOnThe=function(){return", on the "},e.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},e.prototype.lastDay=function(){return"the last day"},e.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},e.prototype.commaOnlyOnX0=function(){return", only on %s"},e.prototype.commaAndOnX0=function(){return", and on %s"},e.prototype.commaEveryX0Months=function(){return", every %s months"},e.prototype.commaOnlyInX0=function(){return", only in %s"},e.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},e.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},e.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},e.prototype.firstWeekday=function(){return"first weekday"},e.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},e.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},e.prototype.commaEveryX0Days=function(){return", every %s days"},e.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},e.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},e.prototype.commaEveryHour=function(){return", every hour"},e.prototype.commaEveryX0Years=function(){return", every %s years"},e.prototype.commaStartingX0=function(){return", starting %s"},e.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},e.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},e}();t.en=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(5);i.ExpressionDescriptor.initialize(new r.enLocaleLoader),t.default=i.ExpressionDescriptor;var s=i.ExpressionDescriptor.toString;t.toString=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),r=function(){function e(){}return e.prototype.load=function(e){e["en"]=new i.en},e}();t.enLocaleLoader=r}])}))},"212d":function(e,t,n){var i=n("bf10"),r=n("201b"),s=i(r,"Promise");e.exports=s},"21de":function(e,t,n){var i={"./csp/dark/rancher-logo.svg":"858f","./csp/favicon.png":"44a5","./csp/metadata":"7f57","./csp/metadata.json":"7f57","./csp/rancher-logo.svg":"b5af","./federal/dark/rancher-logo.svg":"0749","./federal/metadata":"66fa","./federal/metadata.json":"66fa","./federal/rancher-logo.svg":"ad96","./rgs/dark/rancher-logo.svg":"b160","./rgs/metadata":"45d2","./rgs/metadata.json":"45d2","./rgs/rancher-logo.svg":"bd3e","./suse/dark/rancher-logo.svg":"d5dc","./suse/favicon.png":"f595","./suse/metadata":"1d5f","./suse/metadata.json":"1d5f","./suse/rancher-logo.svg":"4816"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=s,e.exports=r,r.id="21de"},2357:function(e,t,n){var i=n("e972"),r=/^\s+/;function s(e){return e?e.slice(0,i(e)+1).replace(r,""):e}e.exports=s},2419:function(e,t,n){var i=n("872c"),r=n("aa31"),s=n("7049");function o(e){var t=-1,n=null==e?0:e.length;this.__data__=new i;while(++tr(e)).join(" ")}function r(e){return e=e||"",e.substr(0,1).toUpperCase()+e.substr(1)}function s(e,t,n=" ",i=!1){if(e=""+e,e.length>=t)return e;const r=t-e.length+1,s=new Array(r).join(n).substr(0,r);return i?e+s:s+e}n.d(t,"a",(function(){return i})),n.d(t,"k",(function(){return r})),n.d(t,"j",(function(){return s})),n.d(t,"c",(function(){return a})),n.d(t,"h",(function(){return p})),n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return b})),n.d(t,"g",(function(){return y})),n.d(t,"i",(function(){return E})),n.d(t,"f",(function(){return S})),n.d(t,"e",(function(){return A}));const o={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function a(e){return String(e).replace(/[&<>"']/g,e=>o[e])}function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){e=Math.max(0,e||1);const t=[];let n;if(window.crypto&&window.crypto.getRandomValues){const i=new Uint32Array(e);for(window.crypto.getRandomValues(i),n=0;nt[e%t.length]).join(""):null}function _(e,t=2,n=" ",i=null){e="string"===typeof e?e.split(/\n/):e||[];const r=new Array(t+1).join(n),s=e.map(e=>{let t="",n=e;if(i){const r=e.match(i);r&&(t=r[r.length-1],n=e.substr(r[0].length))}return`${t}${r}${n}`}),o=s.join("\n");return o}const g=/([a-z\d])([A-Z])/g;function m(e){return e.replace(g,"$1_$2").toLowerCase()}const v=/[ _]/g;function b(e){return m(e).replace(v,"-")}function y(e,t=[]){return t.some(t=>{const n=e||"",i=w(t);return n.match(i)})}function w(e,t=!0){return"string"===typeof e?t?new RegExp(`^${c(e)}$`,"i"):new RegExp(""+c(e),"i"):e}const k=/[^."']+|"([^"]*)"|'([^']*)'/g;function E(e){return e.includes('"')||e.includes("'")?e.match(k).map(e=>e.replace(/['"]/g,"")):e.split(".")}function S(e){let t="";for(const n of e)n.includes(".")?t+=`."${n}"`:t+="."+n;return t.startsWith(".")&&(t=t.substr(1)),t}function A(e){const t=/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/;return t.test(e)}},"2d3f":function(e,t,n){e.exports=n.p+"img/login-landscape.911b980e.svg"},"2e63":function(e,t){function n(e,t){var n=-1,i=null==e?0:e.length;while(++n-1}e.exports=r},"3ad3":function(e,t,n){var i=n("4c0b"),r=i(Object.keys,Object);e.exports=r},"3b54":function(e,t,n){var i=n("c364"),r=n("cb86"),s=n("c68c");function o(e,t,n){var o=-1,a=t.length,c={};while(++oDIV,.vm-console>DIV>DIV,BODY,HTML,MAIN{height:100%}",""]),e.exports=t},"40cc":function(e,t,n){var i=n("e697"),r=Object.prototype,s=r.hasOwnProperty;function o(e){var t=this.__data__;return i?void 0!==t[e]:s.call(t,e)}e.exports=o},"413d":function(e,t){function n(e,t){var n=-1,i=e.length;t||(t=Array(i));while(++n=t||n<0||m&&i>=h}function E(){var e=r();if(k(e))return S(e);f=setTimeout(E,w(e))}function S(e){return f=void 0,v&&l?b(e):(l=u=void 0,d)}function A(){void 0!==f&&clearTimeout(f),_=0,l=p=u=f=void 0}function X(){return void 0===f?d:S(r())}function x(){var e=r(),n=k(e);if(l=arguments,u=this,p=e,n){if(void 0===f)return y(p);if(m)return clearTimeout(f),f=setTimeout(E,t),b(p)}return void 0===f&&(f=setTimeout(E,t)),d}return t=s(t)||0,i(n)&&(g=!!n.leading,m="maxWait"in n,h=m?a(s(n.maxWait)||0,t):h,v="trailing"in n?!!n.trailing:v),x.cancel=A,x.flush=X,x}e.exports=l},"44f6":function(e,t,n){"use strict";n.r(t),n.d(t,"OFF",(function(){return c})),n.d(t,"default",(function(){return S}));var i=n("640c"),r=n("e24b"),s=n("bddd"),o=n("907c"),a=n("377f");const c="Off",l="The virtual machine is waiting for resources to become available.",u="VM error",h="Stopping",d="Not Ready",f="Paused",p="This VM has been paused. If you wish to unpause it, please click the Unpause button below. For further details, please check with your system administrator.",_="POD_STATUS_COMPLETED",g="POD_STATUS_SUCCEEDED",m="POD_STATUS_RUNNING",v=[m,_,g],b={Always:"Always",RerunOnFailure:"RerunOnFailure",Halted:"Halted",Manual:"Manual"},y={Start:"Start",Stop:"Stop"},w="This virtual machine will start shortly. Preparing storage, networking, and compute resources.",k={Pending:"Pending",Scheduling:"Scheduling",Scheduled:"Scheduled",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",Unknown:"Unknown"},E=["pod has unbound immediate PersistentVolumeClaims"];class S extends i["a"]{get canStart(){return!this.spec.runStrategy&&!this.spec.running}get canStop(){return!this.spec.runStrategy&&this.spec.running}get runStrategyLabel(){return this.spec.runStrategy||"-"}get cpuCores(){var e,t;const n=this.$getters["byId"](a["c"],this.id);return(null===n||void 0===n||null===(e=n.spec)||void 0===e||null===(e=e.domain)||void 0===e||null===(e=e.cpu)||void 0===e?void 0:e.cores)||(null===(t=this.spec.template)||void 0===t||null===(t=t.spec)||void 0===t||null===(t=t.domain)||void 0===t||null===(t=t.cpu)||void 0===t?void 0:t.cores)}get nodeName(){var e;const t=this.$getters["byId"](a["c"],this.id),n=this.$getters["byId"](o["b"],null===t||void 0===t||null===(e=t.status)||void 0===e?void 0:e.nodeName);return null===n||void 0===n?void 0:n.id}get displayMemory(){var e,t,n;return(null===(e=this.spec.template.spec.domain.resources)||void 0===e||null===(e=e.limits)||void 0===e?void 0:e.memory)||(null===(t=this.spec.template.spec.domain.resources)||void 0===t||null===(t=t.requests)||void 0===t?void 0:t.memory)||(null===(n=this.spec.template.spec.domain.memory)||void 0===n?void 0:n.guest)||"0Gi"}get networksName(){var e;const t=(null===(e=this.spec.template.spec.domain.devices)||void 0===e?void 0:e.interfaces)||[];return t.map(e=>e.name)}get podResource(){const e=this.$getters["all"](o["c"]);return e.find(e=>{var t,n,i;return(null===(t=this.vmi)||void 0===t||null===(t=t.metadata)||void 0===t?void 0:t.name)&&(null===(n=this.vmi)||void 0===n||null===(n=n.metadata)||void 0===n?void 0:n.name)===(null===(i=e.metadata)||void 0===i||null===(i=i.ownerReferences)||void 0===i?void 0:i[0].name)})}get isVMExpectedRunning(){var e,t,n,i;if(null===this||void 0===this||!this.spec)return!1;const{running:r=null,runStrategy:s=null}=this.spec,o=(null===this||void 0===this||null===(e=this.status)||void 0===e?void 0:e.conditions)||[];if(r)return!0;if(null!==s){let e;switch(s){case b.Halted:return!1;case b.Always:return!0;case b.RerunOnFailure:return!("ErrorUnschedulable"!==(null===(t=this.status)||void 0===t?void 0:t.printableStatus)||!o.find(e=>e.message&&e.message.includes(E)))||["Starting","Running"].includes(null===(n=this.status)||void 0===n?void 0:n.printableStatus);case b.Manual:default:return e=new Set(((null===(i=this.status)||void 0===i?void 0:i.stateChangeRequests)||[]).map(e=>null===e||void 0===e?void 0:e.action)),e.has(y.Stop)?!1:!!e.has(y.Start)||(0===e.size?["Starting","Running"].includes(null===(a=this.status)||void 0===a?void 0:a.printableStatus):this.isVMCreated);var a}}return!1}get isPaused(){var e;const t=(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.conditions)||[],n=t.filter(e=>e.type===f).length>0;return n?{status:f,message:p}:null}get isVMError(){const e=Object(r["d"])(this,"status.conditions"),t=Object(s["d"])(e,"type","Failure");return t?{status:u,detailedMessage:t.message}:null}get isError(){var e;const t=Object(r["d"])(this.vmi,"status.conditions"),n=Object(s["d"])(t,"type","Failure");return n?{status:"VMI error",detailedMessage:n.message}:((this.vmi||this.isVMCreated)&&this.podResource,null===this||void 0===this||null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)}get isRunning(){var e,t;const n=Object(r["d"])(this.vmi,"status.conditions"),i="True"===(null===(e=Object(s["d"])(n,"type","Ready"))||void 0===e?void 0:e.status);return(null===(t=this.vmi)||void 0===t||null===(t=t.status)||void 0===t?void 0:t.phase)===k.Running&&i?{status:k.Running}:null}get isNotReady(){var e;const t=Object(r["d"])(this.vmi,"status.conditions"),n=Object(s["d"])(t,"type","Ready");return"False"===(null===n||void 0===n?void 0:n.status)&&(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)===k.Running?{status:d}:null}get isBeingStopped(){var e;return this&&!this.isVMExpectedRunning&&this.isVMCreated&&(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)!==k.Succeeded?{status:h}:null}get isStarting(){if(this.isVMExpectedRunning&&this.isVMCreated){if(this.podResource){const e=this.podResource.getPodStatus;if(!v.includes(null===e||void 0===e?void 0:e.status))return{...e,status:"Starting",message:w,detailedMessage:null===e||void 0===e?void 0:e.message,pod:this.podResource}}return{status:"Starting",message:w,pod:this.podResource}}return null}get isOff(){return this.isVMExpectedRunning?null:{status:c}}get otherState(){var e,t,n;const i=this.vmi&&[k.Scheduling,k.Scheduled].includes(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)&&{status:"Starting",message:w}||this.vmi&&(null===(t=this.vmi.status)||void 0===t?void 0:t.phase)===k.Pending&&{status:"VMI_WAITING",message:l}||this.vmi&&(null===(n=this.vmi)||void 0===n||null===(n=n.status)||void 0===n?void 0:n.phase)===k.Failed&&{status:"VMI_ERROR"}||this.isVMExpectedRunning&&!this.isVMCreated&&{status:"Pending"}||{status:"UNKNOWN"};return i}get isVMCreated(){var e;return!(null===this||void 0===this||null===(e=this.status)||void 0===e||!e.created)}get getDataVolumeTemplates(){return null===Object(r["d"])(this,"spec.volumeClaimTemplates")?[]:this.spec.volumeClaimTemplates}get vmi(){return this.$getters["byId"](a["c"],this.id)}get actualState(){var e,t,n,i,r,s,o,a,c,l,u,h;if(null!==this&&void 0!==this&&null!==(e=this.metadata)&&void 0!==e&&e.deletionTimestamp)return"Terminating";if(null!==this&&void 0!==this&&null!==(t=this.vmi)&&void 0!==t&&t.migrationState&&"Failed"!==this.vmi.migrationState.status)return this.vmi.migrationState.status;const d=(null===(n=this.isPaused)||void 0===n?void 0:n.status)||(null===(i=this.isVMError)||void 0===i?void 0:i.status)||(null===(r=this.isBeingStopped)||void 0===r?void 0:r.status)||(null===(s=this.isOff)||void 0===s?void 0:s.status)||(null===(o=this.isError)||void 0===o?void 0:o.status)||(null===(a=this.isRunning)||void 0===a?void 0:a.status)||(null===(c=this.isNotReady)||void 0===c?void 0:c.status)||(null===(l=this.isStarting)||void 0===l?void 0:l.status)||(null===(u=this.isWaitingForVMI)||void 0===u?void 0:u.state)||(null===(h=this.otherState)||void 0===h?void 0:h.status);return d}get stateDisplay(){return this.actualState}}},"45d2":function(e){e.exports=JSON.parse('{"hasStylesheet":"false"}')},4774:function(e,t,n){var i=n("cd68"),r=n("500b"),s=n("ecf6");function o(e,t){return s(r(e,t,i),e+"")}e.exports=o},4778:function(e,t,n){var i=n("4b2c"),r=n("986c"),s=n("a4fc"),o=n("659f"),a=n("6944"),c=n("5e52"),l=1,u=2,h="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Map]",_="[object Number]",g="[object RegExp]",m="[object Set]",v="[object String]",b="[object Symbol]",y="[object ArrayBuffer]",w="[object DataView]",k=i?i.prototype:void 0,E=k?k.valueOf:void 0;function S(e,t,n,i,k,S,A){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!S(new r(e),new r(t)));case h:case d:case _:return s(+e,+t);case f:return e.name==t.name&&e.message==t.message;case g:case v:return e==t+"";case p:var X=a;case m:var x=i&l;if(X||(X=c),e.size!=t.size&&!x)return!1;var K=A.get(e);if(K)return K==t;i|=u,A.set(e,t);var C=o(X(e),X(t),i,k,S,A);return A["delete"](e),C;case b:if(E)return E.call(e)==E.call(t)}return!1}e.exports=S},4816:function(e,t,n){e.exports=n.p+"img/rancher-logo.055089a3.svg"},"489a":function(e,t){var n=Object.prototype,i=n.hasOwnProperty;function r(e,t){return null!=e&&i.call(e,t)}e.exports=r},"494f":function(e,t){function n(e){return function(t){return e(t)}}e.exports=n},"4a83":function(e,t,n){var i=n("d3e6"),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,o=i((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,(function(e,n,i,r){t.push(i?r.replace(s,"$1"):n||e)})),t}));e.exports=o},"4ac6":function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"b",(function(){return s})),n.d(t,"e",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"d",(function(){return l}));const i="field.cattle.io/name",r="field.cattle.io/description",s="field.cattle.io/publicEndpoints",o=/cattle\.io\//,a=[o],c=[o],l={CLOUD_INIT:"harvesterhci.io/cloud-init-template",CLOUD_PROVIDER_IPAM:"cloudprovider.harvesterhci.io/ipam",NETWORK_ROUTE:"network.harvesterhci.io/route",IMAGE_NAME:"harvesterhci.io/image-name",NETWORK_TYPE:"network.harvesterhci.io/type",PRIMARY_SERVICE:"cloudprovider.harvesterhci.io/primary-service"}},"4b2c":function(e,t,n){var i=n("201b"),r=i.Symbol;e.exports=r},"4b48":function(e,t){function n(e,t){return e.has(t)}e.exports=n},"4b7a":function(e,t,n){var i=n("effc"),r=n("280a"),s=n("cd68"),o=n("c316"),a=n("d440");function c(e){return"function"==typeof e?e:null==e?s:"object"==typeof e?o(e)?r(e[0],e[1]):i(e):a(e)}e.exports=c},"4c0b":function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},"4efd":function(e,t,n){var i=n("d856"),r=n("54f6"),s=n("f9f5"),o=n("40cc"),a=n("994b");function c(e){var t=-1,n=null==e?0:e.length;this.clear();while(++te.replace(/^ui-/,""),mangleWrite:e=>"ui-"+e}),r("pcs","",{asCookie:a,asUserPreference:!1}),r("locale","en-us",{asCookie:a}),r("keymap","sublime",{options:["sublime","emacs","vim"]}),r("per-page",100,{options:[10,25,50,100],parseJSON:o})),u=(r("logs-wrap",!0,{parseJSON:o}),r("logs-time",!0,{parseJSON:o}),r("logs-range","30 minutes",{parseJSON:o}),r("hide-repos",[],{parseJSON:o}),r("hide-desc",[],{parseJSON:o}),r("hide-sensitive",!0,{options:[!0,!1],parseJSON:o}),r("show-pre-release",!1,{options:[!1,!0],parseJSON:o}),r("chart-mode","featured",{parseJSON:o}),r("date-format","ddd, MMM D YYYY",{options:["ddd, MMM D YYYY","ddd, D MMM YYYY","D/M/YYYY","M/D/YYYY","YYYY-MM-DD"]}),r("time-format","h:mm:ss a",{options:["h:mm:ss a","HH:mm:ss"]}),r("time-zone","local"),r("dev",!1,{parseJSON:o})),h=r("view-in-api",!1,{parseJSON:o,inheritFrom:u}),d=(r("all-namespaces",!1,{parseJSON:o,inheritFrom:u}),r("theme-shortcut",!1,{parseJSON:o,inheritFrom:u}),r("last-visited","home",{parseJSON:o}),r("seen-whatsnew","",{parseJSON:o}),r("read-whatsnew","",{parseJSON:o}),r("after-login-route","home",{parseJSON:o}),r("home-page-cards",{},{parseJSON:o}),r("plugin-developer",!1,{parseJSON:o,inheritFrom:u}),"rke1"),f="rke2";r("provisioner",f,{options:[d,f]}),r("scale-pool-prompt",null,{parseJSON:o})},"500b":function(e,t,n){var i=n("cda3"),r=Math.max;function s(e,t,n){return t=r(void 0===t?e.length-1:t,0),function(){var s=arguments,o=-1,a=r(s.length-t,0),c=Array(a);while(++o=l&&(d=c,f=!1,t=new i(t));e:while(++h0&&n(u)?t>1?s(u,t-1,n,o,a):i(a,u):o||(a[a.length]=u)}return a}e.exports=s},"629b":function(e,t,n){var i=n("6bcf"),r=1/0;function s(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}e.exports=s},"640c":function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var i=n("4ac6"),r=n("8eaf"),s=n.n(r),o=n("7fd6"),a=n.n(o),c=n("8bbf"),l=n.n(c),u=n("2cb5"),h=n("9c09");function d(e){const t=["state","name","description","labels","annotations"];return t.forEach(t=>delete e[t]),e}class f extends h["b"]{constructor(e,t,n=null,i=!1){const r=d(e);super(r,t,n,i)}get labels(){var e;const t=(null===(e=this.metadata)||void 0===e?void 0:e.labels)||{};return s()(t,(e,t)=>Object(u["g"])(t,i["e"]))}setLabels(e){this.metadata||(this.metadata={});const t=this.metadata.labels||{},n=a()(t,(e,t)=>Object(u["g"])(t,i["e"]));l.a.set(this.metadata,"labels",{...n,...e})}setLabel(e,t){var n;t?(this.metadata||(this.metadata={}),this.metadata.labels||(this.metadata.labels={}),l.a.set(this.metadata.labels,e,t)):null!==(n=this.metadata)&&void 0!==n&&n.labels&&(l.a.set(this.metadata.labels,e,void 0),delete this.metadata.labels[e])}get annotations(){var e;const t=(null===(e=this.metadata)||void 0===e?void 0:e.annotations)||{};return s()(t,(e,t)=>Object(u["g"])(t,i["a"]))}setAnnotations(e){this.metadata||(this.metadata={});const t=this.metadata.annotations||{},n=a()(t,(e,t)=>Object(u["g"])(t,i["a"]));l.a.set(this.metadata,"annotations",{...n,...e})}setAnnotation(e,t){var n;t?(this.metadata||(this.metadata={}),this.metadata.annotations||(this.metadata.annotations={}),l.a.set(this.metadata.annotations,e,t)):null!==(n=this.metadata)&&void 0!==n&&n.annotations&&(l.a.set(this.metadata.annotations,e,void 0),delete this.metadata.annotations[e])}get state(){var e;return(null===(e=this.stateObj)||void 0===e?void 0:e.name)||"unknown"}get description(){var e,t;return(null===(e=this.metadata)||void 0===e||null===(e=e.annotations)||void 0===e?void 0:e[i["c"]])||(null===(t=this.spec)||void 0===t?void 0:t.description)||this._description}}n("bddd"),n("7838");var p=n("e24b");h["b"];const _=["metadata.clusterName","metadata.creationTimestamp","metadata.deletionGracePeriodSeconds","metadata.deletionTimestamp","metadata.finalizers","metadata.generateName","metadata.generation","metadata.initializers","metadata.managedFields","metadata.ownerReferences","metadata.resourceVersion","metadata.relationships","metadata.selfLink","metadata.state","metadata.uid","spec.versions.schema","status","stringData","links","_name","_labels","_annotations"];const g=["metadata.resourceVersion","metadata.fields","metadata.clusterName","metadata.deletionGracePeriodSeconds","metadata.generateName"],m=_.filter(e=>!g.includes(e));class v extends f{get name(){var e;return(null===(e=this.metadata)||void 0===e?void 0:e.name)||this._name}get namespace(){var e;return null===(e=this.metadata)||void 0===e?void 0:e.namespace}get description(){var e,t;return(null===(e=this.metadata)||void 0===e||null===(e=e.annotations)||void 0===e?void 0:e[i["c"]])||(null===(t=this.spec)||void 0===t?void 0:t.description)||this._description}set description(e){var t;null!==(t=this.metadata)&&void 0!==t&&t.annotations&&(this.metadata.annotations[i["c"]]=e),this.spec&&(this.spec.description=e),this._description=e}cleanForSave(e,t){const n=super.cleanForSave(e);for(const i of m)Object(p["c"])(n,i);return n}}},6552:function(e,t,n){var i=n("51db"),r=n("0f8f"),s=n("cc7f");function o(e,t){return null==e?e:i(e,r(t),s)}e.exports=o},"659f":function(e,t,n){var i=n("2419"),r=n("9b25"),s=n("4b48"),o=1,a=2;function c(e,t,n,c,l,u){var h=n&o,d=e.length,f=t.length;if(d!=f&&!(h&&f>d))return!1;var p=u.get(e),_=u.get(t);if(p&&_)return p==t&&_==e;var g=-1,m=!0,v=n&a?new i:void 0;u.set(e,t),u.set(t,e);while(++g0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}e.exports=s},"907a":function(e,t){var n=Object.prototype,i=n.toString;function r(e){return i.call(e)}e.exports=r},"907c":function(e,t,n){"use strict";n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return d}));const i={PREFERENCE:"userpreference",SCHEMA_DEFINITION:"schemaDefinition"},r="node",s="pod",o={ROLE:"rbac.authorization.k8s.io.role",CLUSTER_ROLE:"rbac.authorization.k8s.io.clusterrole",ROLE_BINDING:"rbac.authorization.k8s.io.rolebinding",CLUSTER_ROLE_BINDING:"rbac.authorization.k8s.io.clusterrolebinding"},a={DEPLOYMENT:"apps.deployment",CRON_JOB:"batch.cronjob",DAEMON_SET:"apps.daemonset",JOB:"batch.job",STATEFUL_SET:"apps.statefulset",REPLICA_SET:"apps.replicaset",REPLICATION_CONTROLLER:"replicationcontroller"},{DAEMON_SET:c,CRON_JOB:l,JOB:u,...h}=a,d={AUTH_CONFIG:"management.cattle.io.authconfig",CATALOG_TEMPLATE:"management.cattle.io.catalogtemplate",CLUSTER:"management.cattle.io.cluster",CLUSTER_ROLE_TEMPLATE_BINDING:"management.cattle.io.clusterroletemplatebinding",FEATURE:"management.cattle.io.feature",KONTAINER_DRIVER:"management.cattle.io.kontainerdriver",MULTI_CLUSTER_APP:"management.cattle.io.multiclusterapp",NODE:"management.cattle.io.node",NODE_DRIVER:"management.cattle.io.nodedriver",NODE_POOL:"management.cattle.io.nodepool",NODE_TEMPLATE:"management.cattle.io.nodetemplate",PROJECT:"management.cattle.io.project",PROJECT_ROLE_TEMPLATE_BINDING:"management.cattle.io.projectroletemplatebinding",ROLE_TEMPLATE:"management.cattle.io.roletemplate",SETTING:"management.cattle.io.setting",USER:"management.cattle.io.user",TOKEN:"management.cattle.io.token",GLOBAL_ROLE:"management.cattle.io.globalrole",GLOBAL_ROLE_BINDING:"management.cattle.io.globalrolebinding",PSA:"management.cattle.io.podsecurityadmissionconfigurationtemplate",MANAGED_CHART:"management.cattle.io.managedchart",USER_NOTIFICATION:"management.cattle.io.rancherusernotification",GLOBAL_DNS_PROVIDER:"management.cattle.io.globaldnsprovider",RKE_TEMPLATE:"management.cattle.io.clustertemplate",RKE_TEMPLATE_REVISION:"management.cattle.io.clustertemplaterevision",CLUSTER_PROXY_CONFIG:"management.cattle.io.clusterproxyconfig"}},9224:function(e){e.exports=JSON.parse('{"name":"kubevirt-dashboard-extension","description":"SUSE Edge: KubeVirt extension for Rancher Dashboard","icon":"https://raw.githubusercontent.com/cncf/artwork/master/projects/kubevirt/icon/color/kubevirt-icon-color.svg","version":"1.1.0","license":"Apache-2.0","private":false,"rancher":{"annotations":{"catalog.cattle.io/display-name":"KubeVirt","catalog.cattle.io/rancher-version":">= v2.9.0","catalog.cattle.io/ui-extensions-version":">= 2.0.1"}},"scripts":{"dev":"./node_modules/.bin/nuxt dev","nuxt":"./node_modules/.bin/nuxt"},"engines":{"node":">=16"},"devDependencies":{"@vue/cli-plugin-babel":"4.5.18","@vue/cli-service":"4.5.18","@vue/cli-plugin-typescript":"4.5.18"},"browserslist":["> 1%","last 2 versions","not dead"]}')},9243:function(e,t,n){var i=n("405d"),r=n("a9e0"),s=n("212d"),o=n("3819"),a=n("e3e5"),c=n("0e19"),l=n("735f"),u="[object Map]",h="[object Object]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",_="[object DataView]",g=l(i),m=l(r),v=l(s),b=l(o),y=l(a),w=c;(i&&w(new i(new ArrayBuffer(1)))!=_||r&&w(new r)!=u||s&&w(s.resolve())!=d||o&&w(new o)!=f||a&&w(new a)!=p)&&(w=function(e){var t=c(e),n=t==h?e.constructor:void 0,i=n?l(n):"";if(i)switch(i){case g:return _;case m:return u;case v:return d;case b:return f;case y:return p}return t}),e.exports=w},"927d":function(e,t,n){var i=n("1ec9"),r=n("2e63"),s=n("73bd"),o=n("b4f4"),a=n("42b6"),c=n("1ab6"),l=n("413d"),u=n("0233"),h=n("0634"),d=n("b650"),f=n("cc5e"),p=n("9243"),_=n("dd09"),g=n("ecda"),m=n("b03d"),v=n("c316"),b=n("dda8"),y=n("35bb"),w=n("b506"),k=n("fe22"),E=n("0652"),S=n("cc7f"),A=1,X=2,x=4,K="[object Arguments]",C="[object Array]",T="[object Boolean]",F="[object Date]",R="[object Error]",I="[object Function]",O="[object GeneratorFunction]",L="[object Map]",D="[object Number]",M="[object Object]",N="[object RegExp]",P="[object Set]",U="[object String]",B="[object Symbol]",j="[object WeakMap]",Q="[object ArrayBuffer]",G="[object DataView]",V="[object Float32Array]",H="[object Float64Array]",z="[object Int8Array]",$="[object Int16Array]",q="[object Int32Array]",W="[object Uint8Array]",Y="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",ee={};function te(e,t,n,C,T,F){var R,L=t&A,D=t&X,N=t&x;if(n&&(R=T?n(e,C,T,F):n(e)),void 0!==R)return R;if(!w(e))return e;var P=v(e);if(P){if(R=_(e),!L)return l(e,R)}else{var U=p(e),B=U==I||U==O;if(b(e))return c(e,L);if(U==M||U==K||B&&!T){if(R=D||B?{}:m(e),!L)return D?h(e,a(R,e)):u(e,o(R,e))}else{if(!ee[U])return T?e:{};R=g(e,U,L)}}F||(F=new i);var j=F.get(e);if(j)return j;F.set(e,R),k(e)?e.forEach((function(i){R.add(te(i,t,n,i,e,F))})):y(e)&&e.forEach((function(i,r){R.set(r,te(i,t,n,r,e,F))}));var Q=N?D?f:d:D?S:E,G=P?void 0:Q(e);return r(G||e,(function(i,r){G&&(r=i,i=e[r]),s(R,r,te(i,t,n,r,e,F))})),R}ee[K]=ee[C]=ee[Q]=ee[G]=ee[T]=ee[F]=ee[V]=ee[H]=ee[z]=ee[$]=ee[q]=ee[L]=ee[D]=ee[M]=ee[N]=ee[P]=ee[U]=ee[B]=ee[W]=ee[Y]=ee[J]=ee[Z]=!0,ee[R]=ee[I]=ee[j]=!1,e.exports=te},"930a":function(e,t,n){var i=n("e902"),r=Array.prototype,s=r.splice;function o(e){var t=this.__data__,n=i(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():s.call(t,n,1),--this.size,!0}e.exports=o},"94a3":function(e,t,n){var i=n("5fe6"),r=n("6290"),s=n("4774"),o=n("35d9"),a=s((function(e,t){return o(e)?i(e,r(t,1,o,!0)):[]}));e.exports=a},"94dd":function(e,t,n){var i=n("1001");function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}e.exports=r},"959e":function(e,t,n){"use strict";n("e7e6")},"986c":function(e,t,n){var i=n("201b"),r=i.Uint8Array;e.exports=r},"98d3":function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return h})),n.d(t,"f",(function(){return d})),n.d(t,"e",(function(){return p}));const i="undefined"===typeof window?"server":window.navigator.platform.toLowerCase(),r="undefined"===typeof window?"server":window.navigator.userAgent,s=(i.includes("linux")||i.includes("unix"),i.includes("mac")),o=(i.includes("win"),s?"metaKey":"ctrlKey"),a=o,c="shiftKey";function l(e){return!!e[o]}function u(e){return!!e[a]}function h(e){return!!e[c]}function d(e){return e.ctrlKey&&2===e.button}r.includes("Gecko/");const f=r.includes("Chrome/"),p=(!f&&r.includes("AppleWebKit/"),!f&&r.includes("Safari/"));/Android|webOS|iPhone|iPad|iPod|IEMobile/i.test(r)},"994b":function(e,t,n){var i=n("e697"),r="__lodash_hash_undefined__";function s(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?r:t,this}e.exports=s},"9b25":function(e,t){function n(e,t){var n=-1,i=null==e?0:e.length;while(++nd&&r.push(n["i18n/t"](`validation.dns.${a}.tooLongLabel`,{key:t,max:d})),r}function g(e,t,n,i,r=[]){const{nullable:s,required:o,type:a="",minLength:l,maxLength:u,min:h,max:d}=t,p=e?Object(f["d"])(e,"length"):0;if(!s&&o&&("object"===typeof e&&c()(e)||!e&&0!==e))return r.push(i["i18n/t"]("validation.required",{key:n})),r;if(null===e)return r;const _=0===a.indexOf("array[")?"arrayLength":"stringLength";let g=l,m=u;return g&&m?(pm)&&(g===m?r.push(i["i18n/t"](`validation.${_}.exactly`,{key:n,count:g})):r.push(i["i18n/t"](`validation.${_}.between`,{key:n,min:g,max:m}))):g&&pm&&r.push(i["i18n/t"](`validation.${_}.max`,{key:n,count:m})),g=h,m=d,null!==e&&g&&m?(em)&&(g===m?r.push(i["i18n/t"]("validation.number.exactly",{key:n,val:m})):r.push(i["i18n/t"]("validation.number.between",{key:n,min:g,max:m}))):g&&em&&r.push(i["i18n/t"]("validation.number.max",{key:n,val:m})),r}function m(e,t,n,i,r=[]){const{validChars:s,invalidChars:o}=t,a=[];if(s&&a.push(`[^${t.validChars}]`),o&&a.push(`[${t.invalidChars}]`),a.length){const t=new RegExp(`(${a.join("|")})`,"g");let s=e.match(t);s&&(s=d()(s).map(e=>" "===e?"[space]":e),r.push(i["i18n/t"]("validation.chars",{key:n,count:s.length,chars:s.join(" ")})))}return r}function v(e,t,n,i,r=[]){i=i||{};const{max:s=253,restricted:o=!1}=i;"."===e.slice(0,1)&&r.push(n["i18n/t"]("validation.dns.hostname.startDot",{key:t})),o&&e.length>1&&"."===e.slice(-1)&&r.push(n["i18n/t"]("validation.dns.hostname.endDot",{key:t})),0===e.length&&r.push(n["i18n/t"]("validation.dns.hostname.empty",{key:t})),e.length>s&&r.push(n["i18n/t"]("validation.dns.hostname.tooLong",{key:t,max:s}));const a=e.split(/\./);let c;for(let l=0;l{const{name:s,nodePort:o,port:a,targetPort:l}=e,u=i+1;if(r.length>1&&c()(s)&&n.push(t["i18n/t"]("validation.service.ports.name.required",{position:u})),!c()(s)){const e=b(s,"name",t,void 0,n);c()(e)||(n=n.length&&n.length>0?[...n,...e]:e)}if(o){const e=parseInt(o,10);isNaN(e)&&n.push(t["i18n/t"]("validation.service.ports.nodePort.requiredInt",{position:u}))}if(a){const e=parseInt(a,10);isNaN(e)&&n.push(t["i18n/t"]("validation.service.ports.port.requiredInt",{position:u}))}else n.push(t["i18n/t"]("validation.service.ports.port.required",{position:u}));if(l){const e=t["i18n/t"]("validation.service.ports.targetPort.ianaAt",{position:u}),i=parseInt(l,10),r=new RegExp("^\\d+$"),s=r.test(l);if(s)(i<1||i>65535)&&n.push(t["i18n/t"]("validation.service.ports.targetPort.between",{position:u}));else{const i={ianaServiceName:!0,maxLength:15,validChars:"A-Za-z0-9-"},r=b(l,e,t,i,n);c()(r)||n.push(...r)}}else n.push(t["i18n/t"]("validation.service.ports.targetPort.required",{position:u}))}),n)}function k(e,t,n,i){const r=["ClusterIP","NodePort","LoadBalancer"],s=null===e||void 0===e?void 0:e.type;return r.includes(s),n}function E(e,t,n,i){if("ExternalName"===(null===e||void 0===e?void 0:e.type))if(c()(null===e||void 0===e?void 0:e.externalName))n.push(t["i18n/t"]("validation.service.externalName.none"));else{const i=v(e.externalName,"ExternalName",t,void 0,n);c()(i)||(n=n.length&&n.length>0?[...n,...i]:i)}return n}var S=n("d66a"),A=n.n(S);function X(e,t,n,i){return c()(null===e||void 0===e?void 0:e.groups)&&n.push(t["i18n/t"]("validation.prometheusRule.groups.required")),n}function x(e=[],t,n,i){return e.forEach((e,i)=>{const r=i+1;c()(null===e||void 0===e?void 0:e.name)&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.name",{index:r})),c()(null===e||void 0===e?void 0:e.rules)?n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.singleEntry",{index:r})):e.rules.forEach((e,i)=>{const s=i+1;A()(e,"alert")&&c()(null===e||void 0===e?void 0:e.alert)?n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.alertName",{groupIndex:r,ruleIndex:s})):A()(e,"record")&&c()(null===e||void 0===e?void 0:e.record)&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.recordName",{groupIndex:r,ruleIndex:s})),(A()(e,"expr")&&c()(e.expr)||!A()(e,"expr"))&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.expr",{groupIndex:r,ruleIndex:s})),A()(e,"alert")&&(A()(e,"labels")&&c()(e.labels)||!A()(e,"labels"))&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.labels",{groupIndex:r,ruleIndex:s}))})}),n}function K(e,t,n,i){c()(null===e||void 0===e?void 0:e.match)&&c()(null===e||void 0===e?void 0:e["match_re"])&&n.push(t["i18n/t"]("validation.monitoring.route.match"))}function C(e,t,n,i,r){/^\d+[hms]$/.test(e)||n.push(t["i18n/t"]("validation.monitoring.route.interval",{key:r}))}function T(e,t,n){let i;i=e.jobTemplate?Object(f["d"])(e,"jobTemplate.spec.template.spec"):Object(f["d"])(e,"template.spec"),i.containers&&i.containers.length?i.containers.forEach(e=>{e&&!e.image&&n.push(t["i18n/t"]("workload.validation.containerImage",{name:e.name}))}):n.push(t["i18n/t"]("validation.required",{key:t["i18n/t"]("workload.container.titles.containers")}))}var F=n("2105"),R=n.n(F);function I(e="",t,n){try{R.a.toString(e)}catch(i){n.push(t["i18n/t"]("validation.invalidCron"))}}function O(e,t,n){if(!e)return;const{podAffinity:i,podAntiAffinity:r}=e;if(i&&!Object(f["e"])(i)){const{preferredDuringSchedulingIgnoredDuringExecution:e=[],requiredDuringSchedulingIgnoredDuringExecution:r=[]}=i;e.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.affinityTitle"),rules:t["i18n/t"]("validation.podAffinity.preferredDuringSchedulingIgnoredDuringExecution")};L(e,r,t,n);const{podAffinityTerm:s={}}=e;D(s,r,t,n),M(s,r,t,n)}),r.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.affinityTitle"),rules:t["i18n/t"]("validation.podAffinity.requiredDuringSchedulingIgnoredDuringExecution")};D(e,r,t,n),M(e,r,t,n)})}if(r&&!Object(f["e"])(r)){const{preferredDuringSchedulingIgnoredDuringExecution:e=[],requiredDuringSchedulingIgnoredDuringExecution:i=[]}=r;e.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.antiAffinityTitle"),rules:t["i18n/t"]("validation.podAffinity.preferredDuringSchedulingIgnoredDuringExecution")};L(e,r,t,n);const{podAffinityTerm:s={}}=e;D(s,r,t,n),M(s,r,t,n)}),i.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.antiAffinityTitle"),rules:t["i18n/t"]("validation.podAffinity.requiredDuringSchedulingIgnoredDuringExecution")};D(e,r,t,n),M(e,r,t,n)})}}function L(e,t,n,i){const{weight:r=1}=e;("number"!==typeof r||r>100||r<1)&&i.push(n["i18n/t"]("validation.number.between",{key:n["i18n/t"]("workload.scheduling.matchExpressions.weight"),min:1,max:100,...t}))}function D(e,t,n,i){const{topologyKey:r}=e,s=RegExp("([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]");r&&s.test(r)||i.push(n["i18n/t"]("validation.podAffinity.topologyKey",t))}function M(e,t,n,i){const r=["In","NotIn","Exists","DoesNotExist"],{labelSelector:s}=e;if(s&&!Object(f["e"])(s)){const{matchExpressions:e=[]}=s;e.forEach((e,s)=>{const{operator:o,values:a}=e;r.includes(o)||i.push(n["i18n/t"]("validation.podAffinity.matchExpressions.operator",t)),"In"===o||"NotIn"===o?a&&a.length||i.push(n["i18n/t"]("validation.podAffinity.matchExpressions.valuesMustBeDefined",t)):a&&a.length&&i.push(n["i18n/t"]("validation.podAffinity.matchExpressions.valueMustBeEmpty",t))})}}var N=n("907c");function P(e=[],t,n,i=[]){e.some(e=>c()(e.verbs))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingVerb")),e.some(e=>{var t,n;return(null===(t=e.resources)||void 0===t?void 0:t.length)&&(null===(n=e.nonResourceURLs)||void 0===n?void 0:n.length)})&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.noResourceAndNonResource")),i[0]===N["d"].ROLE?(e.some(e=>c()(e.resources))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingResource")),e.some(e=>c()(e.apiGroups))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingApiGroup"))):e.some(e=>{var t,n;return(null===(t=e.resources)||void 0===t?void 0:t.length)&&(null===(n=e.nonResourceUrls)||void 0===n?void 0:n.length)})&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.noResourceAndNonResource")),e.some(e=>c()(e.resources)&&c()(e.nonResourceURLs))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingOneResource"))}function U(e,t,n,i,r){const s="true"===i[0];return s&&(e||"").match(/^(c-.{5}|local)$/i)&&n.push(t["i18n/t"]("validation.cluster.name")),n}var B={clusterName:U,clusterIp:k,externalName:E,flowOutput:l,groupsAreValid:x,logdna:u,ruleGroups:X,interval:C,servicePort:w,matching:K,containerImages:T,cronSchedule:I,podAffinity:O,roleTemplateRules:P},j=n("5877"),Q=n.n(j);async function G(e,t,i="text/plain;charset=utf-8"){const r=new Blob([t],{type:i}),{saveAs:s}=await n.e(6).then(n.t.bind(null,"7ada",7));return s(r,e)}function V(e){const t=new Q.a;for(const n in e)t.file(n,e[n]);return t.generateAsync({type:"blob"}).then(e=>e)}var H=n("a8b9"),z=n("1d19"),$=n("b10f"),q=n.n($);const W=e=>e.toLowerCase().startsWith("https://"),Y=e=>/^(?:https?:\/\/)?(?:localhost|127\.0\.0\.1)/i.test(e),J=e=>q()(e)&&(null===e||void 0===e?void 0:e.toLowerCase().endsWith("/"));function Z(e,t,n){return t=ee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(e){var t=te(e,"string");return"symbol"===typeof t?t:String(t)}function te(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class ne{constructor(e){Z(this,"empty",void 0),Z(this,"int",void 0),Z(this,"string",void 0),Z(this,"isNumber",void 0),Z(this,"isInt",void 0),this.string=String(e),this.int=parseInt(this.string,10),this.empty=!e&&0!==this.int,this.isNumber=!isNaN(this.int)&&!this.string.includes("e"),this.isInt=this.isNumber&&!this.string.includes(".")}}const ie=(e,t)=>{for(const n of t){const t=n(e);if(t)return t}};var re=function(e,{key:t="Value"}){const n=n=>i=>"."===(null===i||void 0===i?void 0:i.slice(0,1))?e(`validation.dns.${n}.startDot`,{key:t}):void 0,r=n=>i=>"."===(null===i||void 0===i?void 0:i.slice(-1))?e(`validation.dns.${n}.endDot`,{key:t}):void 0,s=n=>i=>{var r;return null!==i&&void 0!==i&&null!==(r=i.slice(0,1))&&void 0!==r&&r.match(/[0-9]/)?e(`validation.dns.${n}.startNumber`,{key:t}):void 0},o=n=>i=>"-"===(null===i||void 0===i?void 0:i.slice(0,1))?e(`validation.dns.${n}.startHyphen`,{key:t}):void 0,a=n=>i=>"-"===(null===i||void 0===i?void 0:i.slice(-1))?e(`validation.dns.${n}.endHyphen`,{key:t}):void 0,l=n=>i=>Number(i)i=>Number(i)>Number(n)?e("validation.maxValue",{key:t,max:n}):void 0,h=([n,i])=>r=>l(n)(r)||u(i)(r)?e("validation.betweenValues",{key:t,min:n,max:i}):void 0,d=n=>i=>i.lengthi=>i.length>Number(n)?e("validation.maxLength",{key:t,max:n}):void 0,p=([n,i])=>r=>d(n)(r)||f(i)(r)?e("validation.betweenLengths",{key:t,min:n,max:i}):void 0,_=n=>isNaN(parseInt(n,10))?e("validation.number.requiredInt",{key:t}):void 0,g=n=>!Number.isInteger(+n)||(""+n).match(/\.+/g)?e("validation.number.requiredInt",{key:t}):void 0,m=n=>+n<0?e("validation.number.isPositive",{key:t}):void 0,v=n=>{const i=""+n,r=i.match(/(^0+)(.+)/);return r?e("validation.number.isOctal",{key:t}):void 0},b=n=>parseInt(n,10)<1||parseInt(n,10)>65535?e("validation.number.between",{key:t,min:"1",max:"65535"}):void 0,y=n=>{const i=null===n||void 0===n?void 0:n.match(/[^${'A-Za-z0-9-'}]/g);if(i)return e("validation.chars",{key:t,count:i.length,chars:i.map(e=>" "===e?"Space":`"${e}"`).join(", ")})},w=n=>"--"===(null===n||void 0===n?void 0:n.substr(2,2))&&"xn"!==(null===n||void 0===n?void 0:n.substr(0,2))?e("validation.dns.doubleHyphen",{key:t}):void 0,k=n=>"--"===(null===n||void 0===n?void 0:n.substr(2,2))&&"xn"!==(null===n||void 0===n?void 0:n.substr(0,2))?e("validation.dns.doubleHyphen",{key:t}):void 0,E=n=>(i="")=>0===i.length?e(`validation.dns.${n}.emptyLabel`,{key:t,min:1}):void 0,S=(n,i=63)=>(r="")=>r.length>i?e(`validation.dns.${n}.tooLongLabel`,{key:t,max:i}):void 0,X=(n="")=>n.length>253?e("validation.dns.hostname.tooLong",{key:t,max:253}):void 0,x=(n="")=>"/"!==n[0]&&n.length>0?e("validation.path",{key:t}):void 0,K=n=>n||!1===n?void 0:e("validation.required",{key:t}),C=(n="")=>n.toLowerCase()!==n?e("validation.noUpperCase",{key:t}):void 0,T=t=>{try{R.a.toString(t)}catch(n){return e("validation.invalidCron")}},F=t=>t&&!W(t)?e("validation.setting.serverUrl.https"):void 0,I=t=>Y(t)?e("validation.setting.serverUrl.localhost"):void 0,O=t=>J(t)?e("validation.setting.serverUrl.trailingForwardSlash"):void 0,L=t=>t&&!q()(t)?e("validation.setting.serverUrl.url"):void 0,D=n=>n&&!/^[a-zA-Z0-9]+$/.test(n)?e("validation.alphanumeric",{key:t}):void 0,M=n=>/^\d+[hms]$/.test(n)?void 0:e("validation.monitoring.route.interval",{key:t}),P=t=>null!==t&&void 0!==t&&t.image?void 0:e("workload.validation.containerImage",{name:t.name}),U=t=>{var n,i;const r=t.jobTemplate?null===t||void 0===t||null===(n=t.jobTemplate)||void 0===n||null===(n=n.spec)||void 0===n||null===(n=n.template)||void 0===n||null===(n=n.spec)||void 0===n?void 0:n.containers:null===t||void 0===t||null===(i=t.template)||void 0===i||null===(i=i.spec)||void 0===i?void 0:i.containers;return r&&r.length?r.map(e=>P(e)).find(e=>e):e("validation.required",{key:e("workload.container.titles.containers")})},B=e=>{const t=[y,o("label"),a("label"),w,S("label")];return ie(e,t)},j=e=>{const t=[y,o("label"),a("label"),k,E("label"),S("label",15)];return ie(e,t)},Q=e=>{const t=[y,s("label"),o("label"),a("label"),w,E("label"),S("label")];return ie(e,t)},G=e=>{if(e){const t=[n("hostname"),X,r("hostname")],i=ie(e,t);if(i)return i;const s=e.split("."),c=[y,o("hostname"),a("hostname"),w,E("hostname"),S("hostname")];for(let e=0;e(e=e?e.replace(/^\*\./,""):e,G(e)),H=t=>c()(t)?e("validation.service.externalName.none"):G(t),z=e=>"This is an error returned by the testRule validator",$=t=>c()(null===t||void 0===t?void 0:t.groups)?e("validation.prometheusRule.groups.required"):void 0,Z=t=>n=>{var i;return t&&null!==(i=n||"")&&void 0!==i&&i.match(/^(c-.{5}|local)$/i)?e("validation.cluster.name"):void 0},ee=t=>{const{name:n,idx:i}=t,r=new ne(t.nodePort),s=new ne(t.port),o=new ne(t.targetPort);if(c()(n))return e("validation.service.ports.name.required",{position:i+1});if(!r.empty){if(!r.isInt)return e("validation.service.ports.nodePort.requiredInt",{position:i+1});if(r.int<1||r.int>65535)return e("validation.service.ports.nodePort.between",{position:i+1})}if(s.empty)return e("validation.service.ports.port.required",{position:i+1});var a;if(!s.isInt)return e("validation.service.ports.port.requiredInt",{position:i+1});if(s.int<1||s.int>65535)return e("validation.service.ports.port.between",{position:i+1});if(null!==(a=s.string)&&void 0!==a&&a.includes("."))return s;if(o.empty)return e("validation.service.ports.targetPort.required",{position:i+1});if(o.isInt){if(o.int<1||o.int>65535)return e("validation.service.ports.targetPort.between",{position:i+1})}else{const e=j(o.string);if(e)return e}},te=(t,n)=>{let i;return c()(null===t||void 0===t?void 0:t.name)?e("validation.prometheusRule.groups.valid.name",{index:n}):c()(t.rules)?e("validation.prometheusRule.groups.valid.singleEntry",{index:n}):(t.rules.forEach((t,r)=>{const s=r+1;A()(t,"alert")&&c()(null===t||void 0===t?void 0:t.alert)&&!i?i=e("validation.prometheusRule.groups.valid.rule.alertName",{groupIndex:n,ruleIndex:s}):A()(t,"record")&&c()(null===t||void 0===t?void 0:t.record)&&(i=e("validation.prometheusRule.groups.valid.rule.recordName",{groupIndex:n,ruleIndex:s})),(A()(t,"expr")&&c()(t.expr)&&!i||!A()(t,"expr")&&!i)&&(i=e("validation.prometheusRule.groups.valid.rule.expr",{groupIndex:n,ruleIndex:s})),A()(t,"alert")&&(A()(t,"labels")&&c()(t.labels)&&!i||!A()(t,"labels")&&!i)&&(i=e("validation.prometheusRule.groups.valid.rule.labels",{groupIndex:n,ruleIndex:s}))}),i)},re=e=>{const t=[...e];let n;return t.forEach((e,t,i)=>{n=te(e,t+1),n&&(i.length=t+1)}),n},se=t=>{if(c()(null===t||void 0===t?void 0:t.match)&&c()(null===t||void 0===t?void 0:t["match_re"]))return e("validation.monitoring.route.match")},oe=t=>(n=[])=>{if(n.some(e=>c()(e.verbs)))return e("validation.roleTemplate.roleTemplateRules.missingVerb");if(n.some(e=>{var t,n;return(null===(t=e.resources)||void 0===t?void 0:t.length)&&(null===(n=e.nonResourceURLs)||void 0===n?void 0:n.length)}))return e("validation.roleTemplate.roleTemplateRules.noResourceAndNonResource");if(t===N["d"].ROLE){if(n.some(e=>c()(e.resources)))return e("validation.roleTemplate.roleTemplateRules.missingResource");if(n.some(e=>c()(e.apiGroups)))return e("validation.roleTemplate.roleTemplateRules.missingApiGroup")}else if(n.some(e=>c()(e.resources)&&c()(e.nonResourceURLs)))return e("validation.roleTemplate.roleTemplateRules.missingOneResource")},ae=e=>{},ce=t=>{const n=JSON.parse(t),i=n.type;if(!i)return e("validation.required",{key:"Type"});if("s3"===i){if(!n.accessKeyId)return e("validation.required",{key:"accessKeyId"});if(!n.secretAccessKey)return e("validation.required",{key:"secretAccessKey"});if(!n.bucketRegion)return e("validation.required",{key:"bucketRegion"});if(!n.bucketName)return e("validation.required",{key:"bucketName"})}},le=t=>{const n=["qcow","qcow2","raw","img","iso"];if(!t||""===t)return;const i=t.split("/").pop(),r=i.split(".").pop().toLowerCase();return n.includes(r)?void 0:e("harvester.validation.image.ruleTip")},ue=(t={})=>{if(!t[i["d"].IMAGE_NAME])return e("validation.required",{key:e("harvester.image.fileName")})},he=i=>{const s=null===i||void 0===i?void 0:i.match(/[^a-z0-9.-]/g);return s?e("validation.chars",{key:t,count:s.length,chars:s.map(e=>" "===e?"Space":`"${e}"`).join(", ")}):ie(i,[o("label"),a("label"),n("label"),r("label"),K])};return{absolutePath:x,alphanumeric:D,backupTarget:ce,betweenLengths:p,betweenValues:h,clusterIp:ae,clusterName:Z,containerImage:P,containerImages:U,cronSchedule:T,dnsLabel:B,dnsLabelIanaServiceName:j,dnsLabelRestricted:Q,externalName:H,fileRequired:ue,groupsAreValid:re,hostname:G,imageUrl:le,interval:M,https:F,localhost:I,trailingForwardSlash:O,url:L,matching:se,maxLength:f,maxValue:u,minLength:d,minValue:l,noUpperCase:C,portNumber:b,required:K,requiredInt:_,isInteger:g,isPositive:m,isOctal:v,roleTemplateRules:oe,ruleGroups:$,servicePort:ee,subDomain:he,testRule:z,wildcardHostname:V}};const se=(e,t="",n=3e6,i=500,r=!1)=>{return s("Starting wait for",t),new Promise((r,o)=>{e()&&(s("Wait for",t||"unknown","done immediately"),r(void 0));const a=setTimeout(()=>{if(s("Wait for",t,"timed out"),clearInterval(c),clearTimeout(a),!t)throw new Error(`waitFor timed out after ${n/1e3} seconds`);o(new Error("Failed waiting for: "+t))},n),c=setInterval(()=>{e()?(s("Wait for",t,"done"),clearInterval(c),clearTimeout(a),r(void 0)):t&&s("Wait for",t,"not done yet")},i)});function s(...e){r&&console.log(...e)}};var oe=n("7838"),ae=n.n(oe),ce=n("ddd1"),le=n.n(ce),ue=(n("6552"),n("daaf")),he=n.n(ue),de=n("9c38"),fe=n.n(de),pe=n("8bbf"),_e=n.n(pe),ge=n("7083"),me=n("1722");const ve=["dnsLabel","dnsLabelRestricted","hostname"],be={disabled:"inactive",notapplied:"Not Applied",notready:"Not Ready",waitapplied:"Wait Applied",outofsync:"Out of Sync","in-progress":"In Progress",gitupdating:"Git Updating",errapplied:"Err Applied",waitcheckin:"Wait Check-In",off:"Disabled",waitingforinfrastructure:"Waiting for Infra",waitingfornoderef:"Waiting for Node Ref"},ye="warning",we="x",ke=1e3,Ee=3e4,Se={IN_USE:"in-use",IN_PROGRESS:"in-progress",PENDING_ROLLBACK:"pending-rollback",PENDING_UPGRADE:"pending-upgrade",ABORTED:"aborted",ACTIVATING:"activating",ACTIVE:"active",AVAILABLE:"available",BACKED_UP:"backedup",BOUND:"bound",BUILDING:"building",COMPLETED:"completed",CORDONED:"cordoned",COUNT:"count",CREATED:"created",CREATING:"creating",DEACTIVATING:"deactivating",DEGRADED:"degraded",DENIED:"denied",DEPLOYED:"deployed",DEPLOYING:"deploying",DISABLED:"disabled",DISCONNECTED:"disconnected",DRAINED:"drained",DRAINING:"draining",ERR_APPLIED:"errapplied",ERROR:"error",ERRORING:"erroring",ERRORS:"errors",EXPIRED:"expired",EXPIRING:"expiring",FAIL:"fail",FAILED:"failed",HEALTHY:"healthy",INACTIVE:"inactive",INFO:"info",INITIALIZING:"initializing",INPROGRESS:"inprogress",LOCKED:"locked",MIGRATING:"migrating",MISSING:"missing",MODIFIED:"modified",NOT_APPLICABLE:"notApplicable",NOT_APLLIED:"notapplied",NOT_READY:"notready",OFF:"off",ORPHANED:"orphaned",OTHER:"other",OUT_OF_SYNC:"outofsync",ON_GOING:"on-going",PASS:"pass",PASSED:"passed",PAUSED:"paused",PENDING:"pending",PROVISIONING:"provisioning",PROVISIONED:"provisioned",PURGED:"purged",PURGING:"purging",READY:"ready",RECONNECTING:"reconnecting",REGISTERING:"registering",REINITIALIZING:"reinitializing",RELEASED:"released",REMOVED:"removed",REMOVING:"removing",REQUESTED:"requested",RESTARTING:"restarting",RESTORING:"restoring",RESIZING:"resizing",RUNNING:"running",SKIP:"skip",SKIPPED:"skipped",STARTING:"starting",STOPPED:"stopped",STOPPING:"stopping",SUCCEEDED:"succeeded",SUCCESS:"success",SUCCESSFUL:"successful",SUPERSEDED:"superseded",SUSPENDED:"suspended",UNAVAILABLE:"unavailable",UNHEALTHY:"unhealthy",UNINSTALLED:"uninstalled",UNINSTALLING:"uninstalling",UNKNOWN:"unknown",UNTRIGGERED:"untriggered",UPDATING:"updating",WAIT_APPLIED:"waitapplied",WAIT_CHECKIN:"waitcheckin",WAITING:"waiting",WARNING:"warning"};const Ae={[Se.IN_USE]:{color:"success",icon:"dot-open",label:"In Use",compoundIcon:"checkmark"},[Se.IN_PROGRESS]:{color:"info",icon:"tag",label:"In Progress",compoundIcon:"info"},[Se.PENDING_ROLLBACK]:{color:"info",icon:"dot-half",label:"Pending Rollback",compoundIcon:"info"},[Se.PENDING_UPGRADE]:{color:"info",icon:"dot-half",label:"Pending Update",compoundIcon:"info"},[Se.ABORTED]:{color:"warning",icon:"error",label:"Aborted",compoundIcon:"warning"},[Se.ACTIVATING]:{color:"info",icon:"tag",label:"Activating",compoundIcon:"info"},[Se.ACTIVE]:{color:"success",icon:"dot-open",label:"Active",compoundIcon:"checkmark"},[Se.AVAILABLE]:{color:"success",icon:"dot-open",label:"Available",compoundIcon:"checkmark"},[Se.BACKED_UP]:{color:"success",icon:"backup",label:"Backed Up",compoundIcon:"checkmark"},[Se.BOUND]:{color:"success",icon:"dot",label:"Bound",compoundIcon:"checkmark"},[Se.BUILDING]:{color:"success",icon:"dot-open",label:"Building",compoundIcon:"checkmark"},[Se.COMPLETED]:{color:"success",icon:"dot",label:"Completed",compoundIcon:"checkmark"},[Se.CORDONED]:{color:"info",icon:"tag",label:"Cordoned",compoundIcon:"info"},[Se.COUNT]:{color:"success",icon:"dot-open",label:"Count",compoundIcon:"checkmark"},[Se.CREATED]:{color:"info",icon:"tag",label:"Created",compoundIcon:"info"},[Se.CREATING]:{color:"info",icon:"tag",label:"Creating",compoundIcon:"info"},[Se.DEACTIVATING]:{color:"info",icon:"adjust",label:"Deactivating",compoundIcon:"info"},[Se.DEGRADED]:{color:"warning",icon:"error",label:"Degraded",compoundIcon:"warning"},[Se.DENIED]:{color:"error",icon:"adjust",label:"Denied",compoundIcon:"error"},[Se.DEPLOYED]:{color:"success",icon:"dot-open",label:"Deployed",compoundIcon:"checkmark"},[Se.DISABLED]:{color:"warning",icon:"error",label:"Disabled",compoundIcon:"warning"},[Se.DISCONNECTED]:{color:"warning",icon:"error",label:"Disconnected",compoundIcon:"warning"},[Se.DRAINED]:{color:"info",icon:"tag",label:"Drained",compoundIcon:"info"},[Se.DRAINING]:{color:"warning",icon:"tag",label:"Draining",compoundIcon:"warning"},[Se.ERR_APPLIED]:{color:"error",icon:"error",label:"Error Applied",compoundIcon:"error"},[Se.ERROR]:{color:"error",icon:"error",label:"Error",compoundIcon:"error"},[Se.ERRORING]:{color:"error",icon:"error",label:"Erroring",compoundIcon:"error"},[Se.ERRORS]:{color:"error",icon:"error",label:"Errors",compoundIcon:"error"},[Se.EXPIRED]:{color:"error",icon:"error",label:"Expired",compoundIcon:"warning"},[Se.EXPIRING]:{color:"warning",icon:"error",label:"Expiring",compoundIcon:"error"},[Se.FAIL]:{color:"error",icon:"error",label:"Fail",compoundIcon:"error"},[Se.FAILED]:{color:"error",icon:"error",label:"Failed",compoundIcon:"error"},[Se.HEALTHY]:{color:"success",icon:"dot-open",label:"Healthy",compoundIcon:"checkmark"},[Se.INACTIVE]:{color:"error",icon:"dot",label:"Inactive",compoundIcon:"error"},[Se.INITIALIZING]:{color:"warning",icon:"error",label:"Initializing",compoundIcon:"warning"},[Se.INPROGRESS]:{color:"info",icon:"spinner",label:"In Progress",compoundIcon:"info"},[Se.INFO]:{color:"info",icon:"info",label:"Info",compoundIcon:"info"},[Se.LOCKED]:{color:"warning",icon:"adjust",label:"Locked",compoundIcon:"warning"},[Se.MIGRATING]:{color:"info",icon:"info",label:"Migrated",compoundIcon:"info"},[Se.MISSING]:{color:"warning",icon:"adjust",label:"Missing",compoundIcon:"warning"},[Se.MODIFIED]:{color:"warning",icon:"edit",label:"Modified",compoundIcon:"warning"},[Se.NOT_APPLICABLE]:{color:"warning",icon:"tag",label:"Not Applicable",compoundIcon:"warning"},[Se.NOT_APLLIED]:{color:"warning",icon:"tag",label:"Not Applied",compoundIcon:"warning"},[Se.NOT_READY]:{color:"warning",icon:"tag",label:"Not Ready",compoundIcon:"warning"},[Se.OFF]:{color:"darker",icon:"error",label:"Off"},[Se.ON_GOING]:{color:"info",icon:"info",label:"Info",compoundIcon:"info"},[Se.ORPHANED]:{color:"warning",icon:"tag",label:"Orphaned",compoundIcon:"warning"},[Se.OTHER]:{color:"info",icon:"info",label:"Other",compoundIcon:"info"},[Se.OUT_OF_SYNC]:{color:"warning",icon:"tag",label:"Out Of Sync",compoundIcon:"warning"},[Se.PASS]:{color:"success",icon:"dot-dotfill",label:"Pass",compoundIcon:"checkmark"},[Se.PASSED]:{color:"success",icon:"dot-dotfill",label:"Passed",compoundIcon:"checkmark"},[Se.PAUSED]:{color:"info",icon:"info",label:"Paused",compoundIcon:"info"},[Se.PENDING]:{color:"info",icon:"tag",label:"Pending",compoundIcon:"info"},[Se.PROVISIONING]:{color:"info",icon:"dot",label:"Provisioning",compoundIcon:"info"},[Se.PROVISIONED]:{color:"success",icon:"dot",label:"Provisioned",compoundIcon:"checkmark"},[Se.PURGED]:{color:"error",icon:"purged",label:"Purged",compoundIcon:"error"},[Se.PURGING]:{color:"info",icon:"purged",label:"Purging",compoundIcon:"info"},[Se.READY]:{color:"success",icon:"dot-open",label:"Ready",compoundIcon:"checkmark"},[Se.RECONNECTING]:{color:"error",icon:"error",label:"Reconnecting",compoundIcon:"error"},[Se.REGISTERING]:{color:"info",icon:"tag",label:"Registering",compoundIcon:"info"},[Se.REINITIALIZING]:{color:"warning",icon:"error",label:"Reinitializing",compoundIcon:"warning"},[Se.RELEASED]:{color:"warning",icon:"error",label:"Released",compoundIcon:"warning"},[Se.REMOVED]:{color:"error",icon:"trash",label:"Removed",compoundIcon:"error"},[Se.REMOVING]:{color:"info",icon:"trash",label:"Removing",compoundIcon:"info"},[Se.REQUESTED]:{color:"info",icon:"tag",label:"Requested",compoundIcon:"info"},[Se.RESTARTING]:{color:"info",icon:"adjust",label:"Restarting",compoundIcon:"info"},[Se.RESTORING]:{color:"info",icon:"medicalcross",label:"Restoring",compoundIcon:"info"},[Se.RESIZING]:{color:"warning",icon:"dot",label:"Resizing",compoundIcon:"warning"},[Se.RUNNING]:{color:"success",icon:"dot-open",label:"Running",compoundIcon:"checkmark"},[Se.SKIP]:{color:"info",icon:"dot-open",label:"Skip",compoundIcon:"info"},[Se.SKIPPED]:{color:"info",icon:"dot-open",label:"Skipped",compoundIcon:"info"},[Se.STARTING]:{color:"info",icon:"adjust",label:"Starting",compoundIcon:"info"},[Se.STOPPED]:{color:"error",icon:"dot",label:"Stopped",compoundIcon:"error"},[Se.STOPPING]:{color:"info",icon:"adjust",label:"Stopping",compoundIcon:"info"},[Se.SUCCEEDED]:{color:"success",icon:"dot-dotfill",label:"Succeeded",compoundIcon:"checkmark"},[Se.SUCCESS]:{color:"success",icon:"dot-open",label:"Success",compoundIcon:"checkmark"},[Se.SUCCESSFUL]:{color:"success",icon:"dot-open",label:"Successful"},[Se.SUPERSEDED]:{color:"info",icon:"dot-open",label:"Superseded",compoundIcon:"info"},[Se.SUSPENDED]:{color:"info",icon:"pause",label:"Suspended",compoundIcon:"info"},[Se.UNAVAILABLE]:{color:"error",icon:"error",label:"Unavailable",compoundIcon:"error"},[Se.UNHEALTHY]:{color:"error",icon:"error",label:"Unhealthy",compoundIcon:"error"},[Se.UNINSTALLED]:{color:"info",icon:"trash",label:"Uninstalled",compoundIcon:"info"},[Se.UNINSTALLING]:{color:"info",icon:"trash",label:"Uninstalling",compoundIcon:"info"},[Se.UNKNOWN]:{color:"warning",icon:"x",label:"Unknown",compoundIcon:"warning"},[Se.UNTRIGGERED]:{color:"success",icon:"tag",label:"Untriggered",compoundIcon:"checkmark"},[Se.UPDATING]:{color:"warning",icon:"tag",label:"Updating",compoundIcon:"warning"},[Se.WAIT_APPLIED]:{color:"info",icon:"tag",label:"Wait Applied",compoundIcon:"info"},[Se.WAIT_CHECKIN]:{color:"warning",icon:"tag",label:"Wait Checkin",compoundIcon:"warning"},[Se.WAITING]:{color:"info",icon:"tag",label:"Waiting",compoundIcon:"info"},[Se.WARNING]:{color:"warning",icon:"error",label:"Warning",compoundIcon:"warning"},[Se.DEPLOYING]:{color:"info",icon:"info",label:"Deploying",compoundIcon:"info"}};const Xe={error:1,warning:2,info:3,success:4,ready:5,notready:6,other:7};function xe(e,t,n){if(t)return"text-error";if(n)return"text-info";const i=(e||"active").toLowerCase();let r;return Ae[i]&&Ae[i].color&&(r=Te.call(this,Ae[i].color)),r||(r=ye),"text-"+r}function Ke(e){const t=(e||"active").toLowerCase();return be[t]?be[t]:t.split(/-/).map(p["k"]).join("-")}function Ce(e,t){return e=e.replace(/^(text|bg)-/,""),`${Xe[e]||Xe["other"]} ${t}`}function Te(e){return he()(e)?e(this):e}class Fe{constructor(e,t,n=null,i=!1){for(const r in e)this[r]=e[r];Object.defineProperty(this,"$ctx",{value:t,enumerable:!1}),n&&Object.defineProperty(this,"__rehydrate",{value:n,enumerable:!0,configurable:!0}),i&&Object.defineProperty(this,"__clone",{value:!0,enumerable:!0,configurable:!0,writable:!0})}get $getters(){return this.$ctx.getters}get $rootGetters(){return this.$ctx.rootGetters}get $dispatch(){return this.$ctx.dispatch}get $state(){return this.$ctx.state}get $rootState(){return this.$ctx.rootState}get customValidationRules(){return[]}get _key(){const e=this.metadata;if(e){if(e.uid)return e.uid;if(e.namespace)return`${this.type}/${e.namespace}/${e.name}`}return this.id?`${this.type}/${this.id}`:`${this.type}/${Math.random()}`}get schema(){return this.$getters["schemaFor"](this.type)}toString(){return`[${this.type}: ${this.id}]`}get typeDisplay(){const e=this.schema;return e?this.$rootGetters["type-map/labelFor"](e):"?"}get nameDisplay(){var e,t,n;return this.displayName||(null===(e=this.spec)||void 0===e?void 0:e.displayName)||(null===(t=this.metadata)||void 0===t||null===(t=t.annotations)||void 0===t?void 0:t[i["f"]])||this.name||(null===(n=this.metadata)||void 0===n?void 0:n.name)||this.id}get nameSort(){return Object(z["b"])(this.nameDisplay).toLowerCase()}get namespacedName(){var e;const t=null===(e=this.metadata)||void 0===e?void 0:e.namespace,n=this.nameDisplay;return t?`${t}:${n}`:n}get namespacedNameSort(){return Object(z["b"])(this.namespacedName).toLowerCase()}get groupByLabel(){var e;const t=null===(e=this.metadata)||void 0===e?void 0:e.namespace;let n;return n=t?this.t("resourceTable.groupLabel.namespace",{name:Object(p["c"])(t)}):this.t("resourceTable.groupLabel.notInANamespace"),n}setLabels(){throw new Error("Implement setLabels in subclass")}setLabel(){throw new Error("Implement setLabel in subclass")}setAnnotations(e){throw new Error("Implement setAnnotations in subclass")}setAnnotation(e,t){throw new Error("Implement setAnnotation in subclass")}get stateDisplay(){return Ke(this.state)}get stateColor(){var e,t;return xe.call(this,this.state,null===(e=this.stateObj)||void 0===e?void 0:e.error,null===(t=this.stateObj)||void 0===t?void 0:t.transitioning)}get stateBackground(){return this.stateColor.replace("text-","bg-")}get stateIcon(){let e=!1,t=!1;if(this.metadata&&this.metadata.state&&(e=this.metadata.state.transitioning,t=this.metadata.state.error),e)return"icon icon-spinner icon-spin";if(t)return"icon icon-error";const n=(this.state||"").toLowerCase();let i;return Ae[n]&&Ae[n].icon&&(i=Te.call(this,Ae[n].icon)),i||(i=we),"icon icon-"+i}get stateSort(){return Ce(this.stateColor,this.stateDisplay)}get stateDescription(){var e,t,n;const i=(null===(e=this.stateObj)||void 0===e?void 0:e.transitioning)||!1,r=(null===(t=this.stateObj)||void 0===t?void 0:t.error)||!1,s=null===(n=this.stateObj)||void 0===n?void 0:n.message;return i||r?Object(p["k"])(s):""}get stateObj(){var e;return null===(e=this.metadata)||void 0===e?void 0:e.state}waitForTestFn(e,t,n,i){return se(()=>e.apply(this),t,n||Ee,i||ke,!0)}waitForState(e,t,n){return this.waitForTestFn(()=>(this.state||"").toLowerCase()===e.toLowerCase(),"state="+e,t,n)}waitForTransition(){return this.waitForTestFn(()=>!this.transitioning,"transition completion",void 0,void 0)}waitForAction(e){return this.waitForTestFn(()=>this.hasAction(e),"action="+e,void 0,void 0)}waitForLink(e){return this.waitForTestFn(()=>this.hasLink(e),"link="+e,void 0,void 0)}hasCondition(e){return this.isCondition(e,null)}isCondition(e,t="True"){if(!this.status||!this.status.conditions)return!1;const n=Object(o["d"])(this.status.conditions||[],"type",e);return!!n&&(!t||(n.status||"").toLowerCase()===(""+t).toLowerCase())}waitForCondition(e,t="True",n=Ee,i=ke){return this.waitForTestFn(()=>this.isCondition(e,t),`condition ${e}=${t}`,n,i)}get availableActions(){const e=this._availableActions;let t=null;const n=e.filter(e=>{if(!1===e.enabled)return!1;const n=e.divider,i=!n||n&&!t;return t=n,i});while(n.length&&n[0].divider)n.shift();while(n.length&&n[n.length-1].divider)n.pop();for(let i=1;i{const t={...e},i=t.enabled,r=typeof i;switch(r){case"undefined":t.enabled=!0;break;case"function":Object.defineProperty(t,"enabled",{get:()=>i(this)});break;case"boolean":break;default:console.warn("Unsupported 'enabled' property type for action: "+(e.label||e.labelKey)),delete t.enabled;break}n.push(t)})),n}get canDelete(){return this._canDelete}get _canDelete(){return this.hasLink("remove")&&this.$rootGetters["type-map/optionsFor"](this.type).isRemovable}get canClone(){return!0}get canUpdate(){return this.hasLink("update")&&this.$rootGetters["type-map/optionsFor"](this.type).isEditable}get canCustomEdit(){return this.$rootGetters["type-map/hasCustomEdit"](this.type,this.id)}get canCreate(){var e;return!(this.schema&&(null===(e=this.schema)||void 0===e||!e.collectionMethods.find(e=>"post"===e.toLowerCase())))&&this.$rootGetters["type-map/optionsFor"](this.type).isCreatable}get canViewInApi(){return this.hasLink("self")&&this.$rootGetters["prefs/get"](s["c"])}get canYaml(){return this.hasLink("view")}get canEditYaml(){var e;return(null===(e=this.schema)||void 0===e||null===(e=e.resourceMethods)||void 0===e||!e.find(e=>"blocked-PUT"===e))&&this.canUpdate}hasLink(e){return!!this.linkFor(e)}linkFor(e){return(this.links||{})[e]}followLink(e,t={}){if(t.url||(t.url=(this.links||{})[e]),t.urlSuffix&&(t.url+=t.urlSuffix),!t.url)throw new Error(`Unknown link ${e} on ${this.type} ${this.id}`);return this.$dispatch("request",{opt:t,type:this.type})}hasAction(e){return!!this.actionLinkFor(e)}actionLinkFor(e){return(this.actions||this.actionLinks||{})[e]}doAction(e,t,n={}){return this.$dispatch("resourceAction",{resource:this,actionName:e,body:t,opt:n})}async doActionGrowl(e,t,n={}){try{await this.$dispatch("resourceAction",{resource:this,actionName:e,body:t,opt:n})}catch(i){this.$dispatch("growl/fromError",{title:this.$rootGetters["i18n/t"]("generic.notification.title.error"),err:i.data||i},{root:!0})}}patch(e,t={},n=!1,i=!1){if(t.url||(t.url=this.linkFor("view")||this.linkFor("self")),t.method="patch",t.headers=t.headers||{},!t.headers["content-type"]){const e=n?"application/strategic-merge-patch+json":"application/json-patch+json";t.headers["content-type"]=e}t.data=e;const r=this.$dispatch("request",{opt:t,type:this.type});return i?r.catch(e=>{const t=this.t("resource.errors.update",{name:this.name});console.error(t,e),this.$dispatch("growl/error",{title:t,message:null===e||void 0===e?void 0:e.message,timeout:5e3},{root:!0})}):r}save(){return this._save(...arguments)}cleanForSave(e,t){return delete e.__rehydrate,delete e.__clone,e}processSaveResponse(e){}async _save(e={}){var t;const n=!this.id,i=this.validationErrors(this,e);if(!c()(i))return Promise.reject(i);if(null!==(t=this.metadata)&&void 0!==t&&t.resourceVersion&&(this.metadata.resourceVersion=""+this.metadata.resourceVersion),!e.url)if(n){const t=this.$getters["schemaFor"](this.type);let n=t.linkFor("collection");t.attributes&&t.attributes.namespaced&&this.metadata&&this.metadata.namespace&&(n+="/"+this.metadata.namespace),e.url=n}else e.url=this.linkFor("update")||this.linkFor("self");if(e.method||(e.method=n?"post":"put"),e.headers||(e.headers={}),e.headers["content-type"]||(e.headers["content-type"]="application/json"),e.headers["accept"]||(e.headers["accept"]="application/json"),e.data=this.toSave()||{...this},e.data._type&&(e.data.type=e.data._type),e.data._name&&(e.data.name=e.data._name),e.data._labels&&(e.data.labels=e.data._labels),e.data._annotations&&(e.data.annotations=e.data._annotations),e.data=this.cleanForSave(e.data,n),null!==e&&void 0!==e&&e.replace&&"put"===e.method){const t=e.url.includes("?")?"&":"?";e.url=`${e.url}${t}_replace=true`,delete e.replace}try{const t=await this.$dispatch("request",{opt:e,type:this.type});this.processSaveResponse(t),t&&"Table"!==t.kind&&await this.$dispatch("load",{data:t,existing:n?this:void 0})}catch(r){return this.type&&this.id&&409===(null===r||void 0===r?void 0:r._status)&&await this.$dispatch("find",{type:this.type,id:this.id,opt:{force:!0}}),Promise.reject(r)}return this}remove(){return this._remove(...arguments)}async _remove(e={}){e.url||(e.url=this.linkFor("self")),e.method="delete";const t=await this.$dispatch("request",{opt:e,type:this.type});204===(null===t||void 0===t?void 0:t._status)&&await this.$dispatch("ws.resource.remove",{data:this})}currentRoute(){return window.$globalApp.$route}currentRouter(){return window.$globalApp.$router}get listLocation(){return{name:"c-cluster-product-resource",params:{product:this.$rootGetters["productId"],cluster:this.$rootGetters["clusterId"],resource:this.type}}}get _detailLocation(){var e,t,n;const i=this.$getters["schemaFor"](this.type),r=null===(e=this.id)||void 0===e?void 0:e.replace(/.*\//,"");return{name:`c-cluster-product-resource${null!==i&&void 0!==i&&null!==(t=i.attributes)&&void 0!==t&&t.namespaced?"-namespace":""}-id`,params:{product:this.$rootGetters["productId"],cluster:this.$rootGetters["clusterId"],resource:this.type,namespace:null===(n=this.metadata)||void 0===n?void 0:n.namespace,id:r}}}get detailLocation(){return this._detailLocation}goToDetail(){this.currentRouter().push(this.detailLocation)}goToClone(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["c"],[r["a"]]:r["i"],...e},this.currentRouter().push(t)}goToEdit(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["g"],[r["a"]]:r["i"],...e},this.currentRouter().push(t)}goToViewConfig(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["j"],[r["a"]]:r["d"],...e},this.currentRouter().push(t)}goToEditYaml(){const e=this.detailLocation;e.query={...e.query,[r["b"]]:r["g"],[r["a"]]:r["k"]},this.currentRouter().push(e)}goToViewYaml(){const e=this.detailLocation;e.query={...e.query,[r["b"]]:r["j"],[r["a"]]:r["k"]},this.currentRouter().push(e)}cloneYaml(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["c"],[r["a"]]:r["k"],...e},this.currentRouter().push(t)}async download(){const e=await this.followLink("view",{headers:{accept:"application/yaml"}}),t=await this.cleanForDownload(e.data);G(this.nameDisplay+".yaml",t,"application/yaml")}async downloadBulk(e){const t={},n=[];for(const r of e){let e=r.nameDisplay+".yaml",t=2;while(n.includes(e))e=`${r.nameDisplay}_${t++}.yaml`;n.push(e)}await Object(H["b"])(e,10,(e,i)=>e.followLink("view",{headers:{accept:"application/yaml"}}).then(async e=>{const r=e.data||e,s=await this.cleanForDownload(r);t["resources/"+n[i]]=s}));const i=await V(t);G("resources.zip",i,"application/zip")}viewInApi(){window.open(this.links.self,"_blank")}promptRemove(e){e||(e=this),this.$dispatch("promptRemove",e)}get confirmRemove(){return!1}applyDefaults(){}get urlFromAttrs(){const e=this.$getters["schemaFor"](this.type),{metadata:{namespace:t="default"}}=this;let n=e.links.collection;const i=null===e||void 0===e?void 0:e.attributes;if(!i)throw new Error("Attributes must be present on the schema");const{group:r,resource:s}=i;return n=`${n.slice(0,n.indexOf("/v1"))}/apis/${r}/namespaces/${t}/${s}`,n}cleanYaml(e,t="edit"){try{const n=ae.a.load(e);"edit"!==t&&this.$dispatch("cleanForNew",n),n._type&&(n.type=n._type,delete n._type);const i=ae.a.dump(n,{skipInvalid:!0});return i}catch(n){return null}}cleanForNew(){this.$dispatch("cleanForNew",this)}cleanForDiff(){this.$dispatch("cleanForDiff",this.toJSON())}async cleanForDownload(e){return this.$dispatch("cleanForDownload",e)}yamlForSave(e){try{const t=ae.a.load(e);if(t)return this._type&&(t._type=t.type),ae.a.dump(t)}catch(t){return null}}async saveYaml(e){await this._saveYaml(e)}async _saveYaml(e){var t;const n=ae.a.load(e);if(null!==(t=this.schema)&&void 0!==t&&null!==(t=t.attributes)&&void 0!==t&&t.namespaced&&!n.metadata.namespace){const e=this.$rootGetters["i18n/t"]("resourceYaml.errors.namespaceRequired");throw e}let i;const r=!this.id,s={"content-type":"application/yaml",accept:"application/json"};i=r?await this.schema.followLink("collection",{method:"POST",headers:s,data:e}):await this.followLink("update",{method:"PUT",headers:s,data:e}),await this.$dispatch("load",{data:i,existing:r?this:void 0}),this.isSpoofed&&await this.$dispatch("cluster/findAll",{type:this.type,opt:{force:!0}},{root:!0})}get modelValidationRules(){const e=[],t=null===this||void 0===this?void 0:this.customValidationRules.filter(e=>!!e.validators||!!e.required).map(e=>{const t=re(this.t,{displayKey:null!==e&&void 0!==e&&e.translationKey?this.t(e.translationKey):"Value"});return{path:e.path,rules:[...e.validators||[],...e.required?["required"]:[],...["dnsLabel","dnsLabelRestricted","hostname"].includes(e.type)?[e.type]:[]].map(e=>{if(e.includes(":")){const[n,i]=e.split(":");return t[n](i)}return t[e]}).filter(e=>!!e)}}).filter(e=>e.rules.length>0);return e.push(...t),e}customValidationErrors(e,t=[]){const n=[];let{customValidationRules:i}=this;return c()(i)||(he()(i)&&(i=i()),i.filter(e=>!t.includes(e.path)).forEach(t=>{const{path:i,requiredIf:r,validators:s=[],type:o}=t;let a=Object(f["d"])(e,i);const l=le()(s||[]);let u=i;if(t.translationKey&&this.$rootGetters["i18n/exists"](t.translationKey)&&(u=this.t(t.translationKey)),fe()(a)&&(a=a.trim()),r){const t=Object(f["d"])(e,r);!c()(t)&&c()(a)&&0!==a&&n.push(this.t("validation.required",{key:u}))}if(g(a,t,u,this.$rootGetters,n),m(a,t,u,this.$rootGetters,n),!c()(a)&&ve.includes(o)){const t=(a||"").toLowerCase();t!==a&&(a=t,_e.a.set(e,i,a)),n.push(...y(a,o,u,this.$rootGetters,n))}l.forEach(t=>{const i=t.split(":"),r=i.slice(0,1),s=i.slice(1)||null,o=Object.prototype.hasOwnProperty.call(B,r);if(!c()(r)&&o)B[r](a,this.$rootGetters,n,s,u,e);else if(!c()(r)&&!o){var l;const t=null===(l=this.$rootState.$plugin)||void 0===l?void 0:l.getValidator(r);t?t(a,this.$rootGetters,n,s,u,e):console.warn(this.t("validation.custom.missing",{validatorName:r}))}})})),n}validationErrors(e=this,t={}){return this.customValidationErrors(e)}get ownersByType(){var e;const t=(null===(e=this.metadata)||void 0===e?void 0:e.ownerReferences)||[],n={};return t.forEach(e=>{n[e.kind]?n[e.kind].push(e):n[e.kind]=[e]}),n}get owners(){const e=[];for(const t in this.ownersByType){const n=this.$rootGetters["cluster/schema"](t);if(n){const i=n.id,r=this.$rootGetters["cluster/all"](i);this.ownersByType[t].forEach((t,n)=>{const i=r.find(e=>{var n;return(null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.uid)===t.uid});i&&e.push(i)})}}return e}get details(){return this._details}get _details(){var e;const t=[];return(null===(e=this.owners)||void 0===e?void 0:e.length)>0&&t.push({label:this.t("resourceDetail.detailTop.ownerReferences",{count:this.owners.length}),formatter:"ListLinkDetail",content:this.owners.map(e=>({key:e.id,row:e,col:{},value:e.metadata.name}))}),Object(f["d"])(this,"metadata.deletionTimestamp")&&t.push({label:this.t("resourceDetail.detailTop.deleted"),formatter:"LiveDate",formatterOpts:{addSuffix:!0},content:Object(f["d"])(this,"metadata.deletionTimestamp")}),t}get t(){return this.$rootGetters["i18n/t"]}findOwners(){return this._getRelationship("owner","from")}getOwners(){return this._getRelationship("owner","from")}findOwned(){return this._findRelationship("owner","to")}_relationshipsFor(e,t){var n;const i={selectors:[],ids:[]};if(null===(n=this.metadata)||void 0===n||null===(n=n.relationships)||void 0===n||!n.length)return i;for(const r of this.metadata.relationships)if(("any"===e||r.rel===e)&&r[t+"Type"])if(r.selector)Object(o["b"])(i.selectors,{type:r.toType,namespace:r.toNamespace,selector:r.selector});else{const e=r[t+"Type"];let n=r[t+"Namespace"],s=r[t+"Id"];if(!n&&s.includes("/")){const e=s.indexOf("/");n=s.substr(0,e),s=s.substr(e+1)}const a=(n?n+"/":"")+s;Object(o["a"])(i.ids,{type:e,namespace:n,name:s,id:a})}return i}_getRelationship(e,t){var n;const i=this._relationshipsFor(e,t);return null!==(n=i.selectors)&&void 0!==n&&n.length&&console.warn("Sync request for a relationship that is a selector"),i.ids||[]}async _findRelationship(e,t){const{selectors:n,ids:i}=this._relationshipsFor(e,t),r=[];for(const s of n){const e=await this.$dispatch("findMatching",s);Object(o["b"])(r,e.data)}for(const s of i){const{type:e,id:t}=s;let n=this.$getters["byId"](e,t);if(!n)try{n=await this.$dispatch("find",{type:e,id:t})}catch{}n&&Object(o["a"])(r,n)}return r}get shortId(){const e=this.id.split("/");return e.length>1?e[1]:e[0]}toJSON(){const e={},t=Object.keys(this);for(const i of t){var n;null!==(n=this[i])&&void 0!==n&&n.toJSON?e[i]=this[i].toJSON():e[i]=Object(f["b"])(this[i])}return e}toSave(){}get creationTimestamp(){var e;return null===(e=this.metadata)||void 0===e?void 0:e.creationTimestamp}get yamlFolding(){return[]}}},"9c38":function(e,t,n){var i=n("0e19"),r=n("c316"),s=n("b4b4"),o="[object String]";function a(e){return"string"==typeof e||!r(e)&&s(e)&&i(e)==o}e.exports=a},"9ce4":function(e,t,n){"use strict";(function(e){ +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("__jszip"),require("__jsyaml"),require("vue")):"function"===typeof define&&define.amd?define(["__jszip","__jsyaml"],t):"object"===typeof exports?exports["kubevirt-dashboard-extension-1.1.0"]=t(require("__jszip"),require("__jsyaml"),require("vue")):e["kubevirt-dashboard-extension-1.1.0"]=t(e["__jszip"],e["__jsyaml"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){function t(t){for(var n,r,s=t[0],o=t[1],a=0,c=[];a-1}e.exports=r},"0e19":function(e,t,n){var i=n("4b2c"),r=n("2822"),s=n("907a"),o="[object Null]",a="[object Undefined]",c=i?i.toStringTag:void 0;function l(e){return null==e?void 0===e?a:o:c&&c in Object(e)?r(e):s(e)}e.exports=l},"0e30":function(e,t){function n(){return!1}e.exports=n},"0ed3":function(e,t,n){"use strict";function i(e,t){for(var n=[],i={},r=0;rn.parts.length&&(i.parts.length=n.parts.length)}else{var o=[];for(r=0;r{this.showMessage=!0},250)},beforeDestroy(){clearTimeout(this.timer)}},o=s,a=(n("959e"),n("d802")),c=Object(a["a"])(o,i,r,!1,null,"23723280",null);t["a"]=c.exports},1722:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("7083"),r=n("98d3"),s=n("2cb5"),o=n("da25");function a(e){var t;let n=null===(t=e.params)||void 0===t?void 0:t.product;if(!n){var i;const t=null===(i=e.name)||void 0===i?void 0:i.match(/^c-cluster-([^-]+)/);t&&(n=t[1])}return n||(n=c(e,"product")),n}function c(e,t){if(null!==e&&void 0!==e&&e.meta){const n=Array.isArray(e.meta)?e.meta:[e.meta];for(let e=0;e{if(d(o,e.locationConfig,c||{})){if(t===i["c"].CARD)n===i["b"].CLUSTER_DASHBOARD_CARD&&e.labelKey&&(l[h].label=a.t(e.labelKey));else if(t===i["c"].ACTION&&(n===i["a"].TABLE&&(e.labelKey&&(l[h].label=a.t(e.labelKey)),l[h].bulkable=l[h].multiple||l[h].bulkable,l[h].action||(l[h].action="custom-table-action-"+Object(s["h"])(10).toLowerCase())),n===i["a"].HEADER&&e.shortcut))if("string"===typeof e.shortcut)l[h].shortcutLabel=()=>r["b"]?`(⌘-${e.shortcut.toUpperCase()})`:`(Ctrl-${e.shortcut.toUpperCase()})`,l[h].shortcutKey={windows:["ctrl",e.shortcut],mac:["meta",e.shortcut]};else if("object"===typeof e.shortcut&&!Array.isArray(e.shortcut)&&null!==e.shortcut){l[h].shortcutKey=e.shortcut;const t=r["b"]?l[h].shortcut.mac:l[h].shortcut.windows?l[h].shortcut.windows:[];let n="";t.forEach((e,i)=>{i`(${n})`}u.push(l[h])}})}return u}},"1ab6":function(e,t,n){(function(e){var i=n("201b"),r=t&&!t.nodeType&&t,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o?i.Buffer:void 0,c=a?a.allocUnsafe:void 0;function l(e,t){if(t)return e.slice();var n=e.length,i=c?c(n):new e.constructor(n);return e.copy(i),i}e.exports=l}).call(this,n("6984")(e))},"1b8e":function(e,t,n){e.exports=n.p+"img/banner.a83d2a9b.svg"},"1c25":function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var i=window.document.currentScript,r=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}function s(e){e.register("list","kubevirt.io.virtualmachine",()=>Promise.all([n.e(4),n.e(2)]).then(n.bind(null,"984b"))),e.register("models","kubevirt.io.virtualmachine",()=>n("44f6")),e.register("models","kubevirt.io.virtualmachineinstance",()=>n("0606")),e.register("l10n","en-us",()=>n.e(7).then(n.t.bind(null,"1bb6",7))),e.register("formatters","IPAddress",()=>Promise.all([n.e(3),n.e(0)]).then(n.bind(null,"a09e"))),e.register("formatters","VMState",()=>Promise.all([n.e(3),n.e(0)]).then(n.bind(null,"ec8b")))}var o=n("7083"),a=n("377f");const c=function(e,t){t.map(e=>{e.spec.running=!0,e.save()})},l=function(e,t){t.map(e=>{e.spec.running=!1,e.save()})},u=e=>e.canStop,h=e=>e.canStart,d={label:"Start",icon:"icon icon-play",invoke:c,enabled:h,multiple:!0},f={label:"Stop",icon:"icon icon-close",invoke:l,enabled:u,multiple:!0};var p=function(){var e=this,t=e._self._c;return t("div",[e.$fetchState.pending?t("Loading"):t("SerialConsole",{ref:"serialConsole",model:{value:e.vmi,callback:function(t){e.vmi=t},expression:"vmi"}})],1)},_=[],g=n("15ca"),m=function(){var e=this,t=e._self._c;return t("div",{staticClass:"console-shell-container"},[t("div",{ref:"xterm",staticClass:"shell-body"}),t("resize-observer",{on:{notify:e.fit}})],1)},v=[],b=n("a8b9"),y=n("44db"),w=n.n(y);const k=new WeakMap,E=new WeakMap;function S(e){const t=k.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function A(e){null==e.passiveListener?e.event.cancelable&&(e.canceled=!0,"function"===typeof e.event.preventDefault&&e.event.preventDefault()):"undefined"!==typeof console&&"function"===typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener)}function X(e,t){k.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=Object.keys(t);for(let i=0;i0){const e=new Array(arguments.length);for(let t=0;tnull===e?""+encodeURIComponent(t):`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"),i}function $(e){const t=$.options,n=t.parser[t.strictMode?"strict":"loose"].exec(e);if(!n)throw new Error("Cannot parse as uri: "+e);const i={};let r=14;while(r--)i[t.key[r]]=n[r]||"";return i.query={},i.queryStr.replace(t.q.parser,(e,n,r)=>(n&&(i[t.q.name][n]=r),"")),i}function q(e,t,n){return t=W(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(e){var t=Y(e,"string");return"symbol"===typeof t?t:String(t)}function Y(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}$.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","queryStr","anchor"],q:{name:"query",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};let J=1,Z=!1,ee=!1;const te="ws://",ne="wss://",ie="disconnected",re=(V.addEventListener,"connecting"),se="connected",oe="closing",ae="reconnecting",ce=re,le=se,ue=ie,he="message",de="frame_timeout",fe="connect_error",pe="disconnect_error";class _e extends V{constructor(e,t=!0,n=null,i=null,r=null,s=!1){super(),q(this,"url",void 0),q(this,"autoReconnect",!0),q(this,"frameTimeout",35e3),q(this,"metadata",{}),q(this,"hasBeenOpen",!1),q(this,"hasReconnected",!1),q(this,"protocol",null),q(this,"maxTries",null),q(this,"tries",0),q(this,"idAsTimestamp",!1),q(this,"socket",null),q(this,"state",ie),q(this,"framesReceived",0),q(this,"frameTimer",void 0),q(this,"reconnectTimer",void 0),q(this,"disconnectCallBacks",[]),q(this,"disconnectedAt",0),q(this,"closingId",0),q(this,"autoReconnectUrl",null),this.setUrl(e),this.autoReconnect=t,this.protocol=i,this.maxTries=r,this.idAsTimestamp=s,null!==n&&(this.frameTimeout=n)}setUrl(e){e.match(/wss?:\/\//)||(e=self.location.origin.replace(/^http/,"ws")+e),"https:"===self.location.protocol&&e.startsWith(te)&&(e=ne+e.substr(te.length)),this.url=e}connect(e={}){if(this.socket)return void console.error("Socket refusing to connect while another socket exists");this.state!==ae&&(this.state=re),Object.assign(this.metadata,e);const t=this.idAsTimestamp?(new Date).getTime():J++,n=z(this.url,"sockId",t);let i;this._baseLog("connecting",{id:t,url:n.replace(/\?.*/,"")}),this.tries++,i=this.protocol?new WebSocket(n,this.protocol):new WebSocket(n),i.sockId=t,i.metadata=this.metadata,i.onmessage=this._onmessage.bind(this),i.onopen=this._opened.bind(this),i.onerror=this._error.bind(this),i.onclose=this._closed.bind(this),this.socket=i,this.state=re,this.dispatchEvent(new CustomEvent(ce))}send(e){return!(!this.socket||this.state!==se)&&(this.socket.send(e),!0)}disconnect(e){e&&this.disconnectCallBacks.push(e);const t=this,n=new Promise((e,n)=>{function i(e){n(e),t.removeEventListener(fe,i)}this.state===ie&&e(),this.addEventListener(fe,i),this.disconnectCallBacks.push(()=>{this.removeEventListener(fe,i),e()})});return this.autoReconnect=!1,this._close(),n}reconnect(e={}){Object.assign(this.metadata,e),this.state!==re?this.socket?this._close():this.connect(e):this._log("Ignoring reconnect for socket in connecting")}getMetadata(){return this.socket?this.socket.metadata:{}}getId(){return this.socket?this.socket.sockId:0}isConnected(){return this.state===se}setAutoReconnect(e){this.autoReconnect=e}setAutoReconnectUrl(e){this.autoReconnectUrl=e}_close(){const e=this.socket;if(e){try{this._log("closing"),this.closingId=e.sockId,e.onopen=null,e.onerror=null,e.onmessage=null,e.close()}catch(t){this._log("exception",{e:t.toString()})}this.state=oe}}_opened(){this._log("opened");const e=(new Date).getTime(),t=this.disconnectedAt;let n=0;t&&(n=e-t),this.hasBeenOpen&&(this.hasReconnected=!0),this.hasBeenOpen=!0,this.state=se,this.framesReceived=0,this.disconnectedAt=0,this.dispatchEvent(new CustomEvent(le,{detail:{tries:this.tries,afterMilliseconds:n}})),this.tries=0,this._resetWatchdog(),clearTimeout(this.reconnectTimer)}_onmessage(e){this._resetWatchdog(),this.tries=0,this.framesReceived++,this.dispatchEvent(new CustomEvent(he,{detail:e}))}_resetWatchdog(){clearTimeout(this.frameTimer);const e=this.frameTimeout;e&&this.state===se&&(this.frameTimer=setTimeout(()=>{this._log(`watchdog expired after${e}. Closing`),this._close(),this.dispatchEvent(new CustomEvent(de))},e))}_error(){this.closingId=this.socket?this.socket.sockId:0,this._log("error")}_closed(e){var t;const{code:n,reason:i,wasClean:r}=e;this._baseLog("closed",{id:this.closingId||(null===(t=this.socket)||void 0===t?void 0:t.sockId)||"unknown",code:n,reason:i,clean:r}),this.closingId=0,this.socket=null,clearTimeout(this.reconnectTimer),clearTimeout(this.frameTimer);const s=this.disconnectCallBacks;while(s.length){const e=s.pop();e&&e.apply(this)}if([se,oe].includes(this.state)&&(ee=!0),this.disconnectedAt||(this.disconnectedAt=(new Date).getTime()),Z||ee)if(this.autoReconnect){if(this.state=ae,this.maxTries&&this.tries>1&&this.tries<=this.maxTries){const e=new CustomEvent(fe);this.dispatchEvent(e)}if(this.maxTries&&this.tries>this.maxTries)this._log("closed. Will not reconnect (hit max attempts)"),this.state=ie,this.dispatchEvent(new CustomEvent(pe));else{const e=()=>{this._log("closed. Attempting to reconnect");const e=Math.max(1e3,Math.min(1e3*this.tries,3e4));this.reconnectTimer=setTimeout(()=>{this.connect()},e)};this.autoReconnectUrl?this.autoReconnectUrl().then(t=>{this.setUrl(t),e()}).catch(e=>{console.error("Failed to fetch socket auto reconnect url",e)}):e()}}else this.state=ie;else{this.autoReconnect=!1,this.state=ie;const e=new CustomEvent(fe,{detail:{isSafari:H["e"]}});this.dispatchEvent(e),Z=!0}this.state===ie?this.dispatchEvent(new CustomEvent(ue)):this.state===ae&&this.dispatchEvent(new CustomEvent(ce))}_log(e,t){var n;this._baseLog(e,{state:this.state,id:(null===(n=this.socket)||void 0===n?void 0:n.sockId)||0,...t})}_baseLog(e,t){const n=[e],i=Object.entries(t||{});n.unshift("Socket "),i.length&&(n.push(" ("),i.forEach(([e,t],i)=>{0!==i&&n.push(", "),n.push(`${e}=${t}`)}),n.push(")")),console.log(n.join(""))}}var ge={props:{value:{type:Object,required:!0}},data(){return{socket:null,terminal:null,fitAddon:null,searchAddon:null,webglAddon:null,isOpen:!1,isOpening:!1,backlog:[],firstTime:!0,queue:[]}},computed:{xtermConfig(){return{allowProposedApi:!0,cursorBlink:!0,useStyle:!0,fontSize:12}}},watch:{queue:{handler:w()((async function(e){if(0===e.length)return;const t=await Promise.all(e);(t||[]).forEach(e=>{this.terminal.write(e)}),this.queue=[]}),5)}},beforeDestroy(){this.close()},async mounted(){await this.setupTerminal(),await this.connect()},methods:{async setupTerminal(){const e=getComputedStyle(document.querySelector("body")),t=await n.e(5).then(n.t.bind(null,"2b0c",7)),i=await Object(b["a"])({fit:n.e(5).then(n.t.bind(null,"2b02",7)),webgl:n.e(5).then(n.t.bind(null,"be90",7)),weblinks:n.e(5).then(n.t.bind(null,"c257",7)),search:n.e(5).then(n.t.bind(null,"5d77",7))}),r=new t.Terminal({theme:{background:e.getPropertyValue("--terminal-bg").trim(),cursor:e.getPropertyValue("--terminal-cursor").trim(),foreground:e.getPropertyValue("--terminal-text").trim()},...this.xtermConfig});this.fitAddon=new i.fit.FitAddon,this.searchAddon=new i.search.SearchAddon;try{this.webglAddon=new i.webgl.WebGlAddon}catch(s){this.webglAddon=null}r.loadAddon(this.fitAddon),r.loadAddon(this.searchAddon),r.loadAddon(new i.weblinks.WebLinksAddon),r.open(this.$refs.xterm),this.webglAddon&&r.loadAddon(this.webglAddon),this.fit(),this.flush(),r.onData(e=>{const t=this.str2ab(e);this.write(t)}),this.terminal=r},str2ab(e){const t=new TextEncoder;return t.encode(e)},write(e){this.isOpen?this.socket.send(e):this.backlog.push(e)},clear(){this.terminal.clear()},getSocketUrl(){var e;return""+(null===(e=this.value)||void 0===e?void 0:e.getSerialConsolePath)},async connect(){this.socket&&(await this.socket.disconnect(),this.socket=null,this.terminal.reset());const e=this.getSocketUrl();e&&(this.socket=new _e(e),this.socket.addEventListener(ce,()=>{this.isOpen=!1,this.isOpening=!0}),this.socket.addEventListener(fe,e=>{this.isOpen=!1,this.isOpening=!1,console.error("Connect Error",e)}),this.socket.addEventListener(le,()=>{this.isOpen=!0,this.isOpening=!1,this.show&&(this.fit(),this.flush()),this.firstTime&&(this.socket.send(this.str2ab("\n")),this.firstTime=!1)}),this.socket.addEventListener(ue,()=>{this.isOpen=!1,this.isOpening=!1,this.$emit("close")}),this.socket.addEventListener(he,e=>{this.queue.push(e.detail.data.text())}),this.socket.connect(),this.terminal.focus())},flush(){const e=this.backlog.slice();this.backlog=[];for(const t of e)this.socket.send(t)},fit(){if(!this.fitAddon)return;this.fitAddon.fit();const{rows:e,cols:t}=this.fitAddon.proposeDimensions();if(!this.isOpen)return;const n=JSON.stringify({Width:t,Height:e});this.socket.send(this.str2ab(n))},close(){this.socket&&this.socket.disconnect(),this.terminal&&this.terminal.dispose()}}},me=ge,ve=(n("d1b6"),n("d802")),be=Object(ve["a"])(me,m,v,!1,null,null,null),ye=be.exports,we={components:{SerialConsole:ye,Loading:g["a"]},layout:"blank",data(){return{id:`${this.$route.params.namespace}/${this.$route.params.vm}`}},async fetch(){await this.$store.dispatch("cluster/find",{type:a["c"],id:this.id})},head(){var e;return{title:null===(e=this.vmi)||void 0===e||null===(e=e.metadata)||void 0===e?void 0:e.name}},computed:{vmi(){return this.$store.getters["cluster/byId"](a["c"],this.id)||[]}},mounted(){window.addEventListener("beforeunload",()=>{this.$refs.serialConsole.close()})}},ke=we,Ee=(n("72d8"),Object(ve["a"])(ke,p,_,!1,null,"3bf18937",null)),Se=Ee.exports,Ae=function(){var e=this,t=e._self._c;return e.$fetchState.pending?t("Loading"):t("NovncConsoleWrapper",{ref:"console",staticClass:"novnc-wrapper",model:{value:e.vmi,callback:function(t){e.vmi=t},expression:"vmi"}})},Xe=[],xe=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("div",{staticClass:"vm-console"},[t("div",{staticClass:"combination-keys"},[t("v-popover",{ref:"popover",attrs:{placement:"top",trigger:"click",container:!1},on:{"auto-hide":function(t){e.keysRecord=[]}}},[t("button",{staticClass:"btn btn-sm bg-primary"},[e._v(" "+e._s(e.t("kubevirt.virtualMachine.detail.console.shortKeys"))+" ")]),t("template",{slot:"popover"},[t("novnc-console-item",{attrs:{items:e.keymap,path:e.keysRecord,pos:0},on:{update:e.update,sendKeys:e.sendKeys}})],1)],2),e.hasSoftRebootAction?t("button",{staticClass:"btn btn-sm bg-primary",on:{click:e.softReboot}},[e._v(" "+e._s(e.t("kubevirt.action.softreboot"))+" ")]):e._e()],1),e.url&&!e.isDown?t("NovncConsole",{ref:"novncConsole",attrs:{url:e.url}}):e._e(),e.isDown?t("p",[e._v(" "+e._s(e.t("kubevirt.virtualMachine.detail.console.down"))+" ")]):e._e()],1)])},Ke=[],Ce={XK_VoidSymbol:16777215,XK_BackSpace:65288,XK_Tab:65289,XK_Linefeed:65290,XK_Clear:65291,XK_Return:65293,XK_Pause:65299,XK_Scroll_Lock:65300,XK_Sys_Req:65301,XK_Escape:65307,XK_Delete:65535,XK_Multi_key:65312,XK_Codeinput:65335,XK_SingleCandidate:65340,XK_MultipleCandidate:65341,XK_PreviousCandidate:65342,XK_Kanji:65313,XK_Muhenkan:65314,XK_Henkan_Mode:65315,XK_Henkan:65315,XK_Romaji:65316,XK_Hiragana:65317,XK_Katakana:65318,XK_Hiragana_Katakana:65319,XK_Zenkaku:65320,XK_Hankaku:65321,XK_Zenkaku_Hankaku:65322,XK_Touroku:65323,XK_Massyo:65324,XK_Kana_Lock:65325,XK_Kana_Shift:65326,XK_Eisu_Shift:65327,XK_Eisu_toggle:65328,XK_Kanji_Bangou:65335,XK_Zen_Koho:65341,XK_Mae_Koho:65342,XK_Home:65360,XK_Left:65361,XK_Up:65362,XK_Right:65363,XK_Down:65364,XK_Prior:65365,XK_Page_Up:65365,XK_Next:65366,XK_Page_Down:65366,XK_End:65367,XK_Begin:65368,XK_Select:65376,XK_Print:65377,XK_Execute:65378,XK_Insert:65379,XK_Undo:65381,XK_Redo:65382,XK_Menu:65383,XK_Find:65384,XK_Cancel:65385,XK_Help:65386,XK_Break:65387,XK_Mode_switch:65406,XK_script_switch:65406,XK_Num_Lock:65407,XK_KP_Space:65408,XK_KP_Tab:65417,XK_KP_Enter:65421,XK_KP_F1:65425,XK_KP_F2:65426,XK_KP_F3:65427,XK_KP_F4:65428,XK_KP_Home:65429,XK_KP_Left:65430,XK_KP_Up:65431,XK_KP_Right:65432,XK_KP_Down:65433,XK_KP_Prior:65434,XK_KP_Page_Up:65434,XK_KP_Next:65435,XK_KP_Page_Down:65435,XK_KP_End:65436,XK_KP_Begin:65437,XK_KP_Insert:65438,XK_KP_Delete:65439,XK_KP_Equal:65469,XK_KP_Multiply:65450,XK_KP_Add:65451,XK_KP_Separator:65452,XK_KP_Subtract:65453,XK_KP_Decimal:65454,XK_KP_Divide:65455,XK_KP_0:65456,XK_KP_1:65457,XK_KP_2:65458,XK_KP_3:65459,XK_KP_4:65460,XK_KP_5:65461,XK_KP_6:65462,XK_KP_7:65463,XK_KP_8:65464,XK_KP_9:65465,XK_F1:65470,XK_F2:65471,XK_F3:65472,XK_F4:65473,XK_F5:65474,XK_F6:65475,XK_F7:65476,XK_F8:65477,XK_F9:65478,XK_F10:65479,XK_F11:65480,XK_L1:65480,XK_F12:65481,XK_L2:65481,XK_F13:65482,XK_L3:65482,XK_F14:65483,XK_L4:65483,XK_F15:65484,XK_L5:65484,XK_F16:65485,XK_L6:65485,XK_F17:65486,XK_L7:65486,XK_F18:65487,XK_L8:65487,XK_F19:65488,XK_L9:65488,XK_F20:65489,XK_L10:65489,XK_F21:65490,XK_R1:65490,XK_F22:65491,XK_R2:65491,XK_F23:65492,XK_R3:65492,XK_F24:65493,XK_R4:65493,XK_F25:65494,XK_R5:65494,XK_F26:65495,XK_R6:65495,XK_F27:65496,XK_R7:65496,XK_F28:65497,XK_R8:65497,XK_F29:65498,XK_R9:65498,XK_F30:65499,XK_R10:65499,XK_F31:65500,XK_R11:65500,XK_F32:65501,XK_R12:65501,XK_F33:65502,XK_R13:65502,XK_F34:65503,XK_R14:65503,XK_F35:65504,XK_R15:65504,XK_Shift_L:65505,XK_Shift_R:65506,XK_Control_L:65507,XK_Control_R:65508,XK_Caps_Lock:65509,XK_Shift_Lock:65510,XK_Meta_L:65511,XK_Meta_R:65512,XK_Alt_L:65513,XK_Alt_R:65514,XK_Super_L:65515,XK_Super_R:65516,XK_Hyper_L:65517,XK_Hyper_R:65518,XK_ISO_Level3_Shift:65027,XK_ISO_Next_Group:65032,XK_ISO_Prev_Group:65034,XK_ISO_First_Group:65036,XK_ISO_Last_Group:65038,XK_space:32,XK_exclam:33,XK_quotedbl:34,XK_numbersign:35,XK_dollar:36,XK_percent:37,XK_ampersand:38,XK_apostrophe:39,XK_quoteright:39,XK_parenleft:40,XK_parenright:41,XK_asterisk:42,XK_plus:43,XK_comma:44,XK_minus:45,XK_period:46,XK_slash:47,XK_0:48,XK_1:49,XK_2:50,XK_3:51,XK_4:52,XK_5:53,XK_6:54,XK_7:55,XK_8:56,XK_9:57,XK_colon:58,XK_semicolon:59,XK_less:60,XK_equal:61,XK_greater:62,XK_question:63,XK_at:64,XK_A:65,XK_B:66,XK_C:67,XK_D:68,XK_E:69,XK_F:70,XK_G:71,XK_H:72,XK_I:73,XK_J:74,XK_K:75,XK_L:76,XK_M:77,XK_N:78,XK_O:79,XK_P:80,XK_Q:81,XK_R:82,XK_S:83,XK_T:84,XK_U:85,XK_V:86,XK_W:87,XK_X:88,XK_Y:89,XK_Z:90,XK_bracketleft:91,XK_backslash:92,XK_bracketright:93,XK_asciicircum:94,XK_underscore:95,XK_grave:96,XK_quoteleft:96,XK_a:97,XK_b:98,XK_c:99,XK_d:100,XK_e:101,XK_f:102,XK_g:103,XK_h:104,XK_i:105,XK_j:106,XK_k:107,XK_l:108,XK_m:109,XK_n:110,XK_o:111,XK_p:112,XK_q:113,XK_r:114,XK_s:115,XK_t:116,XK_u:117,XK_v:118,XK_w:119,XK_x:120,XK_y:121,XK_z:122,XK_braceleft:123,XK_bar:124,XK_braceright:125,XK_asciitilde:126,XK_nobreakspace:160,XK_exclamdown:161,XK_cent:162,XK_sterling:163,XK_currency:164,XK_yen:165,XK_brokenbar:166,XK_section:167,XK_diaeresis:168,XK_copyright:169,XK_ordfeminine:170,XK_guillemotleft:171,XK_notsign:172,XK_hyphen:173,XK_registered:174,XK_macron:175,XK_degree:176,XK_plusminus:177,XK_twosuperior:178,XK_threesuperior:179,XK_acute:180,XK_mu:181,XK_paragraph:182,XK_periodcentered:183,XK_cedilla:184,XK_onesuperior:185,XK_masculine:186,XK_guillemotright:187,XK_onequarter:188,XK_onehalf:189,XK_threequarters:190,XK_questiondown:191,XK_Agrave:192,XK_Aacute:193,XK_Acircumflex:194,XK_Atilde:195,XK_Adiaeresis:196,XK_Aring:197,XK_AE:198,XK_Ccedilla:199,XK_Egrave:200,XK_Eacute:201,XK_Ecircumflex:202,XK_Ediaeresis:203,XK_Igrave:204,XK_Iacute:205,XK_Icircumflex:206,XK_Idiaeresis:207,XK_ETH:208,XK_Eth:208,XK_Ntilde:209,XK_Ograve:210,XK_Oacute:211,XK_Ocircumflex:212,XK_Otilde:213,XK_Odiaeresis:214,XK_multiply:215,XK_Oslash:216,XK_Ooblique:216,XK_Ugrave:217,XK_Uacute:218,XK_Ucircumflex:219,XK_Udiaeresis:220,XK_Yacute:221,XK_THORN:222,XK_Thorn:222,XK_ssharp:223,XK_agrave:224,XK_aacute:225,XK_acircumflex:226,XK_atilde:227,XK_adiaeresis:228,XK_aring:229,XK_ae:230,XK_ccedilla:231,XK_egrave:232,XK_eacute:233,XK_ecircumflex:234,XK_ediaeresis:235,XK_igrave:236,XK_iacute:237,XK_icircumflex:238,XK_idiaeresis:239,XK_eth:240,XK_ntilde:241,XK_ograve:242,XK_oacute:243,XK_ocircumflex:244,XK_otilde:245,XK_odiaeresis:246,XK_division:247,XK_oslash:248,XK_ooblique:248,XK_ugrave:249,XK_uacute:250,XK_ucircumflex:251,XK_udiaeresis:252,XK_yacute:253,XK_thorn:254,XK_ydiaeresis:255,XK_Hangul:65329,XK_Hangul_Hanja:65332,XK_Hangul_Jeonja:65336,XF86XK_ModeLock:269025025,XF86XK_MonBrightnessUp:269025026,XF86XK_MonBrightnessDown:269025027,XF86XK_KbdLightOnOff:269025028,XF86XK_KbdBrightnessUp:269025029,XF86XK_KbdBrightnessDown:269025030,XF86XK_Standby:269025040,XF86XK_AudioLowerVolume:269025041,XF86XK_AudioMute:269025042,XF86XK_AudioRaiseVolume:269025043,XF86XK_AudioPlay:269025044,XF86XK_AudioStop:269025045,XF86XK_AudioPrev:269025046,XF86XK_AudioNext:269025047,XF86XK_HomePage:269025048,XF86XK_Mail:269025049,XF86XK_Start:269025050,XF86XK_Search:269025051,XF86XK_AudioRecord:269025052,XF86XK_Calculator:269025053,XF86XK_Memo:269025054,XF86XK_ToDoList:269025055,XF86XK_Calendar:269025056,XF86XK_PowerDown:269025057,XF86XK_ContrastAdjust:269025058,XF86XK_RockerUp:269025059,XF86XK_RockerDown:269025060,XF86XK_RockerEnter:269025061,XF86XK_Back:269025062,XF86XK_Forward:269025063,XF86XK_Stop:269025064,XF86XK_Refresh:269025065,XF86XK_PowerOff:269025066,XF86XK_WakeUp:269025067,XF86XK_Eject:269025068,XF86XK_ScreenSaver:269025069,XF86XK_WWW:269025070,XF86XK_Sleep:269025071,XF86XK_Favorites:269025072,XF86XK_AudioPause:269025073,XF86XK_AudioMedia:269025074,XF86XK_MyComputer:269025075,XF86XK_VendorHome:269025076,XF86XK_LightBulb:269025077,XF86XK_Shop:269025078,XF86XK_History:269025079,XF86XK_OpenURL:269025080,XF86XK_AddFavorite:269025081,XF86XK_HotLinks:269025082,XF86XK_BrightnessAdjust:269025083,XF86XK_Finance:269025084,XF86XK_Community:269025085,XF86XK_AudioRewind:269025086,XF86XK_BackForward:269025087,XF86XK_Launch0:269025088,XF86XK_Launch1:269025089,XF86XK_Launch2:269025090,XF86XK_Launch3:269025091,XF86XK_Launch4:269025092,XF86XK_Launch5:269025093,XF86XK_Launch6:269025094,XF86XK_Launch7:269025095,XF86XK_Launch8:269025096,XF86XK_Launch9:269025097,XF86XK_LaunchA:269025098,XF86XK_LaunchB:269025099,XF86XK_LaunchC:269025100,XF86XK_LaunchD:269025101,XF86XK_LaunchE:269025102,XF86XK_LaunchF:269025103,XF86XK_ApplicationLeft:269025104,XF86XK_ApplicationRight:269025105,XF86XK_Book:269025106,XF86XK_CD:269025107,XF86XK_Calculater:269025108,XF86XK_Clear:269025109,XF86XK_Close:269025110,XF86XK_Copy:269025111,XF86XK_Cut:269025112,XF86XK_Display:269025113,XF86XK_DOS:269025114,XF86XK_Documents:269025115,XF86XK_Excel:269025116,XF86XK_Explorer:269025117,XF86XK_Game:269025118,XF86XK_Go:269025119,XF86XK_iTouch:269025120,XF86XK_LogOff:269025121,XF86XK_Market:269025122,XF86XK_Meeting:269025123,XF86XK_MenuKB:269025125,XF86XK_MenuPB:269025126,XF86XK_MySites:269025127,XF86XK_New:269025128,XF86XK_News:269025129,XF86XK_OfficeHome:269025130,XF86XK_Open:269025131,XF86XK_Option:269025132,XF86XK_Paste:269025133,XF86XK_Phone:269025134,XF86XK_Q:269025136,XF86XK_Reply:269025138,XF86XK_Reload:269025139,XF86XK_RotateWindows:269025140,XF86XK_RotationPB:269025141,XF86XK_RotationKB:269025142,XF86XK_Save:269025143,XF86XK_ScrollUp:269025144,XF86XK_ScrollDown:269025145,XF86XK_ScrollClick:269025146,XF86XK_Send:269025147,XF86XK_Spell:269025148,XF86XK_SplitScreen:269025149,XF86XK_Support:269025150,XF86XK_TaskPane:269025151,XF86XK_Terminal:269025152,XF86XK_Tools:269025153,XF86XK_Travel:269025154,XF86XK_UserPB:269025156,XF86XK_User1KB:269025157,XF86XK_User2KB:269025158,XF86XK_Video:269025159,XF86XK_WheelButton:269025160,XF86XK_Word:269025161,XF86XK_Xfer:269025162,XF86XK_ZoomIn:269025163,XF86XK_ZoomOut:269025164,XF86XK_Away:269025165,XF86XK_Messenger:269025166,XF86XK_WebCam:269025167,XF86XK_MailForward:269025168,XF86XK_Pictures:269025169,XF86XK_Music:269025170,XF86XK_Battery:269025171,XF86XK_Bluetooth:269025172,XF86XK_WLAN:269025173,XF86XK_UWB:269025174,XF86XK_AudioForward:269025175,XF86XK_AudioRepeat:269025176,XF86XK_AudioRandomPlay:269025177,XF86XK_Subtitle:269025178,XF86XK_AudioCycleTrack:269025179,XF86XK_CycleAngle:269025180,XF86XK_FrameBack:269025181,XF86XK_FrameForward:269025182,XF86XK_Time:269025183,XF86XK_Select:269025184,XF86XK_View:269025185,XF86XK_TopMenu:269025186,XF86XK_Red:269025187,XF86XK_Green:269025188,XF86XK_Yellow:269025189,XF86XK_Blue:269025190,XF86XK_Suspend:269025191,XF86XK_Hibernate:269025192,XF86XK_TouchpadToggle:269025193,XF86XK_TouchpadOn:269025200,XF86XK_TouchpadOff:269025201,XF86XK_AudioMicMute:269025202,XF86XK_Switch_VT_1:269024769,XF86XK_Switch_VT_2:269024770,XF86XK_Switch_VT_3:269024771,XF86XK_Switch_VT_4:269024772,XF86XK_Switch_VT_5:269024773,XF86XK_Switch_VT_6:269024774,XF86XK_Switch_VT_7:269024775,XF86XK_Switch_VT_8:269024776,XF86XK_Switch_VT_9:269024777,XF86XK_Switch_VT_10:269024778,XF86XK_Switch_VT_11:269024779,XF86XK_Switch_VT_12:269024780,XF86XK_Ungrab:269024800,XF86XK_ClearGrab:269024801,XF86XK_Next_VMode:269024802,XF86XK_Prev_VMode:269024803,XF86XK_LogWindowTree:269024804,XF86XK_LogGrabInfo:269024805},Te=function(){var e=this,t=e._self._c;return t("div",[e.connected&&e.disconnected?t("div",[t("main",{staticClass:"main-layout error"},[t("div",{staticClass:"text-center"},[t("BrandImage",{attrs:{"file-name":"error-desert-landscape.svg",width:"900",height:"300"}}),t("h1",[e._v(" "+e._s(e.t("generic.notification.title.warning"))+" ")]),t("h2",{staticClass:"text-secondary mt-20"},[e._v(" "+e._s(e.t("vncConsole.error.message"))+" ")])],1)])]):e._e(),t("div",{ref:"view"})])},Fe=[];function Re(e){return e>>>0}function Ie(e){return 0|e}let Oe="warn",Le=()=>{},De=()=>{},Me=()=>{},Ne=()=>{};function Pe(e){if("undefined"===typeof e?e=Oe:Oe=e,Le=De=Me=Ne=()=>{},"undefined"!==typeof window.console)switch(e){case"debug":Le=console.debug.bind(window.console);case"info":De=console.info.bind(window.console);case"warn":Me=console.warn.bind(window.console);case"error":Ne=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+e+"'")}}function Ue(e,t=!1){try{return decodeURIComponent(escape(e))}catch(n){if(n instanceof URIError&&t)return e;throw n}}function Be(e){return unescape(encodeURIComponent(e))}Pe();let je="ontouchstart"in document.documentElement||void 0!==document.ontouchstart||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.addEventListener("touchstart",(function e(){je=!0,window.removeEventListener("touchstart",e,!1)}),!1);let Qe=10*(window.devicePixelRatio||1),Ge=!1;try{const e=document.createElement("canvas");e.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',0===e.style.cursor.indexOf("url")?(De("Data URI scheme cursor supported"),Ge=!0):Me("Data URI scheme cursor not supported")}catch(Ua){Ne("Data URI scheme cursor test exception: "+Ua)}const Ve=Ge;let He=!0;try{const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;e.parentNode.removeChild(e),He=0!=n}catch(Ua){Ne("Scrollbar test exception: "+Ua)}function ze(){return!!/mac/i.exec(navigator.platform)}function $e(){return!!/win/i.exec(navigator.platform)}function qe(){return!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform)}function We(e,t,n){const i=n.getBoundingClientRect();let r={x:0,y:0};return e=i.right?r.x=i.width-1:r.x=e-i.left,t=i.bottom?r.y=i.height-1:r.y=t-i.top,r}function Ye(e){e.stopPropagation(),e.preventDefault()}let Je=!1,Ze=null;function et(e){if(Je)return;const t=new e.constructor(e.type,e);Je=!0,document.captureElement?document.captureElement.dispatchEvent(t):Ze.dispatchEvent(t),Je=!1,e.stopPropagation(),t.defaultPrevented&&e.preventDefault(),"mouseup"===e.type&&rt()}function tt(){const e=document.getElementById("noVNC_mouse_capture_elem");e.style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;const nt=new MutationObserver(tt);function it(e){if(e.setCapture)e.setCapture(),document.captureElement=e;else{rt();let t=document.getElementById("noVNC_mouse_capture_elem");null===t&&(t=document.createElement("div"),t.id="noVNC_mouse_capture_elem",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.zIndex=1e4,t.style.display="none",document.body.appendChild(t),t.addEventListener("contextmenu",et),t.addEventListener("mousemove",et),t.addEventListener("mouseup",et)),document.captureElement=e,nt.observe(e,{attributes:!0}),tt(),t.style.display="",window.addEventListener("mousemove",et),window.addEventListener("mouseup",et)}}function rt(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;Ze=document.captureElement,document.captureElement=null,nt.disconnect();const e=document.getElementById("noVNC_mouse_capture_elem");e.style.display="none",window.removeEventListener("mousemove",et),window.removeEventListener("mouseup",et)}}class st{constructor(){this._listeners=new Map}addEventListener(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}removeEventListener(e,t){this._listeners.has(e)&&this._listeners.get(e).delete(t)}dispatchEvent(e){return!this._listeners.has(e.type)||(this._listeners.get(e.type).forEach(t=>t.call(this,e)),!e.defaultPrevented)}}var ot={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode(e){let t="";const n=e.length,i=n%3;for(let s=0;s>2],t+=this.toBase64Table[((3&e[s])<<4)+(e[s+1]>>4)],t+=this.toBase64Table[((15&e[s+1])<<2)+(e[s+2]>>6)],t+=this.toBase64Table[63&e[s+2]];const r=n-i;return 2===i?(t+=this.toBase64Table[e[r]>>2],t+=this.toBase64Table[((3&e[r])<<4)+(e[r+1]>>4)],t+=this.toBase64Table[(15&e[r+1])<<2],t+=this.toBase64Table[64]):1===i&&(t+=this.toBase64Table[e[r]>>2],t+=this.toBase64Table[(3&e[r])<<4],t+=this.toBase64Table[64],t+=this.toBase64Table[64]),t},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(e,t=0){let n=e.indexOf("=")-t;n<0&&(n=e.length-t);const i=3*(n>>2)+Math.floor(n%4/1.5),r=new Array(i);let s=0,o=0;for(let a=0,c=t;c=8&&(s-=8,n||(r[a++]=o>>s&255),o&=(1<> Display.constructor"),this._target=e,!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},Le("User Agent: "+navigator.userAgent),Le("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=()=>{}}get scale(){return this._scale}set scale(e){this._rescale(e)}get clipViewport(){return this._clipViewport}set clipViewport(e){this._clipViewport=e;const t=this._viewportLoc;this.viewportChangeSize(t.w,t.h),this.viewportChangePos(0,0)}get width(){return this._fbWidth}get height(){return this._fbHeight}viewportChangePos(e,t){const n=this._viewportLoc;e=Math.floor(e),t=Math.floor(t),this._clipViewport||(e=-n.w,t=-n.h);const i=n.x+n.w-1,r=n.y+n.h-1;e<0&&n.x+e<0&&(e=-n.x),i+e>=this._fbWidth&&(e-=i+e-this._fbWidth+1),n.y+t<0&&(t=-n.y),r+t>=this._fbHeight&&(t-=r+t-this._fbHeight+1),0===e&&0===t||(Le("viewportChange deltaX: "+e+", deltaY: "+t),n.x+=e,n.y+=t,this._damage(n.x,n.y,n.w,n.h),this.flip())}viewportChangeSize(e,t){this._clipViewport&&"undefined"!==typeof e&&"undefined"!==typeof t||(Le("Setting viewport to full display region"),e=this._fbWidth,t=this._fbHeight),e=Math.floor(e),t=Math.floor(t),e>this._fbWidth&&(e=this._fbWidth),t>this._fbHeight&&(t=this._fbHeight);const n=this._viewportLoc;if(n.w!==e||n.h!==t){n.w=e,n.h=t;const i=this._target;i.width=e,i.height=t,this.viewportChangePos(0,0),this._damage(n.x,n.y,n.w,n.h),this.flip(),this._rescale(this._scale)}}absX(e){return 0===this._scale?0:Ie(e/this._scale+this._viewportLoc.x)}absY(e){return 0===this._scale?0:Ie(e/this._scale+this._viewportLoc.y)}resize(e,t){this._prevDrawStyle="",this._fbWidth=e,this._fbHeight=t;const n=this._backbuffer;if(n.width!==e||n.height!==t){let i=null;n.width>0&&n.height>0&&(i=this._drawCtx.getImageData(0,0,n.width,n.height)),n.width!==e&&(n.width=e),n.height!==t&&(n.height=t),i&&this._drawCtx.putImageData(i,0,0)}const i=this._viewportLoc;this.viewportChangeSize(i.w,i.h),this.viewportChangePos(0,0)}getImageData(){return this._drawCtx.getImageData(0,0,this.width,this.height)}toDataURL(e,t){return this._backbuffer.toDataURL(e,t)}toBlob(e,t,n){return this._backbuffer.toBlob(e,t,n)}_damage(e,t,n,i){ethis._damageBounds.right&&(this._damageBounds.right=e+n),t+i>this._damageBounds.bottom&&(this._damageBounds.bottom=t+i)}flip(e){if(0===this._renderQ.length||e){let e=this._damageBounds.left,t=this._damageBounds.top,n=this._damageBounds.right-e,i=this._damageBounds.bottom-t,r=e-this._viewportLoc.x,s=t-this._viewportLoc.y;r<0&&(n+=r,e-=r,r=0),s<0&&(i+=s,t-=s,s=0),r+n>this._viewportLoc.w&&(n=this._viewportLoc.w-r),s+i>this._viewportLoc.h&&(i=this._viewportLoc.h-s),n>0&&i>0&&this._targetCtx.drawImage(this._backbuffer,e,t,n,i,r,s,n,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(e,t,n,i,r,s){0===this._renderQ.length||s?(this._setFillColor(r),this._drawCtx.fillRect(e,t,n,i),this._damage(e,t,n,i)):this._renderQPush({type:"fill",x:e,y:t,width:n,height:i,color:r})}copyImage(e,t,n,i,r,s,o){0===this._renderQ.length||o?(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,e,t,r,s,n,i,r,s),this._damage(n,i,r,s)):this._renderQPush({type:"copy",oldX:e,oldY:t,x:n,y:i,width:r,height:s})}imageRect(e,t,n,i,r,s){if(0===n||0===i)return;const o=new Image;o.src="data: "+r+";base64,"+ot.encode(s),this._renderQPush({type:"img",img:o,x:e,y:t,width:n,height:i})}blitImage(e,t,n,i,r,s,o){if(0===this._renderQ.length||o){let o=new Uint8ClampedArray(r.buffer,r.byteOffset+s,n*i*4),a=new ImageData(o,n,i);this._drawCtx.putImageData(a,e,t),this._damage(e,t,n,i)}else{const s=new Uint8Array(n*i*4);s.set(new Uint8Array(r.buffer,0,s.length)),this._renderQPush({type:"blit",data:s,x:e,y:t,width:n,height:i})}}drawImage(e,t,n){this._drawCtx.drawImage(e,t,n),this._damage(t,n,e.width,e.height)}autoscale(e,t){let n;if(0===e||0===t)n=0;else{const i=this._viewportLoc,r=e/t,s=i.w/i.h;n=s>=r?e/i.w:t/i.h}this._rescale(n)}_rescale(e){this._scale=e;const t=this._viewportLoc,n=e*t.w+"px",i=e*t.h+"px";this._target.style.width===n&&this._target.style.height===i||(this._target.style.width=n,this._target.style.height=i)}_setFillColor(e){const t="rgb("+e[0]+","+e[1]+","+e[2]+")";t!==this._prevDrawStyle&&(this._drawCtx.fillStyle=t,this._prevDrawStyle=t)}_renderQPush(e){this._renderQ.push(e),1===this._renderQ.length&&this._scanRenderQ()}_resumeRenderQ(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}_scanRenderQ(){let e=!0;while(e&&this._renderQ.length>0){const t=this._renderQ[0];switch(t.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(t.oldX,t.oldY,t.x,t.y,t.width,t.height,!0);break;case"fill":this.fillRect(t.x,t.y,t.width,t.height,t.color,!0);break;case"blit":this.blitImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"img":if(t.img.complete){if(t.img.width!==t.width||t.img.height!==t.height)return void Ne("Decoded image has incorrect dimensions. Got "+t.img.width+"x"+t.img.height+". Expected "+t.width+"x"+t.height+".");this.drawImage(t.img,t.x,t.y)}else t.img._noVNCDisplay=this,t.img.addEventListener("load",this._resumeRenderQ),e=!1;break}e&&this._renderQ.shift()}0===this._renderQ.length&&this._flushing&&(this._flushing=!1,this.onflush())}}function ct(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var s=0;s>>16&65535|0,o=0;while(0!==n){o=n>2e3?2e3:n,n-=o;do{r=r+t[i++]|0,s=s+r|0}while(--o);r%=65521,s%=65521}return r|s<<16|0}function ft(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}ft();var pt=30,_t=12;function gt(e,t){var n,i,r,s,o,a,c,l,u,h,d,f,p,_,g,m,v,b,y,w,k,E,S,A,X;n=e.state,i=e.next_in,A=e.input,r=i+(e.avail_in-5),s=e.next_out,X=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,h=n.wnext,d=n.window,f=n.hold,p=n.bits,_=n.lencode,g=n.distcode,m=(1<>>24,f>>>=y,p-=y,y=b>>>16&255,0===y)X[s++]=65535&b;else{if(!(16&y)){if(0===(64&y)){b=_[(65535&b)+(f&(1<>>=y,p-=y),p<15&&(f+=A[i++]<>>24,f>>>=y,p-=y,y=b>>>16&255,!(16&y)){if(0===(64&y)){b=g[(65535&b)+(f&(1<c){e.msg="invalid distance too far back",n.mode=pt;break e}if(f>>>=y,p-=y,y=s-o,k>y){if(y=k-y,y>u&&n.sane){e.msg="invalid distance too far back",n.mode=pt;break e}if(E=0,S=d,0===h){if(E+=l-y,y2)X[s++]=S[E++],X[s++]=S[E++],X[s++]=S[E++],w-=3;w&&(X[s++]=S[E++],w>1&&(X[s++]=S[E++]))}else{E=s-k;do{X[s++]=X[E++],X[s++]=X[E++],X[s++]=X[E++],w-=3}while(w>2);w&&(X[s++]=X[E++],w>1&&(X[s++]=X[E++]))}break}}break}}while(i>3,i-=w,p-=w<<3,f&=(1<=1;w--)if(0!==T[w])break;if(k>w&&(k=w),0===w)return r[s++]=20971520,r[s++]=20971520,a.bits=1,0;for(y=1;y0&&(e===yt||1!==w))return-1;for(F[1]=0,v=1;vvt||e===kt&&X>bt)return 1;for(;;){p=v-S,o[b]f?(_=R[I+o[b]],g=K[C+o[b]]):(_=96,g=0),c=1<>S)+l]=p<<24|_<<16|g|0}while(0!==l);c=1<>=1;if(0!==c?(x&=c-1,x+=c):x=0,b++,0===--T[v]){if(v===w)break;v=t[n+o[b]]}if(v>k&&(x&h)!==u){0===S&&(S=k),d+=y,E=v-S,A=1<vt||e===kt&&X>bt)return 1;u=x&h,r[u]=k<<24|E<<16|d-s|0}}return 0!==x&&(r[d+x]=v-S<<24|64<<16|0),a.bits=k,0}var Kt=0,Ct=1,Tt=2;const Ft=4,Rt=5,It=6,Ot=0,Lt=1,Dt=2,Mt=-2,Nt=-3,Pt=-4,Ut=-5,Bt=8;var jt=1,Qt=2,Gt=3,Vt=4,Ht=5,zt=6,$t=7,qt=8,Wt=9,Yt=10,Jt=11,Zt=12,en=13,tn=14,nn=15,rn=16,sn=17,on=18,an=19,cn=20,ln=21,un=22,hn=23,dn=24,fn=25,pn=26,_n=27,gn=28,mn=29,vn=30,bn=31,yn=32,wn=852,kn=592,En=15,Sn=En;function An(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Xn(){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 ut(320),this.work=new ut(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function xn(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=jt,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new ht(wn),t.distcode=t.distdyn=new ht(kn),t.sane=1,t.back=-1,Ot):Mt}function Kn(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,xn(e)):Mt}function Cn(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Mt:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,Kn(e))):Mt}function Tn(e,t){var n,i;return e?(i=new Xn,e.state=i,i.window=null,n=Cn(e,t),n!==Ot&&(e.state=null),n):Mt}function Fn(e){return Tn(e,Sn)}var Rn,In,On=!0;function Ln(e){if(On){var t;Rn=new ht(512),In=new ht(32),t=0;while(t<144)e.lens[t++]=8;while(t<256)e.lens[t++]=9;while(t<280)e.lens[t++]=7;while(t<288)e.lens[t++]=8;xt(Ct,e.lens,0,288,Rn,0,e.work,{bits:9}),t=0;while(t<32)e.lens[t++]=5;xt(Tt,e.lens,0,32,In,0,e.work,{bits:5}),On=!1}e.lencode=Rn,e.lenbits=9,e.distcode=In,e.distbits=5}function Dn(e,t,n,i){var r,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(ct(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),ct(s.window,t,n-i,r,s.wnext),i-=r,i?(ct(s.window,t,n-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=ft(n.check,x,2,0),l=0,u=0,n.mode=Qt;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=vn;break}if((15&l)!==Bt){e.msg="unknown compression method",n.mode=vn;break}if(l>>>=4,u-=4,k=8+(15&l),0===n.wbits)n.wbits=k;else if(k>n.wbits){e.msg="invalid window size",n.mode=vn;break}n.dmax=1<>8&1),512&n.flags&&(x[0]=255&l,x[1]=l>>>8&255,n.check=ft(n.check,x,2,0)),l=0,u=0,n.mode=Gt;case Gt:while(u<32){if(0===a)break e;a--,l+=i[s++]<>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,n.check=ft(n.check,x,4,0)),l=0,u=0,n.mode=Vt;case Vt:while(u<16){if(0===a)break e;a--,l+=i[s++]<>8),512&n.flags&&(x[0]=255&l,x[1]=l>>>8&255,n.check=ft(n.check,x,2,0)),l=0,u=0,n.mode=Ht;case Ht:if(1024&n.flags){while(u<16){if(0===a)break e;a--,l+=i[s++]<>>8&255,n.check=ft(n.check,x,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=zt;case zt:if(1024&n.flags&&(f=n.length,f>a&&(f=a),f&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),ct(n.head.extra,i,s,f,k)),512&n.flags&&(n.check=ft(n.check,i,f,s)),a-=f,s+=f,n.length-=f),n.length))break e;n.length=0,n.mode=$t;case $t:if(2048&n.flags){if(0===a)break e;f=0;do{k=i[s+f++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&f>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Zt;break;case Yt:while(u<32){if(0===a)break e;a--,l+=i[s++]<>>=7&u,u-=7&u,n.mode=_n;break}while(u<3){if(0===a)break e;a--,l+=i[s++]<>>=1,u-=1,3&l){case 0:n.mode=tn;break;case 1:if(Ln(n),n.mode=cn,t===It){l>>>=2,u-=2;break e}break;case 2:n.mode=sn;break;case 3:e.msg="invalid block type",n.mode=vn}l>>>=2,u-=2;break;case tn:l>>>=7&u,u-=7&u;while(u<32){if(0===a)break e;a--,l+=i[s++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=vn;break}if(n.length=65535&l,l=0,u=0,n.mode=nn,t===It)break e;case nn:n.mode=rn;case rn:if(f=n.length,f){if(f>a&&(f=a),f>c&&(f=c),0===f)break e;ct(r,i,s,f,o),a-=f,s+=f,c-=f,o+=f,n.length-=f;break}n.mode=Zt;break;case sn:while(u<14){if(0===a)break e;a--,l+=i[s++]<>>=5,u-=5,n.ndist=1+(31&l),l>>>=5,u-=5,n.ncode=4+(15&l),l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=vn;break}n.have=0,n.mode=on;case on:while(n.have>>=3,u-=3}while(n.have<19)n.lens[K[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},E=xt(Kt,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,E){e.msg="invalid code lengths set",n.mode=vn;break}n.have=0,n.mode=an;case an:while(n.have>>24,m=X>>>16&255,v=65535&X,g<=u)break;if(0===a)break e;a--,l+=i[s++]<>>=g,u-=g,n.lens[n.have++]=v;else{if(16===v){A=g+2;while(u>>=g,u-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=vn;break}k=n.lens[n.have-1],f=3+(3&l),l>>>=2,u-=2}else if(17===v){A=g+3;while(u>>=g,u-=g,k=0,f=3+(7&l),l>>>=3,u-=3}else{A=g+7;while(u>>=g,u-=g,k=0,f=11+(127&l),l>>>=7,u-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=vn;break}while(f--)n.lens[n.have++]=k}}if(n.mode===vn)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=vn;break}if(n.lenbits=9,S={bits:n.lenbits},E=xt(Ct,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,E){e.msg="invalid literal/lengths set",n.mode=vn;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},E=xt(Tt,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,E){e.msg="invalid distances set",n.mode=vn;break}if(n.mode=cn,t===It)break e;case cn:n.mode=ln;case ln:if(a>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,n.hold=l,n.bits=u,gt(e,d),o=e.next_out,r=e.output,c=e.avail_out,s=e.next_in,i=e.input,a=e.avail_in,l=n.hold,u=n.bits,n.mode===Zt&&(n.back=-1);break}for(n.back=0;;){if(X=n.lencode[l&(1<>>24,m=X>>>16&255,v=65535&X,g<=u)break;if(0===a)break e;a--,l+=i[s++]<>b)],g=X>>>24,m=X>>>16&255,v=65535&X,b+g<=u)break;if(0===a)break e;a--,l+=i[s++]<>>=b,u-=b,n.back+=b}if(l>>>=g,u-=g,n.back+=g,n.length=v,0===m){n.mode=pn;break}if(32&m){n.back=-1,n.mode=Zt;break}if(64&m){e.msg="invalid literal/length code",n.mode=vn;break}n.extra=15&m,n.mode=un;case un:if(n.extra){A=n.extra;while(u>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=hn;case hn:for(;;){if(X=n.distcode[l&(1<>>24,m=X>>>16&255,v=65535&X,g<=u)break;if(0===a)break e;a--,l+=i[s++]<>b)],g=X>>>24,m=X>>>16&255,v=65535&X,b+g<=u)break;if(0===a)break e;a--,l+=i[s++]<>>=b,u-=b,n.back+=b}if(l>>>=g,u-=g,n.back+=g,64&m){e.msg="invalid distance code",n.mode=vn;break}n.offset=v,n.extra=15&m,n.mode=dn;case dn:if(n.extra){A=n.extra;while(u>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=vn;break}n.mode=fn;case fn:if(0===c)break e;if(f=d-c,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=vn;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),_=n.window}else _=r,p=o-n.offset,f=n.length;f>c&&(f=c),c-=f,n.length-=f;do{r[o++]=_[p++]}while(--f);0===n.length&&(n.mode=ln);break;case pn:if(0===c)break e;r[o++]=n.length,c--,n.mode=ln;break;case _n:if(n.wrap){while(u<32){if(0===a)break e;a--,l|=i[s++]<this.chunkSize&&(this.chunkSize=e,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=e;let t=Mn(this.strm,0);if(t<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=e)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}reset(){Kn(this.strm)}}var Un=4,Bn=0,jn=1,Qn=2;function Gn(e){var t=e.length;while(--t>=0)e[t]=0}var Vn=0,Hn=1,zn=2,$n=3,qn=258,Wn=29,Yn=256,Jn=Yn+1+Wn,Zn=30,ei=19,ti=2*Jn+1,ni=15,ii=16,ri=7,si=256,oi=16,ai=17,ci=18,li=[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],ui=[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],hi=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],di=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fi=512,pi=new Array(2*(Jn+2));Gn(pi);var _i=new Array(2*Zn);Gn(_i);var gi=new Array(fi);Gn(gi);var mi=new Array(qn-$n+1);Gn(mi);var vi=new Array(Wn);Gn(vi);var bi,yi,wi,ki=new Array(Zn);function Ei(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function Si(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Ai(e){return e<256?gi[e]:gi[256+(e>>>7)]}function Xi(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function xi(e,t,n){e.bi_valid>ii-n?(e.bi_buf|=t<>ii-e.bi_valid,e.bi_valid+=n-ii):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function Ti(e){16===e.bi_valid?(Xi(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function Fi(e,t){var n,i,r,s,o,a,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,h=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(s=0;s<=ni;s++)e.bl_count[s]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;np&&(s=p,_++),c[2*i+1]=s,i>l||(e.bl_count[s]++,o=0,i>=f&&(o=d[i-f]),a=c[2*i],e.opt_len+=a*(s+o),h&&(e.static_len+=a*(u[2*i+1]+o)));if(0!==_){do{s=p-1;while(0===e.bl_count[s])s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(s=p;0!==s;s--){i=e.bl_count[s];while(0!==i)r=e.heap[--n],r>l||(c[2*r+1]!==s&&(e.opt_len+=(s-c[2*r+1])*c[2*r],c[2*r+1]=s),i--)}}}function Ri(e,t,n){var i,r,s=new Array(ni+1),o=0;for(i=1;i<=ni;i++)s[i]=o=o+n[i-1]<<1;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=Ci(s[a]++,a))}}function Ii(){var e,t,n,i,r,s=new Array(ni+1);for(n=0,i=0;i>=7;i8?Xi(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Di(e,t,n,i){Li(e),i&&(Xi(e,n),Xi(e,~n)),ct(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function Mi(e,t,n,i){var r=2*t,s=2*n;return e[r]>1;n>=1;n--)Ni(e,s,n);r=c;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ni(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,s[2*r]=s[2*n]+s[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,s[2*n+1]=s[2*i+1]=r,e.heap[1]=r++,Ni(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Fi(e,t),Ri(s,l,e.bl_count)}function Bi(e,t,n){var i,r,s=-1,o=t[1],a=0,c=7,l=4;for(0===o&&(c=138,l=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=o,o=t[2*(i+1)+1],++a=3;t--)if(0!==e.bl_tree[2*di[t]+1])break;return e.opt_len+=3*(t+1)+5+5+4,t}function Gi(e,t,n,i){var r;for(xi(e,t-257,5),xi(e,n-1,5),xi(e,i-4,4),r=0;r>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return Bn;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return jn;for(t=32;t0?(e.strm.data_type===Qn&&(e.strm.data_type=Vi(e)),Ui(e,e.l_desc),Ui(e,e.d_desc),o=Qi(e),r=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==t?$i(e,t,n,i):e.strategy===Un||s===r?(xi(e,(Hn<<1)+(i?1:0),3),Pi(e,pi,_i)):(xi(e,(zn<<1)+(i?1:0),3),Gi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Pi(e,e.dyn_ltree,e.dyn_dtree)),Oi(e),i&&Li(e)}function Yi(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(mi[n]+Yn+1)]++,e.dyn_dtree[2*Ai(t)]++),e.last_lit===e.lit_bufsize-1}var Ji={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 Zi=0,er=1,tr=3,nr=4,ir=5,rr=0,sr=1,or=-2,ar=-5,cr=-1,lr=1,ur=2,hr=3,dr=4,fr=0,pr=2,_r=8;var gr,mr=9,vr=15,br=8,yr=29,wr=256,kr=wr+1+yr,Er=30,Sr=19,Ar=2*kr+1,Xr=15,xr=3,Kr=258,Cr=Kr+xr+1,Tr=32,Fr=42,Rr=69,Ir=73,Or=91,Lr=103,Dr=113,Mr=666,Nr=1,Pr=2,Ur=3,Br=4,jr=3;function Qr(e,t){return e.msg=Ji[t],t}function Gr(e){return(e<<1)-(e>4?9:0)}function Vr(e){var t=e.length;while(--t>=0)e[t]=0}function Hr(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(ct(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function zr(e,t){Wi(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Hr(e.strm)}function $r(e,t){e.pending_buf[e.pending++]=t}function qr(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Wr(e,t,n,i){var r=e.avail_in;return r>i&&(r=i),0===r?0:(e.avail_in-=r,ct(t,e.input,e.next_in,r,n),1===e.state.wrap?e.adler=dt(e.adler,t,r,n):2===e.state.wrap&&(e.adler=ft(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)}function Yr(e,t){var n,i,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-Cr?e.strstart-(e.w_size-Cr):0,l=e.window,u=e.w_mask,h=e.prev,d=e.strstart+Kr,f=l[s+o-1],p=l[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(n=t,l[n+o]===p&&l[n+o-1]===f&&l[n]===l[s]&&l[++n]===l[s+1]){s+=2,n++;do{}while(l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&so){if(e.match_start=t,o=i,i>=a)break;f=l[s+o-1],p=l[s+o]}}}while((t=h[t&u])>c&&0!==--r);return o<=e.lookahead?o:e.lookahead}function Jr(e){var t,n,i,r,s,o=e.w_size;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-Cr)){ct(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,n=e.hash_size,t=n;do{i=e.head[--t],e.head[t]=i>=o?i-o:0}while(--n);n=o,t=n;do{i=e.prev[--t],e.prev[t]=i>=o?i-o:0}while(--n);r+=o}if(0===e.strm.avail_in)break;if(n=Wr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=xr){s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Jr(e),0===e.lookahead&&t===Zi)return Nr;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,zr(e,!1),0===e.strm.avail_out))return Nr;if(e.strstart-e.block_start>=e.w_size-Cr&&(zr(e,!1),0===e.strm.avail_out))return Nr}return e.insert=0,t===nr?(zr(e,!0),0===e.strm.avail_out?Ur:Br):(e.strstart>e.block_start&&(zr(e,!1),e.strm.avail_out),Nr)}function es(e,t){for(var n,i;;){if(e.lookahead=xr&&(e.ins_h=(e.ins_h<=xr)if(i=Yi(e,e.strstart-e.match_start,e.match_length-xr),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=xr){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=xr&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=xr-1)),e.prev_length>=xr&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-xr,i=Yi(e,e.strstart-1-e.prev_match,e.prev_length-xr),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=(e.ins_h<=xr&&e.strstart>0&&(r=e.strstart-1,i=o[r],i===o[++r]&&i===o[++r]&&i===o[++r])){s=e.strstart+Kr;do{}while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=xr?(n=Yi(e,1,e.match_length-xr),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Yi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(zr(e,!1),0===e.strm.avail_out))return Nr}return e.insert=0,t===nr?(zr(e,!0),0===e.strm.avail_out?Ur:Br):e.last_lit&&(zr(e,!1),0===e.strm.avail_out)?Nr:Pr}function is(e,t){for(var n;;){if(0===e.lookahead&&(Jr(e),0===e.lookahead)){if(t===Zi)return Nr;break}if(e.match_length=0,n=Yi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(zr(e,!1),0===e.strm.avail_out))return Nr}return e.insert=0,t===nr?(zr(e,!0),0===e.strm.avail_out?Ur:Br):e.last_lit&&(zr(e,!1),0===e.strm.avail_out)?Nr:Pr}function rs(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}function ss(e){e.window_size=2*e.w_size,Vr(e.head),e.max_lazy_match=gr[e.level].max_lazy,e.good_match=gr[e.level].good_length,e.nice_match=gr[e.level].nice_length,e.max_chain_length=gr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=xr-1,e.match_available=0,e.ins_h=0}function os(){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=_r,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 ut(2*Ar),this.dyn_dtree=new ut(2*(2*Er+1)),this.bl_tree=new ut(2*(2*Sr+1)),Vr(this.dyn_ltree),Vr(this.dyn_dtree),Vr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ut(Xr+1),this.heap=new ut(2*kr+1),Vr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ut(2*kr+1),Vr(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 as(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=pr,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Fr:Dr,e.adler=2===t.wrap?0:1,t.last_flush=Zi,zi(t),rr):Qr(e,or)}function cs(e){var t=as(e);return t===rr&&ss(e.state),t}function ls(e,t,n,i,r,s){if(!e)return or;var o=1;if(t===cr&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),r<1||r>mr||n!==_r||i<8||i>15||t<0||t>9||s<0||s>dr)return Qr(e,or);8===i&&(i=9);var a=new os;return e.state=a,a.strm=e,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<ir||t<0)return e?Qr(e,or):or;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===Mr&&t!==nr)return Qr(e,0===e.avail_out?ar:or);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===Fr)if(2===i.wrap)e.adler=0,$r(i,31),$r(i,139),$r(i,8),i.gzhead?($r(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)),$r(i,255&i.gzhead.time),$r(i,i.gzhead.time>>8&255),$r(i,i.gzhead.time>>16&255),$r(i,i.gzhead.time>>24&255),$r(i,9===i.level?2:i.strategy>=ur||i.level<2?4:0),$r(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&($r(i,255&i.gzhead.extra.length),$r(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=ft(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Rr):($r(i,0),$r(i,0),$r(i,0),$r(i,0),$r(i,0),$r(i,9===i.level?2:i.strategy>=ur||i.level<2?4:0),$r(i,jr),i.status=Dr);else{var o=_r+(i.w_bits-8<<4)<<8,a=-1;a=i.strategy>=ur||i.level<2?0:i.level<6?1:6===i.level?2:3,o|=a<<6,0!==i.strstart&&(o|=Tr),o+=31-o%31,i.status=Dr,qr(i,o),0!==i.strstart&&(qr(i,e.adler>>>16),qr(i,65535&e.adler)),e.adler=1}if(i.status===Rr)if(i.gzhead.extra){r=i.pending;while(i.gzindex<(65535&i.gzhead.extra.length)){if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),Hr(e),r=i.pending,i.pending===i.pending_buf_size))break;$r(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++}i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Ir)}else i.status=Ir;if(i.status===Ir)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),Hr(e),r=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexr&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),0===s&&(i.gzindex=0,i.status=Or)}else i.status=Or;if(i.status===Or)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),Hr(e),r=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexr&&(e.adler=ft(e.adler,i.pending_buf,i.pending-r,r)),0===s&&(i.status=Lr)}else i.status=Lr;if(i.status===Lr&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Hr(e),i.pending+2<=i.pending_buf_size&&($r(i,255&e.adler),$r(i,e.adler>>8&255),e.adler=0,i.status=Dr)):i.status=Dr),0!==i.pending){if(Hr(e),0===e.avail_out)return i.last_flush=-1,rr}else if(0===e.avail_in&&Gr(t)<=Gr(n)&&t!==nr)return Qr(e,ar);if(i.status===Mr&&0!==e.avail_in)return Qr(e,ar);if(0!==e.avail_in||0!==i.lookahead||t!==Zi&&i.status!==Mr){var c=i.strategy===ur?is(i,t):i.strategy===hr?ns(i,t):gr[i.level].func(i,t);if(c!==Ur&&c!==Br||(i.status=Mr),c===Nr||c===Ur)return 0===e.avail_out&&(i.last_flush=-1),rr;if(c===Pr&&(t===er?qi(i):t!==ir&&($i(i,0,0,!1),t===tr&&(Vr(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Hr(e),0===e.avail_out))return i.last_flush=-1,rr}return t!==nr?rr:i.wrap<=0?sr:(2===i.wrap?($r(i,255&e.adler),$r(i,e.adler>>8&255),$r(i,e.adler>>16&255),$r(i,e.adler>>24&255),$r(i,255&e.total_in),$r(i,e.total_in>>8&255),$r(i,e.total_in>>16&255),$r(i,e.total_in>>24&255)):(qr(i,e.adler>>>16),qr(i,65535&e.adler)),Hr(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?rr:sr)}gr=[new rs(0,0,0,0,Zr),new rs(4,4,8,4,es),new rs(4,5,16,8,es),new rs(4,6,32,32,es),new rs(4,4,16,16,ts),new rs(8,16,32,32,ts),new rs(8,16,128,128,ts),new rs(8,32,128,256,ts),new rs(32,128,258,1024,ts),new rs(32,258,258,4096,ts)];class ds{constructor(){this.strm=new Nn,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,us(this.strm,this.windowBits)}deflate(e){this.strm.input=e,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 t=hs(this.strm,tr),n=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(t<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){let e=[n],i=n.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,t=hs(this.strm,tr),t<0)throw new Error("zlib deflate failed");let n=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);i+=n.length,e.push(n)}while(this.strm.avail_in>0);let r=new Uint8Array(i),s=0;for(let t=0;t=32&&e<=255)return e;const t=fs[e];return void 0!==t?t:16777216|e}},_s={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"},gs={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 ms={};function vs(e,t){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(e in ms)throw new Error('Duplicate entry for key "'+e+'"');ms[e]=[t,t,t,t]}function bs(e,t,n){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===n)throw new Error('Undefined keysym for key "'+e+'"');if(e in ms)throw new Error('Duplicate entry for key "'+e+'"');ms[e]=[t,t,n,t]}function ys(e,t,n){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===n)throw new Error('Undefined keysym for key "'+e+'"');if(e in ms)throw new Error('Duplicate entry for key "'+e+'"');ms[e]=[t,t,t,n]}bs("Alt",Ce.XK_Alt_L,Ce.XK_Alt_R),vs("AltGraph",Ce.XK_ISO_Level3_Shift),vs("CapsLock",Ce.XK_Caps_Lock),bs("Control",Ce.XK_Control_L,Ce.XK_Control_R),bs("Meta",Ce.XK_Super_L,Ce.XK_Super_R),vs("NumLock",Ce.XK_Num_Lock),vs("ScrollLock",Ce.XK_Scroll_Lock),bs("Shift",Ce.XK_Shift_L,Ce.XK_Shift_R),ys("Enter",Ce.XK_Return,Ce.XK_KP_Enter),vs("Tab",Ce.XK_Tab),ys(" ",Ce.XK_space,Ce.XK_KP_Space),ys("ArrowDown",Ce.XK_Down,Ce.XK_KP_Down),ys("ArrowLeft",Ce.XK_Left,Ce.XK_KP_Left),ys("ArrowRight",Ce.XK_Right,Ce.XK_KP_Right),ys("ArrowUp",Ce.XK_Up,Ce.XK_KP_Up),ys("End",Ce.XK_End,Ce.XK_KP_End),ys("Home",Ce.XK_Home,Ce.XK_KP_Home),ys("PageDown",Ce.XK_Next,Ce.XK_KP_Next),ys("PageUp",Ce.XK_Prior,Ce.XK_KP_Prior),vs("Backspace",Ce.XK_BackSpace),ys("Clear",Ce.XK_Clear,Ce.XK_KP_Begin),vs("Copy",Ce.XF86XK_Copy),vs("Cut",Ce.XF86XK_Cut),ys("Delete",Ce.XK_Delete,Ce.XK_KP_Delete),ys("Insert",Ce.XK_Insert,Ce.XK_KP_Insert),vs("Paste",Ce.XF86XK_Paste),vs("Redo",Ce.XK_Redo),vs("Undo",Ce.XK_Undo),vs("Cancel",Ce.XK_Cancel),vs("ContextMenu",Ce.XK_Menu),vs("Escape",Ce.XK_Escape),vs("Execute",Ce.XK_Execute),vs("Find",Ce.XK_Find),vs("Help",Ce.XK_Help),vs("Pause",Ce.XK_Pause),vs("Select",Ce.XK_Select),vs("ZoomIn",Ce.XF86XK_ZoomIn),vs("ZoomOut",Ce.XF86XK_ZoomOut),vs("BrightnessDown",Ce.XF86XK_MonBrightnessDown),vs("BrightnessUp",Ce.XF86XK_MonBrightnessUp),vs("Eject",Ce.XF86XK_Eject),vs("LogOff",Ce.XF86XK_LogOff),vs("Power",Ce.XF86XK_PowerOff),vs("PowerOff",Ce.XF86XK_PowerDown),vs("PrintScreen",Ce.XK_Print),vs("Hibernate",Ce.XF86XK_Hibernate),vs("Standby",Ce.XF86XK_Standby),vs("WakeUp",Ce.XF86XK_WakeUp),vs("AllCandidates",Ce.XK_MultipleCandidate),vs("Alphanumeric",Ce.XK_Eisu_toggle),vs("CodeInput",Ce.XK_Codeinput),vs("Compose",Ce.XK_Multi_key),vs("Convert",Ce.XK_Henkan),vs("GroupFirst",Ce.XK_ISO_First_Group),vs("GroupLast",Ce.XK_ISO_Last_Group),vs("GroupNext",Ce.XK_ISO_Next_Group),vs("GroupPrevious",Ce.XK_ISO_Prev_Group),vs("NonConvert",Ce.XK_Muhenkan),vs("PreviousCandidate",Ce.XK_PreviousCandidate),vs("SingleCandidate",Ce.XK_SingleCandidate),vs("HangulMode",Ce.XK_Hangul),vs("HanjaMode",Ce.XK_Hangul_Hanja),vs("JunjaMode",Ce.XK_Hangul_Jeonja),vs("Eisu",Ce.XK_Eisu_toggle),vs("Hankaku",Ce.XK_Hankaku),vs("Hiragana",Ce.XK_Hiragana),vs("HiraganaKatakana",Ce.XK_Hiragana_Katakana),vs("KanaMode",Ce.XK_Kana_Shift),vs("KanjiMode",Ce.XK_Kanji),vs("Katakana",Ce.XK_Katakana),vs("Romaji",Ce.XK_Romaji),vs("Zenkaku",Ce.XK_Zenkaku),vs("ZenkakuHankaku",Ce.XK_Zenkaku_Hankaku),vs("F1",Ce.XK_F1),vs("F2",Ce.XK_F2),vs("F3",Ce.XK_F3),vs("F4",Ce.XK_F4),vs("F5",Ce.XK_F5),vs("F6",Ce.XK_F6),vs("F7",Ce.XK_F7),vs("F8",Ce.XK_F8),vs("F9",Ce.XK_F9),vs("F10",Ce.XK_F10),vs("F11",Ce.XK_F11),vs("F12",Ce.XK_F12),vs("F13",Ce.XK_F13),vs("F14",Ce.XK_F14),vs("F15",Ce.XK_F15),vs("F16",Ce.XK_F16),vs("F17",Ce.XK_F17),vs("F18",Ce.XK_F18),vs("F19",Ce.XK_F19),vs("F20",Ce.XK_F20),vs("F21",Ce.XK_F21),vs("F22",Ce.XK_F22),vs("F23",Ce.XK_F23),vs("F24",Ce.XK_F24),vs("F25",Ce.XK_F25),vs("F26",Ce.XK_F26),vs("F27",Ce.XK_F27),vs("F28",Ce.XK_F28),vs("F29",Ce.XK_F29),vs("F30",Ce.XK_F30),vs("F31",Ce.XK_F31),vs("F32",Ce.XK_F32),vs("F33",Ce.XK_F33),vs("F34",Ce.XK_F34),vs("F35",Ce.XK_F35),vs("Close",Ce.XF86XK_Close),vs("MailForward",Ce.XF86XK_MailForward),vs("MailReply",Ce.XF86XK_Reply),vs("MailSend",Ce.XF86XK_Send),vs("MediaFastForward",Ce.XF86XK_AudioForward),vs("MediaPause",Ce.XF86XK_AudioPause),vs("MediaPlay",Ce.XF86XK_AudioPlay),vs("MediaRecord",Ce.XF86XK_AudioRecord),vs("MediaRewind",Ce.XF86XK_AudioRewind),vs("MediaStop",Ce.XF86XK_AudioStop),vs("MediaTrackNext",Ce.XF86XK_AudioNext),vs("MediaTrackPrevious",Ce.XF86XK_AudioPrev),vs("New",Ce.XF86XK_New),vs("Open",Ce.XF86XK_Open),vs("Print",Ce.XK_Print),vs("Save",Ce.XF86XK_Save),vs("SpellCheck",Ce.XF86XK_Spell),vs("AudioVolumeDown",Ce.XF86XK_AudioLowerVolume),vs("AudioVolumeUp",Ce.XF86XK_AudioRaiseVolume),vs("AudioVolumeMute",Ce.XF86XK_AudioMute),vs("MicrophoneVolumeMute",Ce.XF86XK_AudioMicMute),vs("LaunchApplication1",Ce.XF86XK_MyComputer),vs("LaunchApplication2",Ce.XF86XK_Calculator),vs("LaunchCalendar",Ce.XF86XK_Calendar),vs("LaunchMail",Ce.XF86XK_Mail),vs("LaunchMediaPlayer",Ce.XF86XK_AudioMedia),vs("LaunchMusicPlayer",Ce.XF86XK_Music),vs("LaunchPhone",Ce.XF86XK_Phone),vs("LaunchScreenSaver",Ce.XF86XK_ScreenSaver),vs("LaunchSpreadsheet",Ce.XF86XK_Excel),vs("LaunchWebBrowser",Ce.XF86XK_WWW),vs("LaunchWebCam",Ce.XF86XK_WebCam),vs("LaunchWordProcessor",Ce.XF86XK_Word),vs("BrowserBack",Ce.XF86XK_Back),vs("BrowserFavorites",Ce.XF86XK_Favorites),vs("BrowserForward",Ce.XF86XK_Forward),vs("BrowserHome",Ce.XF86XK_HomePage),vs("BrowserRefresh",Ce.XF86XK_Refresh),vs("BrowserSearch",Ce.XF86XK_Search),vs("BrowserStop",Ce.XF86XK_Stop),vs("Dimmer",Ce.XF86XK_BrightnessAdjust),vs("MediaAudioTrack",Ce.XF86XK_AudioCycleTrack),vs("RandomToggle",Ce.XF86XK_AudioRandomPlay),vs("SplitScreenToggle",Ce.XF86XK_SplitScreen),vs("Subtitle",Ce.XF86XK_Subtitle),vs("VideoModeNext",Ce.XF86XK_Next_VMode),ys("=",Ce.XK_equal,Ce.XK_KP_Equal),ys("+",Ce.XK_plus,Ce.XK_KP_Add),ys("-",Ce.XK_minus,Ce.XK_KP_Subtract),ys("*",Ce.XK_asterisk,Ce.XK_KP_Multiply),ys("/",Ce.XK_slash,Ce.XK_KP_Divide),ys(".",Ce.XK_period,Ce.XK_KP_Decimal),ys(",",Ce.XK_comma,Ce.XK_KP_Separator),ys("0",Ce.XK_0,Ce.XK_KP_0),ys("1",Ce.XK_1,Ce.XK_KP_1),ys("2",Ce.XK_2,Ce.XK_KP_2),ys("3",Ce.XK_3,Ce.XK_KP_3),ys("4",Ce.XK_4,Ce.XK_KP_4),ys("5",Ce.XK_5,Ce.XK_KP_5),ys("6",Ce.XK_6,Ce.XK_KP_6),ys("7",Ce.XK_7,Ce.XK_KP_7),ys("8",Ce.XK_8,Ce.XK_KP_8),ys("9",Ce.XK_9,Ce.XK_KP_9);var ws=ms;function ks(e){if(e.code){switch(e.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return e.code}if(e.keyCode in _s){let t=_s[e.keyCode];if(ze()&&"ContextMenu"===t&&(t="MetaRight"),2===e.location)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(3===e.location)switch(t){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 t}return"Unidentified"}function Es(e){if(void 0!==e.key){switch(e.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(e.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}return"\0"===e.key&&"NumpadDecimal"===e.code?"Delete":e.key}const t=ks(e);return t in gs?gs[t]:e.charCode?String.fromCharCode(e.charCode):"Unidentified"}function Ss(e){const t=Es(e);if("Unidentified"===t)return null;if(t in ws){let n=e.location;if("Meta"===t&&0===n&&(n=2),"Clear"===t&&3===n){let t=ks(e);"NumLock"===t&&(n=0)}if((void 0===n||n>3)&&(n=0),"Meta"===t){let t=ks(e);if("AltLeft"===t)return Ce.XK_Meta_L;if("AltRight"===t)return Ce.XK_Meta_R}if("Clear"===t){let t=ks(e);if("NumLock"===t)return Ce.XK_Num_Lock}if($e())switch(t){case"Zenkaku":case"Hankaku":return Ce.XK_Zenkaku_Hankaku;case"Romaji":case"KanaMode":return Ce.XK_Romaji}return ws[t][n]}if(1!==t.length)return null;const n=t.charCodeAt();return n?ps.lookup(n):null}class As{constructor(e){this._target=e||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(e,t,n){if(n)this._keyDownList[t]=e;else{if(!(t in this._keyDownList))return;delete this._keyDownList[t]}Le("onkeyevent "+(n?"down":"up")+", keysym: "+e,", code: "+t),this.onkeyevent(e,t,n)}_getKeyCode(e){const t=ks(e);if("Unidentified"!==t)return t;if(e.keyCode&&229!==e.keyCode)return"Platform"+e.keyCode;if(e.keyIdentifier){if("U+"!==e.keyIdentifier.substr(0,2))return e.keyIdentifier;const t=parseInt(e.keyIdentifier.substr(2),16),n=String.fromCharCode(t).toUpperCase();return"Platform"+n.charCodeAt()}return"Unidentified"}_handleKeyDown(e){const t=this._getKeyCode(e);let n=Ss(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===t&&e.timeStamp-this._altGrCtrlTime<50?n=Ce.XK_ISO_Level3_Shift:this._sendKeyEvent(Ce.XK_Control_L,"ControlLeft",!0)),"Unidentified"===t)return n&&(this._sendKeyEvent(n,t,!0),this._sendKeyEvent(n,t,!1)),void Ye(e);if(ze()||qe())switch(n){case Ce.XK_Super_L:n=Ce.XK_Alt_L;break;case Ce.XK_Super_R:n=Ce.XK_Super_L;break;case Ce.XK_Alt_L:n=Ce.XK_Mode_switch;break;case Ce.XK_Alt_R:n=Ce.XK_ISO_Level3_Shift;break}if(t in this._keyDownList&&(n=this._keyDownList[t]),(ze()||qe())&&e.metaKey&&"MetaLeft"!==t&&"MetaRight"!==t)return this._sendKeyEvent(n,t,!0),this._sendKeyEvent(n,t,!1),void Ye(e);if((ze()||qe())&&"CapsLock"===t)return this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!1),void Ye(e);const i=[Ce.XK_Zenkaku_Hankaku,Ce.XK_Eisu_toggle,Ce.XK_Katakana,Ce.XK_Hiragana,Ce.XK_Romaji];return $e()&&i.includes(n)?(this._sendKeyEvent(n,t,!0),this._sendKeyEvent(n,t,!1),void Ye(e)):(Ye(e),"ControlLeft"===t&&$e()&&!("ControlLeft"in this._keyDownList)?(this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),void(this._altGrCtrlTime=e.timeStamp)):void this._sendKeyEvent(n,t,!0))}_handleKeyUp(e){Ye(e);const t=this._getKeyCode(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(Ce.XK_Control_L,"ControlLeft",!0)),(ze()||qe())&&"CapsLock"===t)return this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!0),void this._sendKeyEvent(Ce.XK_Caps_Lock,"CapsLock",!1);this._sendKeyEvent(this._keyDownList[t],t,!1),!$e()||"ShiftLeft"!==t&&"ShiftRight"!==t||("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(Ce.XK_Control_L,"ControlLeft",!0)}_allKeysUp(){Le(">> Keyboard.allKeysUp");for(let e in this._keyDownList)this._sendKeyEvent(this._keyDownList[e],e,!1);Le("<< 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 Xs=0,xs=1,Ks=2,Cs=4,Ts=8,Fs=16,Rs=32,Is=64,Os=127,Ls=50,Ds=90,Ms=250,Ns=1e3,Ps=1e3,Us=50;class Bs{constructor(){this._target=null,this._state=Os,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}attach(e){this.detach(),this._target=e,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(e){let t;switch(e.stopPropagation(),e.preventDefault(),e.type){case"touchstart":t=this._touchStart;break;case"touchmove":t=this._touchMove;break;case"touchend":case"touchcancel":t=this._touchEnd;break}for(let n=0;n0&&Date.now()-this._tracked[0].started>Ms)return this._state=Xs,void this._ignored.push(e);if(this._waitingRelease)return this._state=Xs,void this._ignored.push(e);switch(this._tracked.push({id:e,started:Date.now(),active:!0,firstX:t,firstY:n,lastX:t,lastY:n,angle:0}),this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(xs|Ts|Fs),this._stopLongpressTimeout();break;case 3:this._state&=~(Ks|Rs|Is);break;default:this._state=Xs}}}_touchMove(e,t,n){let i=this._tracked.find(t=>t.id===e);if(void 0===i)return;i.lastX=t,i.lastY=n;let r=t-i.firstX,s=n-i.firstY;if(i.firstX===i.lastX&&i.firstY===i.lastY||(i.angle=180*Math.atan2(s,r)/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(r,s)t.id!==e),n=Math.hypot(t.firstX-t.lastX,t.firstY-t.lastY);if(n>Ls){let e=Math.abs(i.angle-t.angle);e=Math.abs((e+180)%360-180),this._state&=e>Ds?~Rs:~Is,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}_touchEnd(e,t,n){if(-1!==this._ignored.indexOf(e))return this._ignored.splice(this._ignored.indexOf(e),1),void(0===this._ignored.length&&0===this._tracked.length&&(this._state=Os,this._waitingRelease=!1));if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=Xs),!this._hasDetectedGesture()&&(this._state&=~(Ts|Rs|Is),this._state&=~Fs,this._stopLongpressTimeout(),!this._waitingRelease))switch(this._releaseStart=Date.now(),this._waitingRelease=!0,this._tracked.length){case 1:this._state&=~(Ks|Cs);break;case 2:this._state&=~(xs|Cs);break}if(this._waitingRelease){Date.now()-this._releaseStart>Ms&&(this._state=Xs),this._tracked.some(e=>Date.now()-e.started>Ns)&&(this._state=Xs);let t=this._tracked.find(t=>t.id===e);if(t.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==Xs)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(let i=0;ie.active)))}_startLongpressTimeout(){this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout(()=>this._longpressTimeout(),Ps)}_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=Fs,this._pushEvent("gesturestart")}_startTwoTouchTimeout(){this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(()=>this._twoTouchTimeout(),Us)}_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 e=this._getAverageMovement(),t=Math.abs(e.x),n=Math.abs(e.y),i=this._getAverageDistance(),r=Math.abs(Math.hypot(i.first.x,i.first.y)-Math.hypot(i.last.x,i.last.y));this._state=n{this._target&&(t=document.elementFromPoint(e.clientX,e.clientY),this._updateVisibility(t))},0)}_showCursor(){"hidden"===this._canvas.style.visibility&&(this._canvas.style.visibility="")}_hideCursor(){"hidden"!==this._canvas.style.visibility&&(this._canvas.style.visibility="hidden")}_shouldShowCursor(e){return!!e&&(e===this._target||!!this._target.contains(e)&&"none"===window.getComputedStyle(e).cursor)}_updateVisibility(e){this._captureIsActive()&&(e=document.captureElement),this._shouldShowCursor(e)?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 Gs=41943040,Vs={CONNECTING:"connecting",OPEN:"open",CLOSING:"closing",CLOSED:"closed"},Hs={CONNECTING:[WebSocket.CONNECTING,Vs.CONNECTING],OPEN:[WebSocket.OPEN,Vs.OPEN],CLOSING:[WebSocket.CLOSING,Vs.CLOSING],CLOSED:[WebSocket.CLOSED,Vs.CLOSED]},zs=["send","close","binaryType","onerror","onmessage","onopen","protocol","readyState"];class $s{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 e;return null===this._websocket?"unused":(e=this._websocket.readyState,Hs.CONNECTING.includes(e)?"connecting":Hs.OPEN.includes(e)?"open":Hs.CLOSING.includes(e)?"closing":Hs.CLOSED.includes(e)?"closed":"unknown")}get sQ(){return this._sQ}get rQ(){return this._rQ}get rQi(){return this._rQi}set rQi(e){this._rQi=e}get rQlen(){return this._rQlen-this._rQi}rQpeek8(){return this._rQ[this._rQi]}rQskipBytes(e){this._rQi+=e}rQshift8(){return this._rQshift(1)}rQshift16(){return this._rQshift(2)}rQshift32(){return this._rQshift(4)}_rQshift(e){let t=0;for(let n=e-1;n>=0;n--)t+=this._rQ[this._rQi++]<<8*n;return t}rQshiftStr(e){"undefined"===typeof e&&(e=this.rQlen);let t="";for(let n=0;n0&&"open"===this.readyState&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}send(e){this._sQ.set(e,this._sQlen),this._sQlen+=e.length,this.flush()}sendString(e){this.send(e.split("").map(e=>e.charCodeAt(0)))}off(e){this._eventHandlers[e]=()=>{}}on(e,t){this._eventHandlers[e]=t}_allocateBuffers(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}init(){this._allocateBuffers(),this._rQi=0,this._websocket=null}open(e,t){this.attach(new WebSocket(e,t))}attach(e){this.init();const t=[...Object.keys(e),...Object.getOwnPropertyNames(Object.getPrototypeOf(e))];for(let n=0;n{Le(">> WebSock.onopen"),this._websocket.protocol&&De("Server choose sub-protocol: "+this._websocket.protocol),this._eventHandlers.open(),Le("<< WebSock.onopen")},this._websocket.onclose=e=>{Le(">> WebSock.onclose"),this._eventHandlers.close(e),Le("<< WebSock.onclose")},this._websocket.onerror=e=>{Le(">> WebSock.onerror: "+e),this._eventHandlers.error(e),Le("<< WebSock.onerror: "+e)}}close(){this._websocket&&("connecting"!==this.readyState&&"open"!==this.readyState||(De("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=()=>{})}_encodeMessage(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}_expandCompactRQ(e){const t=8*(this._rQlen-this._rQi+e),n=this._rQbufferSizeGs&&(this._rQbufferSize=Gs,this._rQbufferSize-this.rQlenthis._rQbufferSize-this._rQlen&&this._expandCompactRQ(t.length),this._rQ.set(t,this._rQlen),this._rQlen+=t.length}_recvMessage(e){this._DecodeMessage(e.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):Le("Ignoring empty message")}}const qs=[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],Ws=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],Ys=0;let Js,Zs,eo,to,no,io;Js=65536,Zs=1<<24,eo=Js|Zs,to=4,no=1024,io=to|no;const ro=[eo|no,Ys|Ys,Js|Ys,eo|io,eo|to,Js|io,Ys|to,Js|Ys,Ys|no,eo|no,eo|io,Ys|no,Zs|io,eo|to,Zs|Ys,Ys|to,Ys|io,Zs|no,Zs|no,Js|no,Js|no,eo|Ys,eo|Ys,Zs|io,Js|to,Zs|to,Zs|to,Js|to,Ys|Ys,Ys|io,Js|io,Zs|Ys,Js|Ys,eo|io,Ys|to,eo|Ys,eo|no,Zs|Ys,Zs|Ys,Ys|no,eo|to,Js|Ys,Js|no,Zs|to,Ys|no,Ys|to,Zs|io,Js|io,eo|io,Js|to,eo|Ys,Zs|io,Zs|to,Ys|io,Js|io,eo|no,Ys|io,Zs|no,Zs|no,Ys|Ys,Js|to,Js|no,Ys|Ys,eo|to];Js=1<<20,Zs=1<<31,eo=Js|Zs,to=32,no=32768,io=to|no;const so=[eo|io,Zs|no,Ys|no,Js|io,Js|Ys,Ys|to,eo|to,Zs|io,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e)<<12,this.keys[o]|=(63&e)<<16,this.keys[o]|=(258048&t)>>>4,this.keys[o]|=63&t,++o}}enc8(e){const t=e.slice();let n,i,r,s=0;n=t[s++]<<24|t[s++]<<16|t[s++]<<8|t[s++],i=t[s++]<<24|t[s++]<<16|t[s++]<<8|t[s++],r=252645135&(n>>>4^i),i^=r,n^=r<<4,r=65535&(n>>>16^i),i^=r,n^=r<<16,r=858993459&(i>>>2^n),n^=r,i^=r<<2,r=16711935&(i>>>8^n),n^=r,i^=r<<8,i=i<<1|i>>>31&1,r=2863311530&(n^i),n^=r,i^=r,n=n<<1|n>>>31&1;for(let o=0,a=0;o<8;++o){r=i<<28|i>>>4,r^=this.keys[a++];let e=uo[63&r];e|=co[r>>>8&63],e|=oo[r>>>16&63],e|=ro[r>>>24&63],r=i^this.keys[a++],e|=ho[63&r],e|=lo[r>>>8&63],e|=ao[r>>>16&63],e|=so[r>>>24&63],n^=e,r=n<<28|n>>>4,r^=this.keys[a++],e=uo[63&r],e|=co[r>>>8&63],e|=oo[r>>>16&63],e|=ro[r>>>24&63],r=n^this.keys[a++],e|=ho[63&r],e|=lo[r>>>8&63],e|=ao[r>>>16&63],e|=so[r>>>24&63],i^=e}for(i=i<<31|i>>>1,r=2863311530&(n^i),n^=r,i^=r,n=n<<31|n>>>1,r=16711935&(n>>>8^i),i^=r,n^=r<<8,r=858993459&(n>>>2^i),i^=r,n^=r<<2,r=65535&(i>>>16^n),n^=r,i^=r<<16,r=252645135&(i>>>4^n),n^=r,i^=r<<4,r=[i,n],s=0;s<8;s++)t[s]=(r[s>>>2]>>>8*(3-s%4))%256,t[s]<0&&(t[s]+=256);return t}encrypt(e){return this.enc8(e.slice(0,8)).concat(this.enc8(e.slice(8,16)))}}var po={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 _o={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingZRLE:16,encodingTightPNG:-260,encodingJPEG:21,pseudoEncodingQualityLevel9:-23,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel9:-247,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};class go{constructor(){this._rawKey=null,this._ctrKey=null,this._cbcKey=null,this._zeroBlock=new Uint8Array(16),this._prefixBlock0=this._zeroBlock,this._prefixBlock1=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]),this._prefixBlock2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2])}async _encryptBlock(e){const t=await window.crypto.subtle.encrypt({name:"AES-CBC",iv:this._zeroBlock},this._cbcKey,e);return new Uint8Array(t).slice(0,16)}async _initCMAC(){const e=await this._encryptBlock(this._zeroBlock),t=new Uint8Array(16),n=e[0]>>>6;for(let r=0;r<15;r++)t[r]=e[r+1]>>6|e[r]<<2,e[r]=e[r+1]>>7|e[r]<<1;const i=[0,135,14,137];t[14]^=n>>>1,t[15]=e[15]<<2^i[n],e[15]=e[15]<<1^i[n>>1],this._k1=e,this._k2=t}async _encryptCTR(e,t){const n=await window.crypto.subtle.encrypt({name:"AES-CTR",counter:t,length:128},this._ctrKey,e);return new Uint8Array(n)}async _decryptCTR(e,t){const n=await window.crypto.subtle.decrypt({name:"AES-CTR",counter:t,length:128},this._ctrKey,e);return new Uint8Array(n)}async _computeCMAC(e,t){if(16!==t.length)return null;const n=Math.floor(e.length/16),i=Math.ceil(e.length/16),r=e.length-16*n,s=new Uint8Array(16*(i+1));if(s.set(t),s.set(e,16),0===r)for(let c=0;c<16;c++)s[16*n+c]^=this._k1[c];else{s[16*(n+1)+r]=128;for(let e=0;e<16;e++)s[16*(n+1)+e]^=this._k2[e]}let o=await window.crypto.subtle.encrypt({name:"AES-CBC",iv:this._zeroBlock},this._cbcKey,s);o=new Uint8Array(o);const a=o.slice(o.length-32,o.length-16);return a}async setKey(e){this._rawKey=e,this._ctrKey=await window.crypto.subtle.importKey("raw",e,{name:"AES-CTR"},!1,["encrypt","decrypt"]),this._cbcKey=await window.crypto.subtle.importKey("raw",e,{name:"AES-CBC"},!1,["encrypt","decrypt"]),await this._initCMAC()}async encrypt(e,t,n){const i=await this._computeCMAC(n,this._prefixBlock0),r=await this._encryptCTR(e,i),s=await this._computeCMAC(t,this._prefixBlock1),o=await this._computeCMAC(r,this._prefixBlock2);for(let c=0;c<16;c++)o[c]^=i[c]^s[c];const a=new Uint8Array(16+r.length);return a.set(r),a.set(o,r.length),a}async decrypt(e,t,n,i){const r=await this._computeCMAC(n,this._prefixBlock0),s=await this._computeCMAC(t,this._prefixBlock1),o=await this._computeCMAC(e,this._prefixBlock2);for(let c=0;c<16;c++)o[c]^=r[c]^s[c];if(o.length!==i.length)return null;for(let c=0;c>>8,255&e.length]),n=await this._cipher.encrypt(e,t,this._counter);for(let r=0;r<16&&255===this._counter[r]++;r++);const i=new Uint8Array(e.length+2+16);return i.set(t),i.set(n,2),i}async receiveMessage(e,t,n){const i=new Uint8Array([(65280&e)>>>8,255&e]),r=await this._cipher.decrypt(t,i,this._counter,n);for(let s=0;s<16&&255===this._counter[s]++;s++);return r}}class vo{constructor(e){this._key=null,this._keyLength=e,this._keyBytes=Math.ceil(e/8),this._n=null,this._e=null,this._d=null,this._nBigInt=null,this._eBigInt=null,this._dBigInt=null}_base64urlDecode(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.padEnd(4*Math.ceil(e.length/4),"="),ot.decode(e)}_u8ArrayToBigInt(e){let t="0x";for(let n=0;n0)t%2n===1n&&(i=i*e%n),t/=2n,e=e*e%n;return i}async generateKey(){this._key=await window.crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:this._keyLength,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["encrypt","decrypt"]);const e=await window.crypto.subtle.exportKey("jwk",this._key.privateKey);this._n=this._padArray(this._base64urlDecode(e.n),this._keyBytes),this._nBigInt=this._u8ArrayToBigInt(this._n),this._e=this._padArray(this._base64urlDecode(e.e),this._keyBytes),this._eBigInt=this._u8ArrayToBigInt(this._e),this._d=this._padArray(this._base64urlDecode(e.d),this._keyBytes),this._dBigInt=this._u8ArrayToBigInt(this._d)}setPublicKey(e,t){e.length===this._keyBytes&&t.length===this._keyBytes&&(this._n=new Uint8Array(this._keyBytes),this._e=new Uint8Array(this._keyBytes),this._n.set(e),this._e.set(t),this._nBigInt=this._u8ArrayToBigInt(this._n),this._eBigInt=this._u8ArrayToBigInt(this._e))}encrypt(e){if(e.length>this._keyBytes-11)return null;const t=new Uint8Array(this._keyBytes-e.length-3);window.crypto.getRandomValues(t);for(let s=0;s{const i=()=>!this._sock.rQwait("RA2",e);i()?t():(this._checkSock=()=>{i()&&(t(),this._checkSock=null,this._sockReject=null)},this._sockReject=n)})}_waitApproveKeyAsync(){return new Promise((e,t)=>{this._approveServerResolve=e,this._approveServerReject=t})}_waitCredentialsAsync(e){const t=()=>1===e&&void 0!==this._getCredentials().username&&void 0!==this._getCredentials().password||2===e&&void 0!==this._getCredentials().password;return new Promise((e,n)=>{t()?e():(this._checkCredentials=()=>{t()&&(e(),this._checkCredentials=null,this._credentialsReject=null)},this._credentialsReject=n)})}checkInternalEvents(){null!==this._checkSock&&this._checkSock(),null!==this._checkCredentials&&this._checkCredentials()}approveServer(){null!==this._approveServerResolve&&(this._approveServerResolve(),this._approveServerResolve=null)}disconnect(){null!==this._sockReject&&(this._sockReject(new Error("disconnect normally")),this._sockReject=null),null!==this._credentialsReject&&(this._credentialsReject(new Error("disconnect normally")),this._credentialsReject=null),null!==this._approveServerReject&&(this._approveServerReject(new Error("disconnect normally")),this._approveServerReject=null)}async negotiateRA2neAuthAsync(){this._hasStarted=!0,await this._waitSockAsync(4);const e=this._sock.rQslice(0,4),t=this._sock.rQshift32();if(t<1024)throw new Error("RA2: server public key is too short: "+t);if(t>8192)throw new Error("RA2: server public key is too long: "+t);const n=Math.ceil(t/8);await this._waitSockAsync(2*n);const i=this._sock.rQshiftBytes(n),r=this._sock.rQshiftBytes(n),s=new vo(t);s.setPublicKey(i,r);const o=new Uint8Array(4+2*n);o.set(e),o.set(i,4),o.set(r,4+n),this.dispatchEvent(new CustomEvent("serververification",{detail:{type:"RSA",publickey:o}})),await this._waitApproveKeyAsync();const a=2048,c=Math.ceil(a/8),l=new vo(a);await l.generateKey();const u=l.n,h=l.e,d=new Uint8Array(4+2*c);d[0]=(4278190080&a)>>>24,d[1]=(16711680&a)>>>16,d[2]=(65280&a)>>>8,d[3]=255&a,d.set(u,4),d.set(h,4+c),this._sock.send(d);const f=new Uint8Array(16);window.crypto.getRandomValues(f);const p=s.encrypt(f),_=new Uint8Array(2+n);if(_[0]=(65280&n)>>>8,_[1]=255&n,_.set(p,2),this._sock.send(_),await this._waitSockAsync(2),this._sock.rQshift16()!==c)throw new Error("RA2: wrong encrypted message length");const g=this._sock.rQshiftBytes(c),m=l.decrypt(g);if(null===m||16!==m.length)throw new Error("RA2: corrupted server encrypted random");let v=new Uint8Array(32),b=new Uint8Array(32);v.set(m),v.set(f,16),b.set(f),b.set(m,16),v=await window.crypto.subtle.digest("SHA-1",v),v=new Uint8Array(v).slice(0,16),b=await window.crypto.subtle.digest("SHA-1",b),b=new Uint8Array(b).slice(0,16);const y=new mo;await y.setKey(v);const w=new mo;await w.setKey(b);let k=new Uint8Array(8+2*n+2*c),E=new Uint8Array(8+2*n+2*c);if(k.set(o),k.set(d,4+2*n),E.set(d),E.set(o,4+2*c),k=await window.crypto.subtle.digest("SHA-1",k),E=await window.crypto.subtle.digest("SHA-1",E),k=new Uint8Array(k),E=new Uint8Array(E),this._sock.send(await y.makeMessage(E)),await this._waitSockAsync(38),20!==this._sock.rQshift16())throw new Error("RA2: wrong server hash");const S=await w.receiveMessage(20,this._sock.rQshiftBytes(20),this._sock.rQshiftBytes(16));if(null===S)throw new Error("RA2: failed to authenticate the message");for(let C=0;C<20;C++)if(S[C]!==k[C])throw new Error("RA2: wrong server hash");if(await this._waitSockAsync(19),1!==this._sock.rQshift16())throw new Error("RA2: wrong subtype");let A,X=await w.receiveMessage(1,this._sock.rQshiftBytes(1),this._sock.rQshiftBytes(16));if(null===X)throw new Error("RA2: failed to authenticate the message");if(X=X[0],1===X)void 0!==this._getCredentials().username&&void 0!==this._getCredentials().password||this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}}));else{if(2!==X)throw new Error("RA2: wrong subtype");void 0===this._getCredentials().password&&this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}}))}await this._waitCredentialsAsync(X),A=1===X?Be(this._getCredentials().username).slice(0,255):"";const x=Be(this._getCredentials().password).slice(0,255),K=new Uint8Array(A.length+x.length+2);K[0]=A.length,K[A.length+1]=x.length;for(let C=0;C>2);for(let n=0;n>5]|=(255&e.charCodeAt(n/8))<>5]>>>n%32&255);return t}function So(e,t){e[t>>5]|=128<>>9<<4)]=t;let n=1732584193,i=-271733879,r=-1732584194,s=271733878;for(let o=0;o>16)+(t>>16)+(n>>16)<<16|65535&n}function Fo(e,t){return e<>>32-t}class Ro{constructor(){this._lines=0}decodeRect(e,t,n,i,r,s,o){if(0===n||0===i)return!0;0===this._lines&&(this._lines=i);const a=8==o?1:4,c=n*a;if(r.rQwait("RAW",c))return!1;const l=t+(i-this._lines),u=Math.min(this._lines,Math.floor(r.rQlen/c)),h=n*u;let d=r.rQ,f=r.rQi;if(8==o){const e=new Uint8Array(4*h);for(let t=0;t>0&3)/3,e[4*t+1]=255*(d[f+t]>>2&3)/3,e[4*t+2]=255*(d[f+t]>>4&3)/3,e[4*t+3]=255;d=e,f=0}for(let p=0;p0)}}class Io{decodeRect(e,t,n,i,r,s,o){if(r.rQwait("COPYRECT",4))return!1;let a=r.rQshift16(),c=r.rQshift16();return 0===n||0===i||s.copyImage(a,c,e,t,n,i),!0}}class Oo{constructor(){this._subrects=0}decodeRect(e,t,n,i,r,s,o){if(0===this._subrects){if(r.rQwait("RRE",8))return!1;this._subrects=r.rQshift32();let o=r.rQshiftBytes(4);s.fillRect(e,t,n,i,o)}while(this._subrects>0){if(r.rQwait("RRE",12))return!1;let n=r.rQshiftBytes(4),i=r.rQshift16(),o=r.rQshift16(),a=r.rQshift16(),c=r.rQshift16();s.fillRect(e+i,t+o,a,c,n),this._subrects--}return!0}}class Lo{constructor(){this._tiles=0,this._lastsubencoding=0,this._tileBuffer=new Uint8Array(1024)}decodeRect(e,t,n,i,r,s,o){0===this._tiles&&(this._tilesX=Math.ceil(n/16),this._tilesY=Math.ceil(i/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);while(this._tiles>0){let o=1;if(r.rQwait("HEXTILE",o))return!1;let a=r.rQ,c=r.rQi,l=a[c];if(l>30)throw new Error("Illegal hextile subencoding (subencoding: "+l+")");const u=this._totalTiles-this._tiles,h=u%this._tilesX,d=Math.floor(u/this._tilesX),f=e+16*h,p=t+16*d,_=Math.min(16,e+n-f),g=Math.min(16,t+i-p);if(1&l)o+=_*g*4;else if(2&l&&(o+=4),4&l&&(o+=4),8&l){if(o++,r.rQwait("HEXTILE",o))return!1;let e=a[c+o-1];o+=16&l?6*e:2*e}if(r.rQwait("HEXTILE",o))return!1;if(c++,0===l)1&this._lastsubencoding?Le(" Ignoring blank after RAW"):s.fillRect(f,p,_,g,this._background);else if(1&l){let e=_*g;for(let t=0;t>4,i=15&t,r=a[c];c++;const s=1+(r>>4),o=1+(15&r);this._subTile(n,i,s,o,e)}}this._finishTile(s)}r.rQi=c,this._lastsubencoding=l,this._tiles--}return!0}_startTile(e,t,n,i,r){this._tileX=e,this._tileY=t,this._tileW=n,this._tileH=i;const s=r[0],o=r[1],a=r[2],c=this._tileBuffer;for(let l=0;l>e&1&&(this._zlibs[e].reset(),De("Reset zlib stream "+e));this._ctl=this._ctl>>4}let a;if(8===this._ctl)a=this._fillRect(e,t,n,i,r,s,o);else if(9===this._ctl)a=this._jpegRect(e,t,n,i,r,s,o);else if(10===this._ctl)a=this._pngRect(e,t,n,i,r,s,o);else{if(0!=(8&this._ctl))throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");a=this._basicRect(this._ctl,e,t,n,i,r,s,o)}return a&&(this._ctl=null),a}_fillRect(e,t,n,i,r,s,o){if(r.rQwait("TIGHT",3))return!1;const a=r.rQi,c=r.rQ;return s.fillRect(e,t,n,i,[c[a],c[a+1],c[a+2]],!1),r.rQskipBytes(3),!0}_jpegRect(e,t,n,i,r,s,o){let a=this._readData(r);return null!==a&&(s.imageRect(e,t,n,i,"image/jpeg",a),!0)}_pngRect(e,t,n,i,r,s,o){throw new Error("PNG received in standard Tight rect")}_basicRect(e,t,n,i,r,s,o,a){if(null===this._filter)if(4&e){if(s.rQwait("TIGHT",1))return!1;this._filter=s.rQshift8()}else this._filter=0;let c,l=3&e;switch(this._filter){case 0:c=this._copyFilter(l,t,n,i,r,s,o,a);break;case 1:c=this._paletteFilter(l,t,n,i,r,s,o,a);break;case 2:c=this._gradientFilter(l,t,n,i,r,s,o,a);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return c&&(this._filter=null),c}_copyFilter(e,t,n,i,r,s,o,a){const c=i*r*3;let l;if(0===c)return!0;if(c<12){if(s.rQwait("TIGHT",c))return!1;l=s.rQshiftBytes(c)}else{if(l=this._readData(s),null===l)return!1;this._zlibs[e].setInput(l),l=this._zlibs[e].inflate(c),this._zlibs[e].setInput(null)}let u=new Uint8Array(i*r*4);for(let h=0,d=0;h=0;o--)e=4*(u*n+8*i+7-o),t=3*(r[u*c+i]>>o&1),a[e]=s[t],a[e+1]=s[t+1],a[e+2]=s[t+2],a[e+3]=255;for(let o=7;o>=8-n%8;o--)e=4*(u*n+8*i+7-o),t=3*(r[u*c+i]>>o&1),a[e]=s[t],a[e+1]=s[t+1],a[e+2]=s[t+2],a[e+3]=255}o.blitImage(e,t,n,i,a,0,!1)}_paletteRect(e,t,n,i,r,s,o){const a=this._getScratchBuffer(n*i*4),c=n*i*4;for(let l=0,u=0;l=2&&a<=16){const e=this._decodePaletteTile(a,o,i,r);s.blitImage(t,c,i,r,e,0,!1)}else if(128===a){const e=this._decodeRLETile(o);s.blitImage(t,c,i,r,e,0,!1)}else{if(!(a>=130&&a<=255))throw new Error("Unknown subencoding: "+a);{const e=this._decodeRLEPaletteTile(a-128,o);s.blitImage(t,c,i,r,e,0,!1)}}}}return this._length=0,!0}_getBitsPerPixelInPalette(e){return e<=2?1:e<=4?2:e<=16?4:void 0}_readPixels(e){let t=this._pixelBuffer;const n=this._inflator.inflate(3*e);for(let i=0,r=0;i<4*e;i+=4,r+=3)t[i]=n[r],t[i+1]=n[r+1],t[i+2]=n[r+2],t[i+3]=255;return t}_decodePaletteTile(e,t,n,i){const r=this._tileBuffer,s=this._readPixels(e),o=this._getBitsPerPixelInPalette(e),a=(1<>e&a;r[c]=s[4*t],r[c+1]=s[4*t+1],r[c+2]=s[4*t+2],r[c+3]=s[4*t+3],c+=4,e-=o}e<8-o&&u=128&&(s-=128,o=this._readRLELength()),s>e)throw new Error("Too big index in palette: "+s+", palette size: "+e);if(r+o>t)throw new Error("Too big rle length in palette mode: "+o+", allowed length is: "+(t-r));for(let e=0;e192==e[1]||194==e[1]);if(-1==r)throw new Error("Illegal JPEG image without SOF");let o=this._segments.slice(0,r);o=o.concat(this._quantTables.length?this._quantTables:this._cachedQuantTables),o.push(this._segments[r]),o=o.concat(this._huffmanTables.length?this._huffmanTables:this._cachedHuffmanTables,this._segments.slice(r+1));let a=0;for(let e=0;en)return!1;if(255!=e[i])throw new Error("Illegal JPEG marker received (byte: "+e[i]+")");const r=e[i+1];if(i+=2,217==r)return this._jpegLength=i,this._segments.push(e.slice(t,i)),!0;if(218==r){let r=!1;for(let t=i+3;t+1=208&&e[t+1]<=215)){i=t,r=!0;break}if(!r)return!1;this._segments.push(e.slice(t,i)),t=i;continue}if(r>=208&&r<217||1==r){this._segments.push(e.slice(t,i)),t=i;continue}if(i+2>n)return!1;const s=(e[i]<<8)+e[i+1]-2;if(s<0)throw new Error("Illegal JPEG length received (length: "+s+")");if(i+=2,i+s>n)return!1;i+=s;const o=e.slice(t,i);196==r?this._huffmanTables.push(o):219==r&&this._quantTables.push(o),this._segments.push(o),t=i}}}const jo=3,Qo="rgb(40, 40, 40)",Go=17,Vo=50,Ho=19,zo=75,$o=50,qo=1e3,Wo=50,Yo=1,Jo=2,Zo=6,ea=16,ta=19,na=22,ia=30,ra=113,sa=129,oa=256,aa=1,ca=1<<24,la=1<<25,ua=1<<26,ha=1<<27,da=1<<28;class fa extends st{constructor(e,t,n){if(!e)throw new Error("Must specify target");if(!t)throw new Error("Must specify URL, WebSocket or RTCDataChannel");window.isSecureContext||Ne("noVNC requires a secure context (TLS). Expect crashes!"),super(),this._target=e,"string"===typeof t?this._url=t:(this._url=null,this._rawChannel=t),n=n||{},this._rfbCredentials=n.credentials||{},this._shared=!("shared"in n)||!!n.shared,this._repeaterID=n.repeaterID||"",this._wsProtocols=n.wsProtocols||[],this._rfbConnectionState="",this._rfbInitState="",this._rfbAuthScheme=-1,this._rfbCleanDisconnect=!0,this._rfbRSAAESAuthenticationState=null,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),handleRSAAESCredentialsRequired:this._handleRSAAESCredentialsRequired.bind(this),handleRSAAESServerVerification:this._handleRSAAESServerVerification.bind(this)},Le(">> 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=Qo,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 Qs,this._cursorImage=fa.cursors.none,this._decoders[_o.encodingRaw]=new Ro,this._decoders[_o.encodingCopyRect]=new Io,this._decoders[_o.encodingRRE]=new Oo,this._decoders[_o.encodingHextile]=new Lo,this._decoders[_o.encodingTight]=new Do,this._decoders[_o.encodingTightPNG]=new Mo,this._decoders[_o.encodingZRLE]=new Uo,this._decoders[_o.encodingJPEG]=new Bo;try{this._display=new at(this._canvas)}catch(Ua){throw Ne("Display exception: "+Ua),Ua}this._display.onflush=this._onFlush.bind(this),this._keyboard=new As(this._canvas),this._keyboard.onkeyevent=this._handleKeyEvent.bind(this),this._gestures=new Bs,this._sock=new $s,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._expectedClientWidth=null,this._expectedClientHeight=null,this._resizeObserver=new ResizeObserver(this._eventHandlers.handleResize),this._updateConnectionState("connecting"),Le("<< RFB.constructor"),this.dragViewport=!1,this.focusOnClick=!0,this._viewOnly=!1,this._clipViewport=!1,this._clippingViewport=!1,this._scaleViewport=!1,this._resizeSession=!1,this._showDotCursor=!1,void 0!==n.showDotCursor&&(Me("Specifying showDotCursor as a RFB constructor argument is deprecated"),this._showDotCursor=n.showDotCursor),this._qualityLevel=6,this._compressionLevel=2}get viewOnly(){return this._viewOnly}set viewOnly(e){this._viewOnly=e,"connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState||(e?this._keyboard.ungrab():this._keyboard.grab())}get capabilities(){return this._capabilities}get clippingViewport(){return this._clippingViewport}_setClippingViewport(e){e!==this._clippingViewport&&(this._clippingViewport=e,this.dispatchEvent(new CustomEvent("clippingviewport",{detail:this._clippingViewport})))}get touchButton(){return 0}set touchButton(e){Me("Using old API!")}get clipViewport(){return this._clipViewport}set clipViewport(e){this._clipViewport=e,this._updateClip()}get scaleViewport(){return this._scaleViewport}set scaleViewport(e){this._scaleViewport=e,e&&this._clipViewport&&this._updateClip(),this._updateScale(),!e&&this._clipViewport&&this._updateClip()}get resizeSession(){return this._resizeSession}set resizeSession(e){this._resizeSession=e,e&&this._requestRemoteResize()}get showDotCursor(){return this._showDotCursor}set showDotCursor(e){this._showDotCursor=e,this._refreshCursor()}get background(){return this._screen.style.background}set background(e){this._screen.style.background=e}get qualityLevel(){return this._qualityLevel}set qualityLevel(e){!Number.isInteger(e)||e<0||e>9?Ne("qualityLevel must be an integer between 0 and 9"):this._qualityLevel!==e&&(this._qualityLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}get compressionLevel(){return this._compressionLevel}set compressionLevel(e){!Number.isInteger(e)||e<0||e>9?Ne("compressionLevel must be an integer between 0 and 9"):this._compressionLevel!==e&&(this._compressionLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}disconnect(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open"),null!==this._rfbRSAAESAuthenticationState&&this._rfbRSAAESAuthenticationState.disconnect()}approveServer(){null!==this._rfbRSAAESAuthenticationState&&this._rfbRSAAESAuthenticationState.approveServer()}sendCredentials(e){this._rfbCredentials=e,this._resumeAuthentication()}sendCtrlAltDel(){"connected"!==this._rfbConnectionState||this._viewOnly||(De("Sending Ctrl-Alt-Del"),this.sendKey(Ce.XK_Control_L,"ControlLeft",!0),this.sendKey(Ce.XK_Alt_L,"AltLeft",!0),this.sendKey(Ce.XK_Delete,"Delete",!0),this.sendKey(Ce.XK_Delete,"Delete",!1),this.sendKey(Ce.XK_Alt_L,"AltLeft",!1),this.sendKey(Ce.XK_Control_L,"ControlLeft",!1))}machineShutdown(){this._xvpOp(1,2)}machineReboot(){this._xvpOp(1,3)}machineReset(){this._xvpOp(1,4)}sendKey(e,t,n){if("connected"!==this._rfbConnectionState||this._viewOnly)return;if(void 0===n)return this.sendKey(e,t,!0),void this.sendKey(e,t,!1);const i=po[t];if(this._qemuExtKeyEventSupported&&i)e=e||0,De("Sending key ("+(n?"down":"up")+"): keysym "+e+", scancode "+i),fa.messages.QEMUExtendedKeyEvent(this._sock,e,n,i);else{if(!e)return;De("Sending keysym ("+(n?"down":"up")+"): "+e),fa.messages.keyEvent(this._sock,e,n?1:0)}}focus(e){this._canvas.focus(e)}blur(){this._canvas.blur()}clipboardPasteFrom(e){if("connected"===this._rfbConnectionState&&!this._viewOnly)if(this._clipboardServerCapabilitiesFormats[aa]&&this._clipboardServerCapabilitiesActions[ha])this._clipboardText=e,fa.messages.extendedClipboardNotify(this._sock,[aa]);else{let t,n,i;t=0;for(let r of e)t++;i=new Uint8Array(t),n=0;for(let r of e){let e=r.codePointAt(0);e>255&&(e=63),i[n++]=e}fa.messages.clientCutText(this._sock,i)}}getImageData(){return this._display.getImageData()}toDataURL(e,t){return this._display.toDataURL(e,t)}toBlob(e,t,n){return this._display.toBlob(e,t,n)}_connect(){if(Le(">> RFB.connect"),this._url)De("connecting to "+this._url),this._sock.open(this._url,this._wsProtocols);else{if(De(`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),Le("<< RFB.connect")}_disconnect(){Le(">> 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(e){if("NotFoundError"!==e.name)throw e}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),Le("<< RFB.disconnect")}_socketOpen(){"connecting"===this._rfbConnectionState&&""===this._rfbInitState?(this._rfbInitState="ProtocolVersion",Le("Starting VNC handshake")):this._fail("Unexpected server connection while "+this._rfbConnectionState)}_socketClose(e){Le("WebSocket on-close event");let t="";switch(e.code&&(t="(code: "+e.code,e.reason&&(t+=", reason: "+e.reason),t+=")"),this._rfbConnectionState){case"connecting":this._fail("Connection closed "+t);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 "+t);break;default:this._fail("Unexpected server disconnect before connecting "+t);break}this._sock.off("close"),this._rawChannel=null}_socketError(e){Me("WebSocket on-error event")}_focusCanvas(e){this.focusOnClick&&this.focus({preventScroll:!0})}_setDesktopName(e){this._fbName=e,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}_saveExpectedClientSize(){this._expectedClientWidth=this._screen.clientWidth,this._expectedClientHeight=this._screen.clientHeight}_currentClientSize(){return[this._screen.clientWidth,this._screen.clientHeight]}_clientHasExpectedSize(){const[e,t]=this._currentClientSize();return e==this._expectedClientWidth&&t==this._expectedClientHeight}_handleResize(){this._clientHasExpectedSize()||(window.requestAnimationFrame(()=>{this._updateClip(),this._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500)))}_updateClip(){const e=this._display.clipViewport;let t=this._clipViewport;if(this._scaleViewport&&(t=!1),e!==t&&(this._display.clipViewport=t),t){const e=this._screenSize();this._display.viewportChangeSize(e.w,e.h),this._fixScrollbars(),this._setClippingViewport(e.w{Ne("Disconnection timed out."),this._updateConnectionState("disconnected")},1e3*jo);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}else Ne("Tried changing state of a disconnected RFB object");else Le("Already in state '"+e+"', ignoring")}_fail(e){switch(this._rfbConnectionState){case"disconnecting":Ne("Failed when disconnecting: "+e);break;case"connected":Ne("Failed while connected: "+e);break;case"connecting":Ne("Failed when connecting: "+e);break;default:Ne("RFB failure: "+e);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}_setCapability(e,t){this._capabilities[e]=t,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}_handleMessage(){if(0!==this._sock.rQlen)switch(this._rfbConnectionState){case"disconnected":Ne("Got data while disconnected");break;case"connected":while(1){if(this._flushing)break;if(!this._normalMsg())break;if(0===this._sock.rQlen)break}break;case"connecting":while("connecting"===this._rfbConnectionState)if(!this._initMsg())break;break;default:Ne("Got data while in an invalid state");break}else Me("handleMessage called on an empty receive queue")}_handleKeyEvent(e,t,n){this.sendKey(e,t,n)}_handleMouse(e){if("click"===e.type&&e.target!==this._canvas)return;if(e.stopPropagation(),e.preventDefault(),"click"===e.type||"contextmenu"===e.type)return;let t=We(e.clientX,e.clientY,this._canvas);switch(e.type){case"mousedown":it(this._canvas),this._handleMouseButton(t.x,t.y,!0,1<Qe||Math.abs(i)>Qe)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:e,y:t},this._display.viewportChangePos(n,i))}else if(this._mousePos={x:e,y:t},null==this._mouseMoveTimer){const n=Date.now()-this._mouseLastMoveTime;n>Go?(this._sendMouse(e,t,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(()=>{this._handleDelayedMouseMove()},Go-n)}}_handleDelayedMouseMove(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}_sendMouse(e,t,n){"connected"===this._rfbConnectionState&&(this._viewOnly||fa.messages.pointerEvent(this._sock,this._display.absX(e),this._display.absY(t),n))}_handleWheel(e){if("connected"!==this._rfbConnectionState)return;if(this._viewOnly)return;e.stopPropagation(),e.preventDefault();let t=We(e.clientX,e.clientY,this._canvas),n=e.deltaX,i=e.deltaY;0!==e.deltaMode&&(n*=Ho,i*=Ho),this._accumulatedWheelDeltaX+=n,this._accumulatedWheelDeltaY+=i,Math.abs(this._accumulatedWheelDeltaX)>=Vo&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(t.x,t.y,!0,32),this._handleMouseButton(t.x,t.y,!1,32)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(t.x,t.y,!0,64),this._handleMouseButton(t.x,t.y,!1,64)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=Vo&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(t.x,t.y,!0,8),this._handleMouseButton(t.x,t.y,!1,8)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(t.x,t.y,!0,16),this._handleMouseButton(t.x,t.y,!1,16)),this._accumulatedWheelDeltaY=0)}_fakeMouseMove(e,t,n){this._handleMouseMove(t,n),this._cursor.move(e.detail.clientX,e.detail.clientY)}_handleTapEvent(e,t){let n=We(e.detail.clientX,e.detail.clientY,this._canvas);if(null!==this._gestureLastTapTime&&Date.now()-this._gestureLastTapTime$o)this._handleMouseButton(n.x,n.y,!0,8),this._handleMouseButton(n.x,n.y,!1,8),this._gestureLastMagnitudeY+=$o;while(e.detail.magnitudeY-this._gestureLastMagnitudeY<-$o)this._handleMouseButton(n.x,n.y,!0,16),this._handleMouseButton(n.x,n.y,!1,16),this._gestureLastMagnitudeY-=$o;while(e.detail.magnitudeX-this._gestureLastMagnitudeX>$o)this._handleMouseButton(n.x,n.y,!0,32),this._handleMouseButton(n.x,n.y,!1,32),this._gestureLastMagnitudeX+=$o;while(e.detail.magnitudeX-this._gestureLastMagnitudeX<-$o)this._handleMouseButton(n.x,n.y,!0,64),this._handleMouseButton(n.x,n.y,!1,64),this._gestureLastMagnitudeX-=$o;break;case"pinch":if(this._fakeMouseMove(e,n.x,n.y),t=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),Math.abs(t-this._gestureLastMagnitudeX)>zo){this._handleKeyEvent(Ce.XK_Control_L,"ControlLeft",!0);while(t-this._gestureLastMagnitudeX>zo)this._handleMouseButton(n.x,n.y,!0,8),this._handleMouseButton(n.x,n.y,!1,8),this._gestureLastMagnitudeX+=zo;while(t-this._gestureLastMagnitudeX<-zo)this._handleMouseButton(n.x,n.y,!0,16),this._handleMouseButton(n.x,n.y,!1,16),this._gestureLastMagnitudeX-=zo}this._handleKeyEvent(Ce.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(e.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(e,n.x,n.y),this._handleMouseButton(n.x,n.y,!1,1);break;case"longpress":this._fakeMouseMove(e,n.x,n.y),this._handleMouseButton(n.x,n.y,!1,4);break}break}}_negotiateProtocolVersion(){if(this._sock.rQwait("version",12))return!1;const e=this._sock.rQshiftStr(12).substr(4,7);De("Server ProtocolVersion: "+e);let t=0;switch(e){case"000.000":t=1;break;case"003.003":case"003.006":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"003.889":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+e)}if(t){let e="ID:"+this._repeaterID;while(e.length<250)e+="\0";return this._sock.sendString(e),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);const n="00"+parseInt(this._rfbVersion,10)+".00"+10*this._rfbVersion%10;this._sock.sendString("RFB "+n+"\n"),Le("Sent ProtocolVersion: "+n),this._rfbInitState="Security"}_isSupportedSecurityType(e){const t=[Yo,Jo,Zo,ea,ta,na,ia,ra,oa];return t.includes(e)}_negotiateSecurity(){if(this._rfbVersion>=3.7){const e=this._sock.rQshift8();if(this._sock.rQwait("security type",e,1))return!1;if(0===e)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,!0;const t=this._sock.rQshiftBytes(e);Le("Server security types: "+t),this._rfbAuthScheme=-1;for(let n of t)if(this._isSupportedSecurityType(n)){this._rfbAuthScheme=n;break}if(-1===this._rfbAuthScheme)return this._fail("Unsupported security types (types: "+t+")");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,!0}return this._rfbInitState="Authentication",Le("Authenticating using scheme: "+this._rfbAuthScheme),!0}_handleSecurityReason(){if(this._sock.rQwait("reason length",4))return!1;const e=this._sock.rQshift32();let t="";if(e>0){if(this._sock.rQwait("reason",e,4))return!1;t=this._sock.rQshiftStr(e)}return""!==t?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:t}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+t+")")):(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 e=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(e),this._rfbAuthScheme=Jo,this._negotiateAuthentication()}_negotiateVeNCryptAuth(){if(0==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt version",2))return!1;const e=this._sock.rQshift8(),t=this._sock.rQshift8();if(0!=e||2!=t)return this._fail("Unsupported VeNCrypt version "+e+"."+t);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(1==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt ack",1))return!1;const e=this._sock.rQshift8();if(0!=e)return this._fail("VeNCrypt failure "+e);this._rfbVeNCryptState=2}if(2==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;const e=this._sock.rQshift8();if(e<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=e,this._rfbVeNCryptState=3}if(3==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;const e=[];for(let t=0;t>24,this._rfbAuthScheme>>16,this._rfbAuthScheme>>8,this._rfbAuthScheme]),this._rfbVeNCryptState,!0)}}_negotiatePlainAuth(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;const e=Be(this._rfbCredentials.username),t=Be(this._rfbCredentials.password);return this._sock.send([e.length>>24&255,e.length>>16&255,e.length>>8&255,255&e.length]),this._sock.send([t.length>>24&255,t.length>>16&255,t.length>>8&255,255&t.length]),this._sock.sendString(e),this._sock.sendString(t),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 e=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),t=fa.genDES(this._rfbCredentials.password,e);return this._sock.send(t),this._rfbInitState="SecurityResult",!0}_negotiateARDAuth(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;if(void 0!=this._rfbCredentials.ardPublicKey&&void 0!=this._rfbCredentials.ardCredentials)return this._sock.send(this._rfbCredentials.ardCredentials),this._sock.send(this._rfbCredentials.ardPublicKey),this._rfbCredentials.ardCredentials=null,this._rfbCredentials.ardPublicKey=null,this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("read ard",4))return!1;let e=this._sock.rQshiftBytes(2),t=this._sock.rQshift16();if(this._sock.rQwait("read ard keylength",2*t,4))return!1;let n=this._sock.rQshiftBytes(t),i=this._sock.rQshiftBytes(t),r=window.crypto.getRandomValues(new Uint8Array(t)),s=Array.from(window.crypto.getRandomValues(new Uint8Array(64)),e=>String.fromCharCode(65+e%26)).join("");return this._negotiateARDAuthAsync(e,t,n,i,r,s),!1}_modPow(e,t,n){let i="0x"+Array.from(e,e=>("0"+(255&e).toString(16)).slice(-2)).join(""),r="0x"+Array.from(t,e=>("0"+(255&e).toString(16)).slice(-2)).join(""),s="0x"+Array.from(n,e=>("0"+(255&e).toString(16)).slice(-2)).join(""),o=BigInt(i),a=BigInt(r),c=BigInt(s),l=1n;o%=c;while(a>0)a%2n===1n&&(l=l*o%c),a/=2n,o=o*o%c;let u=l.toString(16);while(u.length/2String.fromCharCode(e)).join(""),i=await window.crypto.subtle.importKey("raw",yo(n),{name:"AES-CBC"},!1,["encrypt"]),r=new Uint8Array(e.length);for(let o=0;o0&&this._sock.rQwait("tunnel capabilities",16*e,4))return!1;if(this._rfbTightVNC=!0,e>0)return this._negotiateTightTunnels(e),!1}if(this._sock.rQwait("sub auth count",4))return!1;const e=this._sock.rQshift32();if(0===e)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*e,4))return!1;const t={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},n=[];for(let i=0;ithis._rfbCredentials),this._rfbRSAAESAuthenticationState.addEventListener("serververification",this._eventHandlers.handleRSAAESServerVerification),this._rfbRSAAESAuthenticationState.addEventListener("credentialsrequired",this._eventHandlers.handleRSAAESCredentialsRequired)),this._rfbRSAAESAuthenticationState.checkInternalEvents(),this._rfbRSAAESAuthenticationState.hasStarted||this._rfbRSAAESAuthenticationState.negotiateRA2neAuthAsync().catch(e=>{"disconnect normally"!==e.message&&this._fail(e.message)}).then(()=>(this.dispatchEvent(new CustomEvent("securityresult")),this._rfbInitState="SecurityResult",!0)).finally(()=>{this._rfbRSAAESAuthenticationState.removeEventListener("serververification",this._eventHandlers.handleRSAAESServerVerification),this._rfbRSAAESAuthenticationState.removeEventListener("credentialsrequired",this._eventHandlers.handleRSAAESCredentialsRequired),this._rfbRSAAESAuthenticationState=null}),!1}_negotiateMSLogonIIAuth(){if(this._sock.rQwait("mslogonii dh param",24))return!1;if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;const e=this._sock.rQshiftBytes(8),t=this._sock.rQshiftBytes(8),n=this._sock.rQshiftBytes(8),i=window.crypto.getRandomValues(new Uint8Array(8)),r=new Uint8Array(this._modPow(e,i,t)),s=new Uint8Array(this._modPow(n,i,t)),o=new fo(s),a=Be(this._rfbCredentials.username).substring(0,255),c=Be(this._rfbCredentials.password).substring(0,63),l=new Uint8Array(256),u=new Uint8Array(64);window.crypto.getRandomValues(l),window.crypto.getRandomValues(u);for(let d=0;d=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=e,!0):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:e}})),this._fail("Security handshake failed"))}_negotiateServerInit(){if(this._sock.rQwait("server initialization",24))return!1;const e=this._sock.rQshift16(),t=this._sock.rQshift16(),n=this._sock.rQshift8(),i=this._sock.rQshift8(),r=this._sock.rQshift8(),s=this._sock.rQshift8(),o=this._sock.rQshift16(),a=this._sock.rQshift16(),c=this._sock.rQshift16(),l=this._sock.rQshift8(),u=this._sock.rQshift8(),h=this._sock.rQshift8();this._sock.rQskipBytes(3);const d=this._sock.rQshift32();if(this._sock.rQwait("server init name",d,24))return!1;let f=this._sock.rQshiftStr(d);if(f=Ue(f,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+d))return!1;const e=this._sock.rQshift16(),t=this._sock.rQshift16(),n=this._sock.rQshift16();this._sock.rQskipBytes(2);const i=16*(e+t+n);if(this._sock.rQwait("TightVNC extended server init header",i,32+d))return!1;this._sock.rQskipBytes(16*e),this._sock.rQskipBytes(16*t),this._sock.rQskipBytes(16*n)}return De("Screen: "+e+"x"+t+", bpp: "+n+", depth: "+i+", bigEndian: "+r+", trueColor: "+s+", redMax: "+o+", greenMax: "+a+", blueMax: "+c+", redShift: "+l+", greenShift: "+u+", blueShift: "+h),this._setDesktopName(f),this._resize(e,t),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(Me("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),fa.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),fa.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}_sendEncodings(){const e=[];e.push(_o.encodingCopyRect),24==this._fbDepth&&(e.push(_o.encodingTight),e.push(_o.encodingTightPNG),e.push(_o.encodingZRLE),e.push(_o.encodingJPEG),e.push(_o.encodingHextile),e.push(_o.encodingRRE)),e.push(_o.encodingRaw),e.push(_o.pseudoEncodingQualityLevel0+this._qualityLevel),e.push(_o.pseudoEncodingCompressLevel0+this._compressionLevel),e.push(_o.pseudoEncodingDesktopSize),e.push(_o.pseudoEncodingLastRect),e.push(_o.pseudoEncodingQEMUExtendedKeyEvent),e.push(_o.pseudoEncodingExtendedDesktopSize),e.push(_o.pseudoEncodingXvp),e.push(_o.pseudoEncodingFence),e.push(_o.pseudoEncodingContinuousUpdates),e.push(_o.pseudoEncodingDesktopName),e.push(_o.pseudoEncodingExtendedClipboard),24==this._fbDepth&&(e.push(_o.pseudoEncodingVMwareCursor),e.push(_o.pseudoEncodingCursor)),fa.messages.clientEncodings(this._sock,e)}_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+")")}}_resumeAuthentication(){setTimeout(this._initMsg.bind(this),0)}_handleSetColourMapMsg(){return Le("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}_handleServerCutText(){if(Le("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);let e=this._sock.rQshift32();if(e=Ie(e),this._sock.rQwait("ServerCutText content",Math.abs(e),8))return!1;if(e>=0){const t=this._sock.rQshiftStr(e);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:t}}))}else{e=Math.abs(e);const t=this._sock.rQshift32();let n=65535&t,i=4278190080&t,r=!!(i&ca);if(r){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(let t=0;t<=15;t++){let e=1<0&&"\0"===r.charAt(r.length-1)&&(r=r.slice(0,-1)),r=r.replace("\r\n","\n"),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:r}}))}}}}return!0}_handleServerFenceMsg(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);let e=this._sock.rQshift32(),t=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",t,9))return!1;t>64&&(Me("Bad payload length ("+t+") in fence response"),t=64);const n=this._sock.rQshiftStr(t);return this._supportsFence=!0,e&1<<31?(e&=3,fa.messages.clientFence(this._sock,e,n),!0):this._fail("Unexpected fence response")}_handleXvpMsg(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);const e=this._sock.rQshift8(),t=this._sock.rQshift8();switch(t){case 0:Ne("XVP Operation Failed");break;case 1:this._rfbXvpVer=e,De("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+t+")");break}return!0}_normalMsg(){let e,t,n;switch(e=this._FBU.rects>0?0:this._sock.rQshift8(),e){case 0:return n=this._framebufferUpdate(),n&&!this._enabledContinuousUpdates&&fa.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),n;case 1:return this._handleSetColourMapMsg();case 2:return Le("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return t=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,t&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),De("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+e+")"),Le("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}while(this._FBU.rects>0){if(null===this._FBU.encoding){if(this._sock.rQwait("rect header",12))return!1;const e=this._sock.rQshiftBytes(12);this._FBU.x=(e[0]<<8)+e[1],this._FBU.y=(e[2]<<8)+e[3],this._FBU.width=(e[4]<<8)+e[5],this._FBU.height=(e[6]<<8)+e[7],this._FBU.encoding=parseInt((e[8]<<24)+(e[9]<<16)+(e[10]<<8)+e[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 _o.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case _o.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case _o.pseudoEncodingCursor:return this._handleCursor();case _o.pseudoEncodingQEMUExtendedKeyEvent:return this._qemuExtKeyEventSupported=!0,!0;case _o.pseudoEncodingDesktopName:return this._handleDesktopName();case _o.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case _o.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}_handleVMwareCursor(){const e=this._FBU.x,t=this._FBU.y,n=this._FBU.width,i=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;const r=this._sock.rQshift8();let s;this._sock.rQshift8();const o=4;if(0==r){const e=-256;if(s=new Array(n*i*o),this._sock.rQwait("VMware cursor classic encoding",n*i*o*2,2))return!1;let t=new Array(n*i);for(let s=0;s>8&255,n=e>>16&255,i=e>>24&255;s[a*o]=t,s[a*o+1]=n,s[a*o+2]=i,s[a*o+3]=255}else(t[a]&e)==e?0==r[a]?(s[a*o]=0,s[a*o+1]=0,s[a*o+2]=0,s[a*o+3]=0):(r[a],s[a*o]=0,s[a*o+1]=0,s[a*o+2]=0,s[a*o+3]=255):(s[a*o]=0,s[a*o+1]=0,s[a*o+2]=0,s[a*o+3]=255)}else{if(1!=r)return Me("The given cursor type is not supported: "+r+" given."),!1;if(this._sock.rQwait("VMware cursor alpha encoding",n*i*4,2))return!1;s=new Array(n*i*o);for(let e=0;e>24&255,s[4*e+1]=t>>16&255,s[4*e+2]=t>>8&255,s[4*e+3]=255&t}}return this._updateCursor(s,e,t,n,i),!0}_handleCursor(){const e=this._FBU.x,t=this._FBU.y,n=this._FBU.width,i=this._FBU.height,r=n*i*4,s=Math.ceil(n/8)*i;let o=r+s;if(this._sock.rQwait("cursor encoding",o))return!1;const a=this._sock.rQshiftBytes(r),c=this._sock.rQshiftBytes(s);let l=new Uint8Array(n*i*4),u=0;for(let h=0;he.charCodeAt(0));return new fo(n).encrypt(t)}}fa.messages={keyEvent(e,t,n){const i=e._sQ,r=e._sQlen;i[r]=4,i[r+1]=n,i[r+2]=0,i[r+3]=0,i[r+4]=t>>24,i[r+5]=t>>16,i[r+6]=t>>8,i[r+7]=t,e._sQlen+=8,e.flush()},QEMUExtendedKeyEvent(e,t,n,i){function r(e){const t=i>>8,n=255&i;return 224===t&&n<127?128|n:e}const s=e._sQ,o=e._sQlen;s[o]=255,s[o+1]=0,s[o+2]=n>>8,s[o+3]=n,s[o+4]=t>>24,s[o+5]=t>>16,s[o+6]=t>>8,s[o+7]=t;const a=r(i);s[o+8]=a>>24,s[o+9]=a>>16,s[o+10]=a>>8,s[o+11]=a,e._sQlen+=12,e.flush()},pointerEvent(e,t,n,i){const r=e._sQ,s=e._sQlen;r[s]=5,r[s+1]=i,r[s+2]=t>>8,r[s+3]=t,r[s+4]=n>>8,r[s+5]=n,e._sQlen+=6,e.flush()},_buildExtendedClipboardFlags(e,t){let n=new Uint8Array(4),i=0,r=0;for(let s=0;s>24,n[1]=0,n[2]=0,n[3]=i,n},extendedClipboardProvide(e,t,n){let i=new ds,r=[];for(let a=0;a>24&255,e.length>>16&255,e.length>>8&255,255&e.length);for(let t=0;tparseInt(e)),i.sort((e,t)=>e-t),r.set(fa.messages._buildExtendedClipboardFlags(t,[]));let s=4;for(let o=0;o>24,r[s+1]=n[i[o]]>>16,r[s+2]=n[i[o]]>>8,r[s+3]=n[i[o]]>>0,s+=4,r[3]|=1<>24,i[r+5]=s>>16,i[r+6]=s>>8,i[r+7]=s,e._sQlen+=8;let o=0,a=t.length;while(a>0){let n=Math.min(a,e._sQbufferSize-e._sQlen);for(let r=0;r>8,s[o+3]=t,s[o+4]=n>>8,s[o+5]=n,s[o+6]=1,s[o+7]=0,s[o+8]=i>>24,s[o+9]=i>>16,s[o+10]=i>>8,s[o+11]=i,s[o+12]=0,s[o+13]=0,s[o+14]=0,s[o+15]=0,s[o+16]=t>>8,s[o+17]=t,s[o+18]=n>>8,s[o+19]=n,s[o+20]=r>>24,s[o+21]=r>>16,s[o+22]=r>>8,s[o+23]=r,e._sQlen+=24,e.flush()},clientFence(e,t,n){const i=e._sQ,r=e._sQlen;i[r]=248,i[r+1]=0,i[r+2]=0,i[r+3]=0,i[r+4]=t>>24,i[r+5]=t>>16,i[r+6]=t>>8,i[r+7]=t;const s=n.length;i[r+8]=s;for(let o=0;o>8,o[a+3]=n,o[a+4]=i>>8,o[a+5]=i,o[a+6]=r>>8,o[a+7]=r,o[a+8]=s>>8,o[a+9]=s,e._sQlen+=10,e.flush()},pixelFormat(e,t,n){const i=e._sQ,r=e._sQlen;let s;s=t>16?32:t>8?16:8;const o=Math.floor(t/3);i[r]=0,i[r+1]=0,i[r+2]=0,i[r+3]=0,i[r+4]=s,i[r+5]=t,i[r+6]=0,i[r+7]=n?1:0,i[r+8]=0,i[r+9]=(1<>8,n[i+3]=t.length;let r=i+4;for(let s=0;s>24,n[r+1]=e>>16,n[r+2]=e>>8,n[r+3]=e,r+=4}e._sQlen+=r-i,e.flush()},fbUpdateRequest(e,t,n,i,r,s){const o=e._sQ,a=e._sQlen;"undefined"===typeof n&&(n=0),"undefined"===typeof i&&(i=0),o[a]=3,o[a+1]=t?1:0,o[a+2]=n>>8&255,o[a+3]=255&n,o[a+4]=i>>8&255,o[a+5]=255&i,o[a+6]=r>>8&255,o[a+7]=255&r,o[a+8]=s>>8&255,o[a+9]=255&s,e._sQlen+=10,e.flush()},xvpOp(e,t,n){const i=e._sQ,r=e._sQlen;i[r]=250,i[r+1]=0,i[r+2]=t,i[r+3]=n,e._sQlen+=4,e.flush()}},fa.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}};var pa=function(){var e=this,t=e._self._c;return t("img",e._b({attrs:{src:e.pathToBrandedImage}},"img",e.$attrs,!1))},_a=[],ga=n("9ce4"),ma=n("907c"),va=n("8535"),ba={props:{fileName:{type:String,required:!0},dark:{type:Boolean,default:!1}},data(){var e,t;const n=this.$store.getters["management/all"](ma["a"].SETTING),i=null===n||void 0===n||null===(e=n.filter(e=>e.id===va["a"].LOGIN_BACKGROUND_LIGHT))||void 0===e||null===(e=e[0])||void 0===e?void 0:e.value,r=null===n||void 0===n||null===(t=n.filter(e=>e.id===va["a"].LOGIN_BACKGROUND_DARK))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.value;return{managementSettings:n,uiLoginBackgroundLight:i,uiLoginBackgroundDark:r}},computed:{...Object(ga["a"])({theme:"prefs/theme"}),brand(){const e=this.managementSettings.filter(e=>e.id===va["a"].BRAND)[0]||{};return e.value},uiLogoLight(){const e=this.managementSettings.filter(e=>e.id===va["a"].LOGO_LIGHT)[0]||{};return e.value},uiLogoDark(){const e=this.managementSettings.filter(e=>e.id===va["a"].LOGO_DARK)[0]||{};return e.value},uiBannerLight(){const e=this.managementSettings.filter(e=>e.id===va["a"].BANNER_LIGHT)[0]||{};return e.value},uiBannerDark(){const e=this.managementSettings.filter(e=>e.id===va["a"].BANNER_DARK)[0]||{};return e.value},defaultPathToBrandedImage(){const e="dark"===this.theme?"dark/":"";try{return n("bfed")(`./${e}${this.fileName}`)}catch{return n("fe4c")("./"+this.fileName)}},pathToBrandedImage(){if("rancher-logo.svg"===this.fileName){if("dark"===this.theme&&this.uiLogoDark)return this.uiLogoDark;if(this.uiLogoLight)return this.uiLogoLight}if("banner.svg"===this.fileName){if("dark"===this.theme&&this.uiBannerDark)return this.uiBannerDark;if(this.uiBannerLight)return this.uiBannerLight}if("login-landscape.svg"===this.fileName){if("dark"===this.theme&&this.uiLoginBackgroundDark)return this.uiLoginBackgroundDark;if(this.uiLoginBackgroundLight)return this.uiLoginBackgroundLight}if(this.brand){if("dark"===this.theme||this.dark)try{return n("78ef")(`./${this.brand}/dark/${this.fileName}`)}catch{}try{return n("21de")(`./${this.brand}/${this.fileName}`)}catch{}return this.defaultPathToBrandedImage}return this.defaultPathToBrandedImage}}},ya=ba,wa=Object(ve["a"])(ya,pa,_a,!1,null,null,null),ka=wa.exports,Ea={components:{BrandImage:ka},props:{url:{type:String,default:""}},data(){return{rfb:null,connected:!1,disconnected:!1}},mounted(){this.$nextTick(()=>{const e=new fa(this.$refs.view,this.url);e.addEventListener("connect",()=>{this.connected=!0}),e.addEventListener("disconnect",()=>{this.disconnected=!0}),this.rfb=e})},methods:{disconnect(){this.rfb.disconnect()},ctrlAltDelete(){this.rfb.sendCtrlAltDel()},sendKey(e,t,n){this.rfb.sendKey(e,t,n)}}},Sa=Ea,Aa=(n("0247"),Object(ve["a"])(Sa,Te,Fe,!1,null,"d269b192",null)),Xa=Aa.exports;const xa={ControlLeft:{label:"Ctrl",value:Ce.XK_Control_L},AltLeft:{label:"Alt",value:Ce.XK_Alt_L}},Ka={Delete:{label:"Del",value:Ce.XK_Delete},PrintScreen:{label:"Print Screen",value:Ce.XK_Print}},Ca={KeyN:{label:"N",value:Ce.XK_n},KeyT:{label:"T",value:Ce.XK_t},KeyW:{label:"W",value:Ce.XK_w},KeyY:{label:"Y",value:Ce.XK_y}},Ta={F1:{label:"F1",value:Ce.XK_F1},F2:{label:"F2",value:Ce.XK_F2},F3:{label:"F3",value:Ce.XK_F3},F4:{label:"F4",value:Ce.XK_F4},F5:{label:"F5",value:Ce.XK_F5},F6:{label:"F6",value:Ce.XK_F6},F7:{label:"F7",value:Ce.XK_F7},F8:{label:"F8",value:Ce.XK_F8},F9:{label:"F9",value:Ce.XK_F9},F10:{label:"F10",value:Ce.XK_F10},F11:{label:"F11",value:Ce.XK_F11},F12:{label:"F12",value:Ce.XK_F12}};var Fa={components:{NovncConsole:Xa},props:{value:{type:Object,required:!0,default:()=>({})}},data(){return{keysRecord:[],vmResource:{}}},async fetch(){this.vmResource=await this.$store.dispatch("cluster/find",{type:a["d"],id:this.id})},computed:{isDown(){return this.isEmpty(this.value)},url(){var e;const t=`${window.location.hostname}:${window.location.port}`;return`wss://${t}${null===(e=this.value)||void 0===e?void 0:e.getVMIApiPath}`},allKeys(){return{...xa,...Ka,...Ca,...Ta}},keymap(){const e={...xa,PrintScreen:Ka.PrintScreen,...Ta};return e.AltLeft.keys={PrintScreen:Ka.PrintScreen,...Ta},e.ControlLeft.keys={AltLeft:{...Object.assign(xa.AltLeft,{}),keys:{Delete:Ka.Delete}},...Ca},e},hasSoftRebootAction(){var e;return!(null===(e=this.vmResource)||void 0===e||null===(e=e.actions)||void 0===e||!e.softreboot)}},methods:{isEmpty(e){return void 0!==e&&0===Object.keys(e).length},close(){this.$refs.novncConsole.disconnect()},update({key:e,pos:t}){this.keysRecord.splice(t,this.keysRecord.length-t,e)},sendKeys(){this.keysRecord.forEach(e=>{this.$refs.novncConsole.sendKey(this.allKeys[e].value,e,!0)}),this.keysRecord.reverse().forEach(e=>{this.$refs.novncConsole.sendKey(this.allKeys[e].value,e,!1)}),this.$refs.popover.isOpen=!1,this.keysRecord=[]},softReboot(){this.vmResource.softrebootVM()}}},Ra=Fa,Ia=(n("6089"),Object(ve["a"])(Ra,xe,Ke,!1,null,"c325098a",null)),Oa=Ia.exports,La={components:{NovncConsoleWrapper:Oa,Loading:g["a"]},layout:"blank",data(){return{id:`${this.$route.params.namespace}/${this.$route.params.vm}`}},async fetch(){await this.$store.dispatch("cluster/find",{type:a["c"],id:this.id})},head(){var e;return{title:null===(e=this.vmi)||void 0===e||null===(e=e.metadata)||void 0===e?void 0:e.name}},computed:{vmi(){return this.$store.getters["cluster/byId"](a["c"],this.id)||[]}},mounted(){window.addEventListener("beforeunload",()=>{this.$refs.console.close()})}},Da=La,Ma=(n("1472"),Object(ve["a"])(Da,Ae,Xe,!1,null,null,null)),Na=Ma.exports,Pa=function(e){s(e),e.metadata=n("9224"),e.addProduct(n("85d6")),e.addAction(o["a"].TABLE,{resource:[a["d"]]},d),e.addAction(o["a"].TABLE,{resource:[a["d"]]},f),e.addRoute({name:a["b"]+"-c-cluster-vm-serialconsole",path:"/:product/c/:cluster/console/:namespace/:vm/serial",component:Se,meta:{product:a["b"]}}),e.addRoute({name:a["b"]+"-c-cluster-vm-vncconsole",path:"/:product/c/:cluster/console/:namespace/:vm/vnc",component:Na,meta:{product:a["b"]}})};t["default"]=Pa},"1d19":function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return _}));var i=n("e24b"),r=n("2cb5");const s={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object","[object FileList]":"filelist"},{toString:o}=Object.prototype;function a(e){if(null===e)return"null";if(void 0===e)return"undefined";let t=s[o.call(e)]||"object";return"object"===t&&(e instanceof Error?t="error":e instanceof Date&&(t="date")),t}function c(e,t){const n=e-t;return(n>0)-(n<0)}const l={undefined:0,null:1,boolean:2,number:3,string:4,array:5,object:6,instance:7,function:8,class:9,date:10};function u(e,t){const n=a(e),i=a(t),r=c(l[n],l[i]);if(r)return r;switch(n){case"boolean":case"number":return c(e,t);case"string":return c(e.localeCompare(t),0);case"array":{const n=e.length,i=t.length,r=Math.min(n,i);for(let s=0;s{for(let s=0;se.match(p)?Object(r["j"])(e,10,"0"):e).join("").trim()}},"1d5f":function(e){e.exports=JSON.parse('{"hasStylesheet":"true"}')},"1ec9":function(e,t,n){var i=n("fa8a"),r=n("44d9"),s=n("1386"),o=n("052a"),a=n("2fab"),c=n("e3f8");function l(e){var t=this.__data__=new i(e);this.size=t.size}l.prototype.clear=r,l.prototype["delete"]=s,l.prototype.get=o,l.prototype.has=a,l.prototype.set=c,e.exports=l},"1fce":function(e,t){function n(e,t){var n=-1,i=null==e?0:e.length,r=Array(i);while(++n-1)||n.indexOf(",")>-1||n.indexOf("/")>-1||i.StringUtilities.containsAny(r,e.specialCharacters))if(!t&&r.indexOf(",")>-1&&-1==r.indexOf("-")&&-1==r.indexOf("/")&&!i.StringUtilities.containsAny(n,e.specialCharacters)){var o=r.split(",");s+=this.i18n.at();for(var a=0;a0&&l.length>0&&(s+=", "),s+=l,s.length>0&&u.length>0&&(s+=", "),s+=u}else{var h=n.split("-");s+=i.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(r,h[0],""),this.formatTime(r,h[1],""))}else s+=this.i18n.atSpace()+this.formatTime(r,n,t);return s},e.prototype.getSecondsDescription=function(){var e=this,t=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),(function(e){return e}),(function(t){return i.StringUtilities.format(e.i18n.everyX0Seconds(),t)}),(function(t){return e.i18n.secondsX0ThroughX1PastTheMinute()}),(function(t){return"0"==t?"":parseInt(t)<20?e.i18n.atX0SecondsPastTheMinute():e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute()}));return t},e.prototype.getMinutesDescription=function(){var e=this,t=this.expressionParts[0],n=this.expressionParts[2],r=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),(function(e){return e}),(function(t){return i.StringUtilities.format(e.i18n.everyX0Minutes(),t)}),(function(t){return e.i18n.minutesX0ThroughX1PastTheHour()}),(function(i){try{return"0"==i&&-1==n.indexOf("/")&&""==t?e.i18n.everyHour():parseInt(i)<20?e.i18n.atX0MinutesPastTheHour():e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour()}catch(r){return e.i18n.atX0MinutesPastTheHour()}}));return r},e.prototype.getHoursDescription=function(){var e=this,t=this.expressionParts[2],n=this.getSegmentDescription(t,this.i18n.everyHour(),(function(t){return e.formatTime(t,"0","")}),(function(t){return i.StringUtilities.format(e.i18n.everyX0Hours(),t)}),(function(t){return e.i18n.betweenX0AndX1()}),(function(t){return e.i18n.atX0()}));return n},e.prototype.getDayOfWeekDescription=function(){var e=this,t=this.i18n.daysOfTheWeek(),n=null;return n="*"==this.expressionParts[5]?"":this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),(function(e){var n=e;return e.indexOf("#")>-1?n=e.substr(0,e.indexOf("#")):e.indexOf("L")>-1&&(n=n.replace("L","")),t[parseInt(n)]}),(function(t){return 1==parseInt(t)?"":i.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(),t)}),(function(t){return e.i18n.commaX0ThroughX1()}),(function(t){var n=null;if(t.indexOf("#")>-1){var i=t.substring(t.indexOf("#")+1),r=null;switch(i){case"1":r=e.i18n.first();break;case"2":r=e.i18n.second();break;case"3":r=e.i18n.third();break;case"4":r=e.i18n.fourth();break;case"5":r=e.i18n.fifth();break}n=e.i18n.commaOnThe()+r+e.i18n.spaceX0OfTheMonth()}else if(t.indexOf("L")>-1)n=e.i18n.commaOnTheLastX0OfTheMonth();else{var s="*"!=e.expressionParts[3];n=s?e.i18n.commaAndOnX0():e.i18n.commaOnlyOnX0()}return n})),n},e.prototype.getMonthDescription=function(){var e=this,t=this.i18n.monthsOfTheYear(),n=this.getSegmentDescription(this.expressionParts[4],"",(function(e){return t[parseInt(e)-1]}),(function(t){return 1==parseInt(t)?"":i.StringUtilities.format(e.i18n.commaEveryX0Months(),t)}),(function(t){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()}),(function(t){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()}));return n},e.prototype.getDayOfMonthDescription=function(){var e=this,t=null,n=this.expressionParts[3];switch(n){case"L":t=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":t=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var r=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(r){var s=parseInt(r[0].replace("W","")),o=1==s?this.i18n.firstWeekday():i.StringUtilities.format(this.i18n.weekdayNearestDayX0(),s.toString());t=i.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),o);break}var a=n.match(/L-(\d{1,2})/);if(a){var c=a[1];t=i.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(),c);break}if("*"==n&&"*"!=this.expressionParts[5])return"";t=this.getSegmentDescription(n,this.i18n.commaEveryDay(),(function(t){return"L"==t?e.i18n.lastDay():e.i18n.dayX0?i.StringUtilities.format(e.i18n.dayX0(),t):t}),(function(t){return"1"==t?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days()}),(function(t){return e.i18n.commaBetweenDayX0AndX1OfTheMonth()}),(function(t){return e.i18n.commaOnDayX0OfTheMonth()}));break}return t},e.prototype.getYearDescription=function(){var e=this,t=this.getSegmentDescription(this.expressionParts[6],"",(function(e){return/^\d+$/.test(e)?new Date(parseInt(e),1).getFullYear().toString():e}),(function(t){return i.StringUtilities.format(e.i18n.commaEveryX0Years(),t)}),(function(t){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()}),(function(t){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()}));return t},e.prototype.getSegmentDescription=function(e,t,n,r,s,o){var a=this,c=null;if(e)if("*"===e)c=t;else if(i.StringUtilities.containsAny(e,["/","-",","]))if(e.indexOf("/")>-1){var l=e.split("/");if(c=i.StringUtilities.format(r(l[1]),l[1]),l[0].indexOf("-")>-1){var u=this.generateBetweenSegmentDescription(l[0],s,n);0!=u.indexOf(", ")&&(c+=", "),c+=u}else if(!i.StringUtilities.containsAny(l[0],["*",","])){var h=i.StringUtilities.format(o(l[0]),n(l[0]));h=h.replace(", ",""),c+=i.StringUtilities.format(this.i18n.commaStartingX0(),h)}}else if(e.indexOf(",")>-1){l=e.split(",");for(var d="",f=0;f0&&l.length>2&&(d+=",",f0&&l.length>1&&(f==l.length-1||2==l.length)&&(d+=this.i18n.spaceAnd()+" "),l[f].indexOf("-")>-1){u=this.generateBetweenSegmentDescription(l[f],(function(e){return a.i18n.commaX0ThroughX1()}),n);u=u.replace(", ",""),d+=u}else d+=n(l[f]);c=i.StringUtilities.format(o(e),d)}else e.indexOf("-")>-1&&(c=this.generateBetweenSegmentDescription(e,s,n));else c=i.StringUtilities.format(o(e),n(e));else c="";return c},e.prototype.generateBetweenSegmentDescription=function(e,t,n){var r="",s=e.split("-"),o=n(s[0]),a=n(s[1]);a=a.replace(":00",":59");var c=t(e);return r+=i.StringUtilities.format(c,o,a),r},e.prototype.formatTime=function(e,t,n){var i=parseInt(e),r="",s=!1;this.options.use24HourTimeFormat||(s=this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime(),r=s?this.getPeriod(i)+" ":" "+this.getPeriod(i),i>12&&(i-=12),0===i&&(i=12));var o=t,a="";return n&&(a=":"+("00"+n).substring(n.length)),""+(s?r:"")+("00"+i.toString()).substring(i.toString().length)+":"+("00"+o.toString()).substring(o.toString().length)+a+(s?"":r)},e.prototype.transformVerbosity=function(e,t){return t||(e=e.replace(new RegExp(", "+this.i18n.everyMinute(),"g"),""),e=e.replace(new RegExp(", "+this.i18n.everyHour(),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,"")),e},e.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},e.locales={},e}();t.ExpressionDescriptor=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.format=function(e){for(var t=[],n=1;n-1}))},e}();t.StringUtilities=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){void 0===t&&(t=!0),this.expression=e,this.dayOfWeekStartIndexZero=t}return e.prototype.parse=function(){var e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},e.prototype.extractParts=function(e){if(!this.expression)throw new Error("Expression is empty");var t=e.trim().split(/[ ]+/);if(t.length<5)throw new Error("Expression has only "+t.length+" part"+(1==t.length?"":"s")+". At least 5 parts are required.");if(5==t.length)t.unshift(""),t.push("");else if(6==t.length)/\d{4}$/.test(t[5])?t.unshift(""):t.push("");else if(t.length>7)throw new Error("Expression has "+t.length+" parts; too many!");return t},e.prototype.normalize=function(e){var t=this;if(e[3]=e[3].replace("?","*"),e[5]=e[5].replace("?","*"),e[2]=e[2].replace("?","*"),0==e[0].indexOf("0/")&&(e[0]=e[0].replace("0/","*/")),0==e[1].indexOf("0/")&&(e[1]=e[1].replace("0/","*/")),0==e[2].indexOf("0/")&&(e[2]=e[2].replace("0/","*/")),0==e[3].indexOf("1/")&&(e[3]=e[3].replace("1/","*/")),0==e[4].indexOf("1/")&&(e[4]=e[4].replace("1/","*/")),0==e[5].indexOf("1/")&&(e[5]=e[5].replace("1/","*/")),0==e[6].indexOf("1/")&&(e[6]=e[6].replace("1/","*/")),e[5]=e[5].replace(/(^\d)|([^#/\s]\d)/g,(function(e){var n=e.replace(/\D/,""),i=n;return t.dayOfWeekStartIndexZero?"7"==n&&(i="0"):i=(parseInt(n)-1).toString(),e.replace(n,i)})),"L"==e[5]&&(e[5]="6"),"?"==e[3]&&(e[3]="*"),e[3].indexOf("W")>-1&&(e[3].indexOf(",")>-1||e[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var i in n)e[5]=e[5].replace(new RegExp(i,"gi"),n[i].toString());var r={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var s in r)e[4]=e[4].replace(new RegExp(s,"gi"),r[s].toString());"0"==e[0]&&(e[0]=""),/\*|\-|\,|\//.test(e[2])||!/\*|\//.test(e[1])&&!/\*|\//.test(e[0])||(e[2]+="-"+e[2]);for(var o=0;o-1&&!/^\*|\-|\,/.test(e[o])){var a=null;switch(o){case 4:a="12";break;case 5:a="6";break;case 6:a="9999";break;default:a=null;break}if(null!=a){var c=e[o].split("/");e[o]=c[0]+"-"+a+"/"+c[1]}}},e.prototype.validate=function(e){this.assertNoInvalidCharacters("DOW",e[5]),this.assertNoInvalidCharacters("DOM",e[3])},e.prototype.assertNoInvalidCharacters=function(e,t){var n=t.match(/[A-KM-VX-Z]+/gi);if(n&&n.length)throw new Error(e+" part contains invalid values: '"+n.toString()+"'")},e}();t.CronParser=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},e.prototype.atX0MinutesPastTheHourGt20=function(){return null},e.prototype.commaMonthX0ThroughMonthX1=function(){return null},e.prototype.commaYearX0ThroughYearX1=function(){return null},e.prototype.use24HourTimeFormatByDefault=function(){return!1},e.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},e.prototype.everyMinute=function(){return"every minute"},e.prototype.everyHour=function(){return"every hour"},e.prototype.atSpace=function(){return"At "},e.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},e.prototype.at=function(){return"At"},e.prototype.spaceAnd=function(){return" and"},e.prototype.everySecond=function(){return"every second"},e.prototype.everyX0Seconds=function(){return"every %s seconds"},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},e.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},e.prototype.everyX0Minutes=function(){return"every %s minutes"},e.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},e.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},e.prototype.everyX0Hours=function(){return"every %s hours"},e.prototype.betweenX0AndX1=function(){return"between %s and %s"},e.prototype.atX0=function(){return"at %s"},e.prototype.commaEveryDay=function(){return", every day"},e.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},e.prototype.commaX0ThroughX1=function(){return", %s through %s"},e.prototype.first=function(){return"first"},e.prototype.second=function(){return"second"},e.prototype.third=function(){return"third"},e.prototype.fourth=function(){return"fourth"},e.prototype.fifth=function(){return"fifth"},e.prototype.commaOnThe=function(){return", on the "},e.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},e.prototype.lastDay=function(){return"the last day"},e.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},e.prototype.commaOnlyOnX0=function(){return", only on %s"},e.prototype.commaAndOnX0=function(){return", and on %s"},e.prototype.commaEveryX0Months=function(){return", every %s months"},e.prototype.commaOnlyInX0=function(){return", only in %s"},e.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},e.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},e.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},e.prototype.firstWeekday=function(){return"first weekday"},e.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},e.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},e.prototype.commaEveryX0Days=function(){return", every %s days"},e.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},e.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},e.prototype.commaEveryHour=function(){return", every hour"},e.prototype.commaEveryX0Years=function(){return", every %s years"},e.prototype.commaStartingX0=function(){return", starting %s"},e.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},e.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},e}();t.en=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(5);i.ExpressionDescriptor.initialize(new r.enLocaleLoader),t.default=i.ExpressionDescriptor;var s=i.ExpressionDescriptor.toString;t.toString=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),r=function(){function e(){}return e.prototype.load=function(e){e["en"]=new i.en},e}();t.enLocaleLoader=r}])}))},"212d":function(e,t,n){var i=n("bf10"),r=n("201b"),s=i(r,"Promise");e.exports=s},"21de":function(e,t,n){var i={"./csp/dark/rancher-logo.svg":"858f","./csp/favicon.png":"44a5","./csp/metadata":"7f57","./csp/metadata.json":"7f57","./csp/rancher-logo.svg":"b5af","./federal/dark/rancher-logo.svg":"0749","./federal/metadata":"66fa","./federal/metadata.json":"66fa","./federal/rancher-logo.svg":"ad96","./rgs/dark/rancher-logo.svg":"b160","./rgs/metadata":"45d2","./rgs/metadata.json":"45d2","./rgs/rancher-logo.svg":"bd3e","./suse/dark/rancher-logo.svg":"d5dc","./suse/favicon.png":"f595","./suse/metadata":"1d5f","./suse/metadata.json":"1d5f","./suse/rancher-logo.svg":"4816"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=s,e.exports=r,r.id="21de"},2357:function(e,t,n){var i=n("e972"),r=/^\s+/;function s(e){return e?e.slice(0,i(e)+1).replace(r,""):e}e.exports=s},2419:function(e,t,n){var i=n("872c"),r=n("aa31"),s=n("7049");function o(e){var t=-1,n=null==e?0:e.length;this.__data__=new i;while(++tr(e)).join(" ")}function r(e){return e=e||"",e.substr(0,1).toUpperCase()+e.substr(1)}function s(e,t,n=" ",i=!1){if(e=""+e,e.length>=t)return e;const r=t-e.length+1,s=new Array(r).join(n).substr(0,r);return i?e+s:s+e}n.d(t,"a",(function(){return i})),n.d(t,"k",(function(){return r})),n.d(t,"j",(function(){return s})),n.d(t,"c",(function(){return a})),n.d(t,"h",(function(){return p})),n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return b})),n.d(t,"g",(function(){return y})),n.d(t,"i",(function(){return E})),n.d(t,"f",(function(){return S})),n.d(t,"e",(function(){return A}));const o={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function a(e){return String(e).replace(/[&<>"']/g,e=>o[e])}function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){e=Math.max(0,e||1);const t=[];let n;if(window.crypto&&window.crypto.getRandomValues){const i=new Uint32Array(e);for(window.crypto.getRandomValues(i),n=0;nt[e%t.length]).join(""):null}function _(e,t=2,n=" ",i=null){e="string"===typeof e?e.split(/\n/):e||[];const r=new Array(t+1).join(n),s=e.map(e=>{let t="",n=e;if(i){const r=e.match(i);r&&(t=r[r.length-1],n=e.substr(r[0].length))}return`${t}${r}${n}`}),o=s.join("\n");return o}const g=/([a-z\d])([A-Z])/g;function m(e){return e.replace(g,"$1_$2").toLowerCase()}const v=/[ _]/g;function b(e){return m(e).replace(v,"-")}function y(e,t=[]){return t.some(t=>{const n=e||"",i=w(t);return n.match(i)})}function w(e,t=!0){return"string"===typeof e?t?new RegExp(`^${c(e)}$`,"i"):new RegExp(""+c(e),"i"):e}const k=/[^."']+|"([^"]*)"|'([^']*)'/g;function E(e){return e.includes('"')||e.includes("'")?e.match(k).map(e=>e.replace(/['"]/g,"")):e.split(".")}function S(e){let t="";for(const n of e)n.includes(".")?t+=`."${n}"`:t+="."+n;return t.startsWith(".")&&(t=t.substr(1)),t}function A(e){const t=/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/;return t.test(e)}},"2d3f":function(e,t,n){e.exports=n.p+"img/login-landscape.911b980e.svg"},"2e63":function(e,t){function n(e,t){var n=-1,i=null==e?0:e.length;while(++n-1}e.exports=r},"3ad3":function(e,t,n){var i=n("4c0b"),r=i(Object.keys,Object);e.exports=r},"3b54":function(e,t,n){var i=n("c364"),r=n("cb86"),s=n("c68c");function o(e,t,n){var o=-1,a=t.length,c={};while(++oDIV,.vm-console>DIV>DIV,BODY,HTML,MAIN{height:100%}",""]),e.exports=t},"40cc":function(e,t,n){var i=n("e697"),r=Object.prototype,s=r.hasOwnProperty;function o(e){var t=this.__data__;return i?void 0!==t[e]:s.call(t,e)}e.exports=o},"413d":function(e,t){function n(e,t){var n=-1,i=e.length;t||(t=Array(i));while(++n=t||n<0||m&&i>=h}function E(){var e=r();if(k(e))return S(e);f=setTimeout(E,w(e))}function S(e){return f=void 0,v&&l?b(e):(l=u=void 0,d)}function A(){void 0!==f&&clearTimeout(f),_=0,l=p=u=f=void 0}function X(){return void 0===f?d:S(r())}function x(){var e=r(),n=k(e);if(l=arguments,u=this,p=e,n){if(void 0===f)return y(p);if(m)return clearTimeout(f),f=setTimeout(E,t),b(p)}return void 0===f&&(f=setTimeout(E,t)),d}return t=s(t)||0,i(n)&&(g=!!n.leading,m="maxWait"in n,h=m?a(s(n.maxWait)||0,t):h,v="trailing"in n?!!n.trailing:v),x.cancel=A,x.flush=X,x}e.exports=l},"44f6":function(e,t,n){"use strict";n.r(t),n.d(t,"OFF",(function(){return c})),n.d(t,"default",(function(){return S}));var i=n("640c"),r=n("e24b"),s=n("bddd"),o=n("907c"),a=n("377f");const c="Off",l="The virtual machine is waiting for resources to become available.",u="VM error",h="Stopping",d="Not Ready",f="Paused",p="This VM has been paused. If you wish to unpause it, please click the Unpause button below. For further details, please check with your system administrator.",_="POD_STATUS_COMPLETED",g="POD_STATUS_SUCCEEDED",m="POD_STATUS_RUNNING",v=[m,_,g],b={Always:"Always",RerunOnFailure:"RerunOnFailure",Halted:"Halted",Manual:"Manual"},y={Start:"Start",Stop:"Stop"},w="This virtual machine will start shortly. Preparing storage, networking, and compute resources.",k={Pending:"Pending",Scheduling:"Scheduling",Scheduled:"Scheduled",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",Unknown:"Unknown"},E=["pod has unbound immediate PersistentVolumeClaims"];class S extends i["a"]{get canStart(){return!this.spec.runStrategy&&!this.spec.running}get canStop(){return!this.spec.runStrategy&&this.spec.running}get runStrategyLabel(){return this.spec.runStrategy||"-"}get cpuCores(){var e,t;const n=this.$getters["byId"](a["c"],this.id);return(null===n||void 0===n||null===(e=n.spec)||void 0===e||null===(e=e.domain)||void 0===e||null===(e=e.cpu)||void 0===e?void 0:e.cores)||(null===(t=this.spec.template)||void 0===t||null===(t=t.spec)||void 0===t||null===(t=t.domain)||void 0===t||null===(t=t.cpu)||void 0===t?void 0:t.cores)}get nodeName(){var e;const t=this.$getters["byId"](a["c"],this.id),n=this.$getters["byId"](o["b"],null===t||void 0===t||null===(e=t.status)||void 0===e?void 0:e.nodeName);return null===n||void 0===n?void 0:n.id}get displayMemory(){var e,t,n;return(null===(e=this.spec.template.spec.domain.resources)||void 0===e||null===(e=e.limits)||void 0===e?void 0:e.memory)||(null===(t=this.spec.template.spec.domain.resources)||void 0===t||null===(t=t.requests)||void 0===t?void 0:t.memory)||(null===(n=this.spec.template.spec.domain.memory)||void 0===n?void 0:n.guest)||"0Gi"}get networksName(){var e;const t=(null===(e=this.spec.template.spec.domain.devices)||void 0===e?void 0:e.interfaces)||[];return t.map(e=>e.name)}get podResource(){const e=this.$getters["all"](o["c"]);return e.find(e=>{var t,n,i;return(null===(t=this.vmi)||void 0===t||null===(t=t.metadata)||void 0===t?void 0:t.name)&&(null===(n=this.vmi)||void 0===n||null===(n=n.metadata)||void 0===n?void 0:n.name)===(null===(i=e.metadata)||void 0===i||null===(i=i.ownerReferences)||void 0===i?void 0:i[0].name)})}get isVMExpectedRunning(){var e,t,n,i;if(null===this||void 0===this||!this.spec)return!1;const{running:r=null,runStrategy:s=null}=this.spec,o=(null===this||void 0===this||null===(e=this.status)||void 0===e?void 0:e.conditions)||[];if(r)return!0;if(null!==s){let e;switch(s){case b.Halted:return!1;case b.Always:return!0;case b.RerunOnFailure:return!("ErrorUnschedulable"!==(null===(t=this.status)||void 0===t?void 0:t.printableStatus)||!o.find(e=>e.message&&e.message.includes(E)))||["Starting","Running"].includes(null===(n=this.status)||void 0===n?void 0:n.printableStatus);case b.Manual:default:return e=new Set(((null===(i=this.status)||void 0===i?void 0:i.stateChangeRequests)||[]).map(e=>null===e||void 0===e?void 0:e.action)),e.has(y.Stop)?!1:!!e.has(y.Start)||(0===e.size?["Starting","Running"].includes(null===(a=this.status)||void 0===a?void 0:a.printableStatus):this.isVMCreated);var a}}return!1}get isPaused(){var e;const t=(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.conditions)||[],n=t.filter(e=>e.type===f).length>0;return n?{status:f,message:p}:null}get isVMError(){const e=Object(r["d"])(this,"status.conditions"),t=Object(s["d"])(e,"type","Failure");return t?{status:u,detailedMessage:t.message}:null}get isError(){var e;const t=Object(r["d"])(this.vmi,"status.conditions"),n=Object(s["d"])(t,"type","Failure");return n?{status:"VMI error",detailedMessage:n.message}:((this.vmi||this.isVMCreated)&&this.podResource,null===this||void 0===this||null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)}get isRunning(){var e,t;const n=Object(r["d"])(this.vmi,"status.conditions"),i="True"===(null===(e=Object(s["d"])(n,"type","Ready"))||void 0===e?void 0:e.status);return(null===(t=this.vmi)||void 0===t||null===(t=t.status)||void 0===t?void 0:t.phase)===k.Running&&i?{status:k.Running}:null}get isNotReady(){var e;const t=Object(r["d"])(this.vmi,"status.conditions"),n=Object(s["d"])(t,"type","Ready");return"False"===(null===n||void 0===n?void 0:n.status)&&(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)===k.Running?{status:d}:null}get isBeingStopped(){var e;return this&&!this.isVMExpectedRunning&&this.isVMCreated&&(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)!==k.Succeeded?{status:h}:null}get isStarting(){if(this.isVMExpectedRunning&&this.isVMCreated){if(this.podResource){const e=this.podResource.getPodStatus;if(!v.includes(null===e||void 0===e?void 0:e.status))return{...e,status:"Starting",message:w,detailedMessage:null===e||void 0===e?void 0:e.message,pod:this.podResource}}return{status:"Starting",message:w,pod:this.podResource}}return null}get isOff(){return this.isVMExpectedRunning?null:{status:c}}get otherState(){var e,t,n;const i=this.vmi&&[k.Scheduling,k.Scheduled].includes(null===(e=this.vmi)||void 0===e||null===(e=e.status)||void 0===e?void 0:e.phase)&&{status:"Starting",message:w}||this.vmi&&(null===(t=this.vmi.status)||void 0===t?void 0:t.phase)===k.Pending&&{status:"VMI_WAITING",message:l}||this.vmi&&(null===(n=this.vmi)||void 0===n||null===(n=n.status)||void 0===n?void 0:n.phase)===k.Failed&&{status:"VMI_ERROR"}||this.isVMExpectedRunning&&!this.isVMCreated&&{status:"Pending"}||{status:"UNKNOWN"};return i}get isVMCreated(){var e;return!(null===this||void 0===this||null===(e=this.status)||void 0===e||!e.created)}get getDataVolumeTemplates(){return null===Object(r["d"])(this,"spec.volumeClaimTemplates")?[]:this.spec.volumeClaimTemplates}get vmi(){return this.$getters["byId"](a["c"],this.id)}get actualState(){var e,t,n,i,r,s,o,a,c,l,u,h;if(null!==this&&void 0!==this&&null!==(e=this.metadata)&&void 0!==e&&e.deletionTimestamp)return"Terminating";if(null!==this&&void 0!==this&&null!==(t=this.vmi)&&void 0!==t&&t.migrationState&&"Failed"!==this.vmi.migrationState.status)return this.vmi.migrationState.status;const d=(null===(n=this.isPaused)||void 0===n?void 0:n.status)||(null===(i=this.isVMError)||void 0===i?void 0:i.status)||(null===(r=this.isBeingStopped)||void 0===r?void 0:r.status)||(null===(s=this.isOff)||void 0===s?void 0:s.status)||(null===(o=this.isError)||void 0===o?void 0:o.status)||(null===(a=this.isRunning)||void 0===a?void 0:a.status)||(null===(c=this.isNotReady)||void 0===c?void 0:c.status)||(null===(l=this.isStarting)||void 0===l?void 0:l.status)||(null===(u=this.isWaitingForVMI)||void 0===u?void 0:u.state)||(null===(h=this.otherState)||void 0===h?void 0:h.status);return d}get stateDisplay(){return this.actualState}}},"45d2":function(e){e.exports=JSON.parse('{"hasStylesheet":"false"}')},4774:function(e,t,n){var i=n("cd68"),r=n("500b"),s=n("ecf6");function o(e,t){return s(r(e,t,i),e+"")}e.exports=o},4778:function(e,t,n){var i=n("4b2c"),r=n("986c"),s=n("a4fc"),o=n("659f"),a=n("6944"),c=n("5e52"),l=1,u=2,h="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Map]",_="[object Number]",g="[object RegExp]",m="[object Set]",v="[object String]",b="[object Symbol]",y="[object ArrayBuffer]",w="[object DataView]",k=i?i.prototype:void 0,E=k?k.valueOf:void 0;function S(e,t,n,i,k,S,A){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!S(new r(e),new r(t)));case h:case d:case _:return s(+e,+t);case f:return e.name==t.name&&e.message==t.message;case g:case v:return e==t+"";case p:var X=a;case m:var x=i&l;if(X||(X=c),e.size!=t.size&&!x)return!1;var K=A.get(e);if(K)return K==t;i|=u,A.set(e,t);var C=o(X(e),X(t),i,k,S,A);return A["delete"](e),C;case b:if(E)return E.call(e)==E.call(t)}return!1}e.exports=S},4816:function(e,t,n){e.exports=n.p+"img/rancher-logo.055089a3.svg"},"489a":function(e,t){var n=Object.prototype,i=n.hasOwnProperty;function r(e,t){return null!=e&&i.call(e,t)}e.exports=r},"494f":function(e,t){function n(e){return function(t){return e(t)}}e.exports=n},"4a83":function(e,t,n){var i=n("d3e6"),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,o=i((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,(function(e,n,i,r){t.push(i?r.replace(s,"$1"):n||e)})),t}));e.exports=o},"4ac6":function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"b",(function(){return s})),n.d(t,"e",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"d",(function(){return l}));const i="field.cattle.io/name",r="field.cattle.io/description",s="field.cattle.io/publicEndpoints",o=/cattle\.io\//,a=[o],c=[o],l={CLOUD_INIT:"harvesterhci.io/cloud-init-template",CLOUD_PROVIDER_IPAM:"cloudprovider.harvesterhci.io/ipam",NETWORK_ROUTE:"network.harvesterhci.io/route",IMAGE_NAME:"harvesterhci.io/image-name",NETWORK_TYPE:"network.harvesterhci.io/type",PRIMARY_SERVICE:"cloudprovider.harvesterhci.io/primary-service"}},"4b2c":function(e,t,n){var i=n("201b"),r=i.Symbol;e.exports=r},"4b48":function(e,t){function n(e,t){return e.has(t)}e.exports=n},"4b7a":function(e,t,n){var i=n("effc"),r=n("280a"),s=n("cd68"),o=n("c316"),a=n("d440");function c(e){return"function"==typeof e?e:null==e?s:"object"==typeof e?o(e)?r(e[0],e[1]):i(e):a(e)}e.exports=c},"4c0b":function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},"4efd":function(e,t,n){var i=n("d856"),r=n("54f6"),s=n("f9f5"),o=n("40cc"),a=n("994b");function c(e){var t=-1,n=null==e?0:e.length;this.clear();while(++te.replace(/^ui-/,""),mangleWrite:e=>"ui-"+e}),r("pcs","",{asCookie:a,asUserPreference:!1}),r("locale","en-us",{asCookie:a}),r("keymap","sublime",{options:["sublime","emacs","vim"]}),r("per-page",100,{options:[10,25,50,100],parseJSON:o})),u=(r("logs-wrap",!0,{parseJSON:o}),r("logs-time",!0,{parseJSON:o}),r("logs-range","30 minutes",{parseJSON:o}),r("hide-repos",[],{parseJSON:o}),r("hide-desc",[],{parseJSON:o}),r("hide-sensitive",!0,{options:[!0,!1],parseJSON:o}),r("show-pre-release",!1,{options:[!1,!0],parseJSON:o}),r("chart-mode","featured",{parseJSON:o}),r("date-format","ddd, MMM D YYYY",{options:["ddd, MMM D YYYY","ddd, D MMM YYYY","D/M/YYYY","M/D/YYYY","YYYY-MM-DD"]}),r("time-format","h:mm:ss a",{options:["h:mm:ss a","HH:mm:ss"]}),r("time-zone","local"),r("dev",!1,{parseJSON:o})),h=r("view-in-api",!1,{parseJSON:o,inheritFrom:u}),d=(r("all-namespaces",!1,{parseJSON:o,inheritFrom:u}),r("theme-shortcut",!1,{parseJSON:o,inheritFrom:u}),r("last-visited","home",{parseJSON:o}),r("seen-whatsnew","",{parseJSON:o}),r("read-whatsnew","",{parseJSON:o}),r("after-login-route","home",{parseJSON:o}),r("home-page-cards",{},{parseJSON:o}),r("plugin-developer",!1,{parseJSON:o,inheritFrom:u}),"rke1"),f="rke2";r("provisioner",f,{options:[d,f]}),r("scale-pool-prompt",null,{parseJSON:o})},"500b":function(e,t,n){var i=n("cda3"),r=Math.max;function s(e,t,n){return t=r(void 0===t?e.length-1:t,0),function(){var s=arguments,o=-1,a=r(s.length-t,0),c=Array(a);while(++o=l&&(d=c,f=!1,t=new i(t));e:while(++h0&&n(u)?t>1?s(u,t-1,n,o,a):i(a,u):o||(a[a.length]=u)}return a}e.exports=s},"629b":function(e,t,n){var i=n("6bcf"),r=1/0;function s(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}e.exports=s},"640c":function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var i=n("4ac6"),r=n("8eaf"),s=n.n(r),o=n("7fd6"),a=n.n(o),c=n("8bbf"),l=n.n(c),u=n("2cb5"),h=n("9c09");function d(e){const t=["state","name","description","labels","annotations"];return t.forEach(t=>delete e[t]),e}class f extends h["b"]{constructor(e,t,n=null,i=!1){const r=d(e);super(r,t,n,i)}get labels(){var e;const t=(null===(e=this.metadata)||void 0===e?void 0:e.labels)||{};return s()(t,(e,t)=>Object(u["g"])(t,i["e"]))}setLabels(e){this.metadata||(this.metadata={});const t=this.metadata.labels||{},n=a()(t,(e,t)=>Object(u["g"])(t,i["e"]));l.a.set(this.metadata,"labels",{...n,...e})}setLabel(e,t){var n;t?(this.metadata||(this.metadata={}),this.metadata.labels||(this.metadata.labels={}),l.a.set(this.metadata.labels,e,t)):null!==(n=this.metadata)&&void 0!==n&&n.labels&&(l.a.set(this.metadata.labels,e,void 0),delete this.metadata.labels[e])}get annotations(){var e;const t=(null===(e=this.metadata)||void 0===e?void 0:e.annotations)||{};return s()(t,(e,t)=>Object(u["g"])(t,i["a"]))}setAnnotations(e){this.metadata||(this.metadata={});const t=this.metadata.annotations||{},n=a()(t,(e,t)=>Object(u["g"])(t,i["a"]));l.a.set(this.metadata,"annotations",{...n,...e})}setAnnotation(e,t){var n;t?(this.metadata||(this.metadata={}),this.metadata.annotations||(this.metadata.annotations={}),l.a.set(this.metadata.annotations,e,t)):null!==(n=this.metadata)&&void 0!==n&&n.annotations&&(l.a.set(this.metadata.annotations,e,void 0),delete this.metadata.annotations[e])}get state(){var e;return(null===(e=this.stateObj)||void 0===e?void 0:e.name)||"unknown"}get description(){var e,t;return(null===(e=this.metadata)||void 0===e||null===(e=e.annotations)||void 0===e?void 0:e[i["c"]])||(null===(t=this.spec)||void 0===t?void 0:t.description)||this._description}}n("bddd"),n("7838");var p=n("e24b");h["b"];const _=["metadata.clusterName","metadata.creationTimestamp","metadata.deletionGracePeriodSeconds","metadata.deletionTimestamp","metadata.finalizers","metadata.generateName","metadata.generation","metadata.initializers","metadata.managedFields","metadata.ownerReferences","metadata.resourceVersion","metadata.relationships","metadata.selfLink","metadata.state","metadata.uid","spec.versions.schema","status","stringData","links","_name","_labels","_annotations"];const g=["metadata.resourceVersion","metadata.fields","metadata.clusterName","metadata.deletionGracePeriodSeconds","metadata.generateName"],m=_.filter(e=>!g.includes(e));class v extends f{get name(){var e;return(null===(e=this.metadata)||void 0===e?void 0:e.name)||this._name}get namespace(){var e;return null===(e=this.metadata)||void 0===e?void 0:e.namespace}get description(){var e,t;return(null===(e=this.metadata)||void 0===e||null===(e=e.annotations)||void 0===e?void 0:e[i["c"]])||(null===(t=this.spec)||void 0===t?void 0:t.description)||this._description}set description(e){var t;null!==(t=this.metadata)&&void 0!==t&&t.annotations&&(this.metadata.annotations[i["c"]]=e),this.spec&&(this.spec.description=e),this._description=e}cleanForSave(e,t){const n=super.cleanForSave(e);for(const i of m)Object(p["c"])(n,i);return n}}},6552:function(e,t,n){var i=n("51db"),r=n("0f8f"),s=n("cc7f");function o(e,t){return null==e?e:i(e,r(t),s)}e.exports=o},"659f":function(e,t,n){var i=n("2419"),r=n("9b25"),s=n("4b48"),o=1,a=2;function c(e,t,n,c,l,u){var h=n&o,d=e.length,f=t.length;if(d!=f&&!(h&&f>d))return!1;var p=u.get(e),_=u.get(t);if(p&&_)return p==t&&_==e;var g=-1,m=!0,v=n&a?new i:void 0;u.set(e,t),u.set(t,e);while(++g0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}e.exports=s},"907a":function(e,t){var n=Object.prototype,i=n.toString;function r(e){return i.call(e)}e.exports=r},"907c":function(e,t,n){"use strict";n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return d}));const i={PREFERENCE:"userpreference",SCHEMA_DEFINITION:"schemaDefinition"},r="node",s="pod",o={ROLE:"rbac.authorization.k8s.io.role",CLUSTER_ROLE:"rbac.authorization.k8s.io.clusterrole",ROLE_BINDING:"rbac.authorization.k8s.io.rolebinding",CLUSTER_ROLE_BINDING:"rbac.authorization.k8s.io.clusterrolebinding"},a={DEPLOYMENT:"apps.deployment",CRON_JOB:"batch.cronjob",DAEMON_SET:"apps.daemonset",JOB:"batch.job",STATEFUL_SET:"apps.statefulset",REPLICA_SET:"apps.replicaset",REPLICATION_CONTROLLER:"replicationcontroller"},{DAEMON_SET:c,CRON_JOB:l,JOB:u,...h}=a,d={AUTH_CONFIG:"management.cattle.io.authconfig",CATALOG_TEMPLATE:"management.cattle.io.catalogtemplate",CLUSTER:"management.cattle.io.cluster",CLUSTER_ROLE_TEMPLATE_BINDING:"management.cattle.io.clusterroletemplatebinding",FEATURE:"management.cattle.io.feature",KONTAINER_DRIVER:"management.cattle.io.kontainerdriver",MULTI_CLUSTER_APP:"management.cattle.io.multiclusterapp",NODE:"management.cattle.io.node",NODE_DRIVER:"management.cattle.io.nodedriver",NODE_POOL:"management.cattle.io.nodepool",NODE_TEMPLATE:"management.cattle.io.nodetemplate",PROJECT:"management.cattle.io.project",PROJECT_ROLE_TEMPLATE_BINDING:"management.cattle.io.projectroletemplatebinding",ROLE_TEMPLATE:"management.cattle.io.roletemplate",SETTING:"management.cattle.io.setting",USER:"management.cattle.io.user",TOKEN:"management.cattle.io.token",GLOBAL_ROLE:"management.cattle.io.globalrole",GLOBAL_ROLE_BINDING:"management.cattle.io.globalrolebinding",PSA:"management.cattle.io.podsecurityadmissionconfigurationtemplate",MANAGED_CHART:"management.cattle.io.managedchart",USER_NOTIFICATION:"management.cattle.io.rancherusernotification",GLOBAL_DNS_PROVIDER:"management.cattle.io.globaldnsprovider",RKE_TEMPLATE:"management.cattle.io.clustertemplate",RKE_TEMPLATE_REVISION:"management.cattle.io.clustertemplaterevision",CLUSTER_PROXY_CONFIG:"management.cattle.io.clusterproxyconfig"}},9224:function(e){e.exports=JSON.parse('{"name":"kubevirt-dashboard-extension","description":"SUSE Edge: KubeVirt extension for Rancher Dashboard","icon":"https://raw.githubusercontent.com/cncf/artwork/master/projects/kubevirt/icon/color/kubevirt-icon-color.svg","version":"1.1.0","license":"Apache-2.0","private":false,"rancher":{"annotations":{"catalog.cattle.io/display-name":"KubeVirt","catalog.cattle.io/rancher-version":">= v2.9.0","catalog.cattle.io/ui-extensions-version":">= 2.0.1","catalog.cattle.io/kube-version":">= v1.26.0-0"}},"scripts":{"dev":"./node_modules/.bin/nuxt dev","nuxt":"./node_modules/.bin/nuxt"},"engines":{"node":">=16"},"devDependencies":{"@vue/cli-plugin-babel":"4.5.18","@vue/cli-service":"4.5.18","@vue/cli-plugin-typescript":"4.5.18"},"browserslist":["> 1%","last 2 versions","not dead"]}')},9243:function(e,t,n){var i=n("405d"),r=n("a9e0"),s=n("212d"),o=n("3819"),a=n("e3e5"),c=n("0e19"),l=n("735f"),u="[object Map]",h="[object Object]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",_="[object DataView]",g=l(i),m=l(r),v=l(s),b=l(o),y=l(a),w=c;(i&&w(new i(new ArrayBuffer(1)))!=_||r&&w(new r)!=u||s&&w(s.resolve())!=d||o&&w(new o)!=f||a&&w(new a)!=p)&&(w=function(e){var t=c(e),n=t==h?e.constructor:void 0,i=n?l(n):"";if(i)switch(i){case g:return _;case m:return u;case v:return d;case b:return f;case y:return p}return t}),e.exports=w},"927d":function(e,t,n){var i=n("1ec9"),r=n("2e63"),s=n("73bd"),o=n("b4f4"),a=n("42b6"),c=n("1ab6"),l=n("413d"),u=n("0233"),h=n("0634"),d=n("b650"),f=n("cc5e"),p=n("9243"),_=n("dd09"),g=n("ecda"),m=n("b03d"),v=n("c316"),b=n("dda8"),y=n("35bb"),w=n("b506"),k=n("fe22"),E=n("0652"),S=n("cc7f"),A=1,X=2,x=4,K="[object Arguments]",C="[object Array]",T="[object Boolean]",F="[object Date]",R="[object Error]",I="[object Function]",O="[object GeneratorFunction]",L="[object Map]",D="[object Number]",M="[object Object]",N="[object RegExp]",P="[object Set]",U="[object String]",B="[object Symbol]",j="[object WeakMap]",Q="[object ArrayBuffer]",G="[object DataView]",V="[object Float32Array]",H="[object Float64Array]",z="[object Int8Array]",$="[object Int16Array]",q="[object Int32Array]",W="[object Uint8Array]",Y="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",ee={};function te(e,t,n,C,T,F){var R,L=t&A,D=t&X,N=t&x;if(n&&(R=T?n(e,C,T,F):n(e)),void 0!==R)return R;if(!w(e))return e;var P=v(e);if(P){if(R=_(e),!L)return l(e,R)}else{var U=p(e),B=U==I||U==O;if(b(e))return c(e,L);if(U==M||U==K||B&&!T){if(R=D||B?{}:m(e),!L)return D?h(e,a(R,e)):u(e,o(R,e))}else{if(!ee[U])return T?e:{};R=g(e,U,L)}}F||(F=new i);var j=F.get(e);if(j)return j;F.set(e,R),k(e)?e.forEach((function(i){R.add(te(i,t,n,i,e,F))})):y(e)&&e.forEach((function(i,r){R.set(r,te(i,t,n,r,e,F))}));var Q=N?D?f:d:D?S:E,G=P?void 0:Q(e);return r(G||e,(function(i,r){G&&(r=i,i=e[r]),s(R,r,te(i,t,n,r,e,F))})),R}ee[K]=ee[C]=ee[Q]=ee[G]=ee[T]=ee[F]=ee[V]=ee[H]=ee[z]=ee[$]=ee[q]=ee[L]=ee[D]=ee[M]=ee[N]=ee[P]=ee[U]=ee[B]=ee[W]=ee[Y]=ee[J]=ee[Z]=!0,ee[R]=ee[I]=ee[j]=!1,e.exports=te},"930a":function(e,t,n){var i=n("e902"),r=Array.prototype,s=r.splice;function o(e){var t=this.__data__,n=i(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():s.call(t,n,1),--this.size,!0}e.exports=o},"94a3":function(e,t,n){var i=n("5fe6"),r=n("6290"),s=n("4774"),o=n("35d9"),a=s((function(e,t){return o(e)?i(e,r(t,1,o,!0)):[]}));e.exports=a},"94dd":function(e,t,n){var i=n("1001");function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}e.exports=r},"959e":function(e,t,n){"use strict";n("e7e6")},"986c":function(e,t,n){var i=n("201b"),r=i.Uint8Array;e.exports=r},"98d3":function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return h})),n.d(t,"f",(function(){return d})),n.d(t,"e",(function(){return p}));const i="undefined"===typeof window?"server":window.navigator.platform.toLowerCase(),r="undefined"===typeof window?"server":window.navigator.userAgent,s=(i.includes("linux")||i.includes("unix"),i.includes("mac")),o=(i.includes("win"),s?"metaKey":"ctrlKey"),a=o,c="shiftKey";function l(e){return!!e[o]}function u(e){return!!e[a]}function h(e){return!!e[c]}function d(e){return e.ctrlKey&&2===e.button}r.includes("Gecko/");const f=r.includes("Chrome/"),p=(!f&&r.includes("AppleWebKit/"),!f&&r.includes("Safari/"));/Android|webOS|iPhone|iPad|iPod|IEMobile/i.test(r)},"994b":function(e,t,n){var i=n("e697"),r="__lodash_hash_undefined__";function s(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?r:t,this}e.exports=s},"9b25":function(e,t){function n(e,t){var n=-1,i=null==e?0:e.length;while(++nd&&r.push(n["i18n/t"](`validation.dns.${a}.tooLongLabel`,{key:t,max:d})),r}function g(e,t,n,i,r=[]){const{nullable:s,required:o,type:a="",minLength:l,maxLength:u,min:h,max:d}=t,p=e?Object(f["d"])(e,"length"):0;if(!s&&o&&("object"===typeof e&&c()(e)||!e&&0!==e))return r.push(i["i18n/t"]("validation.required",{key:n})),r;if(null===e)return r;const _=0===a.indexOf("array[")?"arrayLength":"stringLength";let g=l,m=u;return g&&m?(pm)&&(g===m?r.push(i["i18n/t"](`validation.${_}.exactly`,{key:n,count:g})):r.push(i["i18n/t"](`validation.${_}.between`,{key:n,min:g,max:m}))):g&&pm&&r.push(i["i18n/t"](`validation.${_}.max`,{key:n,count:m})),g=h,m=d,null!==e&&g&&m?(em)&&(g===m?r.push(i["i18n/t"]("validation.number.exactly",{key:n,val:m})):r.push(i["i18n/t"]("validation.number.between",{key:n,min:g,max:m}))):g&&em&&r.push(i["i18n/t"]("validation.number.max",{key:n,val:m})),r}function m(e,t,n,i,r=[]){const{validChars:s,invalidChars:o}=t,a=[];if(s&&a.push(`[^${t.validChars}]`),o&&a.push(`[${t.invalidChars}]`),a.length){const t=new RegExp(`(${a.join("|")})`,"g");let s=e.match(t);s&&(s=d()(s).map(e=>" "===e?"[space]":e),r.push(i["i18n/t"]("validation.chars",{key:n,count:s.length,chars:s.join(" ")})))}return r}function v(e,t,n,i,r=[]){i=i||{};const{max:s=253,restricted:o=!1}=i;"."===e.slice(0,1)&&r.push(n["i18n/t"]("validation.dns.hostname.startDot",{key:t})),o&&e.length>1&&"."===e.slice(-1)&&r.push(n["i18n/t"]("validation.dns.hostname.endDot",{key:t})),0===e.length&&r.push(n["i18n/t"]("validation.dns.hostname.empty",{key:t})),e.length>s&&r.push(n["i18n/t"]("validation.dns.hostname.tooLong",{key:t,max:s}));const a=e.split(/\./);let c;for(let l=0;l{const{name:s,nodePort:o,port:a,targetPort:l}=e,u=i+1;if(r.length>1&&c()(s)&&n.push(t["i18n/t"]("validation.service.ports.name.required",{position:u})),!c()(s)){const e=b(s,"name",t,void 0,n);c()(e)||(n=n.length&&n.length>0?[...n,...e]:e)}if(o){const e=parseInt(o,10);isNaN(e)&&n.push(t["i18n/t"]("validation.service.ports.nodePort.requiredInt",{position:u}))}if(a){const e=parseInt(a,10);isNaN(e)&&n.push(t["i18n/t"]("validation.service.ports.port.requiredInt",{position:u}))}else n.push(t["i18n/t"]("validation.service.ports.port.required",{position:u}));if(l){const e=t["i18n/t"]("validation.service.ports.targetPort.ianaAt",{position:u}),i=parseInt(l,10),r=new RegExp("^\\d+$"),s=r.test(l);if(s)(i<1||i>65535)&&n.push(t["i18n/t"]("validation.service.ports.targetPort.between",{position:u}));else{const i={ianaServiceName:!0,maxLength:15,validChars:"A-Za-z0-9-"},r=b(l,e,t,i,n);c()(r)||n.push(...r)}}else n.push(t["i18n/t"]("validation.service.ports.targetPort.required",{position:u}))}),n)}function k(e,t,n,i){const r=["ClusterIP","NodePort","LoadBalancer"],s=null===e||void 0===e?void 0:e.type;return r.includes(s),n}function E(e,t,n,i){if("ExternalName"===(null===e||void 0===e?void 0:e.type))if(c()(null===e||void 0===e?void 0:e.externalName))n.push(t["i18n/t"]("validation.service.externalName.none"));else{const i=v(e.externalName,"ExternalName",t,void 0,n);c()(i)||(n=n.length&&n.length>0?[...n,...i]:i)}return n}var S=n("d66a"),A=n.n(S);function X(e,t,n,i){return c()(null===e||void 0===e?void 0:e.groups)&&n.push(t["i18n/t"]("validation.prometheusRule.groups.required")),n}function x(e=[],t,n,i){return e.forEach((e,i)=>{const r=i+1;c()(null===e||void 0===e?void 0:e.name)&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.name",{index:r})),c()(null===e||void 0===e?void 0:e.rules)?n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.singleEntry",{index:r})):e.rules.forEach((e,i)=>{const s=i+1;A()(e,"alert")&&c()(null===e||void 0===e?void 0:e.alert)?n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.alertName",{groupIndex:r,ruleIndex:s})):A()(e,"record")&&c()(null===e||void 0===e?void 0:e.record)&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.recordName",{groupIndex:r,ruleIndex:s})),(A()(e,"expr")&&c()(e.expr)||!A()(e,"expr"))&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.expr",{groupIndex:r,ruleIndex:s})),A()(e,"alert")&&(A()(e,"labels")&&c()(e.labels)||!A()(e,"labels"))&&n.push(t["i18n/t"]("validation.prometheusRule.groups.valid.rule.labels",{groupIndex:r,ruleIndex:s}))})}),n}function K(e,t,n,i){c()(null===e||void 0===e?void 0:e.match)&&c()(null===e||void 0===e?void 0:e["match_re"])&&n.push(t["i18n/t"]("validation.monitoring.route.match"))}function C(e,t,n,i,r){/^\d+[hms]$/.test(e)||n.push(t["i18n/t"]("validation.monitoring.route.interval",{key:r}))}function T(e,t,n){let i;i=e.jobTemplate?Object(f["d"])(e,"jobTemplate.spec.template.spec"):Object(f["d"])(e,"template.spec"),i.containers&&i.containers.length?i.containers.forEach(e=>{e&&!e.image&&n.push(t["i18n/t"]("workload.validation.containerImage",{name:e.name}))}):n.push(t["i18n/t"]("validation.required",{key:t["i18n/t"]("workload.container.titles.containers")}))}var F=n("2105"),R=n.n(F);function I(e="",t,n){try{R.a.toString(e)}catch(i){n.push(t["i18n/t"]("validation.invalidCron"))}}function O(e,t,n){if(!e)return;const{podAffinity:i,podAntiAffinity:r}=e;if(i&&!Object(f["e"])(i)){const{preferredDuringSchedulingIgnoredDuringExecution:e=[],requiredDuringSchedulingIgnoredDuringExecution:r=[]}=i;e.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.affinityTitle"),rules:t["i18n/t"]("validation.podAffinity.preferredDuringSchedulingIgnoredDuringExecution")};L(e,r,t,n);const{podAffinityTerm:s={}}=e;D(s,r,t,n),M(s,r,t,n)}),r.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.affinityTitle"),rules:t["i18n/t"]("validation.podAffinity.requiredDuringSchedulingIgnoredDuringExecution")};D(e,r,t,n),M(e,r,t,n)})}if(r&&!Object(f["e"])(r)){const{preferredDuringSchedulingIgnoredDuringExecution:e=[],requiredDuringSchedulingIgnoredDuringExecution:i=[]}=r;e.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.antiAffinityTitle"),rules:t["i18n/t"]("validation.podAffinity.preferredDuringSchedulingIgnoredDuringExecution")};L(e,r,t,n);const{podAffinityTerm:s={}}=e;D(s,r,t,n),M(s,r,t,n)}),i.forEach((e,i)=>{const r={index:i,group:t["i18n/t"]("validation.podAffinity.antiAffinityTitle"),rules:t["i18n/t"]("validation.podAffinity.requiredDuringSchedulingIgnoredDuringExecution")};D(e,r,t,n),M(e,r,t,n)})}}function L(e,t,n,i){const{weight:r=1}=e;("number"!==typeof r||r>100||r<1)&&i.push(n["i18n/t"]("validation.number.between",{key:n["i18n/t"]("workload.scheduling.matchExpressions.weight"),min:1,max:100,...t}))}function D(e,t,n,i){const{topologyKey:r}=e,s=RegExp("([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]");r&&s.test(r)||i.push(n["i18n/t"]("validation.podAffinity.topologyKey",t))}function M(e,t,n,i){const r=["In","NotIn","Exists","DoesNotExist"],{labelSelector:s}=e;if(s&&!Object(f["e"])(s)){const{matchExpressions:e=[]}=s;e.forEach((e,s)=>{const{operator:o,values:a}=e;r.includes(o)||i.push(n["i18n/t"]("validation.podAffinity.matchExpressions.operator",t)),"In"===o||"NotIn"===o?a&&a.length||i.push(n["i18n/t"]("validation.podAffinity.matchExpressions.valuesMustBeDefined",t)):a&&a.length&&i.push(n["i18n/t"]("validation.podAffinity.matchExpressions.valueMustBeEmpty",t))})}}var N=n("907c");function P(e=[],t,n,i=[]){e.some(e=>c()(e.verbs))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingVerb")),e.some(e=>{var t,n;return(null===(t=e.resources)||void 0===t?void 0:t.length)&&(null===(n=e.nonResourceURLs)||void 0===n?void 0:n.length)})&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.noResourceAndNonResource")),i[0]===N["d"].ROLE?(e.some(e=>c()(e.resources))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingResource")),e.some(e=>c()(e.apiGroups))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingApiGroup"))):e.some(e=>{var t,n;return(null===(t=e.resources)||void 0===t?void 0:t.length)&&(null===(n=e.nonResourceUrls)||void 0===n?void 0:n.length)})&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.noResourceAndNonResource")),e.some(e=>c()(e.resources)&&c()(e.nonResourceURLs))&&n.push(t["i18n/t"]("validation.roleTemplate.roleTemplateRules.missingOneResource"))}function U(e,t,n,i,r){const s="true"===i[0];return s&&(e||"").match(/^(c-.{5}|local)$/i)&&n.push(t["i18n/t"]("validation.cluster.name")),n}var B={clusterName:U,clusterIp:k,externalName:E,flowOutput:l,groupsAreValid:x,logdna:u,ruleGroups:X,interval:C,servicePort:w,matching:K,containerImages:T,cronSchedule:I,podAffinity:O,roleTemplateRules:P},j=n("5877"),Q=n.n(j);async function G(e,t,i="text/plain;charset=utf-8"){const r=new Blob([t],{type:i}),{saveAs:s}=await n.e(6).then(n.t.bind(null,"7ada",7));return s(r,e)}function V(e){const t=new Q.a;for(const n in e)t.file(n,e[n]);return t.generateAsync({type:"blob"}).then(e=>e)}var H=n("a8b9"),z=n("1d19"),$=n("b10f"),q=n.n($);const W=e=>e.toLowerCase().startsWith("https://"),Y=e=>/^(?:https?:\/\/)?(?:localhost|127\.0\.0\.1)/i.test(e),J=e=>q()(e)&&(null===e||void 0===e?void 0:e.toLowerCase().endsWith("/"));function Z(e,t,n){return t=ee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(e){var t=te(e,"string");return"symbol"===typeof t?t:String(t)}function te(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class ne{constructor(e){Z(this,"empty",void 0),Z(this,"int",void 0),Z(this,"string",void 0),Z(this,"isNumber",void 0),Z(this,"isInt",void 0),this.string=String(e),this.int=parseInt(this.string,10),this.empty=!e&&0!==this.int,this.isNumber=!isNaN(this.int)&&!this.string.includes("e"),this.isInt=this.isNumber&&!this.string.includes(".")}}const ie=(e,t)=>{for(const n of t){const t=n(e);if(t)return t}};var re=function(e,{key:t="Value"}){const n=n=>i=>"."===(null===i||void 0===i?void 0:i.slice(0,1))?e(`validation.dns.${n}.startDot`,{key:t}):void 0,r=n=>i=>"."===(null===i||void 0===i?void 0:i.slice(-1))?e(`validation.dns.${n}.endDot`,{key:t}):void 0,s=n=>i=>{var r;return null!==i&&void 0!==i&&null!==(r=i.slice(0,1))&&void 0!==r&&r.match(/[0-9]/)?e(`validation.dns.${n}.startNumber`,{key:t}):void 0},o=n=>i=>"-"===(null===i||void 0===i?void 0:i.slice(0,1))?e(`validation.dns.${n}.startHyphen`,{key:t}):void 0,a=n=>i=>"-"===(null===i||void 0===i?void 0:i.slice(-1))?e(`validation.dns.${n}.endHyphen`,{key:t}):void 0,l=n=>i=>Number(i)i=>Number(i)>Number(n)?e("validation.maxValue",{key:t,max:n}):void 0,h=([n,i])=>r=>l(n)(r)||u(i)(r)?e("validation.betweenValues",{key:t,min:n,max:i}):void 0,d=n=>i=>i.lengthi=>i.length>Number(n)?e("validation.maxLength",{key:t,max:n}):void 0,p=([n,i])=>r=>d(n)(r)||f(i)(r)?e("validation.betweenLengths",{key:t,min:n,max:i}):void 0,_=n=>isNaN(parseInt(n,10))?e("validation.number.requiredInt",{key:t}):void 0,g=n=>!Number.isInteger(+n)||(""+n).match(/\.+/g)?e("validation.number.requiredInt",{key:t}):void 0,m=n=>+n<0?e("validation.number.isPositive",{key:t}):void 0,v=n=>{const i=""+n,r=i.match(/(^0+)(.+)/);return r?e("validation.number.isOctal",{key:t}):void 0},b=n=>parseInt(n,10)<1||parseInt(n,10)>65535?e("validation.number.between",{key:t,min:"1",max:"65535"}):void 0,y=n=>{const i=null===n||void 0===n?void 0:n.match(/[^${'A-Za-z0-9-'}]/g);if(i)return e("validation.chars",{key:t,count:i.length,chars:i.map(e=>" "===e?"Space":`"${e}"`).join(", ")})},w=n=>"--"===(null===n||void 0===n?void 0:n.substr(2,2))&&"xn"!==(null===n||void 0===n?void 0:n.substr(0,2))?e("validation.dns.doubleHyphen",{key:t}):void 0,k=n=>"--"===(null===n||void 0===n?void 0:n.substr(2,2))&&"xn"!==(null===n||void 0===n?void 0:n.substr(0,2))?e("validation.dns.doubleHyphen",{key:t}):void 0,E=n=>(i="")=>0===i.length?e(`validation.dns.${n}.emptyLabel`,{key:t,min:1}):void 0,S=(n,i=63)=>(r="")=>r.length>i?e(`validation.dns.${n}.tooLongLabel`,{key:t,max:i}):void 0,X=(n="")=>n.length>253?e("validation.dns.hostname.tooLong",{key:t,max:253}):void 0,x=(n="")=>"/"!==n[0]&&n.length>0?e("validation.path",{key:t}):void 0,K=n=>n||!1===n?void 0:e("validation.required",{key:t}),C=(n="")=>n.toLowerCase()!==n?e("validation.noUpperCase",{key:t}):void 0,T=t=>{try{R.a.toString(t)}catch(n){return e("validation.invalidCron")}},F=t=>t&&!W(t)?e("validation.setting.serverUrl.https"):void 0,I=t=>Y(t)?e("validation.setting.serverUrl.localhost"):void 0,O=t=>J(t)?e("validation.setting.serverUrl.trailingForwardSlash"):void 0,L=t=>t&&!q()(t)?e("validation.setting.serverUrl.url"):void 0,D=n=>n&&!/^[a-zA-Z0-9]+$/.test(n)?e("validation.alphanumeric",{key:t}):void 0,M=n=>/^\d+[hms]$/.test(n)?void 0:e("validation.monitoring.route.interval",{key:t}),P=t=>null!==t&&void 0!==t&&t.image?void 0:e("workload.validation.containerImage",{name:t.name}),U=t=>{var n,i;const r=t.jobTemplate?null===t||void 0===t||null===(n=t.jobTemplate)||void 0===n||null===(n=n.spec)||void 0===n||null===(n=n.template)||void 0===n||null===(n=n.spec)||void 0===n?void 0:n.containers:null===t||void 0===t||null===(i=t.template)||void 0===i||null===(i=i.spec)||void 0===i?void 0:i.containers;return r&&r.length?r.map(e=>P(e)).find(e=>e):e("validation.required",{key:e("workload.container.titles.containers")})},B=e=>{const t=[y,o("label"),a("label"),w,S("label")];return ie(e,t)},j=e=>{const t=[y,o("label"),a("label"),k,E("label"),S("label",15)];return ie(e,t)},Q=e=>{const t=[y,s("label"),o("label"),a("label"),w,E("label"),S("label")];return ie(e,t)},G=e=>{if(e){const t=[n("hostname"),X,r("hostname")],i=ie(e,t);if(i)return i;const s=e.split("."),c=[y,o("hostname"),a("hostname"),w,E("hostname"),S("hostname")];for(let e=0;e(e=e?e.replace(/^\*\./,""):e,G(e)),H=t=>c()(t)?e("validation.service.externalName.none"):G(t),z=e=>"This is an error returned by the testRule validator",$=t=>c()(null===t||void 0===t?void 0:t.groups)?e("validation.prometheusRule.groups.required"):void 0,Z=t=>n=>{var i;return t&&null!==(i=n||"")&&void 0!==i&&i.match(/^(c-.{5}|local)$/i)?e("validation.cluster.name"):void 0},ee=t=>{const{name:n,idx:i}=t,r=new ne(t.nodePort),s=new ne(t.port),o=new ne(t.targetPort);if(c()(n))return e("validation.service.ports.name.required",{position:i+1});if(!r.empty){if(!r.isInt)return e("validation.service.ports.nodePort.requiredInt",{position:i+1});if(r.int<1||r.int>65535)return e("validation.service.ports.nodePort.between",{position:i+1})}if(s.empty)return e("validation.service.ports.port.required",{position:i+1});var a;if(!s.isInt)return e("validation.service.ports.port.requiredInt",{position:i+1});if(s.int<1||s.int>65535)return e("validation.service.ports.port.between",{position:i+1});if(null!==(a=s.string)&&void 0!==a&&a.includes("."))return s;if(o.empty)return e("validation.service.ports.targetPort.required",{position:i+1});if(o.isInt){if(o.int<1||o.int>65535)return e("validation.service.ports.targetPort.between",{position:i+1})}else{const e=j(o.string);if(e)return e}},te=(t,n)=>{let i;return c()(null===t||void 0===t?void 0:t.name)?e("validation.prometheusRule.groups.valid.name",{index:n}):c()(t.rules)?e("validation.prometheusRule.groups.valid.singleEntry",{index:n}):(t.rules.forEach((t,r)=>{const s=r+1;A()(t,"alert")&&c()(null===t||void 0===t?void 0:t.alert)&&!i?i=e("validation.prometheusRule.groups.valid.rule.alertName",{groupIndex:n,ruleIndex:s}):A()(t,"record")&&c()(null===t||void 0===t?void 0:t.record)&&(i=e("validation.prometheusRule.groups.valid.rule.recordName",{groupIndex:n,ruleIndex:s})),(A()(t,"expr")&&c()(t.expr)&&!i||!A()(t,"expr")&&!i)&&(i=e("validation.prometheusRule.groups.valid.rule.expr",{groupIndex:n,ruleIndex:s})),A()(t,"alert")&&(A()(t,"labels")&&c()(t.labels)&&!i||!A()(t,"labels")&&!i)&&(i=e("validation.prometheusRule.groups.valid.rule.labels",{groupIndex:n,ruleIndex:s}))}),i)},re=e=>{const t=[...e];let n;return t.forEach((e,t,i)=>{n=te(e,t+1),n&&(i.length=t+1)}),n},se=t=>{if(c()(null===t||void 0===t?void 0:t.match)&&c()(null===t||void 0===t?void 0:t["match_re"]))return e("validation.monitoring.route.match")},oe=t=>(n=[])=>{if(n.some(e=>c()(e.verbs)))return e("validation.roleTemplate.roleTemplateRules.missingVerb");if(n.some(e=>{var t,n;return(null===(t=e.resources)||void 0===t?void 0:t.length)&&(null===(n=e.nonResourceURLs)||void 0===n?void 0:n.length)}))return e("validation.roleTemplate.roleTemplateRules.noResourceAndNonResource");if(t===N["d"].ROLE){if(n.some(e=>c()(e.resources)))return e("validation.roleTemplate.roleTemplateRules.missingResource");if(n.some(e=>c()(e.apiGroups)))return e("validation.roleTemplate.roleTemplateRules.missingApiGroup")}else if(n.some(e=>c()(e.resources)&&c()(e.nonResourceURLs)))return e("validation.roleTemplate.roleTemplateRules.missingOneResource")},ae=e=>{},ce=t=>{const n=JSON.parse(t),i=n.type;if(!i)return e("validation.required",{key:"Type"});if("s3"===i){if(!n.accessKeyId)return e("validation.required",{key:"accessKeyId"});if(!n.secretAccessKey)return e("validation.required",{key:"secretAccessKey"});if(!n.bucketRegion)return e("validation.required",{key:"bucketRegion"});if(!n.bucketName)return e("validation.required",{key:"bucketName"})}},le=t=>{const n=["qcow","qcow2","raw","img","iso"];if(!t||""===t)return;const i=t.split("/").pop(),r=i.split(".").pop().toLowerCase();return n.includes(r)?void 0:e("harvester.validation.image.ruleTip")},ue=(t={})=>{if(!t[i["d"].IMAGE_NAME])return e("validation.required",{key:e("harvester.image.fileName")})},he=i=>{const s=null===i||void 0===i?void 0:i.match(/[^a-z0-9.-]/g);return s?e("validation.chars",{key:t,count:s.length,chars:s.map(e=>" "===e?"Space":`"${e}"`).join(", ")}):ie(i,[o("label"),a("label"),n("label"),r("label"),K])};return{absolutePath:x,alphanumeric:D,backupTarget:ce,betweenLengths:p,betweenValues:h,clusterIp:ae,clusterName:Z,containerImage:P,containerImages:U,cronSchedule:T,dnsLabel:B,dnsLabelIanaServiceName:j,dnsLabelRestricted:Q,externalName:H,fileRequired:ue,groupsAreValid:re,hostname:G,imageUrl:le,interval:M,https:F,localhost:I,trailingForwardSlash:O,url:L,matching:se,maxLength:f,maxValue:u,minLength:d,minValue:l,noUpperCase:C,portNumber:b,required:K,requiredInt:_,isInteger:g,isPositive:m,isOctal:v,roleTemplateRules:oe,ruleGroups:$,servicePort:ee,subDomain:he,testRule:z,wildcardHostname:V}};const se=(e,t="",n=3e6,i=500,r=!1)=>{return s("Starting wait for",t),new Promise((r,o)=>{e()&&(s("Wait for",t||"unknown","done immediately"),r(void 0));const a=setTimeout(()=>{if(s("Wait for",t,"timed out"),clearInterval(c),clearTimeout(a),!t)throw new Error(`waitFor timed out after ${n/1e3} seconds`);o(new Error("Failed waiting for: "+t))},n),c=setInterval(()=>{e()?(s("Wait for",t,"done"),clearInterval(c),clearTimeout(a),r(void 0)):t&&s("Wait for",t,"not done yet")},i)});function s(...e){r&&console.log(...e)}};var oe=n("7838"),ae=n.n(oe),ce=n("ddd1"),le=n.n(ce),ue=(n("6552"),n("daaf")),he=n.n(ue),de=n("9c38"),fe=n.n(de),pe=n("8bbf"),_e=n.n(pe),ge=n("7083"),me=n("1722");const ve=["dnsLabel","dnsLabelRestricted","hostname"],be={disabled:"inactive",notapplied:"Not Applied",notready:"Not Ready",waitapplied:"Wait Applied",outofsync:"Out of Sync","in-progress":"In Progress",gitupdating:"Git Updating",errapplied:"Err Applied",waitcheckin:"Wait Check-In",off:"Disabled",waitingforinfrastructure:"Waiting for Infra",waitingfornoderef:"Waiting for Node Ref"},ye="warning",we="x",ke=1e3,Ee=3e4,Se={IN_USE:"in-use",IN_PROGRESS:"in-progress",PENDING_ROLLBACK:"pending-rollback",PENDING_UPGRADE:"pending-upgrade",ABORTED:"aborted",ACTIVATING:"activating",ACTIVE:"active",AVAILABLE:"available",BACKED_UP:"backedup",BOUND:"bound",BUILDING:"building",COMPLETED:"completed",CORDONED:"cordoned",COUNT:"count",CREATED:"created",CREATING:"creating",DEACTIVATING:"deactivating",DEGRADED:"degraded",DENIED:"denied",DEPLOYED:"deployed",DEPLOYING:"deploying",DISABLED:"disabled",DISCONNECTED:"disconnected",DRAINED:"drained",DRAINING:"draining",ERR_APPLIED:"errapplied",ERROR:"error",ERRORING:"erroring",ERRORS:"errors",EXPIRED:"expired",EXPIRING:"expiring",FAIL:"fail",FAILED:"failed",HEALTHY:"healthy",INACTIVE:"inactive",INFO:"info",INITIALIZING:"initializing",INPROGRESS:"inprogress",LOCKED:"locked",MIGRATING:"migrating",MISSING:"missing",MODIFIED:"modified",NOT_APPLICABLE:"notApplicable",NOT_APLLIED:"notapplied",NOT_READY:"notready",OFF:"off",ORPHANED:"orphaned",OTHER:"other",OUT_OF_SYNC:"outofsync",ON_GOING:"on-going",PASS:"pass",PASSED:"passed",PAUSED:"paused",PENDING:"pending",PROVISIONING:"provisioning",PROVISIONED:"provisioned",PURGED:"purged",PURGING:"purging",READY:"ready",RECONNECTING:"reconnecting",REGISTERING:"registering",REINITIALIZING:"reinitializing",RELEASED:"released",REMOVED:"removed",REMOVING:"removing",REQUESTED:"requested",RESTARTING:"restarting",RESTORING:"restoring",RESIZING:"resizing",RUNNING:"running",SKIP:"skip",SKIPPED:"skipped",STARTING:"starting",STOPPED:"stopped",STOPPING:"stopping",SUCCEEDED:"succeeded",SUCCESS:"success",SUCCESSFUL:"successful",SUPERSEDED:"superseded",SUSPENDED:"suspended",UNAVAILABLE:"unavailable",UNHEALTHY:"unhealthy",UNINSTALLED:"uninstalled",UNINSTALLING:"uninstalling",UNKNOWN:"unknown",UNTRIGGERED:"untriggered",UPDATING:"updating",WAIT_APPLIED:"waitapplied",WAIT_CHECKIN:"waitcheckin",WAITING:"waiting",WARNING:"warning"};const Ae={[Se.IN_USE]:{color:"success",icon:"dot-open",label:"In Use",compoundIcon:"checkmark"},[Se.IN_PROGRESS]:{color:"info",icon:"tag",label:"In Progress",compoundIcon:"info"},[Se.PENDING_ROLLBACK]:{color:"info",icon:"dot-half",label:"Pending Rollback",compoundIcon:"info"},[Se.PENDING_UPGRADE]:{color:"info",icon:"dot-half",label:"Pending Update",compoundIcon:"info"},[Se.ABORTED]:{color:"warning",icon:"error",label:"Aborted",compoundIcon:"warning"},[Se.ACTIVATING]:{color:"info",icon:"tag",label:"Activating",compoundIcon:"info"},[Se.ACTIVE]:{color:"success",icon:"dot-open",label:"Active",compoundIcon:"checkmark"},[Se.AVAILABLE]:{color:"success",icon:"dot-open",label:"Available",compoundIcon:"checkmark"},[Se.BACKED_UP]:{color:"success",icon:"backup",label:"Backed Up",compoundIcon:"checkmark"},[Se.BOUND]:{color:"success",icon:"dot",label:"Bound",compoundIcon:"checkmark"},[Se.BUILDING]:{color:"success",icon:"dot-open",label:"Building",compoundIcon:"checkmark"},[Se.COMPLETED]:{color:"success",icon:"dot",label:"Completed",compoundIcon:"checkmark"},[Se.CORDONED]:{color:"info",icon:"tag",label:"Cordoned",compoundIcon:"info"},[Se.COUNT]:{color:"success",icon:"dot-open",label:"Count",compoundIcon:"checkmark"},[Se.CREATED]:{color:"info",icon:"tag",label:"Created",compoundIcon:"info"},[Se.CREATING]:{color:"info",icon:"tag",label:"Creating",compoundIcon:"info"},[Se.DEACTIVATING]:{color:"info",icon:"adjust",label:"Deactivating",compoundIcon:"info"},[Se.DEGRADED]:{color:"warning",icon:"error",label:"Degraded",compoundIcon:"warning"},[Se.DENIED]:{color:"error",icon:"adjust",label:"Denied",compoundIcon:"error"},[Se.DEPLOYED]:{color:"success",icon:"dot-open",label:"Deployed",compoundIcon:"checkmark"},[Se.DISABLED]:{color:"warning",icon:"error",label:"Disabled",compoundIcon:"warning"},[Se.DISCONNECTED]:{color:"warning",icon:"error",label:"Disconnected",compoundIcon:"warning"},[Se.DRAINED]:{color:"info",icon:"tag",label:"Drained",compoundIcon:"info"},[Se.DRAINING]:{color:"warning",icon:"tag",label:"Draining",compoundIcon:"warning"},[Se.ERR_APPLIED]:{color:"error",icon:"error",label:"Error Applied",compoundIcon:"error"},[Se.ERROR]:{color:"error",icon:"error",label:"Error",compoundIcon:"error"},[Se.ERRORING]:{color:"error",icon:"error",label:"Erroring",compoundIcon:"error"},[Se.ERRORS]:{color:"error",icon:"error",label:"Errors",compoundIcon:"error"},[Se.EXPIRED]:{color:"error",icon:"error",label:"Expired",compoundIcon:"warning"},[Se.EXPIRING]:{color:"warning",icon:"error",label:"Expiring",compoundIcon:"error"},[Se.FAIL]:{color:"error",icon:"error",label:"Fail",compoundIcon:"error"},[Se.FAILED]:{color:"error",icon:"error",label:"Failed",compoundIcon:"error"},[Se.HEALTHY]:{color:"success",icon:"dot-open",label:"Healthy",compoundIcon:"checkmark"},[Se.INACTIVE]:{color:"error",icon:"dot",label:"Inactive",compoundIcon:"error"},[Se.INITIALIZING]:{color:"warning",icon:"error",label:"Initializing",compoundIcon:"warning"},[Se.INPROGRESS]:{color:"info",icon:"spinner",label:"In Progress",compoundIcon:"info"},[Se.INFO]:{color:"info",icon:"info",label:"Info",compoundIcon:"info"},[Se.LOCKED]:{color:"warning",icon:"adjust",label:"Locked",compoundIcon:"warning"},[Se.MIGRATING]:{color:"info",icon:"info",label:"Migrated",compoundIcon:"info"},[Se.MISSING]:{color:"warning",icon:"adjust",label:"Missing",compoundIcon:"warning"},[Se.MODIFIED]:{color:"warning",icon:"edit",label:"Modified",compoundIcon:"warning"},[Se.NOT_APPLICABLE]:{color:"warning",icon:"tag",label:"Not Applicable",compoundIcon:"warning"},[Se.NOT_APLLIED]:{color:"warning",icon:"tag",label:"Not Applied",compoundIcon:"warning"},[Se.NOT_READY]:{color:"warning",icon:"tag",label:"Not Ready",compoundIcon:"warning"},[Se.OFF]:{color:"darker",icon:"error",label:"Off"},[Se.ON_GOING]:{color:"info",icon:"info",label:"Info",compoundIcon:"info"},[Se.ORPHANED]:{color:"warning",icon:"tag",label:"Orphaned",compoundIcon:"warning"},[Se.OTHER]:{color:"info",icon:"info",label:"Other",compoundIcon:"info"},[Se.OUT_OF_SYNC]:{color:"warning",icon:"tag",label:"Out Of Sync",compoundIcon:"warning"},[Se.PASS]:{color:"success",icon:"dot-dotfill",label:"Pass",compoundIcon:"checkmark"},[Se.PASSED]:{color:"success",icon:"dot-dotfill",label:"Passed",compoundIcon:"checkmark"},[Se.PAUSED]:{color:"info",icon:"info",label:"Paused",compoundIcon:"info"},[Se.PENDING]:{color:"info",icon:"tag",label:"Pending",compoundIcon:"info"},[Se.PROVISIONING]:{color:"info",icon:"dot",label:"Provisioning",compoundIcon:"info"},[Se.PROVISIONED]:{color:"success",icon:"dot",label:"Provisioned",compoundIcon:"checkmark"},[Se.PURGED]:{color:"error",icon:"purged",label:"Purged",compoundIcon:"error"},[Se.PURGING]:{color:"info",icon:"purged",label:"Purging",compoundIcon:"info"},[Se.READY]:{color:"success",icon:"dot-open",label:"Ready",compoundIcon:"checkmark"},[Se.RECONNECTING]:{color:"error",icon:"error",label:"Reconnecting",compoundIcon:"error"},[Se.REGISTERING]:{color:"info",icon:"tag",label:"Registering",compoundIcon:"info"},[Se.REINITIALIZING]:{color:"warning",icon:"error",label:"Reinitializing",compoundIcon:"warning"},[Se.RELEASED]:{color:"warning",icon:"error",label:"Released",compoundIcon:"warning"},[Se.REMOVED]:{color:"error",icon:"trash",label:"Removed",compoundIcon:"error"},[Se.REMOVING]:{color:"info",icon:"trash",label:"Removing",compoundIcon:"info"},[Se.REQUESTED]:{color:"info",icon:"tag",label:"Requested",compoundIcon:"info"},[Se.RESTARTING]:{color:"info",icon:"adjust",label:"Restarting",compoundIcon:"info"},[Se.RESTORING]:{color:"info",icon:"medicalcross",label:"Restoring",compoundIcon:"info"},[Se.RESIZING]:{color:"warning",icon:"dot",label:"Resizing",compoundIcon:"warning"},[Se.RUNNING]:{color:"success",icon:"dot-open",label:"Running",compoundIcon:"checkmark"},[Se.SKIP]:{color:"info",icon:"dot-open",label:"Skip",compoundIcon:"info"},[Se.SKIPPED]:{color:"info",icon:"dot-open",label:"Skipped",compoundIcon:"info"},[Se.STARTING]:{color:"info",icon:"adjust",label:"Starting",compoundIcon:"info"},[Se.STOPPED]:{color:"error",icon:"dot",label:"Stopped",compoundIcon:"error"},[Se.STOPPING]:{color:"info",icon:"adjust",label:"Stopping",compoundIcon:"info"},[Se.SUCCEEDED]:{color:"success",icon:"dot-dotfill",label:"Succeeded",compoundIcon:"checkmark"},[Se.SUCCESS]:{color:"success",icon:"dot-open",label:"Success",compoundIcon:"checkmark"},[Se.SUCCESSFUL]:{color:"success",icon:"dot-open",label:"Successful"},[Se.SUPERSEDED]:{color:"info",icon:"dot-open",label:"Superseded",compoundIcon:"info"},[Se.SUSPENDED]:{color:"info",icon:"pause",label:"Suspended",compoundIcon:"info"},[Se.UNAVAILABLE]:{color:"error",icon:"error",label:"Unavailable",compoundIcon:"error"},[Se.UNHEALTHY]:{color:"error",icon:"error",label:"Unhealthy",compoundIcon:"error"},[Se.UNINSTALLED]:{color:"info",icon:"trash",label:"Uninstalled",compoundIcon:"info"},[Se.UNINSTALLING]:{color:"info",icon:"trash",label:"Uninstalling",compoundIcon:"info"},[Se.UNKNOWN]:{color:"warning",icon:"x",label:"Unknown",compoundIcon:"warning"},[Se.UNTRIGGERED]:{color:"success",icon:"tag",label:"Untriggered",compoundIcon:"checkmark"},[Se.UPDATING]:{color:"warning",icon:"tag",label:"Updating",compoundIcon:"warning"},[Se.WAIT_APPLIED]:{color:"info",icon:"tag",label:"Wait Applied",compoundIcon:"info"},[Se.WAIT_CHECKIN]:{color:"warning",icon:"tag",label:"Wait Checkin",compoundIcon:"warning"},[Se.WAITING]:{color:"info",icon:"tag",label:"Waiting",compoundIcon:"info"},[Se.WARNING]:{color:"warning",icon:"error",label:"Warning",compoundIcon:"warning"},[Se.DEPLOYING]:{color:"info",icon:"info",label:"Deploying",compoundIcon:"info"}};const Xe={error:1,warning:2,info:3,success:4,ready:5,notready:6,other:7};function xe(e,t,n){if(t)return"text-error";if(n)return"text-info";const i=(e||"active").toLowerCase();let r;return Ae[i]&&Ae[i].color&&(r=Te.call(this,Ae[i].color)),r||(r=ye),"text-"+r}function Ke(e){const t=(e||"active").toLowerCase();return be[t]?be[t]:t.split(/-/).map(p["k"]).join("-")}function Ce(e,t){return e=e.replace(/^(text|bg)-/,""),`${Xe[e]||Xe["other"]} ${t}`}function Te(e){return he()(e)?e(this):e}class Fe{constructor(e,t,n=null,i=!1){for(const r in e)this[r]=e[r];Object.defineProperty(this,"$ctx",{value:t,enumerable:!1}),n&&Object.defineProperty(this,"__rehydrate",{value:n,enumerable:!0,configurable:!0}),i&&Object.defineProperty(this,"__clone",{value:!0,enumerable:!0,configurable:!0,writable:!0})}get $getters(){return this.$ctx.getters}get $rootGetters(){return this.$ctx.rootGetters}get $dispatch(){return this.$ctx.dispatch}get $state(){return this.$ctx.state}get $rootState(){return this.$ctx.rootState}get customValidationRules(){return[]}get _key(){const e=this.metadata;if(e){if(e.uid)return e.uid;if(e.namespace)return`${this.type}/${e.namespace}/${e.name}`}return this.id?`${this.type}/${this.id}`:`${this.type}/${Math.random()}`}get schema(){return this.$getters["schemaFor"](this.type)}toString(){return`[${this.type}: ${this.id}]`}get typeDisplay(){const e=this.schema;return e?this.$rootGetters["type-map/labelFor"](e):"?"}get nameDisplay(){var e,t,n;return this.displayName||(null===(e=this.spec)||void 0===e?void 0:e.displayName)||(null===(t=this.metadata)||void 0===t||null===(t=t.annotations)||void 0===t?void 0:t[i["f"]])||this.name||(null===(n=this.metadata)||void 0===n?void 0:n.name)||this.id}get nameSort(){return Object(z["b"])(this.nameDisplay).toLowerCase()}get namespacedName(){var e;const t=null===(e=this.metadata)||void 0===e?void 0:e.namespace,n=this.nameDisplay;return t?`${t}:${n}`:n}get namespacedNameSort(){return Object(z["b"])(this.namespacedName).toLowerCase()}get groupByLabel(){var e;const t=null===(e=this.metadata)||void 0===e?void 0:e.namespace;let n;return n=t?this.t("resourceTable.groupLabel.namespace",{name:Object(p["c"])(t)}):this.t("resourceTable.groupLabel.notInANamespace"),n}setLabels(){throw new Error("Implement setLabels in subclass")}setLabel(){throw new Error("Implement setLabel in subclass")}setAnnotations(e){throw new Error("Implement setAnnotations in subclass")}setAnnotation(e,t){throw new Error("Implement setAnnotation in subclass")}get stateDisplay(){return Ke(this.state)}get stateColor(){var e,t;return xe.call(this,this.state,null===(e=this.stateObj)||void 0===e?void 0:e.error,null===(t=this.stateObj)||void 0===t?void 0:t.transitioning)}get stateBackground(){return this.stateColor.replace("text-","bg-")}get stateIcon(){let e=!1,t=!1;if(this.metadata&&this.metadata.state&&(e=this.metadata.state.transitioning,t=this.metadata.state.error),e)return"icon icon-spinner icon-spin";if(t)return"icon icon-error";const n=(this.state||"").toLowerCase();let i;return Ae[n]&&Ae[n].icon&&(i=Te.call(this,Ae[n].icon)),i||(i=we),"icon icon-"+i}get stateSort(){return Ce(this.stateColor,this.stateDisplay)}get stateDescription(){var e,t,n;const i=(null===(e=this.stateObj)||void 0===e?void 0:e.transitioning)||!1,r=(null===(t=this.stateObj)||void 0===t?void 0:t.error)||!1,s=null===(n=this.stateObj)||void 0===n?void 0:n.message;return i||r?Object(p["k"])(s):""}get stateObj(){var e;return null===(e=this.metadata)||void 0===e?void 0:e.state}waitForTestFn(e,t,n,i){return se(()=>e.apply(this),t,n||Ee,i||ke,!0)}waitForState(e,t,n){return this.waitForTestFn(()=>(this.state||"").toLowerCase()===e.toLowerCase(),"state="+e,t,n)}waitForTransition(){return this.waitForTestFn(()=>!this.transitioning,"transition completion",void 0,void 0)}waitForAction(e){return this.waitForTestFn(()=>this.hasAction(e),"action="+e,void 0,void 0)}waitForLink(e){return this.waitForTestFn(()=>this.hasLink(e),"link="+e,void 0,void 0)}hasCondition(e){return this.isCondition(e,null)}isCondition(e,t="True"){if(!this.status||!this.status.conditions)return!1;const n=Object(o["d"])(this.status.conditions||[],"type",e);return!!n&&(!t||(n.status||"").toLowerCase()===(""+t).toLowerCase())}waitForCondition(e,t="True",n=Ee,i=ke){return this.waitForTestFn(()=>this.isCondition(e,t),`condition ${e}=${t}`,n,i)}get availableActions(){const e=this._availableActions;let t=null;const n=e.filter(e=>{if(!1===e.enabled)return!1;const n=e.divider,i=!n||n&&!t;return t=n,i});while(n.length&&n[0].divider)n.shift();while(n.length&&n[n.length-1].divider)n.pop();for(let i=1;i{const t={...e},i=t.enabled,r=typeof i;switch(r){case"undefined":t.enabled=!0;break;case"function":Object.defineProperty(t,"enabled",{get:()=>i(this)});break;case"boolean":break;default:console.warn("Unsupported 'enabled' property type for action: "+(e.label||e.labelKey)),delete t.enabled;break}n.push(t)})),n}get canDelete(){return this._canDelete}get _canDelete(){return this.hasLink("remove")&&this.$rootGetters["type-map/optionsFor"](this.type).isRemovable}get canClone(){return!0}get canUpdate(){return this.hasLink("update")&&this.$rootGetters["type-map/optionsFor"](this.type).isEditable}get canCustomEdit(){return this.$rootGetters["type-map/hasCustomEdit"](this.type,this.id)}get canCreate(){var e;return!(this.schema&&(null===(e=this.schema)||void 0===e||!e.collectionMethods.find(e=>"post"===e.toLowerCase())))&&this.$rootGetters["type-map/optionsFor"](this.type).isCreatable}get canViewInApi(){return this.hasLink("self")&&this.$rootGetters["prefs/get"](s["c"])}get canYaml(){return this.hasLink("view")}get canEditYaml(){var e;return(null===(e=this.schema)||void 0===e||null===(e=e.resourceMethods)||void 0===e||!e.find(e=>"blocked-PUT"===e))&&this.canUpdate}hasLink(e){return!!this.linkFor(e)}linkFor(e){return(this.links||{})[e]}followLink(e,t={}){if(t.url||(t.url=(this.links||{})[e]),t.urlSuffix&&(t.url+=t.urlSuffix),!t.url)throw new Error(`Unknown link ${e} on ${this.type} ${this.id}`);return this.$dispatch("request",{opt:t,type:this.type})}hasAction(e){return!!this.actionLinkFor(e)}actionLinkFor(e){return(this.actions||this.actionLinks||{})[e]}doAction(e,t,n={}){return this.$dispatch("resourceAction",{resource:this,actionName:e,body:t,opt:n})}async doActionGrowl(e,t,n={}){try{await this.$dispatch("resourceAction",{resource:this,actionName:e,body:t,opt:n})}catch(i){this.$dispatch("growl/fromError",{title:this.$rootGetters["i18n/t"]("generic.notification.title.error"),err:i.data||i},{root:!0})}}patch(e,t={},n=!1,i=!1){if(t.url||(t.url=this.linkFor("view")||this.linkFor("self")),t.method="patch",t.headers=t.headers||{},!t.headers["content-type"]){const e=n?"application/strategic-merge-patch+json":"application/json-patch+json";t.headers["content-type"]=e}t.data=e;const r=this.$dispatch("request",{opt:t,type:this.type});return i?r.catch(e=>{const t=this.t("resource.errors.update",{name:this.name});console.error(t,e),this.$dispatch("growl/error",{title:t,message:null===e||void 0===e?void 0:e.message,timeout:5e3},{root:!0})}):r}save(){return this._save(...arguments)}cleanForSave(e,t){return delete e.__rehydrate,delete e.__clone,e}processSaveResponse(e){}async _save(e={}){var t;const n=!this.id,i=this.validationErrors(this,e);if(!c()(i))return Promise.reject(i);if(null!==(t=this.metadata)&&void 0!==t&&t.resourceVersion&&(this.metadata.resourceVersion=""+this.metadata.resourceVersion),!e.url)if(n){const t=this.$getters["schemaFor"](this.type);let n=t.linkFor("collection");t.attributes&&t.attributes.namespaced&&this.metadata&&this.metadata.namespace&&(n+="/"+this.metadata.namespace),e.url=n}else e.url=this.linkFor("update")||this.linkFor("self");if(e.method||(e.method=n?"post":"put"),e.headers||(e.headers={}),e.headers["content-type"]||(e.headers["content-type"]="application/json"),e.headers["accept"]||(e.headers["accept"]="application/json"),e.data=this.toSave()||{...this},e.data._type&&(e.data.type=e.data._type),e.data._name&&(e.data.name=e.data._name),e.data._labels&&(e.data.labels=e.data._labels),e.data._annotations&&(e.data.annotations=e.data._annotations),e.data=this.cleanForSave(e.data,n),null!==e&&void 0!==e&&e.replace&&"put"===e.method){const t=e.url.includes("?")?"&":"?";e.url=`${e.url}${t}_replace=true`,delete e.replace}try{const t=await this.$dispatch("request",{opt:e,type:this.type});this.processSaveResponse(t),t&&"Table"!==t.kind&&await this.$dispatch("load",{data:t,existing:n?this:void 0})}catch(r){return this.type&&this.id&&409===(null===r||void 0===r?void 0:r._status)&&await this.$dispatch("find",{type:this.type,id:this.id,opt:{force:!0}}),Promise.reject(r)}return this}remove(){return this._remove(...arguments)}async _remove(e={}){e.url||(e.url=this.linkFor("self")),e.method="delete";const t=await this.$dispatch("request",{opt:e,type:this.type});204===(null===t||void 0===t?void 0:t._status)&&await this.$dispatch("ws.resource.remove",{data:this})}currentRoute(){return window.$globalApp.$route}currentRouter(){return window.$globalApp.$router}get listLocation(){return{name:"c-cluster-product-resource",params:{product:this.$rootGetters["productId"],cluster:this.$rootGetters["clusterId"],resource:this.type}}}get _detailLocation(){var e,t,n;const i=this.$getters["schemaFor"](this.type),r=null===(e=this.id)||void 0===e?void 0:e.replace(/.*\//,"");return{name:`c-cluster-product-resource${null!==i&&void 0!==i&&null!==(t=i.attributes)&&void 0!==t&&t.namespaced?"-namespace":""}-id`,params:{product:this.$rootGetters["productId"],cluster:this.$rootGetters["clusterId"],resource:this.type,namespace:null===(n=this.metadata)||void 0===n?void 0:n.namespace,id:r}}}get detailLocation(){return this._detailLocation}goToDetail(){this.currentRouter().push(this.detailLocation)}goToClone(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["c"],[r["a"]]:r["i"],...e},this.currentRouter().push(t)}goToEdit(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["g"],[r["a"]]:r["i"],...e},this.currentRouter().push(t)}goToViewConfig(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["j"],[r["a"]]:r["d"],...e},this.currentRouter().push(t)}goToEditYaml(){const e=this.detailLocation;e.query={...e.query,[r["b"]]:r["g"],[r["a"]]:r["k"]},this.currentRouter().push(e)}goToViewYaml(){const e=this.detailLocation;e.query={...e.query,[r["b"]]:r["j"],[r["a"]]:r["k"]},this.currentRouter().push(e)}cloneYaml(e={}){const t=this.detailLocation;t.query={...t.query,[r["b"]]:r["c"],[r["a"]]:r["k"],...e},this.currentRouter().push(t)}async download(){const e=await this.followLink("view",{headers:{accept:"application/yaml"}}),t=await this.cleanForDownload(e.data);G(this.nameDisplay+".yaml",t,"application/yaml")}async downloadBulk(e){const t={},n=[];for(const r of e){let e=r.nameDisplay+".yaml",t=2;while(n.includes(e))e=`${r.nameDisplay}_${t++}.yaml`;n.push(e)}await Object(H["b"])(e,10,(e,i)=>e.followLink("view",{headers:{accept:"application/yaml"}}).then(async e=>{const r=e.data||e,s=await this.cleanForDownload(r);t["resources/"+n[i]]=s}));const i=await V(t);G("resources.zip",i,"application/zip")}viewInApi(){window.open(this.links.self,"_blank")}promptRemove(e){e||(e=this),this.$dispatch("promptRemove",e)}get confirmRemove(){return!1}applyDefaults(){}get urlFromAttrs(){const e=this.$getters["schemaFor"](this.type),{metadata:{namespace:t="default"}}=this;let n=e.links.collection;const i=null===e||void 0===e?void 0:e.attributes;if(!i)throw new Error("Attributes must be present on the schema");const{group:r,resource:s}=i;return n=`${n.slice(0,n.indexOf("/v1"))}/apis/${r}/namespaces/${t}/${s}`,n}cleanYaml(e,t="edit"){try{const n=ae.a.load(e);"edit"!==t&&this.$dispatch("cleanForNew",n),n._type&&(n.type=n._type,delete n._type);const i=ae.a.dump(n,{skipInvalid:!0});return i}catch(n){return null}}cleanForNew(){this.$dispatch("cleanForNew",this)}cleanForDiff(){this.$dispatch("cleanForDiff",this.toJSON())}async cleanForDownload(e){return this.$dispatch("cleanForDownload",e)}yamlForSave(e){try{const t=ae.a.load(e);if(t)return this._type&&(t._type=t.type),ae.a.dump(t)}catch(t){return null}}async saveYaml(e){await this._saveYaml(e)}async _saveYaml(e){var t;const n=ae.a.load(e);if(null!==(t=this.schema)&&void 0!==t&&null!==(t=t.attributes)&&void 0!==t&&t.namespaced&&!n.metadata.namespace){const e=this.$rootGetters["i18n/t"]("resourceYaml.errors.namespaceRequired");throw e}let i;const r=!this.id,s={"content-type":"application/yaml",accept:"application/json"};i=r?await this.schema.followLink("collection",{method:"POST",headers:s,data:e}):await this.followLink("update",{method:"PUT",headers:s,data:e}),await this.$dispatch("load",{data:i,existing:r?this:void 0}),this.isSpoofed&&await this.$dispatch("cluster/findAll",{type:this.type,opt:{force:!0}},{root:!0})}get modelValidationRules(){const e=[],t=null===this||void 0===this?void 0:this.customValidationRules.filter(e=>!!e.validators||!!e.required).map(e=>{const t=re(this.t,{displayKey:null!==e&&void 0!==e&&e.translationKey?this.t(e.translationKey):"Value"});return{path:e.path,rules:[...e.validators||[],...e.required?["required"]:[],...["dnsLabel","dnsLabelRestricted","hostname"].includes(e.type)?[e.type]:[]].map(e=>{if(e.includes(":")){const[n,i]=e.split(":");return t[n](i)}return t[e]}).filter(e=>!!e)}}).filter(e=>e.rules.length>0);return e.push(...t),e}customValidationErrors(e,t=[]){const n=[];let{customValidationRules:i}=this;return c()(i)||(he()(i)&&(i=i()),i.filter(e=>!t.includes(e.path)).forEach(t=>{const{path:i,requiredIf:r,validators:s=[],type:o}=t;let a=Object(f["d"])(e,i);const l=le()(s||[]);let u=i;if(t.translationKey&&this.$rootGetters["i18n/exists"](t.translationKey)&&(u=this.t(t.translationKey)),fe()(a)&&(a=a.trim()),r){const t=Object(f["d"])(e,r);!c()(t)&&c()(a)&&0!==a&&n.push(this.t("validation.required",{key:u}))}if(g(a,t,u,this.$rootGetters,n),m(a,t,u,this.$rootGetters,n),!c()(a)&&ve.includes(o)){const t=(a||"").toLowerCase();t!==a&&(a=t,_e.a.set(e,i,a)),n.push(...y(a,o,u,this.$rootGetters,n))}l.forEach(t=>{const i=t.split(":"),r=i.slice(0,1),s=i.slice(1)||null,o=Object.prototype.hasOwnProperty.call(B,r);if(!c()(r)&&o)B[r](a,this.$rootGetters,n,s,u,e);else if(!c()(r)&&!o){var l;const t=null===(l=this.$rootState.$plugin)||void 0===l?void 0:l.getValidator(r);t?t(a,this.$rootGetters,n,s,u,e):console.warn(this.t("validation.custom.missing",{validatorName:r}))}})})),n}validationErrors(e=this,t={}){return this.customValidationErrors(e)}get ownersByType(){var e;const t=(null===(e=this.metadata)||void 0===e?void 0:e.ownerReferences)||[],n={};return t.forEach(e=>{n[e.kind]?n[e.kind].push(e):n[e.kind]=[e]}),n}get owners(){const e=[];for(const t in this.ownersByType){const n=this.$rootGetters["cluster/schema"](t);if(n){const i=n.id,r=this.$rootGetters["cluster/all"](i);this.ownersByType[t].forEach((t,n)=>{const i=r.find(e=>{var n;return(null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.uid)===t.uid});i&&e.push(i)})}}return e}get details(){return this._details}get _details(){var e;const t=[];return(null===(e=this.owners)||void 0===e?void 0:e.length)>0&&t.push({label:this.t("resourceDetail.detailTop.ownerReferences",{count:this.owners.length}),formatter:"ListLinkDetail",content:this.owners.map(e=>({key:e.id,row:e,col:{},value:e.metadata.name}))}),Object(f["d"])(this,"metadata.deletionTimestamp")&&t.push({label:this.t("resourceDetail.detailTop.deleted"),formatter:"LiveDate",formatterOpts:{addSuffix:!0},content:Object(f["d"])(this,"metadata.deletionTimestamp")}),t}get t(){return this.$rootGetters["i18n/t"]}findOwners(){return this._getRelationship("owner","from")}getOwners(){return this._getRelationship("owner","from")}findOwned(){return this._findRelationship("owner","to")}_relationshipsFor(e,t){var n;const i={selectors:[],ids:[]};if(null===(n=this.metadata)||void 0===n||null===(n=n.relationships)||void 0===n||!n.length)return i;for(const r of this.metadata.relationships)if(("any"===e||r.rel===e)&&r[t+"Type"])if(r.selector)Object(o["b"])(i.selectors,{type:r.toType,namespace:r.toNamespace,selector:r.selector});else{const e=r[t+"Type"];let n=r[t+"Namespace"],s=r[t+"Id"];if(!n&&s.includes("/")){const e=s.indexOf("/");n=s.substr(0,e),s=s.substr(e+1)}const a=(n?n+"/":"")+s;Object(o["a"])(i.ids,{type:e,namespace:n,name:s,id:a})}return i}_getRelationship(e,t){var n;const i=this._relationshipsFor(e,t);return null!==(n=i.selectors)&&void 0!==n&&n.length&&console.warn("Sync request for a relationship that is a selector"),i.ids||[]}async _findRelationship(e,t){const{selectors:n,ids:i}=this._relationshipsFor(e,t),r=[];for(const s of n){const e=await this.$dispatch("findMatching",s);Object(o["b"])(r,e.data)}for(const s of i){const{type:e,id:t}=s;let n=this.$getters["byId"](e,t);if(!n)try{n=await this.$dispatch("find",{type:e,id:t})}catch{}n&&Object(o["a"])(r,n)}return r}get shortId(){const e=this.id.split("/");return e.length>1?e[1]:e[0]}toJSON(){const e={},t=Object.keys(this);for(const i of t){var n;null!==(n=this[i])&&void 0!==n&&n.toJSON?e[i]=this[i].toJSON():e[i]=Object(f["b"])(this[i])}return e}toSave(){}get creationTimestamp(){var e;return null===(e=this.metadata)||void 0===e?void 0:e.creationTimestamp}get yamlFolding(){return[]}}},"9c38":function(e,t,n){var i=n("0e19"),r=n("c316"),s=n("b4b4"),o="[object String]";function a(e){return"string"==typeof e||!r(e)&&s(e)&&i(e)==o}e.exports=a},"9ce4":function(e,t,n){"use strict";(function(e){ /*! * vuex v3.6.2 * (c) 2021 Evan You diff --git a/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js.map b/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js.map index 678ae52..fa1a1fb 100644 --- a/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js.map +++ b/extensions/kubevirt-dashboard-extension/1.1.0/plugin/kubevirt-dashboard-extension-1.1.0.umd.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://kubevirt-dashboard-extension-1.1.0/webpack/universalModuleDefinition","webpack://kubevirt-dashboard-extension-1.1.0/webpack/bootstrap","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_copySymbols.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsole.vue?7011","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_stackGet.js","webpack://kubevirt-dashboard-extension-1.1.0/./models/kubevirt.io.virtualmachineinstance.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_copySymbolsIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/keys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsEqualDeep.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_cloneRegExp.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/federal/dark/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_basePropertyDeep.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/README.md","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_isPrototype.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_listCacheHas.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseGetTag.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/stubFalse.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/vue-style-loader/lib/listToStyles.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/vue-style-loader/lib/addStylesClient.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseFindIndex.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_castFunction.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_cloneArrayBuffer.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseProperty.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/now.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_stackDelete.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/VNCConsolePage.vue?895a","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/Loading.vue","webpack://kubevirt-dashboard-extension-1.1.0/../../node_modules/@rancher/shell/components/Loading.vue","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/Loading.vue?ecf2","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/Loading.vue?f85f","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/router.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/core/plugin-helpers.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_cloneBuffer.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/dark/banner.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://kubevirt-dashboard-extension-1.1.0/./node_modules/@rancher/auto-import","webpack://kubevirt-dashboard-extension-1.1.0/./actions.ts","webpack://kubevirt-dashboard-extension-1.1.0/./components/SerialConsolePage.vue","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/SerialConsole.vue","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/event-target-shim/dist/event-target-shim.mjs","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/url.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/socket.js","webpack://kubevirt-dashboard-extension-1.1.0/components/console/SerialConsole.vue","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/SerialConsole.vue?fd48","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/SerialConsole.vue?85e2","webpack://kubevirt-dashboard-extension-1.1.0/components/SerialConsolePage.vue","webpack://kubevirt-dashboard-extension-1.1.0/./components/SerialConsolePage.vue?0601","webpack://kubevirt-dashboard-extension-1.1.0/./components/SerialConsolePage.vue?94e6","webpack://kubevirt-dashboard-extension-1.1.0/./components/VNCConsolePage.vue","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsoleWrapper.vue","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/keysym.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsole.vue","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/int.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/logging.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/strings.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/browser.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/element.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/events.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/eventtarget.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/base64.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/display.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/utils/common.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/adler32.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/crc32.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/inffast.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/inftrees.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/inflate.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/zstream.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/inflator.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/trees.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/messages.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/vendor/pako/lib/zlib/deflate.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/deflator.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/keysymdef.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/vkeys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/fixedkeys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/domkeytable.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/util.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/keyboard.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/gesturehandler.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/cursor.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/websock.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/des.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/input/xtscancodes.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/encodings.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/ra2.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/util/md5.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/raw.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/copyrect.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/rre.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/hextile.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/tight.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/tightpng.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/zrle.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/decoders/jpeg.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@novnc/novnc/core/rfb.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/BrandImage.vue","webpack://kubevirt-dashboard-extension-1.1.0/../../node_modules/@rancher/shell/components/BrandImage.vue","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/BrandImage.vue?6a10","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/BrandImage.vue?cf38","webpack://kubevirt-dashboard-extension-1.1.0/components/console/NovncConsole.vue","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsole.vue?e579","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsole.vue?edd9","webpack://kubevirt-dashboard-extension-1.1.0/components/console/NovncConsoleWrapper.vue","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsoleWrapper.vue?2e18","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsoleWrapper.vue?a4da","webpack://kubevirt-dashboard-extension-1.1.0/components/VNCConsolePage.vue","webpack://kubevirt-dashboard-extension-1.1.0/./components/VNCConsolePage.vue?d1e0","webpack://kubevirt-dashboard-extension-1.1.0/./components/VNCConsolePage.vue?36bc","webpack://kubevirt-dashboard-extension-1.1.0/./index.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@vue/cli-service/lib/commands/build/entry-lib.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/sort.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_Stack.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arrayMap.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_root.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/cronstrue/dist/cronstrue.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_Promise.js","webpack://kubevirt-dashboard-extension-1.1.0/./.shell/assets/brand sync ^\\.\\/.*\\/.*$","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseTrim.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_SetCache.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getMapData.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseHasIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseToString.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/negate.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/half-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseMatchesProperty.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getRawTag.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/harvester.png","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/string.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/login-landscape.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arrayEach.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_copyObject.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_listCacheSet.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/SerialConsolePage.vue?14ef","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_stackHas.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isEmpty.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/hasIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsEqual.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isMap.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isArrayLikeObject.js","webpack://kubevirt-dashboard-extension-1.1.0/./constants.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_Set.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arrayIncludes.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_nativeKeys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_basePickBy.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_defineProperty.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_DataView.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/VNCConsolePage.vue?e3f5","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_hashHas.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_copyArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isTypedArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseAssignIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_createBaseFor.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/csp/favicon.png","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_stackClear.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/debounce.js","webpack://kubevirt-dashboard-extension-1.1.0/./models/kubevirt.io.virtualmachine.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseRest.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_equalByTag.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/suse/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseHas.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseUnary.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_stringToPath.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/config/labels-annotations.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_Symbol.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_cacheHas.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIteratee.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_overArg.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_Hash.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_nodeUtil.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/store/prefs.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_overRest.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseFor.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_hashDelete.js","webpack://kubevirt-dashboard-extension-1.1.0/external \"__jszip\"","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/error-desert-landscape.svg","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/SerialConsole.vue?f3b7","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arrayFilter.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getSymbolsIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_setToArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@vue/cli-service/node_modules/css-loader/dist/runtime/api.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/stubArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseDifference.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsoleWrapper.vue?ab9d","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseFlatten.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_toKey.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/plugins/steve/hybrid-class.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/models/schema.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/create-yaml.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/plugins/steve/steve-class.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/forIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_equalArrays.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsMatch.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_mapToArray.js","webpack://kubevirt-dashboard-extension-1.1.0/(webpack)/buildin/module.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isSymbol.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_cloneSymbol.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isArguments.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_setCacheHas.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/core/types.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/transform.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/flattenDeep.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/SerialConsolePage.vue?d205","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_toSource.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/cloneDeep.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/decoration-ground.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIndexOf.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_assignValue.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/toString.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_mapCacheDelete.js","webpack://kubevirt-dashboard-extension-1.1.0/external \"__jsyaml\"","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/constant.js","webpack://kubevirt-dashboard-extension-1.1.0/./.shell/assets/brand sync ^\\.\\/.*\\/dark\\/.*$","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_mapCacheGet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_mapCacheSet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_freeGlobal.js","webpack://kubevirt-dashboard-extension-1.1.0/(webpack)/buildin/global.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/pickBy.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseXor.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsMap.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/VNCConsolePage.vue?fa2c","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getMatchData.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/gc/gc-types.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/config/settings.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/csp/dark/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0/./components/SerialConsolePage.vue?7aea","webpack://kubevirt-dashboard-extension-1.1.0/./product.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/xterm/css/xterm.css","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_MapCache.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsole.vue?3f6e","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_isKey.js","webpack://kubevirt-dashboard-extension-1.1.0/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/uniq.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/omitBy.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_shortOut.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_objectToString.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/config/types.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getTag.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseClone.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_listCacheDelete.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/difference.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_cloneDataView.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/Loading.vue?879f","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_Uint8Array.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/platform.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_hashSet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arraySome.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_mapCacheClear.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/flow-output.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/logging-outputs.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/kubernetes-name.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/index.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/service.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/prometheusrule.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/monitoring-route.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/container-images.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/cron-schedule.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/pod-affinity.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/role-template.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/cluster-name.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/custom-validators.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/download.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/setting.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/validators/formRules/index.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/async.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/plugins/dashboard-store/resource-class.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isString.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/vuex/dist/vuex.esm.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/xor.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isEqual.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/noop.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/toNumber.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_strictIndexOf.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsoleWrapper.vue?2eb3","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_isFlattenable.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/dark/login-landscape.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/memoize.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseGetAllKeys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/eq.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_isIndex.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseKeysIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/dark/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/queue.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/promise.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/sunglasses.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_Map.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_setCacheAdd.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/federal/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arrayLikeKeys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arrayIncludesWith.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_initCloneObject.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/is-url/index.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/rgs/dark/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseUniq.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isObjectLike.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseAssign.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isObject.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/csp/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getAllKeys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isLength.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/SerialConsole.vue?2c8b","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseCreate.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/rgs/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/array.ts","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getNative.js","webpack://kubevirt-dashboard-extension-1.1.0/./.shell/assets/images/pl sync ^\\.\\/.*.*$","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseAssignValue.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/decoration-cloud-big-white.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseGet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_castPath.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsoleWrapper.vue?a013","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_equalObjects.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseSet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_arrayPush.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getAllKeysIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/keysIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseForOwn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/identity.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_apply.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsNaN.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_hasPath.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_matchesStrictComparable.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/SerialConsole.vue?bb3e","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_memoizeCapped.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/property.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/suse/dark/rancher-logo.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/has.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_hashClear.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseTimes.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/config/query-params.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isFunction.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/get.js","webpack://kubevirt-dashboard-extension-1.1.0/./.shell/assets/brand sync ^\\.\\/.*\\/metadata\\.json$","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_coreJsData.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_initCloneArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isBuffer.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/compact.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/jsonpath-plus/dist/index-browser-esm.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/utils/object.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getValue.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseKeys.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_WeakMap.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_stackSet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_listCacheGet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/Loading.vue?34ca","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsNative.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_nativeCreate.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/components/Loading.vue?e75b","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsSet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_assocIndexOf.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_cloneTypedArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_isKeyable.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_trimmedEndIndex.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_initCloneByTag.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_setToString.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/setup-step-one.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getSymbols.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsTypedArray.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseMatches.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_listCacheClear.js","webpack://kubevirt-dashboard-extension-1.1.0/./components/console/NovncConsole.vue?e27a","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_mapCacheHas.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_createSet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/brand/suse/favicon.png","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_isMasked.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isArrayLike.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/@rancher/shell/assets/images/pl/banner.svg","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_hashGet.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_ListCache.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_isStrictComparable.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseSetToString.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_nativeKeysIn.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/isSet.js","webpack://kubevirt-dashboard-extension-1.1.0/./.shell/assets/images/pl sync ^\\.\\/.*$","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_getPrototype.js","webpack://kubevirt-dashboard-extension-1.1.0//home/runner/work/dashboard-extensions/dashboard-extensions/node_modules/lodash/_baseIsArguments.js"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__5877__","__WEBPACK_EXTERNAL_MODULE__7838__","__WEBPACK_EXTERNAL_MODULE__8bbf__","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","1","jsonpScriptSrc","__webpack_require__","p","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","oldJsonpFunction","slice","s","copyObject","getSymbols","copySymbols","source","stackGet","__data__","VirtualMachineInstance","SteveModel","clusterId","$rootGetters","prefix","metadata","namespace","getSymbolsIn","copySymbolsIn","arrayLikeKeys","baseKeys","isArrayLike","keys","Stack","equalArrays","equalByTag","equalObjects","getTag","isArray","isBuffer","isTypedArray","COMPARE_PARTIAL_FLAG","argsTag","arrayTag","objectTag","objectProto","baseIsEqualDeep","other","bitmask","customizer","equalFunc","stack","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","reFlags","cloneRegExp","regexp","result","constructor","exec","lastIndex","baseGet","basePropertyDeep","path","isPrototype","Ctor","proto","assocIndexOf","listCacheHas","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseGetTag","stubFalse","listToStyles","parentId","list","styles","newStyles","item","id","css","media","sourceMap","part","parts","hasDocument","DEBUG","stylesInDom","getElementsByTagName","singletonElement","singletonCounter","isProduction","noop","options","ssrIdKey","isOldIE","navigator","test","userAgent","toLowerCase","addStylesClient","_isProduction","_options","addStylesToDom","newList","mayRemove","domStyle","refs","j","addStyle","createStyleElement","styleElement","obj","update","remove","querySelector","parentNode","removeChild","styleIndex","applyToSingletonTag","applyToTag","newObj","replaceText","textStore","index","replacement","filter","Boolean","join","styleSheet","cssText","cssNode","createTextNode","childNodes","insertBefore","ssrId","sources","btoa","unescape","encodeURIComponent","JSON","stringify","firstChild","baseFindIndex","array","predicate","fromIndex","fromRight","identity","castFunction","Uint8Array","cloneArrayBuffer","arrayBuffer","byteLength","set","baseProperty","now","Date","stackDelete","size","render","_vm","_c","_self","loading","staticClass","showMessage","class","attrs","_e","_t","staticRenderFns","props","default","String","noDelay","timer","mounted","beforeDestroy","component","getProductFromRoute","to","_to$params2","product","params","_to$name","match","findMeta","route","meta","Array","checkRouteProduct","$route","locationConfigParam","checkRouteMode","query","_EDIT","as","_CONFIG","_DETAIL","includes","_LIST","_CREATE","endsWith","checkExtensionRouteBinding","locationConfig","context","paramsToCheck","res","param","asArray","x","hash","isEqual","urlPath","exact","getApplicableExtensionEnhancements","pluginCtx","actionType","uiArea","currRoute","translationCtx","_pluginCtx$$plugin","extensionEnhancements","$plugin","getUIConfig","actions","forEach","action","ExtensionPoint","CARD","CardLocation","CLUSTER_DASHBOARD_CARD","labelKey","label","ACTION","ActionLocation","TABLE","bulkable","multiple","randomStr","HEADER","shortcut","shortcutLabel","isMac","toUpperCase","shortcutKey","windows","mac","keyboardCombo","scLabel","ucFirst","freeExports","nodeType","freeModule","moduleExports","Buffer","allocUnsafe","cloneBuffer","buffer","isDeep","copy","window","currentScript","importTypes","register","startVMs","opts","resources","map","resource","spec","running","save","stopVMs","canStopVM","canStop","canStartVM","canStart","startVMAction","icon","invoke","enabled","stopVMAction","$fetchState","pending","ref","model","vmi","callback","$$v","expression","on","fit","privateData","WeakMap","wrappers","pd","retv","assert","setCancelFlag","passiveListener","cancelable","canceled","preventDefault","Event","eventTarget","eventPhase","currentTarget","stopped","immediateStopped","timeStamp","defineRedirectDescriptor","configurable","defineCallDescriptor","apply","arguments","defineWrapper","BaseEvent","CustomEvent","writable","descriptor","getOwnPropertyDescriptor","isFunc","getWrapper","wrapper","getPrototypeOf","wrapEvent","Wrapper","isStopped","setEventPhase","setCurrentTarget","setPassiveListener","stopPropagation","stopImmediatePropagation","bubbles","composed","cancelBubble","setPrototypeOf","listenersMap","CAPTURE","BUBBLE","ATTRIBUTE","isObject","getListeners","listeners","TypeError","defineEventAttributeDescriptor","eventName","node","listenerType","listener","next","prev","delete","newNode","passive","once","defineEventAttribute","eventTargetPrototype","defineCustomEventTarget","eventNames","CustomEventTarget","EventTarget","types","Map","optionsIsObj","capture","wrappedEvent","handleEvent","defaultPrevented","addParam","url","val","out","v","parse","str","parser","strictMode","uri","queryStr","replace","q","_","$1","$2","strict","loose","sockId","warningShown","wasConnected","INSECURE","SECURE","STATE_DISCONNECTED","STATE_CONNECTING","addEventListener","STATE_CONNECTED","STATE_CLOSING","STATE_RECONNECTING","EVENT_CONNECTING","EVENT_CONNECTED","EVENT_DISCONNECTED","EVENT_MESSAGE","EVENT_FRAME_TIMEOUT","EVENT_CONNECT_ERROR","EVENT_DISCONNECT_ERROR","Socket","autoReconnect","frameTimeout","protocol","maxTries","idAsTimestamp","super","_defineProperty","setUrl","location","origin","startsWith","substr","connect","socket","state","assign","getTime","_baseLog","tries","WebSocket","onmessage","_onmessage","onopen","_opened","_error","onclose","_closed","dispatchEvent","send","disconnect","callBack","disconnectCallBacks","onError","removeEventListener","_close","reconnect","_log","getMetadata","getId","isConnected","setAutoReconnect","setAutoReconnectUrl","autoReconnectUrl","closingId","close","toString","atTime","disconnectedAt","afterMilliseconds","hasBeenOpen","hasReconnected","framesReceived","detail","_resetWatchdog","reconnectTimer","frameTimer","_this$socket","code","reason","wasClean","clean","callBacks","fn","pop","delay","Math","max","min","then","catch","isSafari","summary","_this$socket2","values","entries","unshift","log","required","terminal","fitAddon","searchAddon","webglAddon","isOpen","isOpening","backlog","firstTime","queue","computed","xtermConfig","allowProposedApi","cursorBlink","useStyle","fontSize","watch","handler","debounce","neu","msg","write","setupTerminal","methods","docStyle","getComputedStyle","xterm","addons","allHash","webgl","weblinks","search","Terminal","theme","background","getPropertyValue","trim","cursor","foreground","FitAddon","SearchAddon","WebGlAddon","loadAddon","WebLinksAddon","open","$refs","flush","onData","input","str2ab","enc","TextEncoder","encode","clear","getSocketUrl","_this$value","getSerialConsolePath","reset","show","$emit","text","focus","rows","cols","proposeDimensions","Width","Height","dispose","components","SerialConsole","Loading","layout","vm","$store","dispatch","VMI_RESOURCE_NAME","_this$vmi","title","getters","serialConsole","$event","keysRecord","_v","_s","slot","keymap","sendKeys","hasSoftRebootAction","softReboot","isDown","XK_VoidSymbol","XK_BackSpace","XK_Tab","XK_Linefeed","XK_Clear","XK_Return","XK_Pause","XK_Scroll_Lock","XK_Sys_Req","XK_Escape","XK_Delete","XK_Multi_key","XK_Codeinput","XK_SingleCandidate","XK_MultipleCandidate","XK_PreviousCandidate","XK_Kanji","XK_Muhenkan","XK_Henkan_Mode","XK_Henkan","XK_Romaji","XK_Hiragana","XK_Katakana","XK_Hiragana_Katakana","XK_Zenkaku","XK_Hankaku","XK_Zenkaku_Hankaku","XK_Touroku","XK_Massyo","XK_Kana_Lock","XK_Kana_Shift","XK_Eisu_Shift","XK_Eisu_toggle","XK_Kanji_Bangou","XK_Zen_Koho","XK_Mae_Koho","XK_Home","XK_Left","XK_Up","XK_Right","XK_Down","XK_Prior","XK_Page_Up","XK_Next","XK_Page_Down","XK_End","XK_Begin","XK_Select","XK_Print","XK_Execute","XK_Insert","XK_Undo","XK_Redo","XK_Menu","XK_Find","XK_Cancel","XK_Help","XK_Break","XK_Mode_switch","XK_script_switch","XK_Num_Lock","XK_KP_Space","XK_KP_Tab","XK_KP_Enter","XK_KP_F1","XK_KP_F2","XK_KP_F3","XK_KP_F4","XK_KP_Home","XK_KP_Left","XK_KP_Up","XK_KP_Right","XK_KP_Down","XK_KP_Prior","XK_KP_Page_Up","XK_KP_Next","XK_KP_Page_Down","XK_KP_End","XK_KP_Begin","XK_KP_Insert","XK_KP_Delete","XK_KP_Equal","XK_KP_Multiply","XK_KP_Add","XK_KP_Separator","XK_KP_Subtract","XK_KP_Decimal","XK_KP_Divide","XK_KP_0","XK_KP_1","XK_KP_2","XK_KP_3","XK_KP_4","XK_KP_5","XK_KP_6","XK_KP_7","XK_KP_8","XK_KP_9","XK_F1","XK_F2","XK_F3","XK_F4","XK_F5","XK_F6","XK_F7","XK_F8","XK_F9","XK_F10","XK_F11","XK_L1","XK_F12","XK_L2","XK_F13","XK_L3","XK_F14","XK_L4","XK_F15","XK_L5","XK_F16","XK_L6","XK_F17","XK_L7","XK_F18","XK_L8","XK_F19","XK_L9","XK_F20","XK_L10","XK_F21","XK_R1","XK_F22","XK_R2","XK_F23","XK_R3","XK_F24","XK_R4","XK_F25","XK_R5","XK_F26","XK_R6","XK_F27","XK_R7","XK_F28","XK_R8","XK_F29","XK_R9","XK_F30","XK_R10","XK_F31","XK_R11","XK_F32","XK_R12","XK_F33","XK_R13","XK_F34","XK_R14","XK_F35","XK_R15","XK_Shift_L","XK_Shift_R","XK_Control_L","XK_Control_R","XK_Caps_Lock","XK_Shift_Lock","XK_Meta_L","XK_Meta_R","XK_Alt_L","XK_Alt_R","XK_Super_L","XK_Super_R","XK_Hyper_L","XK_Hyper_R","XK_ISO_Level3_Shift","XK_ISO_Next_Group","XK_ISO_Prev_Group","XK_ISO_First_Group","XK_ISO_Last_Group","XK_space","XK_exclam","XK_quotedbl","XK_numbersign","XK_dollar","XK_percent","XK_ampersand","XK_apostrophe","XK_quoteright","XK_parenleft","XK_parenright","XK_asterisk","XK_plus","XK_comma","XK_minus","XK_period","XK_slash","XK_0","XK_1","XK_2","XK_3","XK_4","XK_5","XK_6","XK_7","XK_8","XK_9","XK_colon","XK_semicolon","XK_less","XK_equal","XK_greater","XK_question","XK_at","XK_A","XK_B","XK_C","XK_D","XK_E","XK_F","XK_G","XK_H","XK_I","XK_J","XK_K","XK_L","XK_M","XK_N","XK_O","XK_P","XK_Q","XK_R","XK_S","XK_T","XK_U","XK_V","XK_W","XK_X","XK_Y","XK_Z","XK_bracketleft","XK_backslash","XK_bracketright","XK_asciicircum","XK_underscore","XK_grave","XK_quoteleft","XK_a","XK_b","XK_c","XK_d","XK_e","XK_f","XK_g","XK_h","XK_i","XK_j","XK_k","XK_l","XK_m","XK_n","XK_o","XK_p","XK_q","XK_r","XK_s","XK_t","XK_u","XK_v","XK_w","XK_x","XK_y","XK_z","XK_braceleft","XK_bar","XK_braceright","XK_asciitilde","XK_nobreakspace","XK_exclamdown","XK_cent","XK_sterling","XK_currency","XK_yen","XK_brokenbar","XK_section","XK_diaeresis","XK_copyright","XK_ordfeminine","XK_guillemotleft","XK_notsign","XK_hyphen","XK_registered","XK_macron","XK_degree","XK_plusminus","XK_twosuperior","XK_threesuperior","XK_acute","XK_mu","XK_paragraph","XK_periodcentered","XK_cedilla","XK_onesuperior","XK_masculine","XK_guillemotright","XK_onequarter","XK_onehalf","XK_threequarters","XK_questiondown","XK_Agrave","XK_Aacute","XK_Acircumflex","XK_Atilde","XK_Adiaeresis","XK_Aring","XK_AE","XK_Ccedilla","XK_Egrave","XK_Eacute","XK_Ecircumflex","XK_Ediaeresis","XK_Igrave","XK_Iacute","XK_Icircumflex","XK_Idiaeresis","XK_ETH","XK_Eth","XK_Ntilde","XK_Ograve","XK_Oacute","XK_Ocircumflex","XK_Otilde","XK_Odiaeresis","XK_multiply","XK_Oslash","XK_Ooblique","XK_Ugrave","XK_Uacute","XK_Ucircumflex","XK_Udiaeresis","XK_Yacute","XK_THORN","XK_Thorn","XK_ssharp","XK_agrave","XK_aacute","XK_acircumflex","XK_atilde","XK_adiaeresis","XK_aring","XK_ae","XK_ccedilla","XK_egrave","XK_eacute","XK_ecircumflex","XK_ediaeresis","XK_igrave","XK_iacute","XK_icircumflex","XK_idiaeresis","XK_eth","XK_ntilde","XK_ograve","XK_oacute","XK_ocircumflex","XK_otilde","XK_odiaeresis","XK_division","XK_oslash","XK_ooblique","XK_ugrave","XK_uacute","XK_ucircumflex","XK_udiaeresis","XK_yacute","XK_thorn","XK_ydiaeresis","XK_Hangul","XK_Hangul_Hanja","XK_Hangul_Jeonja","XF86XK_ModeLock","XF86XK_MonBrightnessUp","XF86XK_MonBrightnessDown","XF86XK_KbdLightOnOff","XF86XK_KbdBrightnessUp","XF86XK_KbdBrightnessDown","XF86XK_Standby","XF86XK_AudioLowerVolume","XF86XK_AudioMute","XF86XK_AudioRaiseVolume","XF86XK_AudioPlay","XF86XK_AudioStop","XF86XK_AudioPrev","XF86XK_AudioNext","XF86XK_HomePage","XF86XK_Mail","XF86XK_Start","XF86XK_Search","XF86XK_AudioRecord","XF86XK_Calculator","XF86XK_Memo","XF86XK_ToDoList","XF86XK_Calendar","XF86XK_PowerDown","XF86XK_ContrastAdjust","XF86XK_RockerUp","XF86XK_RockerDown","XF86XK_RockerEnter","XF86XK_Back","XF86XK_Forward","XF86XK_Stop","XF86XK_Refresh","XF86XK_PowerOff","XF86XK_WakeUp","XF86XK_Eject","XF86XK_ScreenSaver","XF86XK_WWW","XF86XK_Sleep","XF86XK_Favorites","XF86XK_AudioPause","XF86XK_AudioMedia","XF86XK_MyComputer","XF86XK_VendorHome","XF86XK_LightBulb","XF86XK_Shop","XF86XK_History","XF86XK_OpenURL","XF86XK_AddFavorite","XF86XK_HotLinks","XF86XK_BrightnessAdjust","XF86XK_Finance","XF86XK_Community","XF86XK_AudioRewind","XF86XK_BackForward","XF86XK_Launch0","XF86XK_Launch1","XF86XK_Launch2","XF86XK_Launch3","XF86XK_Launch4","XF86XK_Launch5","XF86XK_Launch6","XF86XK_Launch7","XF86XK_Launch8","XF86XK_Launch9","XF86XK_LaunchA","XF86XK_LaunchB","XF86XK_LaunchC","XF86XK_LaunchD","XF86XK_LaunchE","XF86XK_LaunchF","XF86XK_ApplicationLeft","XF86XK_ApplicationRight","XF86XK_Book","XF86XK_CD","XF86XK_Calculater","XF86XK_Clear","XF86XK_Close","XF86XK_Copy","XF86XK_Cut","XF86XK_Display","XF86XK_DOS","XF86XK_Documents","XF86XK_Excel","XF86XK_Explorer","XF86XK_Game","XF86XK_Go","XF86XK_iTouch","XF86XK_LogOff","XF86XK_Market","XF86XK_Meeting","XF86XK_MenuKB","XF86XK_MenuPB","XF86XK_MySites","XF86XK_New","XF86XK_News","XF86XK_OfficeHome","XF86XK_Open","XF86XK_Option","XF86XK_Paste","XF86XK_Phone","XF86XK_Q","XF86XK_Reply","XF86XK_Reload","XF86XK_RotateWindows","XF86XK_RotationPB","XF86XK_RotationKB","XF86XK_Save","XF86XK_ScrollUp","XF86XK_ScrollDown","XF86XK_ScrollClick","XF86XK_Send","XF86XK_Spell","XF86XK_SplitScreen","XF86XK_Support","XF86XK_TaskPane","XF86XK_Terminal","XF86XK_Tools","XF86XK_Travel","XF86XK_UserPB","XF86XK_User1KB","XF86XK_User2KB","XF86XK_Video","XF86XK_WheelButton","XF86XK_Word","XF86XK_Xfer","XF86XK_ZoomIn","XF86XK_ZoomOut","XF86XK_Away","XF86XK_Messenger","XF86XK_WebCam","XF86XK_MailForward","XF86XK_Pictures","XF86XK_Music","XF86XK_Battery","XF86XK_Bluetooth","XF86XK_WLAN","XF86XK_UWB","XF86XK_AudioForward","XF86XK_AudioRepeat","XF86XK_AudioRandomPlay","XF86XK_Subtitle","XF86XK_AudioCycleTrack","XF86XK_CycleAngle","XF86XK_FrameBack","XF86XK_FrameForward","XF86XK_Time","XF86XK_Select","XF86XK_View","XF86XK_TopMenu","XF86XK_Red","XF86XK_Green","XF86XK_Yellow","XF86XK_Blue","XF86XK_Suspend","XF86XK_Hibernate","XF86XK_TouchpadToggle","XF86XK_TouchpadOn","XF86XK_TouchpadOff","XF86XK_AudioMicMute","XF86XK_Switch_VT_1","XF86XK_Switch_VT_2","XF86XK_Switch_VT_3","XF86XK_Switch_VT_4","XF86XK_Switch_VT_5","XF86XK_Switch_VT_6","XF86XK_Switch_VT_7","XF86XK_Switch_VT_8","XF86XK_Switch_VT_9","XF86XK_Switch_VT_10","XF86XK_Switch_VT_11","XF86XK_Switch_VT_12","XF86XK_Ungrab","XF86XK_ClearGrab","XF86XK_Next_VMode","XF86XK_Prev_VMode","XF86XK_LogWindowTree","XF86XK_LogGrabInfo","connected","disconnected","toUnsigned32bit","toConvert","toSigned32bit","_logLevel","Debug","Info","Warn","initLogging","level","debug","info","warn","decodeUTF8","utf8string","allowLatin1","decodeURIComponent","escape","URIError","encodeUTF8","DOMString","isTouchDevice","documentElement","ontouchstart","maxTouchPoints","msMaxTouchPoints","onFirstTouch","dragThreshold","devicePixelRatio","_supportsCursorURIs","style","indexOf","exc","supportsCursorURIs","_hasScrollbarGutter","container","visibility","overflow","body","child","scrollbarWidth","offsetWidth","platform","isWindows","isIOS","clientToElement","y","elem","bounds","getBoundingClientRect","pos","left","right","width","top","bottom","height","stopEvent","_captureRecursion","_elementForUnflushedEvents","_captureProxy","newEv","captureElement","releaseCapture","_capturedElemChanged","proxyElem","getElementById","_captureObserver","MutationObserver","setCapture","position","zIndex","display","observe","attributes","EventTargetMixin","_listeners","has","Set","add","toBase64Table","split","base64Pad","lengthpad","toBinaryTable","offset","dataLength","resultLength","floor","leftbits","leftdata","idx","charCodeAt","padding","charAt","_drawCtx","_renderQ","_flushing","_fbWidth","_fbHeight","_prevDrawStyle","_target","getContext","_targetCtx","_viewportLoc","_backbuffer","_damageBounds","_scale","_clipViewport","onflush","scale","_rescale","viewport","vp","viewportChangeSize","w","h","viewportChangePos","deltaX","deltaY","vx2","vy2","_damage","flip","canvas","saveImg","getImageData","putImageData","encoderOptions","toDataURL","quality","toBlob","fromQueue","vx","vy","drawImage","_renderQPush","color","_setFillColor","fillRect","oldX","oldY","newX","newY","mozImageSmoothingEnabled","webkitImageSmoothingEnabled","msImageSmoothingEnabled","imageSmoothingEnabled","mime","arr","img","Image","Uint8ClampedArray","byteOffset","ImageData","newArr","containerWidth","containerHeight","scaleRatio","targetAspectRatio","fbAspectRatio","factor","newStyle","fillStyle","_scanRenderQ","_noVNCDisplay","_resumeRenderQ","ready","a","copyImage","blitImage","complete","arraySet","dest","src_offs","len","dest_offs","subarray","Buf8","Buf16","Uint16Array","Buf32","Int32Array","adler32","adler","buf","s1","s2","makeTable","table","k","BAD","TYPE","inflate_fast","strm","start","_in","last","_out","beg","end","dmax","wsize","whave","wnext","s_window","hold","bits","lcode","dcode","lmask","dmask","here","op","dist","from","from_source","output","next_in","avail_in","next_out","avail_out","lencode","distcode","lenbits","distbits","dolen","dodist","sane","MAXBITS","ENOUGH_LENS","ENOUGH_DISTS","CODES","LENS","DISTS","lbase","lext","dbase","dext","inflate_table","lens","lens_index","codes","table_index","work","incr","fill","low","mask","here_bits","here_op","here_val","sym","curr","drop","used","huff","base","base_index","count","offs","extra","extra_index","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","Z_BUF_ERROR","Z_DEFLATED","HEAD","FLAGS","TIME","OS","EXLEN","EXTRA","NAME","COMMENT","HCRC","DICTID","DICT","TYPEDO","STORED","COPY_","COPY","LENLENS","CODELENS","LEN_","LEN","LENEXT","DIST","DISTEXT","MATCH","LIT","CHECK","LENGTH","DONE","MEM","SYNC","MAX_WBITS","DEF_WBITS","zswap32","InflateState","wrap","havedict","flags","check","total","wbits","ncode","nlen","ndist","have","lendyn","distdyn","back","was","inflateResetKeep","total_in","total_out","inflateReset","inflateReset2","windowBits","inflateInit2","ret","inflateInit","lenfix","distfix","virgin","fixedtables","updatewindow","inflate","put","last_bits","last_op","last_val","hbuf","order","inf_leave","done","time","xflags","os","extra_len","fromCharCode","comment","hcrc","data_type","ZStream","chunkSize","expected","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","zero","STORED_BLOCK","STATIC_TREES","DYN_TREES","MIN_MATCH","MAX_MATCH","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","Buf_size","MAX_BL_BITS","END_BLOCK","REP_3_6","REPZ_3_10","REPZ_11_138","extra_lbits","extra_dbits","extra_blbits","bl_order","DIST_CODE_LEN","static_ltree","static_dtree","_dist_code","_length_code","base_length","static_l_desc","static_d_desc","static_bl_desc","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","TreeDesc","dyn_tree","stat_desc","max_code","d_code","put_short","pending_buf","send_bits","bi_valid","bi_buf","send_code","tree","bi_reverse","bi_flush","gen_bitlen","desc","xbits","f","stree","bl_count","heap","heap_max","opt_len","static_len","gen_codes","next_code","tr_static_init","init_block","dyn_ltree","dyn_dtree","bl_tree","last_lit","matches","bi_windup","copy_block","header","smaller","depth","_n2","_m2","pqdownheap","heap_len","compress_block","ltree","dtree","lc","lx","d_buf","l_buf","build_tree","scan_tree","curlen","prevlen","nextlen","max_count","min_count","send_tree","build_bl_tree","max_blindex","l_desc","d_desc","bl_desc","send_all_trees","lcodes","dcodes","blcodes","rank","detect_data_type","black_mask","static_init_done","_tr_init","_tr_stored_block","stored_len","_tr_align","_tr_flush_block","opt_lenb","static_lenb","strategy","_tr_tally","lit_bufsize","2","0","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_FULL_FLUSH","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_DEFAULT_STRATEGY","configuration_table","MAX_MEM_LEVEL","DEF_MEM_LEVEL","MIN_LOOKAHEAD","PRESET_DICT","INIT_STATE","EXTRA_STATE","NAME_STATE","COMMENT_STATE","HCRC_STATE","BUSY_STATE","FINISH_STATE","BS_NEED_MORE","BS_BLOCK_DONE","BS_FINISH_STARTED","BS_FINISH_DONE","OS_CODE","errorCode","flush_pending","pending_out","flush_block_only","block_start","strstart","put_byte","b","putShortMSB","read_buf","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","w_size","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","lookahead","match_start","fill_window","more","_w_size","window_size","hash_size","insert","ins_h","hash_shift","hash_mask","deflate_stored","max_block_size","pending_buf_size","max_start","deflate_fast","hash_head","bflush","match_length","max_lazy_match","deflate_slow","max_insert","prev_match","match_available","deflate_rle","deflate_huff","Config","good_length","max_lazy","nice_length","max_chain","func","lm_init","DeflateState","status","gzhead","gzindex","method","last_flush","w_bits","hash_bits","deflateResetKeep","deflateReset","deflateInit2","memLevel","deflateInit","deflate","old_flush","level_flags","bstate","outputBuffer","inData","lastRet","outData","chunks","totalLen","newData","codepoints","u","keysym","DOMKeyTable","addStandard","standard","addLeftRight","addNumpad","numpad","getKeycode","evt","keyCode","vkeys","getKey","fixedkeys","charCode","getKeysym","codepoint","lookup","_keyDownList","_altGrArmed","_eventHandlers","_handleKeyUp","_handleKeyDown","_allKeysUp","onkeyevent","down","keyIdentifier","parseInt","char","_getKeyCode","_altGrTimeout","_altGrCtrlTime","_sendKeyEvent","metaKey","jpBadKeys","_handleAltGrTimeout","keydown","keyup","blur","GH_NOGESTURE","GH_ONETAP","GH_TWOTAP","GH_THREETAP","GH_DRAG","GH_LONGPRESS","GH_TWODRAG","GH_PINCH","GH_INITSTATE","GH_MOVE_THRESHOLD","GH_ANGLE_THRESHOLD","GH_MULTITOUCH_TIMEOUT","GH_TAP_TIMEOUT","GH_LONGPRESS_TIMEOUT","GH_TWOTOUCH_TIMEOUT","GestureHandler","_state","_tracked","_ignored","_waitingRelease","_releaseStart","_longpressTimeoutId","_twoTouchTimeoutId","_boundEventHandler","_eventHandler","detach","_stopLongpressTimeout","_stopTwoTouchTimeout","_touchStart","_touchMove","_touchEnd","changedTouches","touch","identifier","clientX","clientY","_hasDetectedGesture","started","active","firstX","firstY","lastX","lastY","angle","_startLongpressTimeout","find","atan2","PI","hypot","prevTouch","prevDeltaMove","deltaAngle","abs","_isTwoTouchTimeoutRunning","_startTwoTouchTimeout","_pushEvent","splice","some","_longpressTimeout","_twoTouchTimeout","avgM","_getAverageMovement","avgMoveH","avgMoveV","avgD","_getAverageDistance","deltaTouchDistance","first","_stateToGesture","avg","_getPosition","distance","movement","gev","fx","fy","ly","totalH","totalV","fdx","fdy","ldx","ldy","useFallback","Cursor","_canvas","pointerEvents","userSelect","WebkitUserSelect","_position","_hotSpot","_handleMouseOver","_handleMouseLeave","_handleMouseMove","_handleMouseUp","mouseover","mouseleave","mousemove","mouseup","rgba","hotx","hoty","ctx","clearRect","_updatePosition","visualViewport","offsetLeft","offsetTop","elementFromPoint","_updateVisibility","relatedTarget","_captureIsActive","contains","_shouldShowCursor","_showCursor","_hideCursor","MAX_RQ_GROW_SIZE","DataChannel","CONNECTING","OPEN","CLOSING","CLOSED","ReadyStates","rawChannelProps","_websocket","_rQi","_rQlen","_rQbufferSize","_rQ","_sQbufferSize","_sQlen","_sQ","subState","readyState","bytes","_rQshift","byte","rQlen","rQshiftBytes","num","goback","_encodeMessage","chr","_allocateBuffers","protocols","attach","rawChannel","init","channelProps","getOwnPropertyNames","prop","binaryType","_recvMessage","minFit","requiredBufferSize","resizeNeeded","oldRQbuffer","copyWithin","u8","_expandCompactRQ","_DecodeMessage","PC2","totrot","z","SP1","SP2","SP3","SP4","SP5","SP6","SP7","SP8","DES","password","pc1m","pcr","kn","rawi","KnLi","raw0","raw1","keysi","fval","enc8","concat","encodings","encodingRaw","encodingCopyRect","encodingRRE","encodingHextile","encodingTight","encodingZRLE","encodingTightPNG","encodingJPEG","pseudoEncodingQualityLevel9","pseudoEncodingQualityLevel0","pseudoEncodingDesktopSize","pseudoEncodingLastRect","pseudoEncodingCursor","pseudoEncodingQEMUExtendedKeyEvent","pseudoEncodingDesktopName","pseudoEncodingExtendedDesktopSize","pseudoEncodingXvp","pseudoEncodingFence","pseudoEncodingContinuousUpdates","pseudoEncodingCompressLevel9","pseudoEncodingCompressLevel0","pseudoEncodingVMwareCursor","pseudoEncodingExtendedClipboard","AESEAXCipher","_rawKey","_ctrKey","_cbcKey","_zeroBlock","_prefixBlock0","_prefixBlock1","_prefixBlock2","block","encrypted","crypto","subtle","encrypt","iv","k1","_encryptBlock","k2","lut","_k1","_k2","counter","decrypted","decrypt","prefixBlock","ceil","cbcData","cbcEncrypted","importKey","_initCMAC","associatedData","nonce","nCMAC","_computeCMAC","_encryptCTR","adCMAC","computedMac","_decryptCTR","RA2Cipher","_cipher","_counter","setKey","ad","keyLength","_key","_keyLength","_keyBytes","_n","_d","_nBigInt","_eBigInt","_dBigInt","padEnd","decode","hex","padStart","BigInt","bigint","padLength","generateKey","modulusLength","publicExponent","privateKey","exportKey","_padArray","_base64urlDecode","_u8ArrayToBigInt","ps","getRandomValues","em","emBigInt","_modPow","_bigIntToU8Array","msgBigInt","sock","getCredentials","_hasStarted","_checkSock","_checkCredentials","_approveServerResolve","_sockReject","_credentialsReject","_approveServerReject","_sock","_getCredentials","hasData","rQwait","subtype","hasCredentials","username","_waitSockAsync","serverKeyLengthBuffer","rQslice","serverKeyLength","rQshift32","serverKeyBytes","serverN","serverE","serverRSACipher","setPublicKey","serverPublickey","publickey","_waitApproveKeyAsync","clientKeyLength","clientKeyBytes","clientRSACipher","clientN","clientE","clientPublicKey","clientRandom","clientEncryptedRandom","clientRandomMessage","rQshift16","serverEncryptedRandom","serverRandom","clientSessionKey","serverSessionKey","digest","clientCipher","serverCipher","serverHash","clientHash","makeMessage","serverHashReceived","receiveMessage","_waitCredentialsAsync","credentials","MD5","M","V","Y","X","g","ii","hh","gg","ff","cmn","rol","RawDecoder","_lines","pixelSize","bytesPerLine","curY","currHeight","pixels","rQ","rQi","newdata","rQskipBytes","CopyRectDecoder","RREDecoder","_subrects","sx","sy","swidth","sheight","_tiles","_lastsubencoding","_tileBuffer","_tilesX","_tilesY","_totalTiles","subencoding","currTile","tileX","tileY","tx","ty","tw","th","subrects","_background","_foreground","_startTile","xy","wh","sw","sh","_subTile","_finishTile","_tileX","_tileY","_tileW","_tileH","red","green","blue","xend","yend","_ctl","_filter","_numColors","_palette","_len","_zlibs","rQshift8","_fillRect","_jpegRect","_pngRect","_basicRect","_readData","imageRect","ctl","streamId","_copyFilter","_paletteFilter","_gradientFilter","uncompressedSize","setInput","rgbx","numColors","rQpeek8","paletteSize","rQshiftTo","bpp","rowSize","_monoRect","_paletteRect","palette","_getScratchBuffer","w1","dp","sp","_scratchBuffer","ZRLE_TILE_WIDTH","ZRLE_TILE_HEIGHT","_length","_inflator","_pixelBuffer","tileSize","_readPixels","_decodePaletteTile","_decodeRLETile","_decodeRLEPaletteTile","tilew","tileh","bitsPerPixel","_getBitsPerPixelInPalette","encoded","indexInPalette","pixel","_readRLELength","current","JPEGDecoder","_quantTables","_huffmanTables","_cachedQuantTables","_cachedHuffmanTables","_jpegLength","_segments","_parseJPEG","sofIndex","findIndex","segments","bufferLength","hasFoundEndOfScan","segment","DISCONNECT_TIMEOUT","DEFAULT_BACKGROUND","MOUSE_MOVE_DELAY","WHEEL_STEP","WHEEL_LINE_HEIGHT","GESTURE_ZOOMSENS","GESTURE_SCRLSENS","DOUBLE_TAP_TIMEOUT","DOUBLE_TAP_THRESHOLD","securityTypeNone","securityTypeVNCAuth","securityTypeRA2ne","securityTypeTight","securityTypeVeNCrypt","securityTypeXVP","securityTypeARD","securityTypeMSLogonII","securityTypeUnixLogon","securityTypePlain","extendedClipboardFormatText","extendedClipboardActionCaps","extendedClipboardActionRequest","extendedClipboardActionPeek","extendedClipboardActionNotify","extendedClipboardActionProvide","urlOrChannel","isSecureContext","_url","_rawChannel","_rfbCredentials","_shared","shared","_repeaterID","repeaterID","_wsProtocols","wsProtocols","_rfbConnectionState","_rfbInitState","_rfbAuthScheme","_rfbCleanDisconnect","_rfbRSAAESAuthenticationState","_rfbVersion","_rfbMaxVersion","_rfbTightVNC","_rfbVeNCryptState","_rfbXvpVer","_fbName","_capabilities","power","_supportsFence","_supportsContinuousUpdates","_enabledContinuousUpdates","_supportsSetDesktopSize","_screenID","_screenFlags","_qemuExtKeyEventSupported","_clipboardText","_clipboardServerCapabilitiesActions","_clipboardServerCapabilitiesFormats","_display","_keyboard","_gestures","_resizeObserver","_disconnTimer","_resizeTimeout","_mouseMoveTimer","_decoders","_FBU","rects","encoding","_mousePos","_mouseButtonMask","_mouseLastMoveTime","_viewportDragging","_viewportDragPos","_viewportHasMoved","_accumulatedWheelDeltaX","_accumulatedWheelDeltaY","_gestureLastTapTime","_gestureFirstDoubleTapEv","_gestureLastMagnitudeX","_gestureLastMagnitudeY","focusCanvas","_focusCanvas","handleResize","_handleResize","handleMouse","_handleMouse","handleWheel","_handleWheel","handleGesture","_handleGesture","handleRSAAESCredentialsRequired","_handleRSAAESCredentialsRequired","handleRSAAESServerVerification","_handleRSAAESServerVerification","_screen","margin","outline","tabIndex","_cursor","_cursorImage","cursors","none","_onFlush","_handleKeyEvent","_socketOpen","_socketClose","_handleMessage","_socketError","_expectedClientWidth","_expectedClientHeight","ResizeObserver","_updateConnectionState","dragViewport","focusOnClick","_viewOnly","_clippingViewport","_scaleViewport","_resizeSession","_showDotCursor","showDotCursor","_qualityLevel","_compressionLevel","viewOnly","ungrab","grab","button","_updateClip","_updateScale","resize","_requestRemoteResize","_refreshCursor","cssValue","qualityLevel","Number","isInteger","_sendEncodings","compressionLevel","off","approveServer","creds","_resumeAuthentication","sendKey","_xvpOp","scancode","messages","QEMUExtendedKeyEvent","keyEvent","extendedClipboardNotify","codePoint","codePointAt","clientCutText","_fail","preventScroll","clientWidth","clientHeight","currentWidth","currentHeight","_currentClientSize","_clientHasExpectedSize","requestAnimationFrame","curClip","clipViewport","newClip","_screenSize","_fixScrollbars","_setClippingViewport","_saveExpectedClientSize","autoscale","setDesktopSize","orig","oldstate","_connect","_disconnect","details","cap","capabilities","_normalMsg","_initMsg","ev","_handleMouseButton","bmask","_sendMouse","timeSinceLastMove","_handleDelayedMouseMove","pointerEvent","absX","absY","dX","dY","deltaMode","elementX","elementY","move","dx","dy","_fakeMouseMove","magnitude","_handleTapEvent","magnitudeX","magnitudeY","sversion","rQshiftStr","isRepeater","sendString","cversion","clientTypes","numTypes","_securityContext","_securityStatus","_isSupportedSecurityType","strlen","xvpAuthStr","_negotiateAuthentication","major","minor","subtypesLength","_rfbVeNCryptSubtypesLength","subtypes","user","pass","challenge","response","genDES","ardPublicKey","ardCredentials","generator","prime","serverPublicKey","clientPrivateKey","_negotiateARDAuthAsync","exponent","modulus","baseHex","exponentHex","modulusHex","hexResult","bytesResult","string","keyString","aesKey","encryptedBlock","sharedKey","substring","paddedUsername","paddedPassword","_aesEcbEncrypt","numTunnels","clientSupportedTunnelTypes","vendor","signature","serverSupportedTunnelTypes","capCode","capVendor","capSignature","_negotiateTightTunnels","subAuthCount","clientSupportedTypes","serverSupportedTypes","authType","checkInternalEvents","hasStarted","negotiateRA2neAuthAsync","finally","A","B","secret","des","usernameBytes","passwordBytes","_negotiateXvpAuth","_negotiateARDAuth","_negotiateStdVNCAuth","_negotiateTightAuth","_negotiateVeNCryptAuth","_negotiatePlainAuth","_negotiateTightUnixAuth","_negotiateRA2neAuth","_negotiateMSLogonIIAuth","bigEndian","trueColor","redMax","greenMax","blueMax","redShift","greenShift","blueShift","nameLength","numServerMessages","numClientMessages","numEncodings","totalMessagesLength","_setDesktopName","_resize","_fbDepth","pixelFormat","fbUpdateRequest","encs","clientEncodings","_negotiateProtocolVersion","_negotiateSecurity","_handleSecurityResult","_handleSecurityReason","_negotiateServerInit","formats","isCaps","clientActions","extendedClipboardCaps","extendedClipboardProvide","extendedClipboardRequest","zlibStream","streamInflator","textData","format","sizeArray","tmpText","payload","clientFence","xvpVer","xvpMsg","_setCapability","msgType","_framebufferUpdate","_handleSetColourMapMsg","_handleServerCutText","_updateContinuousUpdates","_handleServerFenceMsg","_handleXvpMsg","hdr","_handleRect","_handleVMwareCursor","_handleCursor","_handleDesktopName","_handleExtendedDesktopSize","_handleDataRect","cursorType","bytesPerPixel","PIXEL_MASK","andMask","xorMask","bgr","_updateCursor","pixelslength","masklength","pixIdx","maskIdx","alpha","numberOfScreens","firstUpdate","decoder","decodeRect","enableContinuousUpdates","ver","xvpOp","rgbaPixels","image","_shouldShowDotCursor","dot","change","passwordChars","buff","keycode","getRFBkeycode","xtScanCode","upperByte","lowerByte","RFBkeycode","formatFlag","actionFlag","deflator","dataToDeflate","deflatedData","_buildExtendedClipboardFlags","formatKeys","sort","loopOffset","extended","dataOffset","remaining","flushSize","enable","incremental","_b","pathToBrandedImage","$attrs","fileName","dark","_managementSettings$f","_managementSettings$f2","managementSettings","MANAGEMENT","SETTING","uiLoginBackgroundLight","setting","LOGIN_BACKGROUND_LIGHT","uiLoginBackgroundDark","LOGIN_BACKGROUND_DARK","mapGetters","brand","BRAND","uiLogoLight","LOGO_LIGHT","uiLogoDark","LOGO_DARK","uiBannerLight","BANNER_LIGHT","uiBannerDark","BANNER_DARK","defaultPathToBrandedImage","themePrefix","BrandImage","rfb","$nextTick","RFB","view","ctrlAltDelete","sendCtrlAltDel","SHORT_KEYS","ControlLeft","KeyTable","AltLeft","FUNCTION_KEYS","Delete","PrintScreen","NORMAL_KEYS","KeyN","KeyT","KeyW","KeyY","F_KEYS","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","NovncConsole","vmResource","VM_RESOURCE_NAME","isEmpty","ip","hostname","port","getVMIApiPath","allKeys","_this$vmResource","softreboot","novncConsole","reverse","popover","softrebootVM","NovncConsoleWrapper","plugin","addProduct","addAction","addRoute","PRODUCT_NAME","SerialConsolePage","VNCConsolePage","TYPE_MAP","typeOf","spaceship","diff","TYPE_ORDER","null","boolean","number","instance","function","date","compare","typeA","typeB","localeCompare","aLen","bLen","parseField","field","sortBy","ary","objA","objB","parsed","splitRegex","notNumericRegex","sortableNumericSuffix","strPad","ListCache","stackClear","stackHas","stackSet","arrayMap","iteratee","freeGlobal","freeSelf","Function","stringUtilities_1","cronParser_1","ExpressionDescriptor","expressionParts","locales","locale","i18n","use24HourTimeFormat","use24HourTimeFormatByDefault","_a","throwExceptionOnParseError","verbose","dayOfWeekStartIndexZero","_f","descripter","getFullDescription","initialize","localesLoader","specialCharacters","load","description","CronParser","timeSegment","getTimeOfDayDescription","dayOfMonthDesc","getDayOfMonthDescription","monthDesc","getMonthDescription","dayOfWeekDesc","getDayOfWeekDescription","yearDesc","getYearDescription","transformVerbosity","toLocaleUpperCase","ex","anErrorOccuredWhenGeneratingTheExpressionD","secondsExpression","minuteExpression","hourExpression","StringUtilities","containsAny","hourParts","at","formatTime","spaceAnd","secondsDescription","getSecondsDescription","minutesDescription","getMinutesDescription","hoursDescription","getHoursDescription","minuteParts","everyMinuteBetweenX0AndX1","atSpace","_this","getSegmentDescription","everySecond","everyX0Seconds","secondsX0ThroughX1PastTheMinute","atX0SecondsPastTheMinute","atX0SecondsPastTheMinuteGt20","everyMinute","everyX0Minutes","minutesX0ThroughX1PastTheHour","everyHour","atX0MinutesPastTheHour","atX0MinutesPastTheHourGt20","everyX0Hours","betweenX0AndX1","atX0","daysOfWeekNames","daysOfTheWeek","commaEveryDay","exp","commaEveryX0DaysOfTheWeek","commaX0ThroughX1","dayOfWeekOfMonthNumber","dayOfWeekOfMonthDescription","second","third","fourth","fifth","commaOnThe","spaceX0OfTheMonth","commaOnTheLastX0OfTheMonth","domSpecified","commaAndOnX0","commaOnlyOnX0","monthNames","monthsOfTheYear","commaEveryX0Months","commaMonthX0ThroughMonthX1","commaOnlyInMonthX0","commaOnlyInX0","commaOnTheLastDayOfTheMonth","commaOnTheLastWeekdayOfTheMonth","weekDayNumberMatches","dayNumber","dayString","firstWeekday","weekdayNearestDayX0","commaOnTheX0OfTheMonth","lastDayOffSetMatches","offSetDays","commaDaysBeforeTheLastDayOfTheMonth","lastDay","dayX0","commaEveryX0Days","commaBetweenDayX0AndX1OfTheMonth","commaOnDayX0OfTheMonth","getFullYear","commaEveryX0Years","commaYearX0ThroughYearX1","commaOnlyInYearX0","allDescription","getSingleItemDescription","getIntervalDescriptionFormat","getBetweenDescriptionFormat","getDescriptionFormat","betweenSegmentDescription","generateBetweenSegmentDescription","rangeItemDescription","commaStartingX0","descriptionContent","betweenExpression","betweenSegments","betweenSegment1Description","betweenSegment2Description","betweenDescriptionFormat","secondExpression","hour","period","setPeriodBeforeTime","getPeriod","minute","useVerboseFormat","RegExp","pm","am","template","_i","searchStrings","extractParts","normalize","validate","dowDigits","dowDigitsAdjusted","days","SUN","MON","TUE","WED","THU","FRI","SAT","day","months","JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","month","stepRangeThrough","assertNoInvalidCharacters","partDescription","invalidChars","en","commaEveryHour","expressionDescriptor_ts_1","enLocaleLoader_1","enLocaleLoader","en_1","availableLocales","getNative","webpackContext","req","webpackContextResolve","trimmedEndIndex","reTrimStart","baseTrim","MapCache","setCacheAdd","setCacheHas","SetCache","isKeyable","getMapData","baseHasIn","isSymbol","INFINITY","symbolProto","symbolToString","baseToString","FUNC_ERROR_TEXT","negate","args","baseIsEqual","hasIn","isKey","isStrictComparable","matchesStrictComparable","toKey","COMPARE_UNORDERED_FLAG","baseMatchesProperty","srcValue","objValue","nativeObjectToString","isOwn","tag","unmasked","camelToTitle","dasherize","toLength","padChars","neededLen","padStr","entityMap","escapeHtml","html","escapeRegex","random32","tmp","Uint32Array","random","CHARSET","NUMERIC","NO_VOWELS","ALPHA","ALPHA_NUM","ALPHA_LOWER","ALPHA_UPPER","HEX","PASSWORD","chars","indent","lines","token","afterRegex","line","suffix","decamelizeRegex","decamelize","dasherizeRegex","matchesSomeRegex","stringRaw","regexes","regexRaw","regex","ensureRegex","strOrRegex","quotedMatch","splitObjectPath","joinObjectPath","isIpv4","reg","arrayEach","assignValue","baseAssignValue","isNew","newValue","listCacheSet","content","locals","isArguments","mapTag","setTag","hasPath","isObjectLike","baseIsMap","baseUnary","nodeUtil","nodeIsMap","isMap","isArrayLikeObject","KUBEVIRT_RESOURCE_NAME","baseIndexOf","arrayIncludes","overArg","nativeKeys","baseSet","castPath","basePickBy","paths","DataView","___CSS_LOADER_API_IMPORT___","nativeCreate","hashHas","copyArray","baseIsTypedArray","nodeIsTypedArray","keysIn","baseAssignIn","createBaseFor","keysFunc","iterable","toNumber","nativeMax","nativeMin","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","thisArg","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","debounced","isInvoking","OFF","VMI_WAITING_MESSAGE","VM_ERROR","STOPPING","NOT_READY","PAUSED","PAUSED_VM_MODAL_MESSAGE","POD_STATUS_COMPLETED","POD_STATUS_SUCCEEDED","POD_STATUS_RUNNING","POD_STATUS_ALL_READY","RunStrategy","Always","RerunOnFailure","Halted","Manual","StateChangeRequest","Start","Stop","STARTING_MESSAGE","VMIPhase","Pending","Scheduling","Scheduled","Running","Succeeded","Failed","Unknown","IgnoreMessages","VirtualMachine","runStrategy","_vmi$spec","_this$spec$template","$getters","domain","cpu","cores","_vmi$status","NODE","nodeName","_this$spec$template$s","_this$spec$template$s2","_this$spec$template$s3","limits","memory","requests","guest","_this$spec$template$s4","interfaces","devices","podList","POD","pod","_this$vmi2","_pod$metadata","ownerReferences","_this$status","_this$status2","_this$status3","_this$status4","conditions","changeRequests","printableStatus","C","stateChangeRequests","chRequest","_this$status5","isVMCreated","_this$vmi3","isPause","cond","vmFailureCond","findBy","detailedMessage","_this$vmi4","vmiFailureCond","podResource","phase","_findBy","_this$vmi5","isVMIReady","_this$vmi6","VMIReadyCondition","_this$vmi7","isVMExpectedRunning","podStatus","getPodStatus","_this$vmi8","_this$vmi$status","_this$vmi9","_this$status6","created","volumeClaimTemplates","_this$metadata","_this$vmi10","_this$isPaused","_this$isVMError","_this$isBeingStopped","_this$isOff","_this$isError","_this$isRunning","_this$isNotReady","_this$isStarting","_this$isWaitingForVMI","_this$otherState","deletionTimestamp","migrationState","isPaused","isVMError","isBeingStopped","isOff","isError","isRunning","isNotReady","isStarting","isWaitingForVMI","otherState","actualState","overRest","setToString","baseRest","eq","mapToArray","setToArray","boolTag","dateTag","errorTag","numberTag","regexpTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","symbolValueOf","valueOf","convert","isPartial","stacked","baseHas","memoizeCapped","rePropName","reEscapeChar","stringToPath","quote","subString","NORMAN_NAME","DESCRIPTION","CATTLE_PUBLIC_ENDPOINTS","CATTLE_REGEX","LABELS_TO_IGNORE_REGEX","ANNOTATIONS_TO_IGNORE_REGEX","HCI","CLOUD_INIT","CLOUD_PROVIDER_IPAM","NETWORK_ROUTE","IMAGE_NAME","NETWORK_TYPE","PRIMARY_SERVICE","cacheHas","cache","baseMatches","baseIteratee","transform","arg","hashClear","hashDelete","hashGet","hashSet","Hash","entry","freeProcess","process","binding","definitions","def","opt","parseJSON","asCookie","asUserPreference","inheritFrom","mangleRead","mangleWrite","mapPref","GROUP_RESOURCES","ROWS_PER_PAGE","DEV","VIEW_IN_API","_RKE1","_RKE2","otherArgs","baseFor","___CSS_LOADER_AT_RULE_IMPORT_0___","arrayFilter","resIndex","arrayPush","getPrototype","stubArray","nativeGetSymbols","getOwnPropertySymbols","cssWithMappingToString","useSourceMap","cssMapping","sourceMapping","toComment","sourceURLs","sourceRoot","base64","mediaQuery","dedupe","alreadyImportedModules","arrayIncludesWith","LARGE_ARRAY_SIZE","baseDifference","comparator","isCommon","valuesLength","outer","valuesIndex","isFlattenable","baseFlatten","isStrict","cleanHybridResources","potentialNormanHoldovers","HybridModel","Resource","rehydrateNamespace","setClone","cleanedData","labels","omitBy","setLabels","wasIgnored","pickBy","Vue","setLabel","_this$metadata2","_this$metadata3","annotations","setAnnotations","setAnnotation","_this$metadata4","_this$stateObj","stateObj","_this$metadata5","_this$spec","_description","NEVER_ADD","STEVE_ADD","STEVE_NEVER_SAVE","na","_name","cleanForSave","forNew","deleteProperty","forIn","arraySome","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","baseIsMatch","matchData","noCustomizer","webpackPolyfill","deprecate","children","cloneSymbol","symbol","baseIsArguments","propertyIsEnumerable","PanelLocation","TabLocation","TableColumnLocation","baseCreate","baseForOwn","isFunction","accumulator","isArr","isArrLike","flattenDeep","funcProto","funcToString","toSource","baseClone","CLONE_DEEP_FLAG","CLONE_SYMBOLS_FLAG","cloneDeep","baseIsNaN","strictIndexOf","mapCacheDelete","constant","mapCacheGet","mapCacheSet","global","getAllKeysIn","baseUniq","baseXor","arrays","getMatchData","VERSION_RANCHER","VERSION_CLI","VERSION_MACHINE","VERSION_HELM","CLI_URL","DARWIN","WINDOWS","LINUX","API_HOST","CA_CERTS","HIDE_LOCAL_CLUSTER","AUTH_TOKEN_MAX_TTL_MINUTES","KUBECONFIG_GENERATE_TOKEN","KUBECONFIG_DEFAULT_TOKEN_TTL_MINUTES","ENGINE_URL","ENGINE_ISO_URL","FIRST_LOGIN","INGRESS_IP_DOMAIN","SERVER_URL","RKE_METADATA_CONFIG","TELEMETRY","EULA_AGREED","AUTH_USER_INFO_MAX_AGE_SECONDS","AUTH_USER_SESSION_TTL_MINUTES","AUTH_USER_INFO_RESYNC_CRON","AUTH_LOCAL_VALIDATE_DESC","PASSWORD_MIN_LENGTH","CLUSTER_TEMPLATE_ENFORCEMENT","UI_INDEX","UI_DASHBOARD_INDEX","UI_DASHBOARD_HARVESTER_LEGACY_PLUGIN","UI_OFFLINE_PREFERRED","SYSTEM_DEFAULT_REGISTRY","UI_ISSUES","PL","PL_RANCHER_VALUE","SUPPORTED","BANNERS","ISSUES","PRIMARY_COLOR","LINK_COLOR","COMMUNITY_LINKS","FAVICON","UI_PERFORMANCE","UI_CUSTOM_LINKS","UI_SUPPORTED_K8S_VERSIONS","THEME","SYSTEM_NAMESPACES","CLUSTER_AGENT_DEFAULT_AFFINITY","FLEET_AGENT_DEFAULT_AFFINITY","ADD_EXTENSION_REPOS_BANNER_DISPLAY","AGENT_TLS_MODE","USER_RETENTION_CRON","USER_RETENTION_DRY_RUN","USER_LAST_LOGIN_DEFAULT","DISABLE_INACTIVE_USER_AFTER","DELETE_INACTIVE_USER_AFTER","store","basicType","DSL","inStore","showNamespaceFilter","ifHaveType","mapCacheClear","mapCacheHas","reIsDeepProp","reIsPlainProp","uniq","HOT_COUNT","HOT_SPAN","nativeNow","shortOut","lastCalled","stamp","STEVE","PREFERENCE","SCHEMA_DEFINITION","RBAC","ROLE","CLUSTER_ROLE","ROLE_BINDING","CLUSTER_ROLE_BINDING","WORKLOAD_TYPES","DEPLOYMENT","CRON_JOB","DAEMON_SET","JOB","STATEFUL_SET","REPLICA_SET","REPLICATION_CONTROLLER","scalableWorkloads","AUTH_CONFIG","CATALOG_TEMPLATE","CLUSTER","CLUSTER_ROLE_TEMPLATE_BINDING","FEATURE","KONTAINER_DRIVER","MULTI_CLUSTER_APP","NODE_DRIVER","NODE_POOL","NODE_TEMPLATE","PROJECT","PROJECT_ROLE_TEMPLATE_BINDING","ROLE_TEMPLATE","USER","TOKEN","GLOBAL_ROLE","GLOBAL_ROLE_BINDING","PSA","MANAGED_CHART","USER_NOTIFICATION","GLOBAL_DNS_PROVIDER","RKE_TEMPLATE","RKE_TEMPLATE_REVISION","CLUSTER_PROXY_CONFIG","promiseTag","weakMapTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","ArrayBuffer","ctorString","baseAssign","getAllKeys","initCloneArray","initCloneByTag","initCloneObject","isSet","CLONE_FLAT_FLAG","funcTag","genTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","cloneableTags","isFlat","isFull","subValue","arrayProto","listCacheDelete","difference","cloneDataView","dataView","alternateKey","moreKey","rangeKey","isAlternate","isMore","isRange","suppressContextMenu","ctrlKey","isBlink","HASH_UNDEFINED","flowOutput","errors","validatorArgs","verifyLocal","localOutputRefs","globalOutputRefs","logdna","api_key","validateKubernetesName","displayKey","forHostname","errorKey","maxLength","minLength","validChars","validateChars","validateLength","nullable","fieldMin","fieldMax","lengthKey","validateHostname","restricted","validateDnsLabel","ianaServiceName","validateDnsLikeTypes","servicePort","ports","serviceType","ind","nodePort","pPort","targetPort","nameErrors","np","isNaN","tpIanaDisplayKey","tp","tpTest","targetPortIsNumber","isIanaServiceNameErrors","clusterIp","typesToCheck","externalName","hostNameErrors","ruleGroups","groups","groupsAreValid","group","groupIndex","readableGroupIndex","rules","rule","ruleIndex","readableRuleIndex","alert","record","expr","matching","interval","containerImages","podSpec","jobTemplate","containers","cronSchedule","schedule","cronstrue","podAffinity","podAntiAffinity","preferredDuringSchedulingIgnoredDuringExecution","requiredDuringSchedulingIgnoredDuringExecution","term","errorOpts","validateTermWeight","podAffinityTerm","validateTopologyKey","validateLabelSelector","affinityTerm","weight","topologyKey","validOperators","labelSelector","matchExpressions","operator","roleTemplateRules","verbs","_rule$resources","_rule$nonResourceURLs","nonResourceURLs","apiGroups","_rule$resources2","_rule$nonResourceUrls","nonResourceUrls","clusterName","pathValue","isRke2","async","downloadFile","contentType","blob","Blob","saveAs","generateZip","files","zip","JSZip","file","generateAsync","contents","isHttps","isLocalhost","hasTrailingForwardSlash","isUrl","Port","int","empty","isNumber","isInt","runValidators","validators","validator","startDot","endDot","startNumber","_val$slice","startHyphen","endHyphen","minValue","maxValue","betweenValues","betweenLengths","requiredInt","isPositive","isOctal","valueString","isValid","portNumber","dnsChars","matchedChars","dnsDoubleDash","dnsIanaServiceNameDoubleDash","dnsEmpty","dnsTooLong","hostnameTooLong","absolutePath","noUpperCase","https","localhost","trailingForwardSlash","alphanumeric","containerImage","_val$jobTemplate","_val$template","containerError","dnsLabel","dnsLabelIanaServiceName","dnsLabelRestricted","hostNameMessage","labelValidators","labelMessage","wildcardHostname","testRule","_ref","listeningPort","_listeningPort$string","ianaServiceNameErrors","groupIsValid","readableIndex","returnMessage","backupTarget","parseValue","accessKeyId","secretAccessKey","bucketRegion","bucketName","imageUrl","VM_IMAGE_FILE_FORMAT","urlSlug","fileExtension","fileRequired","subDomain","waitFor","testFn","timeoutMs","intervalMs","gatedLog","clearInterval","setInterval","DNS_LIKE_TYPES","REMAP_STATE","disabled","notapplied","notready","waitapplied","outofsync","gitupdating","errapplied","waitcheckin","waitingforinfrastructure","waitingfornoderef","DEFAULT_COLOR","DEFAULT_ICON","DEFAULT_WAIT_INTERVAL","DEFAULT_WAIT_TMIMEOUT","STATES_ENUM","IN_USE","IN_PROGRESS","PENDING_ROLLBACK","PENDING_UPGRADE","ABORTED","ACTIVATING","ACTIVE","AVAILABLE","BACKED_UP","BOUND","BUILDING","COMPLETED","CORDONED","COUNT","CREATED","CREATING","DEACTIVATING","DEGRADED","DENIED","DEPLOYED","DEPLOYING","DISABLED","DISCONNECTED","DRAINED","DRAINING","ERR_APPLIED","ERROR","ERRORING","ERRORS","EXPIRED","EXPIRING","FAIL","FAILED","HEALTHY","INACTIVE","INFO","INITIALIZING","INPROGRESS","LOCKED","MIGRATING","MISSING","MODIFIED","NOT_APPLICABLE","NOT_APLLIED","ORPHANED","OTHER","OUT_OF_SYNC","ON_GOING","PASS","PASSED","PENDING","PROVISIONING","PROVISIONED","PURGED","PURGING","READY","RECONNECTING","REGISTERING","REINITIALIZING","RELEASED","REMOVED","REMOVING","REQUESTED","RESTARTING","RESTORING","RESIZING","RUNNING","SKIP","SKIPPED","STARTING","STOPPED","SUCCEEDED","SUCCESS","SUCCESSFUL","SUPERSEDED","SUSPENDED","UNAVAILABLE","UNHEALTHY","UNINSTALLED","UNINSTALLING","UNKNOWN","UNTRIGGERED","UPDATING","WAIT_APPLIED","WAIT_CHECKIN","WAITING","WARNING","STATES","compoundIcon","SORT_ORDER","warning","success","colorForState","isTransitioning","maybeFn","stateDisplay","stateSort","$ctx","rootGetters","rootState","uid","schema","displayName","nameDisplay","namespacedName","_this$stateObj2","transitioning","stateColor","trans","_this$stateObj3","_this$stateObj4","_this$stateObj5","waitForTestFn","waitForState","waitForTransition","waitForAction","hasAction","waitForLink","hasLink","hasCondition","condition","isCondition","withStatus","waitForCondition","_availableActions","cur","divider","ok","removeAt","currentRoute","currentRouter","app","_route","extensionMenuActions","$rootState","canUpdate","canCustomEdit","canEditYaml","canYaml","canClone","canCreate","bulkAction","canViewInApi","altAction","canDelete","newActionInstance","enabledFn","typeofEnabled","_canDelete","isRemovable","isEditable","_this$schema","collectionMethods","isCreatable","_this$schema2","resourceMethods","linkName","linkFor","links","followLink","urlSuffix","$dispatch","actionName","actionLinkFor","actionLinks","doAction","patch","merge","alertOnError","headers","_save","__rehydrate","__clone","processSaveResponse","_this$metadata6","validationErrors","resourceVersion","namespaced","toSave","_type","_labels","_annotations","argParam","kind","existing","_status","force","_remove","$globalApp","$router","cluster","_this$id","_schema$attributes","_this$metadata7","_detailLocation","goToDetail","detailLocation","goToClone","moreQuery","MODE","_CLONE","AS","_UNFLAG","goToEdit","goToViewConfig","_VIEW","goToEditYaml","_YAML","goToViewYaml","cloneYaml","accept","cleanForDownload","items","names","eachLimit","yaml","cleanedYaml","viewInApi","promptRemove","applyDefaults","collection","cleanYaml","jsyaml","dump","skipInvalid","cleanForNew","cleanForDiff","toJSON","yamlForSave","_saveYaml","_this$schema3","isCreate","isSpoofed","customValidationRulesets","customValidationRules","formRules","formRulesGenerator","translationKey","ruleKey","ruleArg","ruleset","customValidationErrors","ignorePaths","requiredIf","requiredIfPath","fieldType","parsedRules","compact","isString","reqIfVal","tolower","validatorAndArgs","validatorName","validatorExists","CustomValidators","_this$$rootState$$plu","pluginValidator","getValidator","_this$metadata8","ownersByType","owner","owners","allOfResourceType","resourceInstance","resourceByType","_resourceByType$metad","_details","_this$owners","formatter","row","col","formatterOpts","addSuffix","findOwners","_getRelationship","getOwners","findOwned","_findRelationship","_relationshipsFor","rel","direction","_this$metadata9","selectors","ids","relationships","selector","addObjects","toType","toNamespace","addObject","_res$selectors","sel","splitId","_this$k","clone","_this$metadata10","creationTimestamp","applyMixin","version","mixin","beforeCreate","vuexInit","_init","$options","parent","devtoolHook","__VUE_DEVTOOLS_GLOBAL_HOOK__","devtoolPlugin","_devtoolHook","emit","targetState","replaceState","subscribe","mutation","prepend","subscribeAction","forEachValue","isPromise","partial","Module","rawModule","runtime","_children","_rawModule","rawState","prototypeAccessors","addChild","getChild","hasChild","mutations","forEachChild","forEachGetter","forEachAction","forEachMutation","defineProperties","ModuleCollection","rawRootModule","targetModule","newModule","reduce","getNamespace","this$1","rawChildModule","unregister","isRegistered","Store","install","plugins","_committing","_actions","_actionSubscribers","_mutations","_wrappedGetters","_modules","_modulesNamespaceMap","_subscribers","_watcherVM","_makeLocalGettersCache","commit","installModule","resetStoreVM","useDevtools","devtools","config","prototypeAccessors$1","genericSubscribe","subs","resetStore","hot","oldVm","wrappedGetters","silent","$$state","enableStrictMode","_withCommit","_data","nextTick","$destroy","isRoot","parentState","getNestedState","moduleName","local","makeLocalContext","namespacedType","registerMutation","registerAction","registerGetter","noNamespace","_payload","unifyObjectStyle","makeLocalGetters","gettersProxy","splitPos","localType","rawGetter","$watch","deep","sync","_Vue","sub","before","after","cb","registerModule","preserveState","unregisterModule","hasModule","hotUpdate","newOptions","committing","normalizeNamespace","states","normalizeMap","getModuleByNamespace","vuex","isValidMap","helper","xor","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","isBinary","spreadableSymbol","isConcatSpreadable","memoize","resolver","memoized","Cache","baseGetAllKeys","symbolsFunc","MAX_SAFE_INTEGER","reIsUint","isIndex","nativeKeysIn","baseKeysIn","isProto","Queue","getLength","enqueue","dequeue","peek","_hash","fnName","iterator","failed","baseTimes","inherited","isArg","isBuff","isType","skipIndexes","protocolAndDomainRE","localhostDomainRE","nonLocalhostDomainRE","everythingAfterProtocol","createSet","seenIndex","isLength","objectCreate","removeObject","removeObjects","objs","indexes","ranges","unique","thing","findOrFilterBy","keyOrObj","want","filterBy","baseIsNative","getValue","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","nested","hasFunc","MAX_MEMOIZE_SIZE","normalizeComponent","scriptExports","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","_compiled","functional","_scopeId","$vnode","ssrContext","__VUE_SSR_CONTEXT__","_registeredComponents","_ssrRegister","$root","shadowRoot","_injectStyles","originalRender","asyncTag","proxyTag","defaultValue","coreJsData","nativeIsBuffer","_typeof","_classCallCheck","Constructor","_inherits","subClass","superClass","_setPrototypeOf","_getPrototypeOf","__proto__","_isNativeReflectConstruct","Reflect","construct","sham","Proxy","_construct","Parent","Class","_isNativeFunction","_wrapNativeSuper","_cache","_assertThisInitialized","ReferenceError","_possibleConstructorReturn","_createSuper","Derived","hasNativeReflectConstruct","Super","NewTarget","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","_arrayLikeToArray","iter","minLen","arr2","_createForOfIteratorHelper","allowArrayLike","it","F","normalCompletion","didErr","step","return","hasOwnProp","NewError","_Error","_super","avoidNew","JSONPath","otherTypeCallback","optObj","json","resultType","flatten","sandbox","preventEval","parentProperty","autostart","evaluate","_this2","currParent","currParentProperty","currResultType","currPreventEval","currSandbox","currOtherTypeCallback","_expr","toPathString","exprList","toPathArray","_hasParentSelector","_trace","ea","isParentSelector","hasArrExpr","rslt","valOrPath","_getPreferredOutput","pointer","toPointer","_handleCallback","fullRetObj","preferredOutput","parentPropName","literalPriority","retObj","_this3","loc","addRet","_walk","_x","par","pr","_slice","_eval","addType","valueType","isFinite","locProp","_step","_iterator","rett","tl","tt","_vname","_$_parentProperty","_$_parent","_$_property","_$_path","_$_root","_$_v","runInNewContext","pathArr","subx","normalized","$0","ups","moveToAnotherArray","conditionCb","il","funcs","vr","funcString","fString","lastStatementEnd","lastIndexOf","_obj","pathAr","propToDelete","cleanUp","each","isEqualBasic","fromKeys","toKeys","fromValue","toValue","pairs","listCacheGet","isMasked","reRegExpChar","reIsHostCtor","reIsNative","pattern","baseIsSet","cloneTypedArray","typedArray","reWhitespace","baseSetToString","typedArrayTags","listCacheClear","maskSrcKey","IE_PROTO","nodeIsSet"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,WAAYA,QAAQ,YAAaA,QAAQ,QACjD,oBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,UAAW,YAAeJ,GACR,kBAAZC,QACdA,QAAQ,sCAAwCD,EAAQG,QAAQ,WAAYA,QAAQ,YAAaA,QAAQ,QAEzGJ,EAAK,sCAAwCC,EAAQD,EAAK,WAAYA,EAAK,YAAaA,EAAK,SAR/F,CASoB,qBAATO,KAAuBA,KAAOC,MAAO,SAASC,EAAmCC,EAAmCC,GAC/H,O,YCTE,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KA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GAAM,YACN,GAAM,UACN,GAAM,aACN,GAAM,YACN,GAAM,SACN,GAAM,cACN,GAAM,SACN,GAAM,SACN,GAAM,OACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,WACN,GAAM,YACN,GAAM,cACN,GAAM,QACN,GAAM,UACN,GAAM,UACN,GAAM,UACN,GAAM,UACN,IAAM,UACN,IAAM,UACN,IAAM,UACN,IAAM,UACN,IAAM,UACN,IAAM,UACN,IAAM,iBACN,IAAM,YACN,IAAM,gBACN,IAAM,iBACN,IAAM,gBACN,IAAM,eACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,MACN,IAAM,UACN,IAAM,aACN,IAAM,cACN,IAAM,iBACN,IAAM,iBACN,IAAM,cACN,IAAM,gBACN,IAAM,mBACN,IAAM,cACN,IAAM,kBACN,IAAM,kBACN,IAAM,gBACN,IAAM,iBACN,IAAM,qBACN,IAAM,YACN,IAAM,iBACN,IAAM,aACN,IAAM,cACN,IAAM,aACN,IAAM,aACN,IAAM,YChGK,IAIX,UAAoB,YAIpB,QAAoB,MACpB,SAAoB,MACpB,SAAoB,WACpB,YAAoB,cACpB,YAAoB,UACpB,aAAoB,UACpB,MAAoB,QACpB,SAAoB,OACpB,UAAoB,OACpB,UAAoB,QACpB,WAAoB,QACpB,IAAoB,MAKpB,OAAoB,SACpB,IAAoB,MACpB,KAAoB,OACpB,KAAoB,OACpB,OAAoB,SACpB,SAAoB,WACpB,OAAoB,SAIpB,UAAoB,YACpB,UAAoB,YACpB,WAA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AAsBD,GAC/B,OAAOj6F,EAAoBgJ,GAE5B,SAASkxF,EAAsBD,GAC9B,IAAIj6F,EAAoB0C,EAAEoS,EAAKmlF,GAAM,CACpC,IAAI95F,EAAI,IAAIiB,MAAM,uBAAyB64F,EAAM,KAEjD,MADA95F,EAAE+gB,KAAO,mBACH/gB,EAEP,OAAO2U,EAAImlF,GAEZD,EAAe30F,KAAO,WACrB,OAAOjG,OAAOiG,KAAKyP,IAEpBklF,EAAex5F,QAAU05F,EACzBh8F,EAAOD,QAAU+7F,EACjBA,EAAehxF,GAAK,Q,qBCnCpB,IAAIs3F,EAAU,EAAQ,QAGlB+O,EAAe/O,EAAQlhG,OAAOmZ,eAAgBnZ,QAElDlB,EAAOD,QAAUoxG,G,qBCLjB,IAAI7mG,EAAa,EAAQ,QACrBo3F,EAAe,EAAQ,QAGvB75F,EAAU,qBASd,SAASouG,EAAgBlxG,GACvB,OAAO28F,EAAa38F,IAAUuF,EAAWvF,IAAU8C,EAGrD7H,EAAOD,QAAUk2G","file":"kubevirt-dashboard-extension-1.1.0.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"__jszip\"), require(\"__jsyaml\"), require(\"vue\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"__jszip\", \"__jsyaml\", ], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"kubevirt-dashboard-extension-1.1.0\"] = factory(require(\"__jszip\"), require(\"__jsyaml\"), require(\"vue\"));\n\telse\n\t\troot[\"kubevirt-dashboard-extension-1.1.0\"] = factory(root[\"__jszip\"], root[\"__jsyaml\"], root[\"Vue\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__5877__, __WEBPACK_EXTERNAL_MODULE__7838__, __WEBPACK_EXTERNAL_MODULE__8bbf__) {\nreturn "," \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"kubevirt-dashboard-extension-1.1.0.umd.min.\" + ({\"0\":\"formatters\",\"2\":\"list\",\"3\":\"vendors~formatters\",\"4\":\"vendors~list\",\"5\":\"vendors~xterm\"}[chunkId]||chunkId) + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = (typeof self !== 'undefined' ? self : this)[\"webpackJsonpkubevirt_dashboard_extension_1_1_0\"] = (typeof self !== 'undefined' ? self : this)[\"webpackJsonpkubevirt_dashboard_extension_1_1_0\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"1c25\");\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsole.vue?vue&type=style&index=0&id=d269b192&prod&lang=scss&scoped=true&\"","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","import SteveModel from '@shell/plugins/steve/steve-class';\n\nexport default class VirtualMachineInstance extends SteveModel {\n get getVMIApiPath() {\n const clusterId = this.$rootGetters['clusterId'];\n\n if (this.$rootGetters['isMultiCluster']) {\n const prefix = `/k8s/clusters/${clusterId}`;\n\n return `${prefix}/apis/subresources.kubevirt.io/v1/namespaces/${this.metadata.namespace}/virtualmachineinstances/${this.name}/vnc`;\n } else {\n return `/apis/subresources.kubevirt.io/v1/namespaces/${this.metadata.namespace}/virtualmachineinstances/${this.name}/vnc`;\n }\n }\n\n get getSerialConsolePath() {\n const clusterId = this.$rootGetters['clusterId'];\n\n if (this.$rootGetters['isMultiCluster']) {\n const prefix = `/k8s/clusters/${clusterId}`;\n\n return `${prefix}/apis/subresources.kubevirt.io/v1/namespaces/${this.metadata.namespace}/virtualmachineinstances/${this.name}/console`;\n } else {\n return `/apis/subresources.kubevirt.io/v1/namespaces/${this.metadata.namespace}/virtualmachineinstances/${this.name}/console`;\n }\n }\n}\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","module.exports = __webpack_public_path__ + \"img/rancher-logo.05cc233f.svg\";","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","module.exports = __webpack_public_path__ + \"_/_/node_modules/@rancher/shell/assets/images/pl/README.md\";","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n Modified by Evan You @yyx990803\n*/\n\nimport listToStyles from './listToStyles'\n\nvar hasDocument = typeof document !== 'undefined'\n\nif (typeof DEBUG !== 'undefined' && DEBUG) {\n if (!hasDocument) {\n throw new Error(\n 'vue-style-loader cannot be used in a non-browser environment. ' +\n \"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\"\n ) }\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nvar stylesInDom = {/*\n [id: number]: {\n id: number,\n refs: number,\n parts: Array<(obj?: StyleObjectPart) => void>\n }\n*/}\n\nvar head = hasDocument && (document.head || document.getElementsByTagName('head')[0])\nvar singletonElement = null\nvar singletonCounter = 0\nvar isProduction = false\nvar noop = function () {}\nvar options = null\nvar ssrIdKey = 'data-vue-ssr-id'\n\n// Force single-tag solution on IE6-9, which has a hard limit on the # of \n","import mod from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Loading.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Loading.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Loading.vue?vue&type=template&id=23723280&scoped=true&\"\nimport script from \"./Loading.vue?vue&type=script&lang=js&\"\nexport * from \"./Loading.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Loading.vue?vue&type=style&index=0&id=23723280&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"23723280\",\n null\n \n)\n\nexport default component.exports","export function queryParamsFor(current, qp, defaults = {}) {\n const query = Object.assign({}, current || {});\n\n for ( const key of Object.keys(qp) ) {\n const val = qp[key];\n\n if ( typeof defaults[key] === 'undefined' ) {\n // There is no default\n query[key] = qp[key];\n } else if ( defaults[key] === false ) {\n // Value-less boolean flags\n if ( val ) {\n query[key] = null;\n } else {\n delete query[key];\n }\n } else if ( val === defaults[key] ) {\n // The value is the default\n delete query[key];\n } else {\n // The value is not the default\n query[key] = val;\n }\n }\n\n return query;\n}\n\nexport function getClusterFromRoute(to) {\n let cluster = to.params?.cluster;\n\n if (!cluster) {\n cluster = findMeta(to, 'cluster');\n }\n\n return cluster;\n}\n\nexport function getProductFromRoute(to) {\n let product = to.params?.product;\n\n if ( !product ) {\n const match = to.name?.match(/^c-cluster-([^-]+)/);\n\n if ( match ) {\n product = match[1];\n }\n }\n\n // If still no product, see if the route indicates the product via route metadata\n if (!product) {\n product = findMeta(to, 'product');\n }\n\n return product;\n}\n\nexport const getPackageFromRoute = (route) => {\n if (!route?.meta) {\n return;\n }\n // Sometimes meta is an array... sometimes not\n const arraySafe = Array.isArray(route.meta) ? route.meta : [route.meta];\n\n return arraySafe.find((m) => !!m.pkg)?.pkg;\n};\n\nexport const getResourceFromRoute = (to) => {\n let resource = to.params?.resource;\n\n if (!resource) {\n resource = findMeta(to, 'resource');\n }\n\n return resource;\n};\n\n/**\n * Given a route it will look through the matching parent routes to see if any match the fn (predicate) criteria\n *\n * @param {*} to a VueRouter Route object\n * @param {*} fn fn is a predicate which is passed a matched route. It will return true to indicate there was a matching route and false otherwise\n * @returns true if a matching route was found, false otherwise\n */\nexport const routeMatched = (to, fn) => {\n const matched = to?.matched || [];\n\n return !!matched.find(fn);\n};\n\n/**\n * Checks to see if the route requires authentication by taking a look at the route and it's parents 'meta' to see if it\n * contains { requiresAuthentication: true }\n * @param {*} to a VueRouter Route object\n * @returns true if the route requires authentication, false otherwise\n */\nexport const routeRequiresAuthentication = (to) => {\n return routeMatched(to, (matched) => matched.meta?.requiresAuthentication);\n};\n\nfunction findMeta(route, key) {\n if (route?.meta) {\n const meta = Array.isArray(route.meta) ? route.meta : [route.meta];\n\n for (let i = 0; i < meta.length; i++) {\n if (meta[i][key]) {\n return meta[i][key];\n }\n }\n }\n\n return undefined;\n}\n","import { ActionLocation, CardLocation, ExtensionPoint } from '@shell/core/types';\nimport { isMac } from '@shell/utils/platform';\nimport { ucFirst, randomStr } from '@shell/utils/string';\nimport {\n _EDIT, _CONFIG, _DETAIL, _LIST, _CREATE\n} from '@shell/config/query-params';\nimport { getProductFromRoute } from '@shell/utils/router';\nimport { isEqual } from '@shell/utils/object';\n\nfunction checkRouteProduct($route, locationConfigParam) {\n const product = getProductFromRoute($route);\n\n // alias for the homepage\n if (locationConfigParam === 'home' && $route.name === 'home') {\n return true;\n } else if (locationConfigParam === product) {\n return true;\n }\n\n return false;\n}\n\nfunction checkRouteMode({ name, query }, locationConfigParam) {\n if (locationConfigParam === _EDIT && query.mode && query.mode === _EDIT && !query.as) {\n return true;\n } else if (locationConfigParam === _CONFIG && query.as && query.as === _CONFIG) {\n return true;\n } else if (locationConfigParam === _DETAIL && !query.as && name.includes('-id') && (!query.mode || query?.mode !== _EDIT)) {\n return true;\n // alias to target all list views\n } else if (locationConfigParam === _LIST && !name.includes('-id') && name.includes('-resource')) {\n return true;\n // alias to target create views\n } else if (locationConfigParam === _CREATE && name.endsWith('-create')) {\n return true;\n }\n\n return false;\n}\n\nfunction checkExtensionRouteBinding($route, locationConfig, context) {\n // if no configuration is passed, consider it as global\n if (!Object.keys(locationConfig).length) {\n return true;\n }\n\n const { params } = $route;\n\n // \"params\" to be checked based on the locationConfig\n // This has become overloaded with mode and context\n const paramsToCheck = [\n 'product',\n 'resource',\n 'namespace',\n 'cluster',\n 'id',\n 'mode',\n 'path',\n 'hash',\n // url query params\n 'queryParam',\n // Custom context specific params provided by the extension, not to be confused with location params\n 'context',\n ];\n\n let res = true;\n\n for (let i = 0; i < paramsToCheck.length; i++) {\n const param = paramsToCheck[i];\n\n if (locationConfig[param]) {\n const asArray = Array.isArray(locationConfig[param]) ? locationConfig[param] : [locationConfig[param]];\n\n for (let x = 0; x < asArray.length; x++) {\n const locationConfigParam = asArray[x];\n\n if (locationConfigParam) {\n if (param === 'hash') {\n res = $route.hash ? $route.hash.includes(locationConfigParam) : false;\n // handle \"product\" in a separate way...\n } else if (param === 'product') {\n res = checkRouteProduct($route, locationConfigParam);\n // also handle \"mode\" in a separate way because it mainly depends on query params\n } else if (param === 'mode') {\n res = checkRouteMode($route, locationConfigParam);\n } else if (param === 'resource') {\n // Match exact resource but also allow resource of '*' to match any resource\n res = (params[param] && locationConfigParam === '*') || locationConfigParam === params[param];\n } else if (param === 'context') {\n // Need all keys and values to match\n res = isEqual(locationConfigParam, context);\n // evaluate queryParam in route\n } else if (param === 'queryParam') {\n res = isEqual(locationConfigParam, $route.query);\n // evaluate path in route\n } else if (param === 'path' && locationConfigParam.urlPath) {\n if (locationConfigParam.endsWith) {\n res = $route.path.endsWith(locationConfigParam.urlPath);\n } else if (!Object.keys(locationConfigParam).includes('exact') || locationConfigParam.exact) {\n res = locationConfigParam.urlPath === $route.path;\n } else {\n res = $route.path.includes(locationConfigParam.urlPath);\n }\n } else if (locationConfigParam === params[param]) {\n res = true;\n } else {\n res = false;\n }\n }\n\n // If a single location config param is good then this is an param (aka ['pods', 'configmap'] = pods or configmaps)\n if (res) {\n break;\n }\n }\n\n // If a single param (set of location config params) is bad then this is not an acceptable location\n if (!res) {\n break;\n }\n }\n }\n\n return res;\n}\n\nexport function getApplicableExtensionEnhancements(pluginCtx, actionType, uiArea, currRoute, translationCtx = pluginCtx, context) {\n const extensionEnhancements = [];\n\n // gate it so that we prevent errors on older versions of dashboard\n if (pluginCtx.$plugin?.getUIConfig) {\n const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);\n\n actions.forEach((action, i) => {\n if (checkExtensionRouteBinding(currRoute, action.locationConfig, context || {})) {\n // ADD CARD PLUGIN UI ENHANCEMENT\n if (actionType === ExtensionPoint.CARD) {\n // intercept to apply translation\n if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {\n actions[i].label = translationCtx.t(action.labelKey);\n }\n\n // ADD ACTION PLUGIN UI ENHANCEMENT\n } else if (actionType === ExtensionPoint.ACTION) {\n // TABLE ACTION\n if (uiArea === ActionLocation.TABLE) {\n // intercept to apply translation\n if (action.labelKey) {\n actions[i].label = translationCtx.t(action.labelKey);\n }\n\n // bulkable flag\n actions[i].bulkable = actions[i].multiple || actions[i].bulkable;\n\n // populate action identifier to prevent errors\n if (!actions[i].action) {\n actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;\n }\n }\n\n // extract simplified shortcut definition on plugin - HEADER ACTION\n if (uiArea === ActionLocation.HEADER && action.shortcut) {\n // if it's a string, then assume CTRL for windows and META for mac\n if (typeof action.shortcut === 'string') {\n actions[i].shortcutLabel = () => {\n return isMac ? `(\\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;\n };\n actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };\n // correct check for an Object type in JS... handle the object passed\n } else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {\n actions[i].shortcutKey = action.shortcut;\n const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];\n let scLabel = '';\n\n keyboardCombo.forEach((key, i) => {\n if (i < keyboardCombo.length - 1) {\n if (key === 'meta') {\n key = '\\u2318';\n } else {\n key = ucFirst(key);\n }\n scLabel += `${ key }`;\n scLabel += '-';\n } else {\n scLabel += `${ key.toUpperCase() }`;\n }\n });\n\n actions[i].shortcutLabel = () => {\n return `(${ scLabel })`;\n };\n }\n }\n }\n\n extensionEnhancements.push(actions[i]);\n }\n });\n }\n\n return extensionEnhancements;\n}\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","module.exports = __webpack_public_path__ + \"img/banner.a83d2a9b.svg\";","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","export function importTypes($plugin) { \n $plugin.register('list', 'kubevirt.io.virtualmachine', () => import(/* webpackChunkName: \"list\" */'@pkg/list/kubevirt.io.virtualmachine.vue'));\n $plugin.register('models', 'kubevirt.io.virtualmachine', () => require(/* webpackChunkName: \"models\" */'@pkg/models/kubevirt.io.virtualmachine.js'));\n $plugin.register('models', 'kubevirt.io.virtualmachineinstance', () => require(/* webpackChunkName: \"models\" */'@pkg/models/kubevirt.io.virtualmachineinstance.js'));\n $plugin.register('l10n', 'en-us', () => import('@pkg/l10n/en-us.yaml'));\n $plugin.register('formatters', 'IPAddress', () => import(/* webpackChunkName: \"formatters\" */'@pkg/formatters/IPAddress.vue'));\n $plugin.register('formatters', 'VMState', () => import(/* webpackChunkName: \"formatters\" */'@pkg/formatters/VMState.vue'));\n};\n","import { Action } from '@rancher/shell/core/types';\nimport VirtualMachineModel from './models/kubevirt.io.virtualmachine';\n\n// NOTE: a workaround for properties not defined on VirtualMachine's parent classes\ntype VirtualMachine = VirtualMachineModel & {\n spec: any;\n save: any;\n};\n\nconst startVMs: Action['invoke'] = function (opts, resources: VirtualMachine[]) {\n resources.map((resource) => {\n resource.spec.running = true;\n resource.save();\n });\n};\n\nconst stopVMs: Action['invoke'] = function (opts, resources: VirtualMachine[]) {\n resources.map((resource) => {\n resource.spec.running = false;\n resource.save();\n });\n};\n\nconst canStopVM: Action['enabled'] = (resource: VirtualMachine) => resource.canStop;\nconst canStartVM: Action['enabled'] = (resource: VirtualMachine) => resource.canStart;\n\nexport const startVMAction: Action = {\n label: 'Start',\n icon: 'icon icon-play',\n invoke: startVMs,\n enabled: canStartVM,\n multiple: true,\n};\n\nexport const stopVMAction: Action = {\n label: 'Stop',\n icon: 'icon icon-close',\n invoke: stopVMs,\n enabled: canStopVM,\n multiple: true,\n // disabled: true,\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.$fetchState.pending)?_c('Loading'):_c('SerialConsole',{ref:\"serialConsole\",model:{value:(_vm.vmi),callback:function ($$v) {_vm.vmi=$$v},expression:\"vmi\"}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"console-shell-container\"},[_c('div',{ref:\"xterm\",staticClass:\"shell-body\"}),_c('resize-observer',{on:{\"notify\":_vm.fit}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @author Toru Nagashima \n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap();\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap();\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event);\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n );\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n );\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true;\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault();\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n });\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true });\n\n // Define accessors\n const keys = Object.keys(event);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key));\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget;\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation();\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this);\n\n data.stopped = true;\n data.immediateStopped = true;\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation();\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this));\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true;\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this));\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n});\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype);\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event);\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value;\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event;\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto);\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event);\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n });\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n const isFunc = typeof descriptor.value === \"function\";\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n );\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);\n wrappers.set(proto, wrapper);\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nfunction wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event));\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nfunction isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nfunction setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase;\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nfunction setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget;\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nfunction setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener;\n}\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap();\n\n// Listener types\nconst CAPTURE = 1;\nconst BUBBLE = 2;\nconst ATTRIBUTE = 3;\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget);\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this);\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next;\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null; // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this);\n\n // Traverse to the tail while removing old value.\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n node = node.next;\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n };\n if (prev === null) {\n listeners.set(eventName, newNode);\n } else {\n prev.next = newNode;\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n );\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this);\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n });\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map());\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length);\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i];\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this);\n const optionsIsObj = isObject(options);\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n };\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName);\n if (node === undefined) {\n listeners.set(eventName, newNode);\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null;\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node;\n node = node.next;\n }\n\n // Add it.\n prev.next = newNode;\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this);\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n return\n }\n\n prev = node;\n node = node.next;\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this);\n const eventName = event.type;\n let node = listeners.get(eventName);\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event);\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null;\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n );\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent);\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err);\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent);\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next;\n }\n setPassiveListener(wrappedEvent, null);\n setEventPhase(wrappedEvent, 0);\n setCurrentTarget(wrappedEvent, null);\n\n return !wrappedEvent.defaultPrevented\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n});\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);\n}\n\nexport default EventTarget;\nexport { defineEventAttribute, EventTarget };\n//# sourceMappingURL=event-target-shim.mjs.map\n","type UriField = 'source' | 'protocol' | 'authority' | 'userInfo' | 'user' | 'password' | 'host' | 'port' | 'relative' | 'path' | 'directory' | 'file' | 'queryStr' | 'anchor'\ntype UriFields = {\n [key in UriField]: string; // eslint-disable-line no-unused-vars\n}\nexport type QueryParams = {\n [key: string]: string\n}\n\ninterface ParsedUri extends UriFields {\n query: QueryParams;\n}\n\nexport function addParam(url: string, key: string, val: string | string[]): string {\n let out = url + (url.includes('?') ? '&' : '?');\n\n // val can be a string or an array of strings\n if ( !Array.isArray(val) ) {\n val = [val];\n }\n out += val.map((v) => {\n if ( v === null ) {\n return `${ encodeURIComponent(key) }`;\n } else {\n return `${ encodeURIComponent(key) }=${ encodeURIComponent(v) }`;\n }\n }).join('&');\n\n return out;\n}\n\nexport function addParams(url: string, params: QueryParams): string {\n if ( params && typeof params === 'object' ) {\n Object.keys(params).forEach((key) => {\n url = addParam(url, key, params[key]);\n });\n }\n\n return url;\n}\n\nexport function removeParam(url: string, key: string): string {\n const parsed = parse(url);\n\n if ( parsed.query?.[key] ) {\n delete parsed.query[key];\n }\n\n return stringify(parsed);\n}\n\nexport function parseLinkHeader(str: string): Record {\n const out: { [key: string]: string} = { };\n const lines = (str || '').split(',');\n\n for ( const line of lines ) {\n const match = line.match(/^\\s*<([^>]+)>\\s*;\\s*rel\\s*=\"(.*)\"/);\n\n if ( match ) {\n out[match[2].toLowerCase()] = match[1];\n }\n }\n\n return out;\n}\n\nexport function isMaybeSecure(port: number, proto: string): boolean {\n const protocol = proto.toLowerCase();\n\n return portMatch([port], [443, 8443], ['443']) || protocol === 'https';\n}\n\nexport function portMatch(ports: number[], equals: number[], endsWith: string[]): boolean {\n for (let i = 0; i < ports.length; i++) {\n const port = ports[i];\n\n if (equals.includes(port)) {\n return true;\n }\n\n for (let j = 0; j < endsWith.length; j++) {\n const suffix = `${ endsWith[j] }`;\n const portStr = `${ port }`;\n\n if (portStr !== suffix && portStr.endsWith(suffix)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\n// parseUri 1.2.2\n// (c) Steven Levithan \n// https://javascriptsource.com/parseuri/\n// MIT License\nexport function parse(str: string): ParsedUri {\n const o = parse.options;\n const m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n\n if (!m) {\n throw new Error(`Cannot parse as uri: ${ str }`);\n }\n const uri = {} as ParsedUri;\n let i = 14;\n\n while (i--) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri.query = {};\n uri.queryStr.replace(o.q.parser, (_, $1: string, $2: string): string => {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n\n return '';\n });\n\n return uri;\n}\n\nparse.options = {\n strictMode: false,\n key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'queryStr', 'anchor'],\n q: {\n name: 'query',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n} as {\n strictMode: boolean,\n key: UriField[],\n q: {\n name: 'query',\n parser: RegExp\n },\n parser: {\n strict: RegExp,\n loose: RegExp\n }\n};\n\nexport function stringify(uri: ParsedUri): string {\n let out = `${ uri.protocol }://`;\n\n if ( uri.user && uri.password ) {\n out += `${ uri.user }:${ uri.password }@`;\n } else if ( uri.user ) {\n out += `${ uri.user }@`;\n }\n\n out += uri.host;\n\n if ( uri.port ) {\n out += `:${ uri.port }`;\n }\n\n out += uri.path || '/';\n\n out = addParams(out, uri.query || {});\n\n if ( uri.anchor ) {\n out += `#${ uri.anchor }`;\n }\n\n return out;\n}\n","import { EventTarget } from 'event-target-shim';\nimport { isSafari } from '@shell/utils/platform';\nimport { addParam } from '@shell/utils/url';\n\nlet sockId = 1;\nlet warningShown = false;\nlet wasConnected = false;\n\nconst INSECURE = 'ws://';\nconst SECURE = 'wss://';\n\nconst STATE_DISCONNECTED = 'disconnected';\n\nexport const addEventListener = EventTarget.addEventListener;\nexport const STATE_CONNECTING = 'connecting';\nexport const STATE_CONNECTED = 'connected';\nconst STATE_CLOSING = 'closing';\nconst STATE_RECONNECTING = 'reconnecting';\n\nexport const EVENT_CONNECTING = STATE_CONNECTING;\nexport const EVENT_CONNECTED = STATE_CONNECTED;\nexport const EVENT_DISCONNECTED = STATE_DISCONNECTED;\nexport const EVENT_MESSAGE = 'message';\nexport const EVENT_FRAME_TIMEOUT = 'frame_timeout';\nexport const EVENT_CONNECT_ERROR = 'connect_error';\nexport const EVENT_DISCONNECT_ERROR = 'disconnect_error';\n\nexport const NO_WATCH = 'NO_WATCH';\nexport const NO_SCHEMA = 'NO_SCHEMA';\nexport const NO_PERMS = 'NO_PERMS';\nexport const REVISION_TOO_OLD = 'TOO_OLD';\n\nexport default class Socket extends EventTarget {\n url;\n autoReconnect = true;\n frameTimeout = 35000;\n metadata = {};\n hasBeenOpen = false;\n hasReconnected = false;\n protocol = null;\n maxTries = null;\n tries = 0;\n idAsTimestamp = false;\n\n // \"Private\"\n socket = null;\n state = STATE_DISCONNECTED;\n framesReceived = 0;\n frameTimer;\n reconnectTimer;\n disconnectCallBacks = [];\n disconnectedAt = 0;\n closingId = 0;\n autoReconnectUrl = null;\n\n constructor(url, autoReconnect = true, frameTimeout = null, protocol = null, maxTries = null, idAsTimestamp = false) {\n super();\n\n this.setUrl(url);\n this.autoReconnect = autoReconnect;\n this.protocol = protocol;\n // maxTries = null === never stop trying to reconnect\n // allow maxTries to be defined on individual sockets bc not all will clearly warn the user that we've stopped trying\n this.maxTries = maxTries;\n this.idAsTimestamp = idAsTimestamp;\n\n if ( frameTimeout !== null ) {\n this.frameTimeout = frameTimeout;\n }\n }\n\n setUrl(url) {\n if ( !url.match(/wss?:\\/\\//) ) {\n url = self.location.origin.replace(/^http/, 'ws') + url;\n }\n\n if ( self.location.protocol === 'https:' && url.startsWith(INSECURE) ) {\n url = SECURE + url.substr(INSECURE.length);\n }\n\n this.url = url;\n }\n\n connect(metadata = {}) {\n if ( this.socket ) {\n console.error('Socket refusing to connect while another socket exists'); // eslint-disable-line no-console\n\n return;\n }\n\n if (this.state !== STATE_RECONNECTING) {\n this.state = STATE_CONNECTING;\n }\n\n Object.assign(this.metadata, metadata);\n\n const id = this.idAsTimestamp ? new Date().getTime() : sockId++;\n const url = addParam(this.url, 'sockId', id);\n\n this._baseLog('connecting', { id, url: url.replace(/\\?.*/, '') });\n\n let socket;\n\n this.tries++;\n\n if ( this.protocol ) {\n socket = new WebSocket(url, this.protocol);\n } else {\n socket = new WebSocket(url);\n }\n\n socket.sockId = id;\n socket.metadata = this.metadata;\n socket.onmessage = this._onmessage.bind(this);\n socket.onopen = this._opened.bind(this);\n socket.onerror = this._error.bind(this);\n socket.onclose = this._closed.bind(this);\n\n this.socket = socket;\n this.state = STATE_CONNECTING;\n\n this.dispatchEvent(new CustomEvent(EVENT_CONNECTING));\n }\n\n send(data) {\n if ( this.socket && this.state === STATE_CONNECTED ) {\n this.socket.send(data);\n\n return true;\n }\n\n return false;\n }\n\n disconnect(callBack) {\n if ( callBack ) {\n this.disconnectCallBacks.push(callBack);\n }\n\n const self = this;\n const promise = new Promise((resolve, reject) => {\n if ( this.state === STATE_DISCONNECTED ) {\n resolve();\n }\n\n function onError(e) {\n reject(e);\n self.removeEventListener(EVENT_CONNECT_ERROR, onError);\n }\n\n this.addEventListener(EVENT_CONNECT_ERROR, onError);\n\n this.disconnectCallBacks.push(() => {\n this.removeEventListener(EVENT_CONNECT_ERROR, onError);\n resolve();\n });\n });\n\n this.autoReconnect = false;\n this._close();\n\n return promise;\n }\n\n reconnect(metadata = {}) {\n Object.assign(this.metadata, metadata);\n\n if ( this.state === STATE_CONNECTING ) {\n this._log('Ignoring reconnect for socket in connecting');\n\n return;\n }\n\n if ( this.socket ) {\n this._close();\n } else {\n this.connect(metadata);\n }\n }\n\n getMetadata() {\n if ( this.socket ) {\n return this.socket.metadata;\n } else {\n return {};\n }\n }\n\n getId() {\n if ( this.socket ) {\n return this.socket.sockId;\n } else {\n return 0;\n }\n }\n\n isConnected() {\n return this.state === STATE_CONNECTED;\n }\n\n setAutoReconnect(autoReconnect) {\n this.autoReconnect = autoReconnect;\n }\n\n /**\n * Supply an async fn that will provide a new url to reconnect to\n */\n setAutoReconnectUrl(autoReconnectUrl) {\n this.autoReconnectUrl = autoReconnectUrl;\n }\n\n // \"Private\"\n _close() {\n const socket = this.socket;\n\n if ( !socket ) {\n return;\n }\n\n try {\n this._log('closing');\n this.closingId = socket.sockId;\n socket.onopen = null;\n socket.onerror = null;\n socket.onmessage = null;\n socket.close();\n } catch (e) {\n this._log('exception', { e: e.toString() });\n // Continue anyway...\n }\n\n this.state = STATE_CLOSING;\n }\n\n _opened() {\n this._log('opened');\n const now = (new Date()).getTime();\n\n const atTime = this.disconnectedAt;\n let afterMilliseconds = 0;\n\n if ( atTime ) {\n afterMilliseconds = now - atTime;\n }\n\n if ( this.hasBeenOpen ) {\n this.hasReconnected = true;\n }\n\n this.hasBeenOpen = true;\n this.state = STATE_CONNECTED;\n this.framesReceived = 0;\n this.disconnectedAt = 0;\n\n this.dispatchEvent(new CustomEvent(EVENT_CONNECTED, { detail: { tries: this.tries, afterMilliseconds } }));\n this.tries = 0;\n this._resetWatchdog();\n clearTimeout(this.reconnectTimer);\n }\n\n _onmessage(event) {\n this._resetWatchdog();\n this.tries = 0;\n this.framesReceived++;\n\n this.dispatchEvent(new CustomEvent(EVENT_MESSAGE, { detail: event }));\n }\n\n _resetWatchdog() {\n clearTimeout(this.frameTimer);\n\n const timeout = this.frameTimeout;\n\n if ( timeout && this.state === STATE_CONNECTED) {\n this.frameTimer = setTimeout(() => {\n this._log(`watchdog expired after${ timeout }. Closing`);\n this._close();\n this.dispatchEvent(new CustomEvent(EVENT_FRAME_TIMEOUT));\n }, timeout);\n }\n }\n\n _error() {\n this.closingId = (this.socket ? this.socket.sockId : 0);\n this._log('error');\n }\n\n _closed(event) {\n const { code, reason, wasClean } = event;\n\n this._baseLog('closed', {\n id: this.closingId || this.socket?.sockId || 'unknown', code, reason, clean: wasClean\n });\n\n this.closingId = 0;\n this.socket = null;\n clearTimeout(this.reconnectTimer);\n clearTimeout(this.frameTimer);\n\n const callBacks = this.disconnectCallBacks;\n\n while ( callBacks.length ) {\n const fn = callBacks.pop();\n\n if ( fn ) {\n fn.apply(this);\n }\n }\n\n if ( [STATE_CONNECTED, STATE_CLOSING].includes(this.state) ) {\n wasConnected = true;\n }\n\n if ( !this.disconnectedAt ) {\n this.disconnectedAt = (new Date()).getTime();\n }\n\n if ( !warningShown && !wasConnected ) {\n this.autoReconnect = false;\n this.state = STATE_DISCONNECTED;\n\n const e = new CustomEvent(EVENT_CONNECT_ERROR, { detail: { isSafari } });\n\n this.dispatchEvent(e);\n warningShown = true;\n } else if ( this.autoReconnect ) {\n this.state = STATE_RECONNECTING;\n\n if (this.maxTries && this.tries > 1 && this.tries <= this.maxTries) {\n // dispatch an event which will trigger a growl from steve-plugin sockets warning users that we've lost connection and are attempting to reconnect\n const e = new CustomEvent(EVENT_CONNECT_ERROR);\n\n this.dispatchEvent(e);\n }\n\n if (this.maxTries && this.tries > this.maxTries) {\n this._log('closed. Will not reconnect (hit max attempts)');\n this.state = STATE_DISCONNECTED;\n // dispatch an event which will trigger a growl from steve-plugin sockets warning users that we've given up trying to reconnect\n this.dispatchEvent(new CustomEvent(EVENT_DISCONNECT_ERROR));\n } else {\n const reconnect = () => {\n this._log('closed. Attempting to reconnect');\n const delay = Math.max(1000, Math.min(1000 * this.tries, 30000));\n\n this.reconnectTimer = setTimeout(() => {\n this.connect();\n }, delay);\n };\n\n if (this.autoReconnectUrl) {\n this.autoReconnectUrl()\n .then((url) => {\n this.setUrl(url);\n\n reconnect();\n })\n .catch((e) => {\n console.error('Failed to fetch socket auto reconnect url', e); // eslint-disable-line no-console\n });\n } else {\n reconnect();\n }\n }\n } else {\n this.state = STATE_DISCONNECTED;\n }\n\n if ( this.state === STATE_DISCONNECTED ) {\n this.dispatchEvent(new CustomEvent(EVENT_DISCONNECTED));\n } else if ( this.state === STATE_RECONNECTING ) {\n this.dispatchEvent(new CustomEvent(EVENT_CONNECTING));\n }\n }\n\n /**\n * `console.log` the provided summary statement, with default information to identify the socket and the provided props\n */\n _log(summary, props) {\n this._baseLog(summary, {\n state: this.state, id: this.socket?.sockId || 0, ...props\n });\n }\n\n /**\n * `console.log` the provided summary statement and props\n *\n * This does not contain information to identify the socket and can be used in scenarios where it's not known or default\n */\n _baseLog(summary, props) {\n const message = [summary];\n const values = Object.entries(props || {});\n\n message.unshift('Socket ');\n\n if (values.length) {\n message.push(' (');\n values.forEach(([key, value], index) => {\n if (index !== 0) {\n message.push(`, `);\n }\n message.push(`${ key }=${ value }`);\n });\n message.push(')');\n }\n\n console.log(message.join('')); // eslint-disable-line no-console\n }\n}\n","\n\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsole.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsole.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./SerialConsole.vue?vue&type=template&id=a61c3450&\"\nimport script from \"./SerialConsole.vue?vue&type=script&lang=js&\"\nexport * from \"./SerialConsole.vue?vue&type=script&lang=js&\"\nimport style0 from \"./SerialConsole.vue?vue&type=style&index=0&id=a61c3450&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsolePage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsolePage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./SerialConsolePage.vue?vue&type=template&id=3bf18937&scoped=true&\"\nimport script from \"./SerialConsolePage.vue?vue&type=script&lang=js&\"\nexport * from \"./SerialConsolePage.vue?vue&type=script&lang=js&\"\nimport style0 from \"./SerialConsolePage.vue?vue&type=style&index=0&id=3bf18937&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3bf18937\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.$fetchState.pending)?_c('Loading'):_c('NovncConsoleWrapper',{ref:\"console\",staticClass:\"novnc-wrapper\",model:{value:(_vm.vmi),callback:function ($$v) {_vm.vmi=$$v},expression:\"vmi\"}})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{attrs:{\"id\":\"app\"}},[_c('div',{staticClass:\"vm-console\"},[_c('div',{staticClass:\"combination-keys\"},[_c('v-popover',{ref:\"popover\",attrs:{\"placement\":\"top\",\"trigger\":\"click\",\"container\":false},on:{\"auto-hide\":function($event){_vm.keysRecord = []}}},[_c('button',{staticClass:\"btn btn-sm bg-primary\"},[_vm._v(\" \"+_vm._s(_vm.t('kubevirt.virtualMachine.detail.console.shortKeys'))+\" \")]),_c('template',{slot:\"popover\"},[_c('novnc-console-item',{attrs:{\"items\":_vm.keymap,\"path\":_vm.keysRecord,\"pos\":0},on:{\"update\":_vm.update,\"sendKeys\":_vm.sendKeys}})],1)],2),(_vm.hasSoftRebootAction)?_c('button',{staticClass:\"btn btn-sm bg-primary\",on:{\"click\":_vm.softReboot}},[_vm._v(\" \"+_vm._s(_vm.t('kubevirt.action.softreboot'))+\" \")]):_vm._e()],1),(_vm.url && !_vm.isDown)?_c('NovncConsole',{ref:\"novncConsole\",attrs:{\"url\":_vm.url}}):_vm._e(),(_vm.isDown)?_c('p',[_vm._v(\" \"+_vm._s(_vm.t('kubevirt.virtualMachine.detail.console.down'))+\" \")]):_vm._e()],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/* eslint-disable key-spacing */\n\nexport default {\n XK_VoidSymbol: 0xffffff, /* Void symbol */\n\n XK_BackSpace: 0xff08, /* Back space, back char */\n XK_Tab: 0xff09,\n XK_Linefeed: 0xff0a, /* Linefeed, LF */\n XK_Clear: 0xff0b,\n XK_Return: 0xff0d, /* Return, enter */\n XK_Pause: 0xff13, /* Pause, hold */\n XK_Scroll_Lock: 0xff14,\n XK_Sys_Req: 0xff15,\n XK_Escape: 0xff1b,\n XK_Delete: 0xffff, /* Delete, rubout */\n\n /* International & multi-key character composition */\n\n XK_Multi_key: 0xff20, /* Multi-key character compose */\n XK_Codeinput: 0xff37,\n XK_SingleCandidate: 0xff3c,\n XK_MultipleCandidate: 0xff3d,\n XK_PreviousCandidate: 0xff3e,\n\n /* Japanese keyboard support */\n\n XK_Kanji: 0xff21, /* Kanji, Kanji convert */\n XK_Muhenkan: 0xff22, /* Cancel Conversion */\n XK_Henkan_Mode: 0xff23, /* Start/Stop Conversion */\n XK_Henkan: 0xff23, /* Alias for Henkan_Mode */\n XK_Romaji: 0xff24, /* to Romaji */\n XK_Hiragana: 0xff25, /* to Hiragana */\n XK_Katakana: 0xff26, /* to Katakana */\n XK_Hiragana_Katakana: 0xff27, /* Hiragana/Katakana toggle */\n XK_Zenkaku: 0xff28, /* to Zenkaku */\n XK_Hankaku: 0xff29, /* to Hankaku */\n XK_Zenkaku_Hankaku: 0xff2a, /* Zenkaku/Hankaku toggle */\n XK_Touroku: 0xff2b, /* Add to Dictionary */\n XK_Massyo: 0xff2c, /* Delete from Dictionary */\n XK_Kana_Lock: 0xff2d, /* Kana Lock */\n XK_Kana_Shift: 0xff2e, /* Kana Shift */\n XK_Eisu_Shift: 0xff2f, /* Alphanumeric Shift */\n XK_Eisu_toggle: 0xff30, /* Alphanumeric toggle */\n XK_Kanji_Bangou: 0xff37, /* Codeinput */\n XK_Zen_Koho: 0xff3d, /* Multiple/All Candidate(s) */\n XK_Mae_Koho: 0xff3e, /* Previous Candidate */\n\n /* Cursor control & motion */\n\n XK_Home: 0xff50,\n XK_Left: 0xff51, /* Move left, left arrow */\n XK_Up: 0xff52, /* Move up, up arrow */\n XK_Right: 0xff53, /* Move right, right arrow */\n XK_Down: 0xff54, /* Move down, down arrow */\n XK_Prior: 0xff55, /* Prior, previous */\n XK_Page_Up: 0xff55,\n XK_Next: 0xff56, /* Next */\n XK_Page_Down: 0xff56,\n XK_End: 0xff57, /* EOL */\n XK_Begin: 0xff58, /* BOL */\n\n\n /* Misc functions */\n\n XK_Select: 0xff60, /* Select, mark */\n XK_Print: 0xff61,\n XK_Execute: 0xff62, /* Execute, run, do */\n XK_Insert: 0xff63, /* Insert, insert here */\n XK_Undo: 0xff65,\n XK_Redo: 0xff66, /* Redo, again */\n XK_Menu: 0xff67,\n XK_Find: 0xff68, /* Find, search */\n XK_Cancel: 0xff69, /* Cancel, stop, abort, exit */\n XK_Help: 0xff6a, /* Help */\n XK_Break: 0xff6b,\n XK_Mode_switch: 0xff7e, /* Character set switch */\n XK_script_switch: 0xff7e, /* Alias for mode_switch */\n XK_Num_Lock: 0xff7f,\n\n /* Keypad functions, keypad numbers cleverly chosen to map to ASCII */\n\n XK_KP_Space: 0xff80, /* Space */\n XK_KP_Tab: 0xff89,\n XK_KP_Enter: 0xff8d, /* Enter */\n XK_KP_F1: 0xff91, /* PF1, KP_A, ... */\n XK_KP_F2: 0xff92,\n XK_KP_F3: 0xff93,\n XK_KP_F4: 0xff94,\n XK_KP_Home: 0xff95,\n XK_KP_Left: 0xff96,\n XK_KP_Up: 0xff97,\n XK_KP_Right: 0xff98,\n XK_KP_Down: 0xff99,\n XK_KP_Prior: 0xff9a,\n XK_KP_Page_Up: 0xff9a,\n XK_KP_Next: 0xff9b,\n XK_KP_Page_Down: 0xff9b,\n XK_KP_End: 0xff9c,\n XK_KP_Begin: 0xff9d,\n XK_KP_Insert: 0xff9e,\n XK_KP_Delete: 0xff9f,\n XK_KP_Equal: 0xffbd, /* Equals */\n XK_KP_Multiply: 0xffaa,\n XK_KP_Add: 0xffab,\n XK_KP_Separator: 0xffac, /* Separator, often comma */\n XK_KP_Subtract: 0xffad,\n XK_KP_Decimal: 0xffae,\n XK_KP_Divide: 0xffaf,\n\n XK_KP_0: 0xffb0,\n XK_KP_1: 0xffb1,\n XK_KP_2: 0xffb2,\n XK_KP_3: 0xffb3,\n XK_KP_4: 0xffb4,\n XK_KP_5: 0xffb5,\n XK_KP_6: 0xffb6,\n XK_KP_7: 0xffb7,\n XK_KP_8: 0xffb8,\n XK_KP_9: 0xffb9,\n\n /*\n * Auxiliary functions; note the duplicate definitions for left and right\n * function keys; Sun keyboards and a few other manufacturers have such\n * function key groups on the left and/or right sides of the keyboard.\n * We've not found a keyboard with more than 35 function keys total.\n */\n\n XK_F1: 0xffbe,\n XK_F2: 0xffbf,\n XK_F3: 0xffc0,\n XK_F4: 0xffc1,\n XK_F5: 0xffc2,\n XK_F6: 0xffc3,\n XK_F7: 0xffc4,\n XK_F8: 0xffc5,\n XK_F9: 0xffc6,\n XK_F10: 0xffc7,\n XK_F11: 0xffc8,\n XK_L1: 0xffc8,\n XK_F12: 0xffc9,\n XK_L2: 0xffc9,\n XK_F13: 0xffca,\n XK_L3: 0xffca,\n XK_F14: 0xffcb,\n XK_L4: 0xffcb,\n XK_F15: 0xffcc,\n XK_L5: 0xffcc,\n XK_F16: 0xffcd,\n XK_L6: 0xffcd,\n XK_F17: 0xffce,\n XK_L7: 0xffce,\n XK_F18: 0xffcf,\n XK_L8: 0xffcf,\n XK_F19: 0xffd0,\n XK_L9: 0xffd0,\n XK_F20: 0xffd1,\n XK_L10: 0xffd1,\n XK_F21: 0xffd2,\n XK_R1: 0xffd2,\n XK_F22: 0xffd3,\n XK_R2: 0xffd3,\n XK_F23: 0xffd4,\n XK_R3: 0xffd4,\n XK_F24: 0xffd5,\n XK_R4: 0xffd5,\n XK_F25: 0xffd6,\n XK_R5: 0xffd6,\n XK_F26: 0xffd7,\n XK_R6: 0xffd7,\n XK_F27: 0xffd8,\n XK_R7: 0xffd8,\n XK_F28: 0xffd9,\n XK_R8: 0xffd9,\n XK_F29: 0xffda,\n XK_R9: 0xffda,\n XK_F30: 0xffdb,\n XK_R10: 0xffdb,\n XK_F31: 0xffdc,\n XK_R11: 0xffdc,\n XK_F32: 0xffdd,\n XK_R12: 0xffdd,\n XK_F33: 0xffde,\n XK_R13: 0xffde,\n XK_F34: 0xffdf,\n XK_R14: 0xffdf,\n XK_F35: 0xffe0,\n XK_R15: 0xffe0,\n\n /* Modifiers */\n\n XK_Shift_L: 0xffe1, /* Left shift */\n XK_Shift_R: 0xffe2, /* Right shift */\n XK_Control_L: 0xffe3, /* Left control */\n XK_Control_R: 0xffe4, /* Right control */\n XK_Caps_Lock: 0xffe5, /* Caps lock */\n XK_Shift_Lock: 0xffe6, /* Shift lock */\n\n XK_Meta_L: 0xffe7, /* Left meta */\n XK_Meta_R: 0xffe8, /* Right meta */\n XK_Alt_L: 0xffe9, /* Left alt */\n XK_Alt_R: 0xffea, /* Right alt */\n XK_Super_L: 0xffeb, /* Left super */\n XK_Super_R: 0xffec, /* Right super */\n XK_Hyper_L: 0xffed, /* Left hyper */\n XK_Hyper_R: 0xffee, /* Right hyper */\n\n /*\n * Keyboard (XKB) Extension function and modifier keys\n * (from Appendix C of \"The X Keyboard Extension: Protocol Specification\")\n * Byte 3 = 0xfe\n */\n\n XK_ISO_Level3_Shift: 0xfe03, /* AltGr */\n XK_ISO_Next_Group: 0xfe08,\n XK_ISO_Prev_Group: 0xfe0a,\n XK_ISO_First_Group: 0xfe0c,\n XK_ISO_Last_Group: 0xfe0e,\n\n /*\n * Latin 1\n * (ISO/IEC 8859-1: Unicode U+0020..U+00FF)\n * Byte 3: 0\n */\n\n XK_space: 0x0020, /* U+0020 SPACE */\n XK_exclam: 0x0021, /* U+0021 EXCLAMATION MARK */\n XK_quotedbl: 0x0022, /* U+0022 QUOTATION MARK */\n XK_numbersign: 0x0023, /* U+0023 NUMBER SIGN */\n XK_dollar: 0x0024, /* U+0024 DOLLAR SIGN */\n XK_percent: 0x0025, /* U+0025 PERCENT SIGN */\n XK_ampersand: 0x0026, /* U+0026 AMPERSAND */\n XK_apostrophe: 0x0027, /* U+0027 APOSTROPHE */\n XK_quoteright: 0x0027, /* deprecated */\n XK_parenleft: 0x0028, /* U+0028 LEFT PARENTHESIS */\n XK_parenright: 0x0029, /* U+0029 RIGHT PARENTHESIS */\n XK_asterisk: 0x002a, /* U+002A ASTERISK */\n XK_plus: 0x002b, /* U+002B PLUS SIGN */\n XK_comma: 0x002c, /* U+002C COMMA */\n XK_minus: 0x002d, /* U+002D HYPHEN-MINUS */\n XK_period: 0x002e, /* U+002E FULL STOP */\n XK_slash: 0x002f, /* U+002F SOLIDUS */\n XK_0: 0x0030, /* U+0030 DIGIT ZERO */\n XK_1: 0x0031, /* U+0031 DIGIT ONE */\n XK_2: 0x0032, /* U+0032 DIGIT TWO */\n XK_3: 0x0033, /* U+0033 DIGIT THREE */\n XK_4: 0x0034, /* U+0034 DIGIT FOUR */\n XK_5: 0x0035, /* U+0035 DIGIT FIVE */\n XK_6: 0x0036, /* U+0036 DIGIT SIX */\n XK_7: 0x0037, /* U+0037 DIGIT SEVEN */\n XK_8: 0x0038, /* U+0038 DIGIT EIGHT */\n XK_9: 0x0039, /* U+0039 DIGIT NINE */\n XK_colon: 0x003a, /* U+003A COLON */\n XK_semicolon: 0x003b, /* U+003B SEMICOLON */\n XK_less: 0x003c, /* U+003C LESS-THAN SIGN */\n XK_equal: 0x003d, /* U+003D EQUALS SIGN */\n XK_greater: 0x003e, /* U+003E GREATER-THAN SIGN */\n XK_question: 0x003f, /* U+003F QUESTION MARK */\n XK_at: 0x0040, /* U+0040 COMMERCIAL AT */\n XK_A: 0x0041, /* U+0041 LATIN CAPITAL LETTER A */\n XK_B: 0x0042, /* U+0042 LATIN CAPITAL LETTER B */\n XK_C: 0x0043, /* U+0043 LATIN CAPITAL LETTER C */\n XK_D: 0x0044, /* U+0044 LATIN CAPITAL LETTER D */\n XK_E: 0x0045, /* U+0045 LATIN CAPITAL LETTER E */\n XK_F: 0x0046, /* U+0046 LATIN CAPITAL LETTER F */\n XK_G: 0x0047, /* U+0047 LATIN CAPITAL LETTER G */\n XK_H: 0x0048, /* U+0048 LATIN CAPITAL LETTER H */\n XK_I: 0x0049, /* U+0049 LATIN CAPITAL LETTER I */\n XK_J: 0x004a, /* U+004A LATIN CAPITAL LETTER J */\n XK_K: 0x004b, /* U+004B LATIN CAPITAL LETTER K */\n XK_L: 0x004c, /* U+004C LATIN CAPITAL LETTER L */\n XK_M: 0x004d, /* U+004D LATIN CAPITAL LETTER M */\n XK_N: 0x004e, /* U+004E LATIN CAPITAL LETTER N */\n XK_O: 0x004f, /* U+004F LATIN CAPITAL LETTER O */\n XK_P: 0x0050, /* U+0050 LATIN CAPITAL LETTER P */\n XK_Q: 0x0051, /* U+0051 LATIN CAPITAL LETTER Q */\n XK_R: 0x0052, /* U+0052 LATIN CAPITAL LETTER R */\n XK_S: 0x0053, /* U+0053 LATIN CAPITAL LETTER S */\n XK_T: 0x0054, /* U+0054 LATIN CAPITAL LETTER T */\n XK_U: 0x0055, /* U+0055 LATIN CAPITAL LETTER U */\n XK_V: 0x0056, /* U+0056 LATIN CAPITAL LETTER V */\n XK_W: 0x0057, /* U+0057 LATIN CAPITAL LETTER W */\n XK_X: 0x0058, /* U+0058 LATIN CAPITAL LETTER X */\n XK_Y: 0x0059, /* U+0059 LATIN CAPITAL LETTER Y */\n XK_Z: 0x005a, /* U+005A LATIN CAPITAL LETTER Z */\n XK_bracketleft: 0x005b, /* U+005B LEFT SQUARE BRACKET */\n XK_backslash: 0x005c, /* U+005C REVERSE SOLIDUS */\n XK_bracketright: 0x005d, /* U+005D RIGHT SQUARE BRACKET */\n XK_asciicircum: 0x005e, /* U+005E CIRCUMFLEX ACCENT */\n XK_underscore: 0x005f, /* U+005F LOW LINE */\n XK_grave: 0x0060, /* U+0060 GRAVE ACCENT */\n XK_quoteleft: 0x0060, /* deprecated */\n XK_a: 0x0061, /* U+0061 LATIN SMALL LETTER A */\n XK_b: 0x0062, /* U+0062 LATIN SMALL LETTER B */\n XK_c: 0x0063, /* U+0063 LATIN SMALL LETTER C */\n XK_d: 0x0064, /* U+0064 LATIN SMALL LETTER D */\n XK_e: 0x0065, /* U+0065 LATIN SMALL LETTER E */\n XK_f: 0x0066, /* U+0066 LATIN SMALL LETTER F */\n XK_g: 0x0067, /* U+0067 LATIN SMALL LETTER G */\n XK_h: 0x0068, /* U+0068 LATIN SMALL LETTER H */\n XK_i: 0x0069, /* U+0069 LATIN SMALL LETTER I */\n XK_j: 0x006a, /* U+006A LATIN SMALL LETTER J */\n XK_k: 0x006b, /* U+006B LATIN SMALL LETTER K */\n XK_l: 0x006c, /* U+006C LATIN SMALL LETTER L */\n XK_m: 0x006d, /* U+006D LATIN SMALL LETTER M */\n XK_n: 0x006e, /* U+006E LATIN SMALL LETTER N */\n XK_o: 0x006f, /* U+006F LATIN SMALL LETTER O */\n XK_p: 0x0070, /* U+0070 LATIN SMALL LETTER P */\n XK_q: 0x0071, /* U+0071 LATIN SMALL LETTER Q */\n XK_r: 0x0072, /* U+0072 LATIN SMALL LETTER R */\n XK_s: 0x0073, /* U+0073 LATIN SMALL LETTER S */\n XK_t: 0x0074, /* U+0074 LATIN SMALL LETTER T */\n XK_u: 0x0075, /* U+0075 LATIN SMALL LETTER U */\n XK_v: 0x0076, /* U+0076 LATIN SMALL LETTER V */\n XK_w: 0x0077, /* U+0077 LATIN SMALL LETTER W */\n XK_x: 0x0078, /* U+0078 LATIN SMALL LETTER X */\n XK_y: 0x0079, /* U+0079 LATIN SMALL LETTER Y */\n XK_z: 0x007a, /* U+007A LATIN SMALL LETTER Z */\n XK_braceleft: 0x007b, /* U+007B LEFT CURLY BRACKET */\n XK_bar: 0x007c, /* U+007C VERTICAL LINE */\n XK_braceright: 0x007d, /* U+007D RIGHT CURLY BRACKET */\n XK_asciitilde: 0x007e, /* U+007E TILDE */\n\n XK_nobreakspace: 0x00a0, /* U+00A0 NO-BREAK SPACE */\n XK_exclamdown: 0x00a1, /* U+00A1 INVERTED EXCLAMATION MARK */\n XK_cent: 0x00a2, /* U+00A2 CENT SIGN */\n XK_sterling: 0x00a3, /* U+00A3 POUND SIGN */\n XK_currency: 0x00a4, /* U+00A4 CURRENCY SIGN */\n XK_yen: 0x00a5, /* U+00A5 YEN SIGN */\n XK_brokenbar: 0x00a6, /* U+00A6 BROKEN BAR */\n XK_section: 0x00a7, /* U+00A7 SECTION SIGN */\n XK_diaeresis: 0x00a8, /* U+00A8 DIAERESIS */\n XK_copyright: 0x00a9, /* U+00A9 COPYRIGHT SIGN */\n XK_ordfeminine: 0x00aa, /* U+00AA FEMININE ORDINAL INDICATOR */\n XK_guillemotleft: 0x00ab, /* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */\n XK_notsign: 0x00ac, /* U+00AC NOT SIGN */\n XK_hyphen: 0x00ad, /* U+00AD SOFT HYPHEN */\n XK_registered: 0x00ae, /* U+00AE REGISTERED SIGN */\n XK_macron: 0x00af, /* U+00AF MACRON */\n XK_degree: 0x00b0, /* U+00B0 DEGREE SIGN */\n XK_plusminus: 0x00b1, /* U+00B1 PLUS-MINUS SIGN */\n XK_twosuperior: 0x00b2, /* U+00B2 SUPERSCRIPT TWO */\n XK_threesuperior: 0x00b3, /* U+00B3 SUPERSCRIPT THREE */\n XK_acute: 0x00b4, /* U+00B4 ACUTE ACCENT */\n XK_mu: 0x00b5, /* U+00B5 MICRO SIGN */\n XK_paragraph: 0x00b6, /* U+00B6 PILCROW SIGN */\n XK_periodcentered: 0x00b7, /* U+00B7 MIDDLE DOT */\n XK_cedilla: 0x00b8, /* U+00B8 CEDILLA */\n XK_onesuperior: 0x00b9, /* U+00B9 SUPERSCRIPT ONE */\n XK_masculine: 0x00ba, /* U+00BA MASCULINE ORDINAL INDICATOR */\n XK_guillemotright: 0x00bb, /* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */\n XK_onequarter: 0x00bc, /* U+00BC VULGAR FRACTION ONE QUARTER */\n XK_onehalf: 0x00bd, /* U+00BD VULGAR FRACTION ONE HALF */\n XK_threequarters: 0x00be, /* U+00BE VULGAR FRACTION THREE QUARTERS */\n XK_questiondown: 0x00bf, /* U+00BF INVERTED QUESTION MARK */\n XK_Agrave: 0x00c0, /* U+00C0 LATIN CAPITAL LETTER A WITH GRAVE */\n XK_Aacute: 0x00c1, /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */\n XK_Acircumflex: 0x00c2, /* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */\n XK_Atilde: 0x00c3, /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */\n XK_Adiaeresis: 0x00c4, /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */\n XK_Aring: 0x00c5, /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */\n XK_AE: 0x00c6, /* U+00C6 LATIN CAPITAL LETTER AE */\n XK_Ccedilla: 0x00c7, /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */\n XK_Egrave: 0x00c8, /* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */\n XK_Eacute: 0x00c9, /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */\n XK_Ecircumflex: 0x00ca, /* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */\n XK_Ediaeresis: 0x00cb, /* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */\n XK_Igrave: 0x00cc, /* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */\n XK_Iacute: 0x00cd, /* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */\n XK_Icircumflex: 0x00ce, /* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */\n XK_Idiaeresis: 0x00cf, /* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */\n XK_ETH: 0x00d0, /* U+00D0 LATIN CAPITAL LETTER ETH */\n XK_Eth: 0x00d0, /* deprecated */\n XK_Ntilde: 0x00d1, /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */\n XK_Ograve: 0x00d2, /* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */\n XK_Oacute: 0x00d3, /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */\n XK_Ocircumflex: 0x00d4, /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */\n XK_Otilde: 0x00d5, /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */\n XK_Odiaeresis: 0x00d6, /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */\n XK_multiply: 0x00d7, /* U+00D7 MULTIPLICATION SIGN */\n XK_Oslash: 0x00d8, /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */\n XK_Ooblique: 0x00d8, /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */\n XK_Ugrave: 0x00d9, /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */\n XK_Uacute: 0x00da, /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */\n XK_Ucircumflex: 0x00db, /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */\n XK_Udiaeresis: 0x00dc, /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */\n XK_Yacute: 0x00dd, /* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */\n XK_THORN: 0x00de, /* U+00DE LATIN CAPITAL LETTER THORN */\n XK_Thorn: 0x00de, /* deprecated */\n XK_ssharp: 0x00df, /* U+00DF LATIN SMALL LETTER SHARP S */\n XK_agrave: 0x00e0, /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */\n XK_aacute: 0x00e1, /* U+00E1 LATIN SMALL LETTER A WITH ACUTE */\n XK_acircumflex: 0x00e2, /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */\n XK_atilde: 0x00e3, /* U+00E3 LATIN SMALL LETTER A WITH TILDE */\n XK_adiaeresis: 0x00e4, /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */\n XK_aring: 0x00e5, /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */\n XK_ae: 0x00e6, /* U+00E6 LATIN SMALL LETTER AE */\n XK_ccedilla: 0x00e7, /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */\n XK_egrave: 0x00e8, /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */\n XK_eacute: 0x00e9, /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */\n XK_ecircumflex: 0x00ea, /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */\n XK_ediaeresis: 0x00eb, /* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */\n XK_igrave: 0x00ec, /* U+00EC LATIN SMALL LETTER I WITH GRAVE */\n XK_iacute: 0x00ed, /* U+00ED LATIN SMALL LETTER I WITH ACUTE */\n XK_icircumflex: 0x00ee, /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */\n XK_idiaeresis: 0x00ef, /* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */\n XK_eth: 0x00f0, /* U+00F0 LATIN SMALL LETTER ETH */\n XK_ntilde: 0x00f1, /* U+00F1 LATIN SMALL LETTER N WITH TILDE */\n XK_ograve: 0x00f2, /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */\n XK_oacute: 0x00f3, /* U+00F3 LATIN SMALL LETTER O WITH ACUTE */\n XK_ocircumflex: 0x00f4, /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */\n XK_otilde: 0x00f5, /* U+00F5 LATIN SMALL LETTER O WITH TILDE */\n XK_odiaeresis: 0x00f6, /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */\n XK_division: 0x00f7, /* U+00F7 DIVISION SIGN */\n XK_oslash: 0x00f8, /* U+00F8 LATIN SMALL LETTER O WITH STROKE */\n XK_ooblique: 0x00f8, /* U+00F8 LATIN SMALL LETTER O WITH STROKE */\n XK_ugrave: 0x00f9, /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */\n XK_uacute: 0x00fa, /* U+00FA LATIN SMALL LETTER U WITH ACUTE */\n XK_ucircumflex: 0x00fb, /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */\n XK_udiaeresis: 0x00fc, /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */\n XK_yacute: 0x00fd, /* U+00FD LATIN SMALL LETTER Y WITH ACUTE */\n XK_thorn: 0x00fe, /* U+00FE LATIN SMALL LETTER THORN */\n XK_ydiaeresis: 0x00ff, /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */\n\n /*\n * Korean\n * Byte 3 = 0x0e\n */\n\n XK_Hangul: 0xff31, /* Hangul start/stop(toggle) */\n XK_Hangul_Hanja: 0xff34, /* Start Hangul->Hanja Conversion */\n XK_Hangul_Jeonja: 0xff38, /* Jeonja mode */\n\n /*\n * XFree86 vendor specific keysyms.\n *\n * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.\n */\n\n XF86XK_ModeLock: 0x1008FF01,\n XF86XK_MonBrightnessUp: 0x1008FF02,\n XF86XK_MonBrightnessDown: 0x1008FF03,\n XF86XK_KbdLightOnOff: 0x1008FF04,\n XF86XK_KbdBrightnessUp: 0x1008FF05,\n XF86XK_KbdBrightnessDown: 0x1008FF06,\n XF86XK_Standby: 0x1008FF10,\n XF86XK_AudioLowerVolume: 0x1008FF11,\n XF86XK_AudioMute: 0x1008FF12,\n XF86XK_AudioRaiseVolume: 0x1008FF13,\n XF86XK_AudioPlay: 0x1008FF14,\n XF86XK_AudioStop: 0x1008FF15,\n XF86XK_AudioPrev: 0x1008FF16,\n XF86XK_AudioNext: 0x1008FF17,\n XF86XK_HomePage: 0x1008FF18,\n XF86XK_Mail: 0x1008FF19,\n XF86XK_Start: 0x1008FF1A,\n XF86XK_Search: 0x1008FF1B,\n XF86XK_AudioRecord: 0x1008FF1C,\n XF86XK_Calculator: 0x1008FF1D,\n XF86XK_Memo: 0x1008FF1E,\n XF86XK_ToDoList: 0x1008FF1F,\n XF86XK_Calendar: 0x1008FF20,\n XF86XK_PowerDown: 0x1008FF21,\n XF86XK_ContrastAdjust: 0x1008FF22,\n XF86XK_RockerUp: 0x1008FF23,\n XF86XK_RockerDown: 0x1008FF24,\n XF86XK_RockerEnter: 0x1008FF25,\n XF86XK_Back: 0x1008FF26,\n XF86XK_Forward: 0x1008FF27,\n XF86XK_Stop: 0x1008FF28,\n XF86XK_Refresh: 0x1008FF29,\n XF86XK_PowerOff: 0x1008FF2A,\n XF86XK_WakeUp: 0x1008FF2B,\n XF86XK_Eject: 0x1008FF2C,\n XF86XK_ScreenSaver: 0x1008FF2D,\n XF86XK_WWW: 0x1008FF2E,\n XF86XK_Sleep: 0x1008FF2F,\n XF86XK_Favorites: 0x1008FF30,\n XF86XK_AudioPause: 0x1008FF31,\n XF86XK_AudioMedia: 0x1008FF32,\n XF86XK_MyComputer: 0x1008FF33,\n XF86XK_VendorHome: 0x1008FF34,\n XF86XK_LightBulb: 0x1008FF35,\n XF86XK_Shop: 0x1008FF36,\n XF86XK_History: 0x1008FF37,\n XF86XK_OpenURL: 0x1008FF38,\n XF86XK_AddFavorite: 0x1008FF39,\n XF86XK_HotLinks: 0x1008FF3A,\n XF86XK_BrightnessAdjust: 0x1008FF3B,\n XF86XK_Finance: 0x1008FF3C,\n XF86XK_Community: 0x1008FF3D,\n XF86XK_AudioRewind: 0x1008FF3E,\n XF86XK_BackForward: 0x1008FF3F,\n XF86XK_Launch0: 0x1008FF40,\n XF86XK_Launch1: 0x1008FF41,\n XF86XK_Launch2: 0x1008FF42,\n XF86XK_Launch3: 0x1008FF43,\n XF86XK_Launch4: 0x1008FF44,\n XF86XK_Launch5: 0x1008FF45,\n XF86XK_Launch6: 0x1008FF46,\n XF86XK_Launch7: 0x1008FF47,\n XF86XK_Launch8: 0x1008FF48,\n XF86XK_Launch9: 0x1008FF49,\n XF86XK_LaunchA: 0x1008FF4A,\n XF86XK_LaunchB: 0x1008FF4B,\n XF86XK_LaunchC: 0x1008FF4C,\n XF86XK_LaunchD: 0x1008FF4D,\n XF86XK_LaunchE: 0x1008FF4E,\n XF86XK_LaunchF: 0x1008FF4F,\n XF86XK_ApplicationLeft: 0x1008FF50,\n XF86XK_ApplicationRight: 0x1008FF51,\n XF86XK_Book: 0x1008FF52,\n XF86XK_CD: 0x1008FF53,\n XF86XK_Calculater: 0x1008FF54,\n XF86XK_Clear: 0x1008FF55,\n XF86XK_Close: 0x1008FF56,\n XF86XK_Copy: 0x1008FF57,\n XF86XK_Cut: 0x1008FF58,\n XF86XK_Display: 0x1008FF59,\n XF86XK_DOS: 0x1008FF5A,\n XF86XK_Documents: 0x1008FF5B,\n XF86XK_Excel: 0x1008FF5C,\n XF86XK_Explorer: 0x1008FF5D,\n XF86XK_Game: 0x1008FF5E,\n XF86XK_Go: 0x1008FF5F,\n XF86XK_iTouch: 0x1008FF60,\n XF86XK_LogOff: 0x1008FF61,\n XF86XK_Market: 0x1008FF62,\n XF86XK_Meeting: 0x1008FF63,\n XF86XK_MenuKB: 0x1008FF65,\n XF86XK_MenuPB: 0x1008FF66,\n XF86XK_MySites: 0x1008FF67,\n XF86XK_New: 0x1008FF68,\n XF86XK_News: 0x1008FF69,\n XF86XK_OfficeHome: 0x1008FF6A,\n XF86XK_Open: 0x1008FF6B,\n XF86XK_Option: 0x1008FF6C,\n XF86XK_Paste: 0x1008FF6D,\n XF86XK_Phone: 0x1008FF6E,\n XF86XK_Q: 0x1008FF70,\n XF86XK_Reply: 0x1008FF72,\n XF86XK_Reload: 0x1008FF73,\n XF86XK_RotateWindows: 0x1008FF74,\n XF86XK_RotationPB: 0x1008FF75,\n XF86XK_RotationKB: 0x1008FF76,\n XF86XK_Save: 0x1008FF77,\n XF86XK_ScrollUp: 0x1008FF78,\n XF86XK_ScrollDown: 0x1008FF79,\n XF86XK_ScrollClick: 0x1008FF7A,\n XF86XK_Send: 0x1008FF7B,\n XF86XK_Spell: 0x1008FF7C,\n XF86XK_SplitScreen: 0x1008FF7D,\n XF86XK_Support: 0x1008FF7E,\n XF86XK_TaskPane: 0x1008FF7F,\n XF86XK_Terminal: 0x1008FF80,\n XF86XK_Tools: 0x1008FF81,\n XF86XK_Travel: 0x1008FF82,\n XF86XK_UserPB: 0x1008FF84,\n XF86XK_User1KB: 0x1008FF85,\n XF86XK_User2KB: 0x1008FF86,\n XF86XK_Video: 0x1008FF87,\n XF86XK_WheelButton: 0x1008FF88,\n XF86XK_Word: 0x1008FF89,\n XF86XK_Xfer: 0x1008FF8A,\n XF86XK_ZoomIn: 0x1008FF8B,\n XF86XK_ZoomOut: 0x1008FF8C,\n XF86XK_Away: 0x1008FF8D,\n XF86XK_Messenger: 0x1008FF8E,\n XF86XK_WebCam: 0x1008FF8F,\n XF86XK_MailForward: 0x1008FF90,\n XF86XK_Pictures: 0x1008FF91,\n XF86XK_Music: 0x1008FF92,\n XF86XK_Battery: 0x1008FF93,\n XF86XK_Bluetooth: 0x1008FF94,\n XF86XK_WLAN: 0x1008FF95,\n XF86XK_UWB: 0x1008FF96,\n XF86XK_AudioForward: 0x1008FF97,\n XF86XK_AudioRepeat: 0x1008FF98,\n XF86XK_AudioRandomPlay: 0x1008FF99,\n XF86XK_Subtitle: 0x1008FF9A,\n XF86XK_AudioCycleTrack: 0x1008FF9B,\n XF86XK_CycleAngle: 0x1008FF9C,\n XF86XK_FrameBack: 0x1008FF9D,\n XF86XK_FrameForward: 0x1008FF9E,\n XF86XK_Time: 0x1008FF9F,\n XF86XK_Select: 0x1008FFA0,\n XF86XK_View: 0x1008FFA1,\n XF86XK_TopMenu: 0x1008FFA2,\n XF86XK_Red: 0x1008FFA3,\n XF86XK_Green: 0x1008FFA4,\n XF86XK_Yellow: 0x1008FFA5,\n XF86XK_Blue: 0x1008FFA6,\n XF86XK_Suspend: 0x1008FFA7,\n XF86XK_Hibernate: 0x1008FFA8,\n XF86XK_TouchpadToggle: 0x1008FFA9,\n XF86XK_TouchpadOn: 0x1008FFB0,\n XF86XK_TouchpadOff: 0x1008FFB1,\n XF86XK_AudioMicMute: 0x1008FFB2,\n XF86XK_Switch_VT_1: 0x1008FE01,\n XF86XK_Switch_VT_2: 0x1008FE02,\n XF86XK_Switch_VT_3: 0x1008FE03,\n XF86XK_Switch_VT_4: 0x1008FE04,\n XF86XK_Switch_VT_5: 0x1008FE05,\n XF86XK_Switch_VT_6: 0x1008FE06,\n XF86XK_Switch_VT_7: 0x1008FE07,\n XF86XK_Switch_VT_8: 0x1008FE08,\n XF86XK_Switch_VT_9: 0x1008FE09,\n XF86XK_Switch_VT_10: 0x1008FE0A,\n XF86XK_Switch_VT_11: 0x1008FE0B,\n XF86XK_Switch_VT_12: 0x1008FE0C,\n XF86XK_Ungrab: 0x1008FE20,\n XF86XK_ClearGrab: 0x1008FE21,\n XF86XK_Next_VMode: 0x1008FE22,\n XF86XK_Prev_VMode: 0x1008FE23,\n XF86XK_LogWindowTree: 0x1008FE24,\n XF86XK_LogGrabInfo: 0x1008FE25,\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.connected && _vm.disconnected)?_c('div',[_c('main',{staticClass:\"main-layout error\"},[_c('div',{staticClass:\"text-center\"},[_c('BrandImage',{attrs:{\"file-name\":\"error-desert-landscape.svg\",\"width\":\"900\",\"height\":\"300\"}}),_c('h1',[_vm._v(\" \"+_vm._s(_vm.t('generic.notification.title.warning'))+\" \")]),_c('h2',{staticClass:\"text-secondary mt-20\"},[_vm._v(\" \"+_vm._s(_vm.t('vncConsole.error.message'))+\" \")])],1)])]):_vm._e(),_c('div',{ref:\"view\"})])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nexport function toUnsigned32bit(toConvert) {\n return toConvert >>> 0;\n}\n\nexport function toSigned32bit(toConvert) {\n return toConvert | 0;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Logging/debug routines\n */\n\nlet _logLevel = 'warn';\n\nlet Debug = () => {};\nlet Info = () => {};\nlet Warn = () => {};\nlet Error = () => {};\n\nexport function initLogging(level) {\n if (typeof level === 'undefined') {\n level = _logLevel;\n } else {\n _logLevel = level;\n }\n\n Debug = Info = Warn = Error = () => {};\n\n if (typeof window.console !== \"undefined\") {\n /* eslint-disable no-console, no-fallthrough */\n switch (level) {\n case 'debug':\n Debug = console.debug.bind(window.console);\n case 'info':\n Info = console.info.bind(window.console);\n case 'warn':\n Warn = console.warn.bind(window.console);\n case 'error':\n Error = console.error.bind(window.console);\n case 'none':\n break;\n default:\n throw new window.Error(\"invalid logging type '\" + level + \"'\");\n }\n /* eslint-enable no-console, no-fallthrough */\n }\n}\n\nexport function getLogging() {\n return _logLevel;\n}\n\nexport { Debug, Info, Warn, Error };\n\n// Initialize logging level\ninitLogging();\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n// Decode from UTF-8\nexport function decodeUTF8(utf8string, allowLatin1=false) {\n try {\n return decodeURIComponent(escape(utf8string));\n } catch (e) {\n if (e instanceof URIError) {\n if (allowLatin1) {\n // If we allow Latin1 we can ignore any decoding fails\n // and in these cases return the original string\n return utf8string;\n }\n }\n throw e;\n }\n}\n\n// Encode to UTF-8\nexport function encodeUTF8(DOMString) {\n return unescape(encodeURIComponent(DOMString));\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n * Browser feature support detection\n */\n\nimport * as Log from './logging.js';\n\n// Touch detection\nexport let isTouchDevice = ('ontouchstart' in document.documentElement) ||\n // requried for Chrome debugger\n (document.ontouchstart !== undefined) ||\n // required for MS Surface\n (navigator.maxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0);\nwindow.addEventListener('touchstart', function onFirstTouch() {\n isTouchDevice = true;\n window.removeEventListener('touchstart', onFirstTouch, false);\n}, false);\n\n\n// The goal is to find a certain physical width, the devicePixelRatio\n// brings us a bit closer but is not optimal.\nexport let dragThreshold = 10 * (window.devicePixelRatio || 1);\n\nlet _supportsCursorURIs = false;\n\ntry {\n const target = document.createElement('canvas');\n target.style.cursor = 'url(\"data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==\") 2 2, default';\n\n if (target.style.cursor.indexOf(\"url\") === 0) {\n Log.Info(\"Data URI scheme cursor supported\");\n _supportsCursorURIs = true;\n } else {\n Log.Warn(\"Data URI scheme cursor not supported\");\n }\n} catch (exc) {\n Log.Error(\"Data URI scheme cursor test exception: \" + exc);\n}\n\nexport const supportsCursorURIs = _supportsCursorURIs;\n\nlet _hasScrollbarGutter = true;\ntry {\n // Create invisible container\n const container = document.createElement('div');\n container.style.visibility = 'hidden';\n container.style.overflow = 'scroll'; // forcing scrollbars\n document.body.appendChild(container);\n\n // Create a div and place it in the container\n const child = document.createElement('div');\n container.appendChild(child);\n\n // Calculate the difference between the container's full width\n // and the child's width - the difference is the scrollbars\n const scrollbarWidth = (container.offsetWidth - child.offsetWidth);\n\n // Clean up\n container.parentNode.removeChild(container);\n\n _hasScrollbarGutter = scrollbarWidth != 0;\n} catch (exc) {\n Log.Error(\"Scrollbar test exception: \" + exc);\n}\nexport const hasScrollbarGutter = _hasScrollbarGutter;\n\n/*\n * The functions for detection of platforms and browsers below are exported\n * but the use of these should be minimized as much as possible.\n *\n * It's better to use feature detection than platform detection.\n */\n\n/* OS */\n\nexport function isMac() {\n return !!(/mac/i).exec(navigator.platform);\n}\n\nexport function isWindows() {\n return !!(/win/i).exec(navigator.platform);\n}\n\nexport function isIOS() {\n return (!!(/ipad/i).exec(navigator.platform) ||\n !!(/iphone/i).exec(navigator.platform) ||\n !!(/ipod/i).exec(navigator.platform));\n}\n\nexport function isAndroid() {\n /* Android sets navigator.platform to Linux :/ */\n return !!navigator.userAgent.match('Android ');\n}\n\nexport function isChromeOS() {\n /* ChromeOS sets navigator.platform to Linux :/ */\n return !!navigator.userAgent.match(' CrOS ');\n}\n\n/* Browser */\n\nexport function isSafari() {\n return !!navigator.userAgent.match('Safari/...') &&\n !navigator.userAgent.match('Chrome/...') &&\n !navigator.userAgent.match('Chromium/...') &&\n !navigator.userAgent.match('Epiphany/...');\n}\n\nexport function isFirefox() {\n return !!navigator.userAgent.match('Firefox/...') &&\n !navigator.userAgent.match('Seamonkey/...');\n}\n\nexport function isChrome() {\n return !!navigator.userAgent.match('Chrome/...') &&\n !navigator.userAgent.match('Chromium/...') &&\n !navigator.userAgent.match('Edg/...') &&\n !navigator.userAgent.match('OPR/...');\n}\n\nexport function isChromium() {\n return !!navigator.userAgent.match('Chromium/...');\n}\n\nexport function isOpera() {\n return !!navigator.userAgent.match('OPR/...');\n}\n\nexport function isEdge() {\n return !!navigator.userAgent.match('Edg/...');\n}\n\n/* Engine */\n\nexport function isGecko() {\n return !!navigator.userAgent.match('Gecko/...');\n}\n\nexport function isWebKit() {\n return !!navigator.userAgent.match('AppleWebKit/...') &&\n !navigator.userAgent.match('Chrome/...');\n}\n\nexport function isBlink() {\n return !!navigator.userAgent.match('Chrome/...');\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * HTML element utility functions\n */\n\nexport function clientToElement(x, y, elem) {\n const bounds = elem.getBoundingClientRect();\n let pos = { x: 0, y: 0 };\n // Clip to target bounds\n if (x < bounds.left) {\n pos.x = 0;\n } else if (x >= bounds.right) {\n pos.x = bounds.width - 1;\n } else {\n pos.x = x - bounds.left;\n }\n if (y < bounds.top) {\n pos.y = 0;\n } else if (y >= bounds.bottom) {\n pos.y = bounds.height - 1;\n } else {\n pos.y = y - bounds.top;\n }\n return pos;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Cross-browser event and position routines\n */\n\nexport function getPointerEvent(e) {\n return e.changedTouches ? e.changedTouches[0] : e.touches ? e.touches[0] : e;\n}\n\nexport function stopEvent(e) {\n e.stopPropagation();\n e.preventDefault();\n}\n\n// Emulate Element.setCapture() when not supported\nlet _captureRecursion = false;\nlet _elementForUnflushedEvents = null;\ndocument.captureElement = null;\nfunction _captureProxy(e) {\n // Recursion protection as we'll see our own event\n if (_captureRecursion) return;\n\n // Clone the event as we cannot dispatch an already dispatched event\n const newEv = new e.constructor(e.type, e);\n\n _captureRecursion = true;\n if (document.captureElement) {\n document.captureElement.dispatchEvent(newEv);\n } else {\n _elementForUnflushedEvents.dispatchEvent(newEv);\n }\n _captureRecursion = false;\n\n // Avoid double events\n e.stopPropagation();\n\n // Respect the wishes of the redirected event handlers\n if (newEv.defaultPrevented) {\n e.preventDefault();\n }\n\n // Implicitly release the capture on button release\n if (e.type === \"mouseup\") {\n releaseCapture();\n }\n}\n\n// Follow cursor style of target element\nfunction _capturedElemChanged() {\n const proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n proxyElem.style.cursor = window.getComputedStyle(document.captureElement).cursor;\n}\n\nconst _captureObserver = new MutationObserver(_capturedElemChanged);\n\nexport function setCapture(target) {\n if (target.setCapture) {\n\n target.setCapture();\n document.captureElement = target;\n } else {\n // Release any existing capture in case this method is\n // called multiple times without coordination\n releaseCapture();\n\n let proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n\n if (proxyElem === null) {\n proxyElem = document.createElement(\"div\");\n proxyElem.id = \"noVNC_mouse_capture_elem\";\n proxyElem.style.position = \"fixed\";\n proxyElem.style.top = \"0px\";\n proxyElem.style.left = \"0px\";\n proxyElem.style.width = \"100%\";\n proxyElem.style.height = \"100%\";\n proxyElem.style.zIndex = 10000;\n proxyElem.style.display = \"none\";\n document.body.appendChild(proxyElem);\n\n // This is to make sure callers don't get confused by having\n // our blocking element as the target\n proxyElem.addEventListener('contextmenu', _captureProxy);\n\n proxyElem.addEventListener('mousemove', _captureProxy);\n proxyElem.addEventListener('mouseup', _captureProxy);\n }\n\n document.captureElement = target;\n\n // Track cursor and get initial cursor\n _captureObserver.observe(target, {attributes: true});\n _capturedElemChanged();\n\n proxyElem.style.display = \"\";\n\n // We listen to events on window in order to keep tracking if it\n // happens to leave the viewport\n window.addEventListener('mousemove', _captureProxy);\n window.addEventListener('mouseup', _captureProxy);\n }\n}\n\nexport function releaseCapture() {\n if (document.releaseCapture) {\n\n document.releaseCapture();\n document.captureElement = null;\n\n } else {\n if (!document.captureElement) {\n return;\n }\n\n // There might be events already queued. The event proxy needs\n // access to the captured element for these queued events.\n // E.g. contextmenu (right-click) in Microsoft Edge\n //\n // Before removing the capturedElem pointer we save it to a\n // temporary variable that the unflushed events can use.\n _elementForUnflushedEvents = document.captureElement;\n document.captureElement = null;\n\n _captureObserver.disconnect();\n\n const proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n proxyElem.style.display = \"none\";\n\n window.removeEventListener('mousemove', _captureProxy);\n window.removeEventListener('mouseup', _captureProxy);\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nexport default class EventTargetMixin {\n constructor() {\n this._listeners = new Map();\n }\n\n addEventListener(type, callback) {\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Set());\n }\n this._listeners.get(type).add(callback);\n }\n\n removeEventListener(type, callback) {\n if (this._listeners.has(type)) {\n this._listeners.get(type).delete(callback);\n }\n }\n\n dispatchEvent(event) {\n if (!this._listeners.has(event.type)) {\n return true;\n }\n this._listeners.get(event.type)\n .forEach(callback => callback.call(this, event));\n return !event.defaultPrevented;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n// From: http://hg.mozilla.org/mozilla-central/raw-file/ec10630b1a54/js/src/devtools/jint/sunspider/string-base64.js\n\nimport * as Log from './util/logging.js';\n\nexport default {\n /* Convert data (an array of integers) to a Base64 string. */\n toBase64Table: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split(''),\n base64Pad: '=',\n\n encode(data) {\n \"use strict\";\n let result = '';\n const length = data.length;\n const lengthpad = (length % 3);\n // Convert every three bytes to 4 ascii characters.\n\n for (let i = 0; i < (length - 2); i += 3) {\n result += this.toBase64Table[data[i] >> 2];\n result += this.toBase64Table[((data[i] & 0x03) << 4) + (data[i + 1] >> 4)];\n result += this.toBase64Table[((data[i + 1] & 0x0f) << 2) + (data[i + 2] >> 6)];\n result += this.toBase64Table[data[i + 2] & 0x3f];\n }\n\n // Convert the remaining 1 or 2 bytes, pad out to 4 characters.\n const j = length - lengthpad;\n if (lengthpad === 2) {\n result += this.toBase64Table[data[j] >> 2];\n result += this.toBase64Table[((data[j] & 0x03) << 4) + (data[j + 1] >> 4)];\n result += this.toBase64Table[(data[j + 1] & 0x0f) << 2];\n result += this.toBase64Table[64];\n } else if (lengthpad === 1) {\n result += this.toBase64Table[data[j] >> 2];\n result += this.toBase64Table[(data[j] & 0x03) << 4];\n result += this.toBase64Table[64];\n result += this.toBase64Table[64];\n }\n\n return result;\n },\n\n /* Convert Base64 data to a string */\n /* eslint-disable comma-spacing */\n toBinaryTable: [\n -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,\n -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,\n -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,\n 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,\n -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,\n 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,\n -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,\n 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1\n ],\n /* eslint-enable comma-spacing */\n\n decode(data, offset = 0) {\n let dataLength = data.indexOf('=') - offset;\n if (dataLength < 0) { dataLength = data.length - offset; }\n\n /* Every four characters is 3 resulting numbers */\n const resultLength = (dataLength >> 2) * 3 + Math.floor((dataLength % 4) / 1.5);\n const result = new Array(resultLength);\n\n // Convert one by one.\n\n let leftbits = 0; // number of bits decoded, but yet to be appended\n let leftdata = 0; // bits decoded, but yet to be appended\n for (let idx = 0, i = offset; i < data.length; i++) {\n const c = this.toBinaryTable[data.charCodeAt(i) & 0x7f];\n const padding = (data.charAt(i) === this.base64Pad);\n // Skip illegal characters and whitespace\n if (c === -1) {\n Log.Error(\"Illegal character code \" + data.charCodeAt(i) + \" at position \" + i);\n continue;\n }\n\n // Collect data into leftdata, update bitcount\n leftdata = (leftdata << 6) | c;\n leftbits += 6;\n\n // If we have 8 or more bits, append 8 bits to the result\n if (leftbits >= 8) {\n leftbits -= 8;\n // Append if not padding.\n if (!padding) {\n result[idx++] = (leftdata >> leftbits) & 0xff;\n }\n leftdata &= (1 << leftbits) - 1;\n }\n }\n\n // If there are any bits left, the base64 string was corrupted\n if (leftbits) {\n const err = new Error('Corrupted base64 string');\n err.name = 'Base64-Error';\n throw err;\n }\n\n return result;\n }\n}; /* End of Base64 namespace */\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nimport * as Log from './util/logging.js';\nimport Base64 from \"./base64.js\";\nimport { toSigned32bit } from './util/int.js';\n\nexport default class Display {\n constructor(target) {\n this._drawCtx = null;\n\n this._renderQ = []; // queue drawing actions for in-oder rendering\n this._flushing = false;\n\n // the full frame buffer (logical canvas) size\n this._fbWidth = 0;\n this._fbHeight = 0;\n\n this._prevDrawStyle = \"\";\n\n Log.Debug(\">> Display.constructor\");\n\n // The visible canvas\n this._target = target;\n\n if (!this._target) {\n throw new Error(\"Target must be set\");\n }\n\n if (typeof this._target === 'string') {\n throw new Error('target must be a DOM element');\n }\n\n if (!this._target.getContext) {\n throw new Error(\"no getContext method\");\n }\n\n this._targetCtx = this._target.getContext('2d');\n\n // the visible canvas viewport (i.e. what actually gets seen)\n this._viewportLoc = { 'x': 0, 'y': 0, 'w': this._target.width, 'h': this._target.height };\n\n // The hidden canvas, where we do the actual rendering\n this._backbuffer = document.createElement('canvas');\n this._drawCtx = this._backbuffer.getContext('2d');\n\n this._damageBounds = { left: 0, top: 0,\n right: this._backbuffer.width,\n bottom: this._backbuffer.height };\n\n Log.Debug(\"User Agent: \" + navigator.userAgent);\n\n Log.Debug(\"<< Display.constructor\");\n\n // ===== PROPERTIES =====\n\n this._scale = 1.0;\n this._clipViewport = false;\n\n // ===== EVENT HANDLERS =====\n\n this.onflush = () => {}; // A flush request has finished\n }\n\n // ===== PROPERTIES =====\n\n get scale() { return this._scale; }\n set scale(scale) {\n this._rescale(scale);\n }\n\n get clipViewport() { return this._clipViewport; }\n set clipViewport(viewport) {\n this._clipViewport = viewport;\n // May need to readjust the viewport dimensions\n const vp = this._viewportLoc;\n this.viewportChangeSize(vp.w, vp.h);\n this.viewportChangePos(0, 0);\n }\n\n get width() {\n return this._fbWidth;\n }\n\n get height() {\n return this._fbHeight;\n }\n\n // ===== PUBLIC METHODS =====\n\n viewportChangePos(deltaX, deltaY) {\n const vp = this._viewportLoc;\n deltaX = Math.floor(deltaX);\n deltaY = Math.floor(deltaY);\n\n if (!this._clipViewport) {\n deltaX = -vp.w; // clamped later of out of bounds\n deltaY = -vp.h;\n }\n\n const vx2 = vp.x + vp.w - 1;\n const vy2 = vp.y + vp.h - 1;\n\n // Position change\n\n if (deltaX < 0 && vp.x + deltaX < 0) {\n deltaX = -vp.x;\n }\n if (vx2 + deltaX >= this._fbWidth) {\n deltaX -= vx2 + deltaX - this._fbWidth + 1;\n }\n\n if (vp.y + deltaY < 0) {\n deltaY = -vp.y;\n }\n if (vy2 + deltaY >= this._fbHeight) {\n deltaY -= (vy2 + deltaY - this._fbHeight + 1);\n }\n\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n Log.Debug(\"viewportChange deltaX: \" + deltaX + \", deltaY: \" + deltaY);\n\n vp.x += deltaX;\n vp.y += deltaY;\n\n this._damage(vp.x, vp.y, vp.w, vp.h);\n\n this.flip();\n }\n\n viewportChangeSize(width, height) {\n\n if (!this._clipViewport ||\n typeof(width) === \"undefined\" ||\n typeof(height) === \"undefined\") {\n\n Log.Debug(\"Setting viewport to full display region\");\n width = this._fbWidth;\n height = this._fbHeight;\n }\n\n width = Math.floor(width);\n height = Math.floor(height);\n\n if (width > this._fbWidth) {\n width = this._fbWidth;\n }\n if (height > this._fbHeight) {\n height = this._fbHeight;\n }\n\n const vp = this._viewportLoc;\n if (vp.w !== width || vp.h !== height) {\n vp.w = width;\n vp.h = height;\n\n const canvas = this._target;\n canvas.width = width;\n canvas.height = height;\n\n // The position might need to be updated if we've grown\n this.viewportChangePos(0, 0);\n\n this._damage(vp.x, vp.y, vp.w, vp.h);\n this.flip();\n\n // Update the visible size of the target canvas\n this._rescale(this._scale);\n }\n }\n\n absX(x) {\n if (this._scale === 0) {\n return 0;\n }\n return toSigned32bit(x / this._scale + this._viewportLoc.x);\n }\n\n absY(y) {\n if (this._scale === 0) {\n return 0;\n }\n return toSigned32bit(y / this._scale + this._viewportLoc.y);\n }\n\n resize(width, height) {\n this._prevDrawStyle = \"\";\n\n this._fbWidth = width;\n this._fbHeight = height;\n\n const canvas = this._backbuffer;\n if (canvas.width !== width || canvas.height !== height) {\n\n // We have to save the canvas data since changing the size will clear it\n let saveImg = null;\n if (canvas.width > 0 && canvas.height > 0) {\n saveImg = this._drawCtx.getImageData(0, 0, canvas.width, canvas.height);\n }\n\n if (canvas.width !== width) {\n canvas.width = width;\n }\n if (canvas.height !== height) {\n canvas.height = height;\n }\n\n if (saveImg) {\n this._drawCtx.putImageData(saveImg, 0, 0);\n }\n }\n\n // Readjust the viewport as it may be incorrectly sized\n // and positioned\n const vp = this._viewportLoc;\n this.viewportChangeSize(vp.w, vp.h);\n this.viewportChangePos(0, 0);\n }\n\n getImageData() {\n return this._drawCtx.getImageData(0, 0, this.width, this.height);\n }\n\n toDataURL(type, encoderOptions) {\n return this._backbuffer.toDataURL(type, encoderOptions);\n }\n\n toBlob(callback, type, quality) {\n return this._backbuffer.toBlob(callback, type, quality);\n }\n\n // Track what parts of the visible canvas that need updating\n _damage(x, y, w, h) {\n if (x < this._damageBounds.left) {\n this._damageBounds.left = x;\n }\n if (y < this._damageBounds.top) {\n this._damageBounds.top = y;\n }\n if ((x + w) > this._damageBounds.right) {\n this._damageBounds.right = x + w;\n }\n if ((y + h) > this._damageBounds.bottom) {\n this._damageBounds.bottom = y + h;\n }\n }\n\n // Update the visible canvas with the contents of the\n // rendering canvas\n flip(fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n this._renderQPush({\n 'type': 'flip'\n });\n } else {\n let x = this._damageBounds.left;\n let y = this._damageBounds.top;\n let w = this._damageBounds.right - x;\n let h = this._damageBounds.bottom - y;\n\n let vx = x - this._viewportLoc.x;\n let vy = y - this._viewportLoc.y;\n\n if (vx < 0) {\n w += vx;\n x -= vx;\n vx = 0;\n }\n if (vy < 0) {\n h += vy;\n y -= vy;\n vy = 0;\n }\n\n if ((vx + w) > this._viewportLoc.w) {\n w = this._viewportLoc.w - vx;\n }\n if ((vy + h) > this._viewportLoc.h) {\n h = this._viewportLoc.h - vy;\n }\n\n if ((w > 0) && (h > 0)) {\n // FIXME: We may need to disable image smoothing here\n // as well (see copyImage()), but we haven't\n // noticed any problem yet.\n this._targetCtx.drawImage(this._backbuffer,\n x, y, w, h,\n vx, vy, w, h);\n }\n\n this._damageBounds.left = this._damageBounds.top = 65535;\n this._damageBounds.right = this._damageBounds.bottom = 0;\n }\n }\n\n pending() {\n return this._renderQ.length > 0;\n }\n\n flush() {\n if (this._renderQ.length === 0) {\n this.onflush();\n } else {\n this._flushing = true;\n }\n }\n\n fillRect(x, y, width, height, color, fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n this._renderQPush({\n 'type': 'fill',\n 'x': x,\n 'y': y,\n 'width': width,\n 'height': height,\n 'color': color\n });\n } else {\n this._setFillColor(color);\n this._drawCtx.fillRect(x, y, width, height);\n this._damage(x, y, width, height);\n }\n }\n\n copyImage(oldX, oldY, newX, newY, w, h, fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n this._renderQPush({\n 'type': 'copy',\n 'oldX': oldX,\n 'oldY': oldY,\n 'x': newX,\n 'y': newY,\n 'width': w,\n 'height': h,\n });\n } else {\n // Due to this bug among others [1] we need to disable the image-smoothing to\n // avoid getting a blur effect when copying data.\n //\n // 1. https://bugzilla.mozilla.org/show_bug.cgi?id=1194719\n //\n // We need to set these every time since all properties are reset\n // when the the size is changed\n this._drawCtx.mozImageSmoothingEnabled = false;\n this._drawCtx.webkitImageSmoothingEnabled = false;\n this._drawCtx.msImageSmoothingEnabled = false;\n this._drawCtx.imageSmoothingEnabled = false;\n\n this._drawCtx.drawImage(this._backbuffer,\n oldX, oldY, w, h,\n newX, newY, w, h);\n this._damage(newX, newY, w, h);\n }\n }\n\n imageRect(x, y, width, height, mime, arr) {\n /* The internal logic cannot handle empty images, so bail early */\n if ((width === 0) || (height === 0)) {\n return;\n }\n\n const img = new Image();\n img.src = \"data: \" + mime + \";base64,\" + Base64.encode(arr);\n\n this._renderQPush({\n 'type': 'img',\n 'img': img,\n 'x': x,\n 'y': y,\n 'width': width,\n 'height': height\n });\n }\n\n blitImage(x, y, width, height, arr, offset, fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n // NB(directxman12): it's technically more performant here to use preallocated arrays,\n // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue,\n // this probably isn't getting called *nearly* as much\n const newArr = new Uint8Array(width * height * 4);\n newArr.set(new Uint8Array(arr.buffer, 0, newArr.length));\n this._renderQPush({\n 'type': 'blit',\n 'data': newArr,\n 'x': x,\n 'y': y,\n 'width': width,\n 'height': height,\n });\n } else {\n // NB(directxman12): arr must be an Type Array view\n let data = new Uint8ClampedArray(arr.buffer,\n arr.byteOffset + offset,\n width * height * 4);\n let img = new ImageData(data, width, height);\n this._drawCtx.putImageData(img, x, y);\n this._damage(x, y, width, height);\n }\n }\n\n drawImage(img, x, y) {\n this._drawCtx.drawImage(img, x, y);\n this._damage(x, y, img.width, img.height);\n }\n\n autoscale(containerWidth, containerHeight) {\n let scaleRatio;\n\n if (containerWidth === 0 || containerHeight === 0) {\n scaleRatio = 0;\n\n } else {\n\n const vp = this._viewportLoc;\n const targetAspectRatio = containerWidth / containerHeight;\n const fbAspectRatio = vp.w / vp.h;\n\n if (fbAspectRatio >= targetAspectRatio) {\n scaleRatio = containerWidth / vp.w;\n } else {\n scaleRatio = containerHeight / vp.h;\n }\n }\n\n this._rescale(scaleRatio);\n }\n\n // ===== PRIVATE METHODS =====\n\n _rescale(factor) {\n this._scale = factor;\n const vp = this._viewportLoc;\n\n // NB(directxman12): If you set the width directly, or set the\n // style width to a number, the canvas is cleared.\n // However, if you set the style width to a string\n // ('NNNpx'), the canvas is scaled without clearing.\n const width = factor * vp.w + 'px';\n const height = factor * vp.h + 'px';\n\n if ((this._target.style.width !== width) ||\n (this._target.style.height !== height)) {\n this._target.style.width = width;\n this._target.style.height = height;\n }\n }\n\n _setFillColor(color) {\n const newStyle = 'rgb(' + color[0] + ',' + color[1] + ',' + color[2] + ')';\n if (newStyle !== this._prevDrawStyle) {\n this._drawCtx.fillStyle = newStyle;\n this._prevDrawStyle = newStyle;\n }\n }\n\n _renderQPush(action) {\n this._renderQ.push(action);\n if (this._renderQ.length === 1) {\n // If this can be rendered immediately it will be, otherwise\n // the scanner will wait for the relevant event\n this._scanRenderQ();\n }\n }\n\n _resumeRenderQ() {\n // \"this\" is the object that is ready, not the\n // display object\n this.removeEventListener('load', this._noVNCDisplay._resumeRenderQ);\n this._noVNCDisplay._scanRenderQ();\n }\n\n _scanRenderQ() {\n let ready = true;\n while (ready && this._renderQ.length > 0) {\n const a = this._renderQ[0];\n switch (a.type) {\n case 'flip':\n this.flip(true);\n break;\n case 'copy':\n this.copyImage(a.oldX, a.oldY, a.x, a.y, a.width, a.height, true);\n break;\n case 'fill':\n this.fillRect(a.x, a.y, a.width, a.height, a.color, true);\n break;\n case 'blit':\n this.blitImage(a.x, a.y, a.width, a.height, a.data, 0, true);\n break;\n case 'img':\n if (a.img.complete) {\n if (a.img.width !== a.width || a.img.height !== a.height) {\n Log.Error(\"Decoded image has incorrect dimensions. Got \" +\n a.img.width + \"x\" + a.img.height + \". Expected \" +\n a.width + \"x\" + a.height + \".\");\n return;\n }\n this.drawImage(a.img, a.x, a.y);\n } else {\n a.img._noVNCDisplay = this;\n a.img.addEventListener('load', this._resumeRenderQ);\n // We need to wait for this image to 'load'\n // to keep things in-order\n ready = false;\n }\n break;\n }\n\n if (ready) {\n this._renderQ.shift();\n }\n }\n\n if (this._renderQ.length === 0 && this._flushing) {\n this._flushing = false;\n this.onflush();\n }\n }\n}\n","// reduce buffer size, avoiding mem copy\nexport function shrinkBuf (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nexport function arraySet (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n}\n\n// Join array of chunks to single array.\nexport function flattenChunks (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n}\n\nexport var Buf8 = Uint8Array;\nexport var Buf16 = Uint16Array;\nexport var Buf32 = Int32Array;\n","// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It doesn't worth to make additional optimizationa as in original.\n// Small size is preferable.\n\nexport default function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n","// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n\n// Use ordinary array, since untyped makes no boost here\nexport default function makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n","// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nexport default function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","import * as utils from \"../utils/common.js\";\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nexport default function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","import * as utils from \"../utils/common.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport inflate_fast from \"./inffast.js\";\nimport inflate_table from \"./inftrees.js\";\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//export const Z_NO_FLUSH = 0;\n//export const Z_PARTIAL_FLUSH = 1;\n//export const Z_SYNC_FLUSH = 2;\n//export const Z_FULL_FLUSH = 3;\nexport const Z_FINISH = 4;\nexport const Z_BLOCK = 5;\nexport const Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nexport const Z_OK = 0;\nexport const Z_STREAM_END = 1;\nexport const Z_NEED_DICT = 2;\n//export const Z_ERRNO = -1;\nexport const Z_STREAM_ERROR = -2;\nexport const Z_DATA_ERROR = -3;\nexport const Z_MEM_ERROR = -4;\nexport const Z_BUF_ERROR = -5;\n//export const Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nexport const Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more conveniend processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' insdead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexport { inflateReset, inflateReset2, inflateResetKeep, inflateInit, inflateInit2, inflate, inflateEnd, inflateGetHeader, inflateSetDictionary };\nexport var inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","export default function ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nimport { inflateInit, inflate, inflateReset } from \"../vendor/pako/lib/zlib/inflate.js\";\nimport ZStream from \"../vendor/pako/lib/zlib/zstream.js\";\n\nexport default class Inflate {\n constructor() {\n this.strm = new ZStream();\n this.chunkSize = 1024 * 10 * 10;\n this.strm.output = new Uint8Array(this.chunkSize);\n this.windowBits = 5;\n\n inflateInit(this.strm, this.windowBits);\n }\n\n setInput(data) {\n if (!data) {\n //FIXME: flush remaining data.\n /* eslint-disable camelcase */\n this.strm.input = null;\n this.strm.avail_in = 0;\n this.strm.next_in = 0;\n } else {\n this.strm.input = data;\n this.strm.avail_in = this.strm.input.length;\n this.strm.next_in = 0;\n /* eslint-enable camelcase */\n }\n }\n\n inflate(expected) {\n // resize our output buffer if it's too small\n // (we could just use multiple chunks, but that would cause an extra\n // allocation each time to flatten the chunks)\n if (expected > this.chunkSize) {\n this.chunkSize = expected;\n this.strm.output = new Uint8Array(this.chunkSize);\n }\n\n /* eslint-disable camelcase */\n this.strm.next_out = 0;\n this.strm.avail_out = expected;\n /* eslint-enable camelcase */\n\n let ret = inflate(this.strm, 0); // Flush argument not used.\n if (ret < 0) {\n throw new Error(\"zlib inflate failed\");\n }\n\n if (this.strm.next_out != expected) {\n throw new Error(\"Incomplete zlib block\");\n }\n\n return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);\n }\n\n reset() {\n inflateReset(this.strm);\n }\n}\n","import * as utils from \"../utils/common.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [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];\n\nvar extra_dbits = /* extra bits for each distance code */\n [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];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexport { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align };\n","export default {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","import * as utils from \"../utils/common.js\";\nimport * as trees from \"./trees.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport msg from \"./messages.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nexport const Z_NO_FLUSH = 0;\nexport const Z_PARTIAL_FLUSH = 1;\n//export const Z_SYNC_FLUSH = 2;\nexport const Z_FULL_FLUSH = 3;\nexport const Z_FINISH = 4;\nexport const Z_BLOCK = 5;\n//export const Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nexport const Z_OK = 0;\nexport const Z_STREAM_END = 1;\n//export const Z_NEED_DICT = 2;\n//export const Z_ERRNO = -1;\nexport const Z_STREAM_ERROR = -2;\nexport const Z_DATA_ERROR = -3;\n//export const Z_MEM_ERROR = -4;\nexport const Z_BUF_ERROR = -5;\n//export const Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//export const Z_NO_COMPRESSION = 0;\n//export const Z_BEST_SPEED = 1;\n//export const Z_BEST_COMPRESSION = 9;\nexport const Z_DEFAULT_COMPRESSION = -1;\n\n\nexport const Z_FILTERED = 1;\nexport const Z_HUFFMAN_ONLY = 2;\nexport const Z_RLE = 3;\nexport const Z_FIXED = 4;\nexport const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//export const Z_BINARY = 0;\n//export const Z_TEXT = 1;\n//export const Z_ASCII = 1; // = Z_TEXT\nexport const Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nexport const Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n // Do nothing\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n // Do nothing\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexport { deflateInit, deflateInit2, deflateReset, deflateResetKeep, deflateSetHeader, deflate, deflateEnd, deflateSetDictionary };\nexport var deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nimport { deflateInit, deflate } from \"../vendor/pako/lib/zlib/deflate.js\";\nimport { Z_FULL_FLUSH } from \"../vendor/pako/lib/zlib/deflate.js\";\nimport ZStream from \"../vendor/pako/lib/zlib/zstream.js\";\n\nexport default class Deflator {\n constructor() {\n this.strm = new ZStream();\n this.chunkSize = 1024 * 10 * 10;\n this.outputBuffer = new Uint8Array(this.chunkSize);\n this.windowBits = 5;\n\n deflateInit(this.strm, this.windowBits);\n }\n\n deflate(inData) {\n /* eslint-disable camelcase */\n this.strm.input = inData;\n this.strm.avail_in = this.strm.input.length;\n this.strm.next_in = 0;\n this.strm.output = this.outputBuffer;\n this.strm.avail_out = this.chunkSize;\n this.strm.next_out = 0;\n /* eslint-enable camelcase */\n\n let lastRet = deflate(this.strm, Z_FULL_FLUSH);\n let outData = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);\n\n if (lastRet < 0) {\n throw new Error(\"zlib deflate failed\");\n }\n\n if (this.strm.avail_in > 0) {\n // Read chunks until done\n\n let chunks = [outData];\n let totalLen = outData.length;\n do {\n /* eslint-disable camelcase */\n this.strm.output = new Uint8Array(this.chunkSize);\n this.strm.next_out = 0;\n this.strm.avail_out = this.chunkSize;\n /* eslint-enable camelcase */\n\n lastRet = deflate(this.strm, Z_FULL_FLUSH);\n\n if (lastRet < 0) {\n throw new Error(\"zlib deflate failed\");\n }\n\n let chunk = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);\n totalLen += chunk.length;\n chunks.push(chunk);\n } while (this.strm.avail_in > 0);\n\n // Combine chunks into a single data\n\n let newData = new Uint8Array(totalLen);\n let offset = 0;\n\n for (let i = 0; i < chunks.length; i++) {\n newData.set(chunks[i], offset);\n offset += chunks[i].length;\n }\n\n outData = newData;\n }\n\n /* eslint-disable camelcase */\n this.strm.input = null;\n this.strm.avail_in = 0;\n this.strm.next_in = 0;\n /* eslint-enable camelcase */\n\n return outData;\n }\n\n}\n","/*\n * Mapping from Unicode codepoints to X11/RFB keysyms\n *\n * This file was automatically generated from keysymdef.h\n * DO NOT EDIT!\n */\n\n/* Functions at the bottom */\n\nconst codepoints = {\n 0x0100: 0x03c0, // XK_Amacron\n 0x0101: 0x03e0, // XK_amacron\n 0x0102: 0x01c3, // XK_Abreve\n 0x0103: 0x01e3, // XK_abreve\n 0x0104: 0x01a1, // XK_Aogonek\n 0x0105: 0x01b1, // XK_aogonek\n 0x0106: 0x01c6, // XK_Cacute\n 0x0107: 0x01e6, // XK_cacute\n 0x0108: 0x02c6, // XK_Ccircumflex\n 0x0109: 0x02e6, // XK_ccircumflex\n 0x010a: 0x02c5, // XK_Cabovedot\n 0x010b: 0x02e5, // XK_cabovedot\n 0x010c: 0x01c8, // XK_Ccaron\n 0x010d: 0x01e8, // XK_ccaron\n 0x010e: 0x01cf, // XK_Dcaron\n 0x010f: 0x01ef, // XK_dcaron\n 0x0110: 0x01d0, // XK_Dstroke\n 0x0111: 0x01f0, // XK_dstroke\n 0x0112: 0x03aa, // XK_Emacron\n 0x0113: 0x03ba, // XK_emacron\n 0x0116: 0x03cc, // XK_Eabovedot\n 0x0117: 0x03ec, // XK_eabovedot\n 0x0118: 0x01ca, // XK_Eogonek\n 0x0119: 0x01ea, // XK_eogonek\n 0x011a: 0x01cc, // XK_Ecaron\n 0x011b: 0x01ec, // XK_ecaron\n 0x011c: 0x02d8, // XK_Gcircumflex\n 0x011d: 0x02f8, // XK_gcircumflex\n 0x011e: 0x02ab, // XK_Gbreve\n 0x011f: 0x02bb, // XK_gbreve\n 0x0120: 0x02d5, // XK_Gabovedot\n 0x0121: 0x02f5, // XK_gabovedot\n 0x0122: 0x03ab, // XK_Gcedilla\n 0x0123: 0x03bb, // XK_gcedilla\n 0x0124: 0x02a6, // XK_Hcircumflex\n 0x0125: 0x02b6, // XK_hcircumflex\n 0x0126: 0x02a1, // XK_Hstroke\n 0x0127: 0x02b1, // XK_hstroke\n 0x0128: 0x03a5, // XK_Itilde\n 0x0129: 0x03b5, // XK_itilde\n 0x012a: 0x03cf, // XK_Imacron\n 0x012b: 0x03ef, // XK_imacron\n 0x012e: 0x03c7, // XK_Iogonek\n 0x012f: 0x03e7, // XK_iogonek\n 0x0130: 0x02a9, // XK_Iabovedot\n 0x0131: 0x02b9, // XK_idotless\n 0x0134: 0x02ac, // XK_Jcircumflex\n 0x0135: 0x02bc, // XK_jcircumflex\n 0x0136: 0x03d3, // XK_Kcedilla\n 0x0137: 0x03f3, // XK_kcedilla\n 0x0138: 0x03a2, // XK_kra\n 0x0139: 0x01c5, // XK_Lacute\n 0x013a: 0x01e5, // XK_lacute\n 0x013b: 0x03a6, // XK_Lcedilla\n 0x013c: 0x03b6, // XK_lcedilla\n 0x013d: 0x01a5, // XK_Lcaron\n 0x013e: 0x01b5, // XK_lcaron\n 0x0141: 0x01a3, // XK_Lstroke\n 0x0142: 0x01b3, // XK_lstroke\n 0x0143: 0x01d1, // XK_Nacute\n 0x0144: 0x01f1, // XK_nacute\n 0x0145: 0x03d1, // XK_Ncedilla\n 0x0146: 0x03f1, // XK_ncedilla\n 0x0147: 0x01d2, // XK_Ncaron\n 0x0148: 0x01f2, // XK_ncaron\n 0x014a: 0x03bd, // XK_ENG\n 0x014b: 0x03bf, // XK_eng\n 0x014c: 0x03d2, // XK_Omacron\n 0x014d: 0x03f2, // XK_omacron\n 0x0150: 0x01d5, // XK_Odoubleacute\n 0x0151: 0x01f5, // XK_odoubleacute\n 0x0152: 0x13bc, // XK_OE\n 0x0153: 0x13bd, // XK_oe\n 0x0154: 0x01c0, // XK_Racute\n 0x0155: 0x01e0, // XK_racute\n 0x0156: 0x03a3, // XK_Rcedilla\n 0x0157: 0x03b3, // XK_rcedilla\n 0x0158: 0x01d8, // XK_Rcaron\n 0x0159: 0x01f8, // XK_rcaron\n 0x015a: 0x01a6, // XK_Sacute\n 0x015b: 0x01b6, // XK_sacute\n 0x015c: 0x02de, // XK_Scircumflex\n 0x015d: 0x02fe, // XK_scircumflex\n 0x015e: 0x01aa, // XK_Scedilla\n 0x015f: 0x01ba, // XK_scedilla\n 0x0160: 0x01a9, // XK_Scaron\n 0x0161: 0x01b9, // XK_scaron\n 0x0162: 0x01de, // XK_Tcedilla\n 0x0163: 0x01fe, // XK_tcedilla\n 0x0164: 0x01ab, // XK_Tcaron\n 0x0165: 0x01bb, // XK_tcaron\n 0x0166: 0x03ac, // XK_Tslash\n 0x0167: 0x03bc, // XK_tslash\n 0x0168: 0x03dd, // XK_Utilde\n 0x0169: 0x03fd, // XK_utilde\n 0x016a: 0x03de, // XK_Umacron\n 0x016b: 0x03fe, // XK_umacron\n 0x016c: 0x02dd, // XK_Ubreve\n 0x016d: 0x02fd, // XK_ubreve\n 0x016e: 0x01d9, // XK_Uring\n 0x016f: 0x01f9, // XK_uring\n 0x0170: 0x01db, // XK_Udoubleacute\n 0x0171: 0x01fb, // XK_udoubleacute\n 0x0172: 0x03d9, // XK_Uogonek\n 0x0173: 0x03f9, // XK_uogonek\n 0x0178: 0x13be, // XK_Ydiaeresis\n 0x0179: 0x01ac, // XK_Zacute\n 0x017a: 0x01bc, // XK_zacute\n 0x017b: 0x01af, // XK_Zabovedot\n 0x017c: 0x01bf, // XK_zabovedot\n 0x017d: 0x01ae, // XK_Zcaron\n 0x017e: 0x01be, // XK_zcaron\n 0x0192: 0x08f6, // XK_function\n 0x01d2: 0x10001d1, // XK_Ocaron\n 0x02c7: 0x01b7, // XK_caron\n 0x02d8: 0x01a2, // XK_breve\n 0x02d9: 0x01ff, // XK_abovedot\n 0x02db: 0x01b2, // XK_ogonek\n 0x02dd: 0x01bd, // XK_doubleacute\n 0x0385: 0x07ae, // XK_Greek_accentdieresis\n 0x0386: 0x07a1, // XK_Greek_ALPHAaccent\n 0x0388: 0x07a2, // XK_Greek_EPSILONaccent\n 0x0389: 0x07a3, // XK_Greek_ETAaccent\n 0x038a: 0x07a4, // XK_Greek_IOTAaccent\n 0x038c: 0x07a7, // XK_Greek_OMICRONaccent\n 0x038e: 0x07a8, // XK_Greek_UPSILONaccent\n 0x038f: 0x07ab, // XK_Greek_OMEGAaccent\n 0x0390: 0x07b6, // XK_Greek_iotaaccentdieresis\n 0x0391: 0x07c1, // XK_Greek_ALPHA\n 0x0392: 0x07c2, // XK_Greek_BETA\n 0x0393: 0x07c3, // XK_Greek_GAMMA\n 0x0394: 0x07c4, // XK_Greek_DELTA\n 0x0395: 0x07c5, // XK_Greek_EPSILON\n 0x0396: 0x07c6, // XK_Greek_ZETA\n 0x0397: 0x07c7, // XK_Greek_ETA\n 0x0398: 0x07c8, // XK_Greek_THETA\n 0x0399: 0x07c9, // XK_Greek_IOTA\n 0x039a: 0x07ca, // XK_Greek_KAPPA\n 0x039b: 0x07cb, // XK_Greek_LAMDA\n 0x039c: 0x07cc, // XK_Greek_MU\n 0x039d: 0x07cd, // XK_Greek_NU\n 0x039e: 0x07ce, // XK_Greek_XI\n 0x039f: 0x07cf, // XK_Greek_OMICRON\n 0x03a0: 0x07d0, // XK_Greek_PI\n 0x03a1: 0x07d1, // XK_Greek_RHO\n 0x03a3: 0x07d2, // XK_Greek_SIGMA\n 0x03a4: 0x07d4, // XK_Greek_TAU\n 0x03a5: 0x07d5, // XK_Greek_UPSILON\n 0x03a6: 0x07d6, // XK_Greek_PHI\n 0x03a7: 0x07d7, // XK_Greek_CHI\n 0x03a8: 0x07d8, // XK_Greek_PSI\n 0x03a9: 0x07d9, // XK_Greek_OMEGA\n 0x03aa: 0x07a5, // XK_Greek_IOTAdieresis\n 0x03ab: 0x07a9, // XK_Greek_UPSILONdieresis\n 0x03ac: 0x07b1, // XK_Greek_alphaaccent\n 0x03ad: 0x07b2, // XK_Greek_epsilonaccent\n 0x03ae: 0x07b3, // XK_Greek_etaaccent\n 0x03af: 0x07b4, // XK_Greek_iotaaccent\n 0x03b0: 0x07ba, // XK_Greek_upsilonaccentdieresis\n 0x03b1: 0x07e1, // XK_Greek_alpha\n 0x03b2: 0x07e2, // XK_Greek_beta\n 0x03b3: 0x07e3, // XK_Greek_gamma\n 0x03b4: 0x07e4, // XK_Greek_delta\n 0x03b5: 0x07e5, // XK_Greek_epsilon\n 0x03b6: 0x07e6, // XK_Greek_zeta\n 0x03b7: 0x07e7, // XK_Greek_eta\n 0x03b8: 0x07e8, // XK_Greek_theta\n 0x03b9: 0x07e9, // XK_Greek_iota\n 0x03ba: 0x07ea, // XK_Greek_kappa\n 0x03bb: 0x07eb, // XK_Greek_lamda\n 0x03bc: 0x07ec, // XK_Greek_mu\n 0x03bd: 0x07ed, // XK_Greek_nu\n 0x03be: 0x07ee, // XK_Greek_xi\n 0x03bf: 0x07ef, // XK_Greek_omicron\n 0x03c0: 0x07f0, // XK_Greek_pi\n 0x03c1: 0x07f1, // XK_Greek_rho\n 0x03c2: 0x07f3, // XK_Greek_finalsmallsigma\n 0x03c3: 0x07f2, // XK_Greek_sigma\n 0x03c4: 0x07f4, // XK_Greek_tau\n 0x03c5: 0x07f5, // XK_Greek_upsilon\n 0x03c6: 0x07f6, // XK_Greek_phi\n 0x03c7: 0x07f7, // XK_Greek_chi\n 0x03c8: 0x07f8, // XK_Greek_psi\n 0x03c9: 0x07f9, // XK_Greek_omega\n 0x03ca: 0x07b5, // XK_Greek_iotadieresis\n 0x03cb: 0x07b9, // XK_Greek_upsilondieresis\n 0x03cc: 0x07b7, // XK_Greek_omicronaccent\n 0x03cd: 0x07b8, // XK_Greek_upsilonaccent\n 0x03ce: 0x07bb, // XK_Greek_omegaaccent\n 0x0401: 0x06b3, // XK_Cyrillic_IO\n 0x0402: 0x06b1, // XK_Serbian_DJE\n 0x0403: 0x06b2, // XK_Macedonia_GJE\n 0x0404: 0x06b4, // XK_Ukrainian_IE\n 0x0405: 0x06b5, // XK_Macedonia_DSE\n 0x0406: 0x06b6, // XK_Ukrainian_I\n 0x0407: 0x06b7, // XK_Ukrainian_YI\n 0x0408: 0x06b8, // XK_Cyrillic_JE\n 0x0409: 0x06b9, // XK_Cyrillic_LJE\n 0x040a: 0x06ba, // XK_Cyrillic_NJE\n 0x040b: 0x06bb, // XK_Serbian_TSHE\n 0x040c: 0x06bc, // XK_Macedonia_KJE\n 0x040e: 0x06be, // XK_Byelorussian_SHORTU\n 0x040f: 0x06bf, // XK_Cyrillic_DZHE\n 0x0410: 0x06e1, // XK_Cyrillic_A\n 0x0411: 0x06e2, // XK_Cyrillic_BE\n 0x0412: 0x06f7, // XK_Cyrillic_VE\n 0x0413: 0x06e7, // XK_Cyrillic_GHE\n 0x0414: 0x06e4, // XK_Cyrillic_DE\n 0x0415: 0x06e5, // XK_Cyrillic_IE\n 0x0416: 0x06f6, // XK_Cyrillic_ZHE\n 0x0417: 0x06fa, // XK_Cyrillic_ZE\n 0x0418: 0x06e9, // XK_Cyrillic_I\n 0x0419: 0x06ea, // XK_Cyrillic_SHORTI\n 0x041a: 0x06eb, // XK_Cyrillic_KA\n 0x041b: 0x06ec, // XK_Cyrillic_EL\n 0x041c: 0x06ed, // XK_Cyrillic_EM\n 0x041d: 0x06ee, // XK_Cyrillic_EN\n 0x041e: 0x06ef, // XK_Cyrillic_O\n 0x041f: 0x06f0, // XK_Cyrillic_PE\n 0x0420: 0x06f2, // XK_Cyrillic_ER\n 0x0421: 0x06f3, // XK_Cyrillic_ES\n 0x0422: 0x06f4, // XK_Cyrillic_TE\n 0x0423: 0x06f5, // XK_Cyrillic_U\n 0x0424: 0x06e6, // XK_Cyrillic_EF\n 0x0425: 0x06e8, // XK_Cyrillic_HA\n 0x0426: 0x06e3, // XK_Cyrillic_TSE\n 0x0427: 0x06fe, // XK_Cyrillic_CHE\n 0x0428: 0x06fb, // XK_Cyrillic_SHA\n 0x0429: 0x06fd, // XK_Cyrillic_SHCHA\n 0x042a: 0x06ff, // XK_Cyrillic_HARDSIGN\n 0x042b: 0x06f9, // XK_Cyrillic_YERU\n 0x042c: 0x06f8, // XK_Cyrillic_SOFTSIGN\n 0x042d: 0x06fc, // XK_Cyrillic_E\n 0x042e: 0x06e0, // XK_Cyrillic_YU\n 0x042f: 0x06f1, // XK_Cyrillic_YA\n 0x0430: 0x06c1, // XK_Cyrillic_a\n 0x0431: 0x06c2, // XK_Cyrillic_be\n 0x0432: 0x06d7, // XK_Cyrillic_ve\n 0x0433: 0x06c7, // XK_Cyrillic_ghe\n 0x0434: 0x06c4, // XK_Cyrillic_de\n 0x0435: 0x06c5, // XK_Cyrillic_ie\n 0x0436: 0x06d6, // XK_Cyrillic_zhe\n 0x0437: 0x06da, // XK_Cyrillic_ze\n 0x0438: 0x06c9, // XK_Cyrillic_i\n 0x0439: 0x06ca, // XK_Cyrillic_shorti\n 0x043a: 0x06cb, // XK_Cyrillic_ka\n 0x043b: 0x06cc, // XK_Cyrillic_el\n 0x043c: 0x06cd, // XK_Cyrillic_em\n 0x043d: 0x06ce, // XK_Cyrillic_en\n 0x043e: 0x06cf, // XK_Cyrillic_o\n 0x043f: 0x06d0, // XK_Cyrillic_pe\n 0x0440: 0x06d2, // XK_Cyrillic_er\n 0x0441: 0x06d3, // XK_Cyrillic_es\n 0x0442: 0x06d4, // XK_Cyrillic_te\n 0x0443: 0x06d5, // XK_Cyrillic_u\n 0x0444: 0x06c6, // XK_Cyrillic_ef\n 0x0445: 0x06c8, // XK_Cyrillic_ha\n 0x0446: 0x06c3, // XK_Cyrillic_tse\n 0x0447: 0x06de, // XK_Cyrillic_che\n 0x0448: 0x06db, // XK_Cyrillic_sha\n 0x0449: 0x06dd, // XK_Cyrillic_shcha\n 0x044a: 0x06df, // XK_Cyrillic_hardsign\n 0x044b: 0x06d9, // XK_Cyrillic_yeru\n 0x044c: 0x06d8, // XK_Cyrillic_softsign\n 0x044d: 0x06dc, // XK_Cyrillic_e\n 0x044e: 0x06c0, // XK_Cyrillic_yu\n 0x044f: 0x06d1, // XK_Cyrillic_ya\n 0x0451: 0x06a3, // XK_Cyrillic_io\n 0x0452: 0x06a1, // XK_Serbian_dje\n 0x0453: 0x06a2, // XK_Macedonia_gje\n 0x0454: 0x06a4, // XK_Ukrainian_ie\n 0x0455: 0x06a5, // XK_Macedonia_dse\n 0x0456: 0x06a6, // XK_Ukrainian_i\n 0x0457: 0x06a7, // XK_Ukrainian_yi\n 0x0458: 0x06a8, // XK_Cyrillic_je\n 0x0459: 0x06a9, // XK_Cyrillic_lje\n 0x045a: 0x06aa, // XK_Cyrillic_nje\n 0x045b: 0x06ab, // XK_Serbian_tshe\n 0x045c: 0x06ac, // XK_Macedonia_kje\n 0x045e: 0x06ae, // XK_Byelorussian_shortu\n 0x045f: 0x06af, // XK_Cyrillic_dzhe\n 0x0490: 0x06bd, // XK_Ukrainian_GHE_WITH_UPTURN\n 0x0491: 0x06ad, // XK_Ukrainian_ghe_with_upturn\n 0x05d0: 0x0ce0, // XK_hebrew_aleph\n 0x05d1: 0x0ce1, // XK_hebrew_bet\n 0x05d2: 0x0ce2, // XK_hebrew_gimel\n 0x05d3: 0x0ce3, // XK_hebrew_dalet\n 0x05d4: 0x0ce4, // XK_hebrew_he\n 0x05d5: 0x0ce5, // XK_hebrew_waw\n 0x05d6: 0x0ce6, // XK_hebrew_zain\n 0x05d7: 0x0ce7, // XK_hebrew_chet\n 0x05d8: 0x0ce8, // XK_hebrew_tet\n 0x05d9: 0x0ce9, // XK_hebrew_yod\n 0x05da: 0x0cea, // XK_hebrew_finalkaph\n 0x05db: 0x0ceb, // XK_hebrew_kaph\n 0x05dc: 0x0cec, // XK_hebrew_lamed\n 0x05dd: 0x0ced, // XK_hebrew_finalmem\n 0x05de: 0x0cee, // XK_hebrew_mem\n 0x05df: 0x0cef, // XK_hebrew_finalnun\n 0x05e0: 0x0cf0, // XK_hebrew_nun\n 0x05e1: 0x0cf1, // XK_hebrew_samech\n 0x05e2: 0x0cf2, // XK_hebrew_ayin\n 0x05e3: 0x0cf3, // XK_hebrew_finalpe\n 0x05e4: 0x0cf4, // XK_hebrew_pe\n 0x05e5: 0x0cf5, // XK_hebrew_finalzade\n 0x05e6: 0x0cf6, // XK_hebrew_zade\n 0x05e7: 0x0cf7, // XK_hebrew_qoph\n 0x05e8: 0x0cf8, // XK_hebrew_resh\n 0x05e9: 0x0cf9, // XK_hebrew_shin\n 0x05ea: 0x0cfa, // XK_hebrew_taw\n 0x060c: 0x05ac, // XK_Arabic_comma\n 0x061b: 0x05bb, // XK_Arabic_semicolon\n 0x061f: 0x05bf, // XK_Arabic_question_mark\n 0x0621: 0x05c1, // XK_Arabic_hamza\n 0x0622: 0x05c2, // XK_Arabic_maddaonalef\n 0x0623: 0x05c3, // XK_Arabic_hamzaonalef\n 0x0624: 0x05c4, // XK_Arabic_hamzaonwaw\n 0x0625: 0x05c5, // XK_Arabic_hamzaunderalef\n 0x0626: 0x05c6, // XK_Arabic_hamzaonyeh\n 0x0627: 0x05c7, // XK_Arabic_alef\n 0x0628: 0x05c8, // XK_Arabic_beh\n 0x0629: 0x05c9, // XK_Arabic_tehmarbuta\n 0x062a: 0x05ca, // XK_Arabic_teh\n 0x062b: 0x05cb, // XK_Arabic_theh\n 0x062c: 0x05cc, // XK_Arabic_jeem\n 0x062d: 0x05cd, // XK_Arabic_hah\n 0x062e: 0x05ce, // XK_Arabic_khah\n 0x062f: 0x05cf, // XK_Arabic_dal\n 0x0630: 0x05d0, // XK_Arabic_thal\n 0x0631: 0x05d1, // XK_Arabic_ra\n 0x0632: 0x05d2, // XK_Arabic_zain\n 0x0633: 0x05d3, // XK_Arabic_seen\n 0x0634: 0x05d4, // XK_Arabic_sheen\n 0x0635: 0x05d5, // XK_Arabic_sad\n 0x0636: 0x05d6, // XK_Arabic_dad\n 0x0637: 0x05d7, // XK_Arabic_tah\n 0x0638: 0x05d8, // XK_Arabic_zah\n 0x0639: 0x05d9, // XK_Arabic_ain\n 0x063a: 0x05da, // XK_Arabic_ghain\n 0x0640: 0x05e0, // XK_Arabic_tatweel\n 0x0641: 0x05e1, // XK_Arabic_feh\n 0x0642: 0x05e2, // XK_Arabic_qaf\n 0x0643: 0x05e3, // XK_Arabic_kaf\n 0x0644: 0x05e4, // XK_Arabic_lam\n 0x0645: 0x05e5, // XK_Arabic_meem\n 0x0646: 0x05e6, // XK_Arabic_noon\n 0x0647: 0x05e7, // XK_Arabic_ha\n 0x0648: 0x05e8, // XK_Arabic_waw\n 0x0649: 0x05e9, // XK_Arabic_alefmaksura\n 0x064a: 0x05ea, // XK_Arabic_yeh\n 0x064b: 0x05eb, // XK_Arabic_fathatan\n 0x064c: 0x05ec, // XK_Arabic_dammatan\n 0x064d: 0x05ed, // XK_Arabic_kasratan\n 0x064e: 0x05ee, // XK_Arabic_fatha\n 0x064f: 0x05ef, // XK_Arabic_damma\n 0x0650: 0x05f0, // XK_Arabic_kasra\n 0x0651: 0x05f1, // XK_Arabic_shadda\n 0x0652: 0x05f2, // XK_Arabic_sukun\n 0x0e01: 0x0da1, // XK_Thai_kokai\n 0x0e02: 0x0da2, // XK_Thai_khokhai\n 0x0e03: 0x0da3, // XK_Thai_khokhuat\n 0x0e04: 0x0da4, // XK_Thai_khokhwai\n 0x0e05: 0x0da5, // XK_Thai_khokhon\n 0x0e06: 0x0da6, // XK_Thai_khorakhang\n 0x0e07: 0x0da7, // XK_Thai_ngongu\n 0x0e08: 0x0da8, // XK_Thai_chochan\n 0x0e09: 0x0da9, // XK_Thai_choching\n 0x0e0a: 0x0daa, // XK_Thai_chochang\n 0x0e0b: 0x0dab, // XK_Thai_soso\n 0x0e0c: 0x0dac, // XK_Thai_chochoe\n 0x0e0d: 0x0dad, // XK_Thai_yoying\n 0x0e0e: 0x0dae, // XK_Thai_dochada\n 0x0e0f: 0x0daf, // XK_Thai_topatak\n 0x0e10: 0x0db0, // XK_Thai_thothan\n 0x0e11: 0x0db1, // XK_Thai_thonangmontho\n 0x0e12: 0x0db2, // XK_Thai_thophuthao\n 0x0e13: 0x0db3, // XK_Thai_nonen\n 0x0e14: 0x0db4, // XK_Thai_dodek\n 0x0e15: 0x0db5, // XK_Thai_totao\n 0x0e16: 0x0db6, // XK_Thai_thothung\n 0x0e17: 0x0db7, // XK_Thai_thothahan\n 0x0e18: 0x0db8, // XK_Thai_thothong\n 0x0e19: 0x0db9, // XK_Thai_nonu\n 0x0e1a: 0x0dba, // XK_Thai_bobaimai\n 0x0e1b: 0x0dbb, // XK_Thai_popla\n 0x0e1c: 0x0dbc, // XK_Thai_phophung\n 0x0e1d: 0x0dbd, // XK_Thai_fofa\n 0x0e1e: 0x0dbe, // XK_Thai_phophan\n 0x0e1f: 0x0dbf, // XK_Thai_fofan\n 0x0e20: 0x0dc0, // XK_Thai_phosamphao\n 0x0e21: 0x0dc1, // XK_Thai_moma\n 0x0e22: 0x0dc2, // XK_Thai_yoyak\n 0x0e23: 0x0dc3, // XK_Thai_rorua\n 0x0e24: 0x0dc4, // XK_Thai_ru\n 0x0e25: 0x0dc5, // XK_Thai_loling\n 0x0e26: 0x0dc6, // XK_Thai_lu\n 0x0e27: 0x0dc7, // XK_Thai_wowaen\n 0x0e28: 0x0dc8, // XK_Thai_sosala\n 0x0e29: 0x0dc9, // XK_Thai_sorusi\n 0x0e2a: 0x0dca, // XK_Thai_sosua\n 0x0e2b: 0x0dcb, // XK_Thai_hohip\n 0x0e2c: 0x0dcc, // XK_Thai_lochula\n 0x0e2d: 0x0dcd, // XK_Thai_oang\n 0x0e2e: 0x0dce, // XK_Thai_honokhuk\n 0x0e2f: 0x0dcf, // XK_Thai_paiyannoi\n 0x0e30: 0x0dd0, // XK_Thai_saraa\n 0x0e31: 0x0dd1, // XK_Thai_maihanakat\n 0x0e32: 0x0dd2, // XK_Thai_saraaa\n 0x0e33: 0x0dd3, // XK_Thai_saraam\n 0x0e34: 0x0dd4, // XK_Thai_sarai\n 0x0e35: 0x0dd5, // XK_Thai_saraii\n 0x0e36: 0x0dd6, // XK_Thai_saraue\n 0x0e37: 0x0dd7, // XK_Thai_sarauee\n 0x0e38: 0x0dd8, // XK_Thai_sarau\n 0x0e39: 0x0dd9, // XK_Thai_sarauu\n 0x0e3a: 0x0dda, // XK_Thai_phinthu\n 0x0e3f: 0x0ddf, // XK_Thai_baht\n 0x0e40: 0x0de0, // XK_Thai_sarae\n 0x0e41: 0x0de1, // XK_Thai_saraae\n 0x0e42: 0x0de2, // XK_Thai_sarao\n 0x0e43: 0x0de3, // XK_Thai_saraaimaimuan\n 0x0e44: 0x0de4, // XK_Thai_saraaimaimalai\n 0x0e45: 0x0de5, // XK_Thai_lakkhangyao\n 0x0e46: 0x0de6, // XK_Thai_maiyamok\n 0x0e47: 0x0de7, // XK_Thai_maitaikhu\n 0x0e48: 0x0de8, // XK_Thai_maiek\n 0x0e49: 0x0de9, // XK_Thai_maitho\n 0x0e4a: 0x0dea, // XK_Thai_maitri\n 0x0e4b: 0x0deb, // XK_Thai_maichattawa\n 0x0e4c: 0x0dec, // XK_Thai_thanthakhat\n 0x0e4d: 0x0ded, // XK_Thai_nikhahit\n 0x0e50: 0x0df0, // XK_Thai_leksun\n 0x0e51: 0x0df1, // XK_Thai_leknung\n 0x0e52: 0x0df2, // XK_Thai_leksong\n 0x0e53: 0x0df3, // XK_Thai_leksam\n 0x0e54: 0x0df4, // XK_Thai_leksi\n 0x0e55: 0x0df5, // XK_Thai_lekha\n 0x0e56: 0x0df6, // XK_Thai_lekhok\n 0x0e57: 0x0df7, // XK_Thai_lekchet\n 0x0e58: 0x0df8, // XK_Thai_lekpaet\n 0x0e59: 0x0df9, // XK_Thai_lekkao\n 0x2002: 0x0aa2, // XK_enspace\n 0x2003: 0x0aa1, // XK_emspace\n 0x2004: 0x0aa3, // XK_em3space\n 0x2005: 0x0aa4, // XK_em4space\n 0x2007: 0x0aa5, // XK_digitspace\n 0x2008: 0x0aa6, // XK_punctspace\n 0x2009: 0x0aa7, // XK_thinspace\n 0x200a: 0x0aa8, // XK_hairspace\n 0x2012: 0x0abb, // XK_figdash\n 0x2013: 0x0aaa, // XK_endash\n 0x2014: 0x0aa9, // XK_emdash\n 0x2015: 0x07af, // XK_Greek_horizbar\n 0x2017: 0x0cdf, // XK_hebrew_doublelowline\n 0x2018: 0x0ad0, // XK_leftsinglequotemark\n 0x2019: 0x0ad1, // XK_rightsinglequotemark\n 0x201a: 0x0afd, // XK_singlelowquotemark\n 0x201c: 0x0ad2, // XK_leftdoublequotemark\n 0x201d: 0x0ad3, // XK_rightdoublequotemark\n 0x201e: 0x0afe, // XK_doublelowquotemark\n 0x2020: 0x0af1, // XK_dagger\n 0x2021: 0x0af2, // XK_doubledagger\n 0x2022: 0x0ae6, // XK_enfilledcircbullet\n 0x2025: 0x0aaf, // XK_doubbaselinedot\n 0x2026: 0x0aae, // XK_ellipsis\n 0x2030: 0x0ad5, // XK_permille\n 0x2032: 0x0ad6, // XK_minutes\n 0x2033: 0x0ad7, // XK_seconds\n 0x2038: 0x0afc, // XK_caret\n 0x203e: 0x047e, // XK_overline\n 0x20a9: 0x0eff, // XK_Korean_Won\n 0x20ac: 0x20ac, // XK_EuroSign\n 0x2105: 0x0ab8, // XK_careof\n 0x2116: 0x06b0, // XK_numerosign\n 0x2117: 0x0afb, // XK_phonographcopyright\n 0x211e: 0x0ad4, // XK_prescription\n 0x2122: 0x0ac9, // XK_trademark\n 0x2153: 0x0ab0, // XK_onethird\n 0x2154: 0x0ab1, // XK_twothirds\n 0x2155: 0x0ab2, // XK_onefifth\n 0x2156: 0x0ab3, // XK_twofifths\n 0x2157: 0x0ab4, // XK_threefifths\n 0x2158: 0x0ab5, // XK_fourfifths\n 0x2159: 0x0ab6, // XK_onesixth\n 0x215a: 0x0ab7, // XK_fivesixths\n 0x215b: 0x0ac3, // XK_oneeighth\n 0x215c: 0x0ac4, // XK_threeeighths\n 0x215d: 0x0ac5, // XK_fiveeighths\n 0x215e: 0x0ac6, // XK_seveneighths\n 0x2190: 0x08fb, // XK_leftarrow\n 0x2191: 0x08fc, // XK_uparrow\n 0x2192: 0x08fd, // XK_rightarrow\n 0x2193: 0x08fe, // XK_downarrow\n 0x21d2: 0x08ce, // XK_implies\n 0x21d4: 0x08cd, // XK_ifonlyif\n 0x2202: 0x08ef, // XK_partialderivative\n 0x2207: 0x08c5, // XK_nabla\n 0x2218: 0x0bca, // XK_jot\n 0x221a: 0x08d6, // XK_radical\n 0x221d: 0x08c1, // XK_variation\n 0x221e: 0x08c2, // XK_infinity\n 0x2227: 0x08de, // XK_logicaland\n 0x2228: 0x08df, // XK_logicalor\n 0x2229: 0x08dc, // XK_intersection\n 0x222a: 0x08dd, // XK_union\n 0x222b: 0x08bf, // XK_integral\n 0x2234: 0x08c0, // XK_therefore\n 0x223c: 0x08c8, // XK_approximate\n 0x2243: 0x08c9, // XK_similarequal\n 0x2245: 0x1002248, // XK_approxeq\n 0x2260: 0x08bd, // XK_notequal\n 0x2261: 0x08cf, // XK_identical\n 0x2264: 0x08bc, // XK_lessthanequal\n 0x2265: 0x08be, // XK_greaterthanequal\n 0x2282: 0x08da, // XK_includedin\n 0x2283: 0x08db, // XK_includes\n 0x22a2: 0x0bfc, // XK_righttack\n 0x22a3: 0x0bdc, // XK_lefttack\n 0x22a4: 0x0bc2, // XK_downtack\n 0x22a5: 0x0bce, // XK_uptack\n 0x2308: 0x0bd3, // XK_upstile\n 0x230a: 0x0bc4, // XK_downstile\n 0x2315: 0x0afa, // XK_telephonerecorder\n 0x2320: 0x08a4, // XK_topintegral\n 0x2321: 0x08a5, // XK_botintegral\n 0x2395: 0x0bcc, // XK_quad\n 0x239b: 0x08ab, // XK_topleftparens\n 0x239d: 0x08ac, // XK_botleftparens\n 0x239e: 0x08ad, // XK_toprightparens\n 0x23a0: 0x08ae, // XK_botrightparens\n 0x23a1: 0x08a7, // XK_topleftsqbracket\n 0x23a3: 0x08a8, // XK_botleftsqbracket\n 0x23a4: 0x08a9, // XK_toprightsqbracket\n 0x23a6: 0x08aa, // XK_botrightsqbracket\n 0x23a8: 0x08af, // XK_leftmiddlecurlybrace\n 0x23ac: 0x08b0, // XK_rightmiddlecurlybrace\n 0x23b7: 0x08a1, // XK_leftradical\n 0x23ba: 0x09ef, // XK_horizlinescan1\n 0x23bb: 0x09f0, // XK_horizlinescan3\n 0x23bc: 0x09f2, // XK_horizlinescan7\n 0x23bd: 0x09f3, // XK_horizlinescan9\n 0x2409: 0x09e2, // XK_ht\n 0x240a: 0x09e5, // XK_lf\n 0x240b: 0x09e9, // XK_vt\n 0x240c: 0x09e3, // XK_ff\n 0x240d: 0x09e4, // XK_cr\n 0x2423: 0x0aac, // XK_signifblank\n 0x2424: 0x09e8, // XK_nl\n 0x2500: 0x08a3, // XK_horizconnector\n 0x2502: 0x08a6, // XK_vertconnector\n 0x250c: 0x08a2, // XK_topleftradical\n 0x2510: 0x09eb, // XK_uprightcorner\n 0x2514: 0x09ed, // XK_lowleftcorner\n 0x2518: 0x09ea, // XK_lowrightcorner\n 0x251c: 0x09f4, // XK_leftt\n 0x2524: 0x09f5, // XK_rightt\n 0x252c: 0x09f7, // XK_topt\n 0x2534: 0x09f6, // XK_bott\n 0x253c: 0x09ee, // XK_crossinglines\n 0x2592: 0x09e1, // XK_checkerboard\n 0x25aa: 0x0ae7, // XK_enfilledsqbullet\n 0x25ab: 0x0ae1, // XK_enopensquarebullet\n 0x25ac: 0x0adb, // XK_filledrectbullet\n 0x25ad: 0x0ae2, // XK_openrectbullet\n 0x25ae: 0x0adf, // XK_emfilledrect\n 0x25af: 0x0acf, // XK_emopenrectangle\n 0x25b2: 0x0ae8, // XK_filledtribulletup\n 0x25b3: 0x0ae3, // XK_opentribulletup\n 0x25b6: 0x0add, // XK_filledrighttribullet\n 0x25b7: 0x0acd, // XK_rightopentriangle\n 0x25bc: 0x0ae9, // XK_filledtribulletdown\n 0x25bd: 0x0ae4, // XK_opentribulletdown\n 0x25c0: 0x0adc, // XK_filledlefttribullet\n 0x25c1: 0x0acc, // XK_leftopentriangle\n 0x25c6: 0x09e0, // XK_soliddiamond\n 0x25cb: 0x0ace, // XK_emopencircle\n 0x25cf: 0x0ade, // XK_emfilledcircle\n 0x25e6: 0x0ae0, // XK_enopencircbullet\n 0x2606: 0x0ae5, // XK_openstar\n 0x260e: 0x0af9, // XK_telephone\n 0x2613: 0x0aca, // XK_signaturemark\n 0x261c: 0x0aea, // XK_leftpointer\n 0x261e: 0x0aeb, // XK_rightpointer\n 0x2640: 0x0af8, // XK_femalesymbol\n 0x2642: 0x0af7, // XK_malesymbol\n 0x2663: 0x0aec, // XK_club\n 0x2665: 0x0aee, // XK_heart\n 0x2666: 0x0aed, // XK_diamond\n 0x266d: 0x0af6, // XK_musicalflat\n 0x266f: 0x0af5, // XK_musicalsharp\n 0x2713: 0x0af3, // XK_checkmark\n 0x2717: 0x0af4, // XK_ballotcross\n 0x271d: 0x0ad9, // XK_latincross\n 0x2720: 0x0af0, // XK_maltesecross\n 0x27e8: 0x0abc, // XK_leftanglebracket\n 0x27e9: 0x0abe, // XK_rightanglebracket\n 0x3001: 0x04a4, // XK_kana_comma\n 0x3002: 0x04a1, // XK_kana_fullstop\n 0x300c: 0x04a2, // XK_kana_openingbracket\n 0x300d: 0x04a3, // XK_kana_closingbracket\n 0x309b: 0x04de, // XK_voicedsound\n 0x309c: 0x04df, // XK_semivoicedsound\n 0x30a1: 0x04a7, // XK_kana_a\n 0x30a2: 0x04b1, // XK_kana_A\n 0x30a3: 0x04a8, // XK_kana_i\n 0x30a4: 0x04b2, // XK_kana_I\n 0x30a5: 0x04a9, // XK_kana_u\n 0x30a6: 0x04b3, // XK_kana_U\n 0x30a7: 0x04aa, // XK_kana_e\n 0x30a8: 0x04b4, // XK_kana_E\n 0x30a9: 0x04ab, // XK_kana_o\n 0x30aa: 0x04b5, // XK_kana_O\n 0x30ab: 0x04b6, // XK_kana_KA\n 0x30ad: 0x04b7, // XK_kana_KI\n 0x30af: 0x04b8, // XK_kana_KU\n 0x30b1: 0x04b9, // XK_kana_KE\n 0x30b3: 0x04ba, // XK_kana_KO\n 0x30b5: 0x04bb, // XK_kana_SA\n 0x30b7: 0x04bc, // XK_kana_SHI\n 0x30b9: 0x04bd, // XK_kana_SU\n 0x30bb: 0x04be, // XK_kana_SE\n 0x30bd: 0x04bf, // XK_kana_SO\n 0x30bf: 0x04c0, // XK_kana_TA\n 0x30c1: 0x04c1, // XK_kana_CHI\n 0x30c3: 0x04af, // XK_kana_tsu\n 0x30c4: 0x04c2, // XK_kana_TSU\n 0x30c6: 0x04c3, // XK_kana_TE\n 0x30c8: 0x04c4, // XK_kana_TO\n 0x30ca: 0x04c5, // XK_kana_NA\n 0x30cb: 0x04c6, // XK_kana_NI\n 0x30cc: 0x04c7, // XK_kana_NU\n 0x30cd: 0x04c8, // XK_kana_NE\n 0x30ce: 0x04c9, // XK_kana_NO\n 0x30cf: 0x04ca, // XK_kana_HA\n 0x30d2: 0x04cb, // XK_kana_HI\n 0x30d5: 0x04cc, // XK_kana_FU\n 0x30d8: 0x04cd, // XK_kana_HE\n 0x30db: 0x04ce, // XK_kana_HO\n 0x30de: 0x04cf, // XK_kana_MA\n 0x30df: 0x04d0, // XK_kana_MI\n 0x30e0: 0x04d1, // XK_kana_MU\n 0x30e1: 0x04d2, // XK_kana_ME\n 0x30e2: 0x04d3, // XK_kana_MO\n 0x30e3: 0x04ac, // XK_kana_ya\n 0x30e4: 0x04d4, // XK_kana_YA\n 0x30e5: 0x04ad, // XK_kana_yu\n 0x30e6: 0x04d5, // XK_kana_YU\n 0x30e7: 0x04ae, // XK_kana_yo\n 0x30e8: 0x04d6, // XK_kana_YO\n 0x30e9: 0x04d7, // XK_kana_RA\n 0x30ea: 0x04d8, // XK_kana_RI\n 0x30eb: 0x04d9, // XK_kana_RU\n 0x30ec: 0x04da, // XK_kana_RE\n 0x30ed: 0x04db, // XK_kana_RO\n 0x30ef: 0x04dc, // XK_kana_WA\n 0x30f2: 0x04a6, // XK_kana_WO\n 0x30f3: 0x04dd, // XK_kana_N\n 0x30fb: 0x04a5, // XK_kana_conjunctive\n 0x30fc: 0x04b0, // XK_prolongedsound\n};\n\nexport default {\n lookup(u) {\n // Latin-1 is one-to-one mapping\n if ((u >= 0x20) && (u <= 0xff)) {\n return u;\n }\n\n // Lookup table (fairly random)\n const keysym = codepoints[u];\n if (keysym !== undefined) {\n return keysym;\n }\n\n // General mapping as final fallback\n return 0x01000000 | u;\n },\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\n/*\n * Mapping between Microsoft® Windows® Virtual-Key codes and\n * HTML key codes.\n */\n\nexport default {\n 0x08: 'Backspace',\n 0x09: 'Tab',\n 0x0a: 'NumpadClear',\n 0x0d: 'Enter',\n 0x10: 'ShiftLeft',\n 0x11: 'ControlLeft',\n 0x12: 'AltLeft',\n 0x13: 'Pause',\n 0x14: 'CapsLock',\n 0x15: 'Lang1',\n 0x19: 'Lang2',\n 0x1b: 'Escape',\n 0x1c: 'Convert',\n 0x1d: 'NonConvert',\n 0x20: 'Space',\n 0x21: 'PageUp',\n 0x22: 'PageDown',\n 0x23: 'End',\n 0x24: 'Home',\n 0x25: 'ArrowLeft',\n 0x26: 'ArrowUp',\n 0x27: 'ArrowRight',\n 0x28: 'ArrowDown',\n 0x29: 'Select',\n 0x2c: 'PrintScreen',\n 0x2d: 'Insert',\n 0x2e: 'Delete',\n 0x2f: 'Help',\n 0x30: 'Digit0',\n 0x31: 'Digit1',\n 0x32: 'Digit2',\n 0x33: 'Digit3',\n 0x34: 'Digit4',\n 0x35: 'Digit5',\n 0x36: 'Digit6',\n 0x37: 'Digit7',\n 0x38: 'Digit8',\n 0x39: 'Digit9',\n 0x5b: 'MetaLeft',\n 0x5c: 'MetaRight',\n 0x5d: 'ContextMenu',\n 0x5f: 'Sleep',\n 0x60: 'Numpad0',\n 0x61: 'Numpad1',\n 0x62: 'Numpad2',\n 0x63: 'Numpad3',\n 0x64: 'Numpad4',\n 0x65: 'Numpad5',\n 0x66: 'Numpad6',\n 0x67: 'Numpad7',\n 0x68: 'Numpad8',\n 0x69: 'Numpad9',\n 0x6a: 'NumpadMultiply',\n 0x6b: 'NumpadAdd',\n 0x6c: 'NumpadDecimal',\n 0x6d: 'NumpadSubtract',\n 0x6e: 'NumpadDecimal', // Duplicate, because buggy on Windows\n 0x6f: 'NumpadDivide',\n 0x70: 'F1',\n 0x71: 'F2',\n 0x72: 'F3',\n 0x73: 'F4',\n 0x74: 'F5',\n 0x75: 'F6',\n 0x76: 'F7',\n 0x77: 'F8',\n 0x78: 'F9',\n 0x79: 'F10',\n 0x7a: 'F11',\n 0x7b: 'F12',\n 0x7c: 'F13',\n 0x7d: 'F14',\n 0x7e: 'F15',\n 0x7f: 'F16',\n 0x80: 'F17',\n 0x81: 'F18',\n 0x82: 'F19',\n 0x83: 'F20',\n 0x84: 'F21',\n 0x85: 'F22',\n 0x86: 'F23',\n 0x87: 'F24',\n 0x90: 'NumLock',\n 0x91: 'ScrollLock',\n 0xa6: 'BrowserBack',\n 0xa7: 'BrowserForward',\n 0xa8: 'BrowserRefresh',\n 0xa9: 'BrowserStop',\n 0xaa: 'BrowserSearch',\n 0xab: 'BrowserFavorites',\n 0xac: 'BrowserHome',\n 0xad: 'AudioVolumeMute',\n 0xae: 'AudioVolumeDown',\n 0xaf: 'AudioVolumeUp',\n 0xb0: 'MediaTrackNext',\n 0xb1: 'MediaTrackPrevious',\n 0xb2: 'MediaStop',\n 0xb3: 'MediaPlayPause',\n 0xb4: 'LaunchMail',\n 0xb5: 'MediaSelect',\n 0xb6: 'LaunchApp1',\n 0xb7: 'LaunchApp2',\n 0xe1: 'AltRight', // Only when it is AltGraph\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\n/*\n * Fallback mapping between HTML key codes (physical keys) and\n * HTML key values. This only works for keys that don't vary\n * between layouts. We also omit those who manage fine by mapping the\n * Unicode representation.\n *\n * See https://www.w3.org/TR/uievents-code/ for possible codes.\n * See https://www.w3.org/TR/uievents-key/ for possible values.\n */\n\n/* eslint-disable key-spacing */\n\nexport default {\n\n// 3.1.1.1. Writing System Keys\n\n 'Backspace': 'Backspace',\n\n// 3.1.1.2. Functional Keys\n\n 'AltLeft': 'Alt',\n 'AltRight': 'Alt', // This could also be 'AltGraph'\n 'CapsLock': 'CapsLock',\n 'ContextMenu': 'ContextMenu',\n 'ControlLeft': 'Control',\n 'ControlRight': 'Control',\n 'Enter': 'Enter',\n 'MetaLeft': 'Meta',\n 'MetaRight': 'Meta',\n 'ShiftLeft': 'Shift',\n 'ShiftRight': 'Shift',\n 'Tab': 'Tab',\n // FIXME: Japanese/Korean keys\n\n// 3.1.2. Control Pad Section\n\n 'Delete': 'Delete',\n 'End': 'End',\n 'Help': 'Help',\n 'Home': 'Home',\n 'Insert': 'Insert',\n 'PageDown': 'PageDown',\n 'PageUp': 'PageUp',\n\n// 3.1.3. Arrow Pad Section\n\n 'ArrowDown': 'ArrowDown',\n 'ArrowLeft': 'ArrowLeft',\n 'ArrowRight': 'ArrowRight',\n 'ArrowUp': 'ArrowUp',\n\n// 3.1.4. Numpad Section\n\n 'NumLock': 'NumLock',\n 'NumpadBackspace': 'Backspace',\n 'NumpadClear': 'Clear',\n\n// 3.1.5. Function Section\n\n 'Escape': 'Escape',\n 'F1': 'F1',\n 'F2': 'F2',\n 'F3': 'F3',\n 'F4': 'F4',\n 'F5': 'F5',\n 'F6': 'F6',\n 'F7': 'F7',\n 'F8': 'F8',\n 'F9': 'F9',\n 'F10': 'F10',\n 'F11': 'F11',\n 'F12': 'F12',\n 'F13': 'F13',\n 'F14': 'F14',\n 'F15': 'F15',\n 'F16': 'F16',\n 'F17': 'F17',\n 'F18': 'F18',\n 'F19': 'F19',\n 'F20': 'F20',\n 'F21': 'F21',\n 'F22': 'F22',\n 'F23': 'F23',\n 'F24': 'F24',\n 'F25': 'F25',\n 'F26': 'F26',\n 'F27': 'F27',\n 'F28': 'F28',\n 'F29': 'F29',\n 'F30': 'F30',\n 'F31': 'F31',\n 'F32': 'F32',\n 'F33': 'F33',\n 'F34': 'F34',\n 'F35': 'F35',\n 'PrintScreen': 'PrintScreen',\n 'ScrollLock': 'ScrollLock',\n 'Pause': 'Pause',\n\n// 3.1.6. Media Keys\n\n 'BrowserBack': 'BrowserBack',\n 'BrowserFavorites': 'BrowserFavorites',\n 'BrowserForward': 'BrowserForward',\n 'BrowserHome': 'BrowserHome',\n 'BrowserRefresh': 'BrowserRefresh',\n 'BrowserSearch': 'BrowserSearch',\n 'BrowserStop': 'BrowserStop',\n 'Eject': 'Eject',\n 'LaunchApp1': 'LaunchMyComputer',\n 'LaunchApp2': 'LaunchCalendar',\n 'LaunchMail': 'LaunchMail',\n 'MediaPlayPause': 'MediaPlay',\n 'MediaStop': 'MediaStop',\n 'MediaTrackNext': 'MediaTrackNext',\n 'MediaTrackPrevious': 'MediaTrackPrevious',\n 'Power': 'Power',\n 'Sleep': 'Sleep',\n 'AudioVolumeDown': 'AudioVolumeDown',\n 'AudioVolumeMute': 'AudioVolumeMute',\n 'AudioVolumeUp': 'AudioVolumeUp',\n 'WakeUp': 'WakeUp',\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\nimport KeyTable from \"./keysym.js\";\n\n/*\n * Mapping between HTML key values and VNC/X11 keysyms for \"special\"\n * keys that cannot be handled via their Unicode codepoint.\n *\n * See https://www.w3.org/TR/uievents-key/ for possible values.\n */\n\nconst DOMKeyTable = {};\n\nfunction addStandard(key, standard) {\n if (standard === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (key in DOMKeyTable) throw new Error(\"Duplicate entry for key \\\"\" + key + \"\\\"\");\n DOMKeyTable[key] = [standard, standard, standard, standard];\n}\n\nfunction addLeftRight(key, left, right) {\n if (left === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (right === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (key in DOMKeyTable) throw new Error(\"Duplicate entry for key \\\"\" + key + \"\\\"\");\n DOMKeyTable[key] = [left, left, right, left];\n}\n\nfunction addNumpad(key, standard, numpad) {\n if (standard === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (numpad === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (key in DOMKeyTable) throw new Error(\"Duplicate entry for key \\\"\" + key + \"\\\"\");\n DOMKeyTable[key] = [standard, standard, standard, numpad];\n}\n\n// 3.2. Modifier Keys\n\naddLeftRight(\"Alt\", KeyTable.XK_Alt_L, KeyTable.XK_Alt_R);\naddStandard(\"AltGraph\", KeyTable.XK_ISO_Level3_Shift);\naddStandard(\"CapsLock\", KeyTable.XK_Caps_Lock);\naddLeftRight(\"Control\", KeyTable.XK_Control_L, KeyTable.XK_Control_R);\n// - Fn\n// - FnLock\naddLeftRight(\"Meta\", KeyTable.XK_Super_L, KeyTable.XK_Super_R);\naddStandard(\"NumLock\", KeyTable.XK_Num_Lock);\naddStandard(\"ScrollLock\", KeyTable.XK_Scroll_Lock);\naddLeftRight(\"Shift\", KeyTable.XK_Shift_L, KeyTable.XK_Shift_R);\n// - Symbol\n// - SymbolLock\n// - Hyper\n// - Super\n\n// 3.3. Whitespace Keys\n\naddNumpad(\"Enter\", KeyTable.XK_Return, KeyTable.XK_KP_Enter);\naddStandard(\"Tab\", KeyTable.XK_Tab);\naddNumpad(\" \", KeyTable.XK_space, KeyTable.XK_KP_Space);\n\n// 3.4. Navigation Keys\n\naddNumpad(\"ArrowDown\", KeyTable.XK_Down, KeyTable.XK_KP_Down);\naddNumpad(\"ArrowLeft\", KeyTable.XK_Left, KeyTable.XK_KP_Left);\naddNumpad(\"ArrowRight\", KeyTable.XK_Right, KeyTable.XK_KP_Right);\naddNumpad(\"ArrowUp\", KeyTable.XK_Up, KeyTable.XK_KP_Up);\naddNumpad(\"End\", KeyTable.XK_End, KeyTable.XK_KP_End);\naddNumpad(\"Home\", KeyTable.XK_Home, KeyTable.XK_KP_Home);\naddNumpad(\"PageDown\", KeyTable.XK_Next, KeyTable.XK_KP_Next);\naddNumpad(\"PageUp\", KeyTable.XK_Prior, KeyTable.XK_KP_Prior);\n\n// 3.5. Editing Keys\n\naddStandard(\"Backspace\", KeyTable.XK_BackSpace);\n// Browsers send \"Clear\" for the numpad 5 without NumLock because\n// Windows uses VK_Clear for that key. But Unix expects KP_Begin for\n// that scenario.\naddNumpad(\"Clear\", KeyTable.XK_Clear, KeyTable.XK_KP_Begin);\naddStandard(\"Copy\", KeyTable.XF86XK_Copy);\n// - CrSel\naddStandard(\"Cut\", KeyTable.XF86XK_Cut);\naddNumpad(\"Delete\", KeyTable.XK_Delete, KeyTable.XK_KP_Delete);\n// - EraseEof\n// - ExSel\naddNumpad(\"Insert\", KeyTable.XK_Insert, KeyTable.XK_KP_Insert);\naddStandard(\"Paste\", KeyTable.XF86XK_Paste);\naddStandard(\"Redo\", KeyTable.XK_Redo);\naddStandard(\"Undo\", KeyTable.XK_Undo);\n\n// 3.6. UI Keys\n\n// - Accept\n// - Again (could just be XK_Redo)\n// - Attn\naddStandard(\"Cancel\", KeyTable.XK_Cancel);\naddStandard(\"ContextMenu\", KeyTable.XK_Menu);\naddStandard(\"Escape\", KeyTable.XK_Escape);\naddStandard(\"Execute\", KeyTable.XK_Execute);\naddStandard(\"Find\", KeyTable.XK_Find);\naddStandard(\"Help\", KeyTable.XK_Help);\naddStandard(\"Pause\", KeyTable.XK_Pause);\n// - Play\n// - Props\naddStandard(\"Select\", KeyTable.XK_Select);\naddStandard(\"ZoomIn\", KeyTable.XF86XK_ZoomIn);\naddStandard(\"ZoomOut\", KeyTable.XF86XK_ZoomOut);\n\n// 3.7. Device Keys\n\naddStandard(\"BrightnessDown\", KeyTable.XF86XK_MonBrightnessDown);\naddStandard(\"BrightnessUp\", KeyTable.XF86XK_MonBrightnessUp);\naddStandard(\"Eject\", KeyTable.XF86XK_Eject);\naddStandard(\"LogOff\", KeyTable.XF86XK_LogOff);\naddStandard(\"Power\", KeyTable.XF86XK_PowerOff);\naddStandard(\"PowerOff\", KeyTable.XF86XK_PowerDown);\naddStandard(\"PrintScreen\", KeyTable.XK_Print);\naddStandard(\"Hibernate\", KeyTable.XF86XK_Hibernate);\naddStandard(\"Standby\", KeyTable.XF86XK_Standby);\naddStandard(\"WakeUp\", KeyTable.XF86XK_WakeUp);\n\n// 3.8. IME and Composition Keys\n\naddStandard(\"AllCandidates\", KeyTable.XK_MultipleCandidate);\naddStandard(\"Alphanumeric\", KeyTable.XK_Eisu_toggle);\naddStandard(\"CodeInput\", KeyTable.XK_Codeinput);\naddStandard(\"Compose\", KeyTable.XK_Multi_key);\naddStandard(\"Convert\", KeyTable.XK_Henkan);\n// - Dead\n// - FinalMode\naddStandard(\"GroupFirst\", KeyTable.XK_ISO_First_Group);\naddStandard(\"GroupLast\", KeyTable.XK_ISO_Last_Group);\naddStandard(\"GroupNext\", KeyTable.XK_ISO_Next_Group);\naddStandard(\"GroupPrevious\", KeyTable.XK_ISO_Prev_Group);\n// - ModeChange (XK_Mode_switch is often used for AltGr)\n// - NextCandidate\naddStandard(\"NonConvert\", KeyTable.XK_Muhenkan);\naddStandard(\"PreviousCandidate\", KeyTable.XK_PreviousCandidate);\n// - Process\naddStandard(\"SingleCandidate\", KeyTable.XK_SingleCandidate);\naddStandard(\"HangulMode\", KeyTable.XK_Hangul);\naddStandard(\"HanjaMode\", KeyTable.XK_Hangul_Hanja);\naddStandard(\"JunjaMode\", KeyTable.XK_Hangul_Jeonja);\naddStandard(\"Eisu\", KeyTable.XK_Eisu_toggle);\naddStandard(\"Hankaku\", KeyTable.XK_Hankaku);\naddStandard(\"Hiragana\", KeyTable.XK_Hiragana);\naddStandard(\"HiraganaKatakana\", KeyTable.XK_Hiragana_Katakana);\naddStandard(\"KanaMode\", KeyTable.XK_Kana_Shift); // could also be _Kana_Lock\naddStandard(\"KanjiMode\", KeyTable.XK_Kanji);\naddStandard(\"Katakana\", KeyTable.XK_Katakana);\naddStandard(\"Romaji\", KeyTable.XK_Romaji);\naddStandard(\"Zenkaku\", KeyTable.XK_Zenkaku);\naddStandard(\"ZenkakuHankaku\", KeyTable.XK_Zenkaku_Hankaku);\n\n// 3.9. General-Purpose Function Keys\n\naddStandard(\"F1\", KeyTable.XK_F1);\naddStandard(\"F2\", KeyTable.XK_F2);\naddStandard(\"F3\", KeyTable.XK_F3);\naddStandard(\"F4\", KeyTable.XK_F4);\naddStandard(\"F5\", KeyTable.XK_F5);\naddStandard(\"F6\", KeyTable.XK_F6);\naddStandard(\"F7\", KeyTable.XK_F7);\naddStandard(\"F8\", KeyTable.XK_F8);\naddStandard(\"F9\", KeyTable.XK_F9);\naddStandard(\"F10\", KeyTable.XK_F10);\naddStandard(\"F11\", KeyTable.XK_F11);\naddStandard(\"F12\", KeyTable.XK_F12);\naddStandard(\"F13\", KeyTable.XK_F13);\naddStandard(\"F14\", KeyTable.XK_F14);\naddStandard(\"F15\", KeyTable.XK_F15);\naddStandard(\"F16\", KeyTable.XK_F16);\naddStandard(\"F17\", KeyTable.XK_F17);\naddStandard(\"F18\", KeyTable.XK_F18);\naddStandard(\"F19\", KeyTable.XK_F19);\naddStandard(\"F20\", KeyTable.XK_F20);\naddStandard(\"F21\", KeyTable.XK_F21);\naddStandard(\"F22\", KeyTable.XK_F22);\naddStandard(\"F23\", KeyTable.XK_F23);\naddStandard(\"F24\", KeyTable.XK_F24);\naddStandard(\"F25\", KeyTable.XK_F25);\naddStandard(\"F26\", KeyTable.XK_F26);\naddStandard(\"F27\", KeyTable.XK_F27);\naddStandard(\"F28\", KeyTable.XK_F28);\naddStandard(\"F29\", KeyTable.XK_F29);\naddStandard(\"F30\", KeyTable.XK_F30);\naddStandard(\"F31\", KeyTable.XK_F31);\naddStandard(\"F32\", KeyTable.XK_F32);\naddStandard(\"F33\", KeyTable.XK_F33);\naddStandard(\"F34\", KeyTable.XK_F34);\naddStandard(\"F35\", KeyTable.XK_F35);\n// - Soft1...\n\n// 3.10. Multimedia Keys\n\n// - ChannelDown\n// - ChannelUp\naddStandard(\"Close\", KeyTable.XF86XK_Close);\naddStandard(\"MailForward\", KeyTable.XF86XK_MailForward);\naddStandard(\"MailReply\", KeyTable.XF86XK_Reply);\naddStandard(\"MailSend\", KeyTable.XF86XK_Send);\n// - MediaClose\naddStandard(\"MediaFastForward\", KeyTable.XF86XK_AudioForward);\naddStandard(\"MediaPause\", KeyTable.XF86XK_AudioPause);\naddStandard(\"MediaPlay\", KeyTable.XF86XK_AudioPlay);\n// - MediaPlayPause\naddStandard(\"MediaRecord\", KeyTable.XF86XK_AudioRecord);\naddStandard(\"MediaRewind\", KeyTable.XF86XK_AudioRewind);\naddStandard(\"MediaStop\", KeyTable.XF86XK_AudioStop);\naddStandard(\"MediaTrackNext\", KeyTable.XF86XK_AudioNext);\naddStandard(\"MediaTrackPrevious\", KeyTable.XF86XK_AudioPrev);\naddStandard(\"New\", KeyTable.XF86XK_New);\naddStandard(\"Open\", KeyTable.XF86XK_Open);\naddStandard(\"Print\", KeyTable.XK_Print);\naddStandard(\"Save\", KeyTable.XF86XK_Save);\naddStandard(\"SpellCheck\", KeyTable.XF86XK_Spell);\n\n// 3.11. Multimedia Numpad Keys\n\n// - Key11\n// - Key12\n\n// 3.12. Audio Keys\n\n// - AudioBalanceLeft\n// - AudioBalanceRight\n// - AudioBassBoostDown\n// - AudioBassBoostToggle\n// - AudioBassBoostUp\n// - AudioFaderFront\n// - AudioFaderRear\n// - AudioSurroundModeNext\n// - AudioTrebleDown\n// - AudioTrebleUp\naddStandard(\"AudioVolumeDown\", KeyTable.XF86XK_AudioLowerVolume);\naddStandard(\"AudioVolumeUp\", KeyTable.XF86XK_AudioRaiseVolume);\naddStandard(\"AudioVolumeMute\", KeyTable.XF86XK_AudioMute);\n// - MicrophoneToggle\n// - MicrophoneVolumeDown\n// - MicrophoneVolumeUp\naddStandard(\"MicrophoneVolumeMute\", KeyTable.XF86XK_AudioMicMute);\n\n// 3.13. Speech Keys\n\n// - SpeechCorrectionList\n// - SpeechInputToggle\n\n// 3.14. Application Keys\n\naddStandard(\"LaunchApplication1\", KeyTable.XF86XK_MyComputer);\naddStandard(\"LaunchApplication2\", KeyTable.XF86XK_Calculator);\naddStandard(\"LaunchCalendar\", KeyTable.XF86XK_Calendar);\n// - LaunchContacts\naddStandard(\"LaunchMail\", KeyTable.XF86XK_Mail);\naddStandard(\"LaunchMediaPlayer\", KeyTable.XF86XK_AudioMedia);\naddStandard(\"LaunchMusicPlayer\", KeyTable.XF86XK_Music);\naddStandard(\"LaunchPhone\", KeyTable.XF86XK_Phone);\naddStandard(\"LaunchScreenSaver\", KeyTable.XF86XK_ScreenSaver);\naddStandard(\"LaunchSpreadsheet\", KeyTable.XF86XK_Excel);\naddStandard(\"LaunchWebBrowser\", KeyTable.XF86XK_WWW);\naddStandard(\"LaunchWebCam\", KeyTable.XF86XK_WebCam);\naddStandard(\"LaunchWordProcessor\", KeyTable.XF86XK_Word);\n\n// 3.15. Browser Keys\n\naddStandard(\"BrowserBack\", KeyTable.XF86XK_Back);\naddStandard(\"BrowserFavorites\", KeyTable.XF86XK_Favorites);\naddStandard(\"BrowserForward\", KeyTable.XF86XK_Forward);\naddStandard(\"BrowserHome\", KeyTable.XF86XK_HomePage);\naddStandard(\"BrowserRefresh\", KeyTable.XF86XK_Refresh);\naddStandard(\"BrowserSearch\", KeyTable.XF86XK_Search);\naddStandard(\"BrowserStop\", KeyTable.XF86XK_Stop);\n\n// 3.16. Mobile Phone Keys\n\n// - A whole bunch...\n\n// 3.17. TV Keys\n\n// - A whole bunch...\n\n// 3.18. Media Controller Keys\n\n// - A whole bunch...\naddStandard(\"Dimmer\", KeyTable.XF86XK_BrightnessAdjust);\naddStandard(\"MediaAudioTrack\", KeyTable.XF86XK_AudioCycleTrack);\naddStandard(\"RandomToggle\", KeyTable.XF86XK_AudioRandomPlay);\naddStandard(\"SplitScreenToggle\", KeyTable.XF86XK_SplitScreen);\naddStandard(\"Subtitle\", KeyTable.XF86XK_Subtitle);\naddStandard(\"VideoModeNext\", KeyTable.XF86XK_Next_VMode);\n\n// Extra: Numpad\n\naddNumpad(\"=\", KeyTable.XK_equal, KeyTable.XK_KP_Equal);\naddNumpad(\"+\", KeyTable.XK_plus, KeyTable.XK_KP_Add);\naddNumpad(\"-\", KeyTable.XK_minus, KeyTable.XK_KP_Subtract);\naddNumpad(\"*\", KeyTable.XK_asterisk, KeyTable.XK_KP_Multiply);\naddNumpad(\"/\", KeyTable.XK_slash, KeyTable.XK_KP_Divide);\naddNumpad(\".\", KeyTable.XK_period, KeyTable.XK_KP_Decimal);\naddNumpad(\",\", KeyTable.XK_comma, KeyTable.XK_KP_Separator);\naddNumpad(\"0\", KeyTable.XK_0, KeyTable.XK_KP_0);\naddNumpad(\"1\", KeyTable.XK_1, KeyTable.XK_KP_1);\naddNumpad(\"2\", KeyTable.XK_2, KeyTable.XK_KP_2);\naddNumpad(\"3\", KeyTable.XK_3, KeyTable.XK_KP_3);\naddNumpad(\"4\", KeyTable.XK_4, KeyTable.XK_KP_4);\naddNumpad(\"5\", KeyTable.XK_5, KeyTable.XK_KP_5);\naddNumpad(\"6\", KeyTable.XK_6, KeyTable.XK_KP_6);\naddNumpad(\"7\", KeyTable.XK_7, KeyTable.XK_KP_7);\naddNumpad(\"8\", KeyTable.XK_8, KeyTable.XK_KP_8);\naddNumpad(\"9\", KeyTable.XK_9, KeyTable.XK_KP_9);\n\nexport default DOMKeyTable;\n","import KeyTable from \"./keysym.js\";\nimport keysyms from \"./keysymdef.js\";\nimport vkeys from \"./vkeys.js\";\nimport fixedkeys from \"./fixedkeys.js\";\nimport DOMKeyTable from \"./domkeytable.js\";\nimport * as browser from \"../util/browser.js\";\n\n// Get 'KeyboardEvent.code', handling legacy browsers\nexport function getKeycode(evt) {\n // Are we getting proper key identifiers?\n // (unfortunately Firefox and Chrome are crappy here and gives\n // us an empty string on some platforms, rather than leaving it\n // undefined)\n if (evt.code) {\n // Mozilla isn't fully in sync with the spec yet\n switch (evt.code) {\n case 'OSLeft': return 'MetaLeft';\n case 'OSRight': return 'MetaRight';\n }\n\n return evt.code;\n }\n\n // The de-facto standard is to use Windows Virtual-Key codes\n // in the 'keyCode' field for non-printable characters\n if (evt.keyCode in vkeys) {\n let code = vkeys[evt.keyCode];\n\n // macOS has messed up this code for some reason\n if (browser.isMac() && (code === 'ContextMenu')) {\n code = 'MetaRight';\n }\n\n // The keyCode doesn't distinguish between left and right\n // for the standard modifiers\n if (evt.location === 2) {\n switch (code) {\n case 'ShiftLeft': return 'ShiftRight';\n case 'ControlLeft': return 'ControlRight';\n case 'AltLeft': return 'AltRight';\n }\n }\n\n // Nor a bunch of the numpad keys\n if (evt.location === 3) {\n switch (code) {\n case 'Delete': return 'NumpadDecimal';\n case 'Insert': return 'Numpad0';\n case 'End': return 'Numpad1';\n case 'ArrowDown': return 'Numpad2';\n case 'PageDown': return 'Numpad3';\n case 'ArrowLeft': return 'Numpad4';\n case 'ArrowRight': return 'Numpad6';\n case 'Home': return 'Numpad7';\n case 'ArrowUp': return 'Numpad8';\n case 'PageUp': return 'Numpad9';\n case 'Enter': return 'NumpadEnter';\n }\n }\n\n return code;\n }\n\n return 'Unidentified';\n}\n\n// Get 'KeyboardEvent.key', handling legacy browsers\nexport function getKey(evt) {\n // Are we getting a proper key value?\n if (evt.key !== undefined) {\n // Mozilla isn't fully in sync with the spec yet\n switch (evt.key) {\n case 'OS': return 'Meta';\n case 'LaunchMyComputer': return 'LaunchApplication1';\n case 'LaunchCalculator': return 'LaunchApplication2';\n }\n\n // iOS leaks some OS names\n switch (evt.key) {\n case 'UIKeyInputUpArrow': return 'ArrowUp';\n case 'UIKeyInputDownArrow': return 'ArrowDown';\n case 'UIKeyInputLeftArrow': return 'ArrowLeft';\n case 'UIKeyInputRightArrow': return 'ArrowRight';\n case 'UIKeyInputEscape': return 'Escape';\n }\n\n // Broken behaviour in Chrome\n if ((evt.key === '\\x00') && (evt.code === 'NumpadDecimal')) {\n return 'Delete';\n }\n\n return evt.key;\n }\n\n // Try to deduce it based on the physical key\n const code = getKeycode(evt);\n if (code in fixedkeys) {\n return fixedkeys[code];\n }\n\n // If that failed, then see if we have a printable character\n if (evt.charCode) {\n return String.fromCharCode(evt.charCode);\n }\n\n // At this point we have nothing left to go on\n return 'Unidentified';\n}\n\n// Get the most reliable keysym value we can get from a key event\nexport function getKeysym(evt) {\n const key = getKey(evt);\n\n if (key === 'Unidentified') {\n return null;\n }\n\n // First look up special keys\n if (key in DOMKeyTable) {\n let location = evt.location;\n\n // Safari screws up location for the right cmd key\n if ((key === 'Meta') && (location === 0)) {\n location = 2;\n }\n\n // And for Clear\n if ((key === 'Clear') && (location === 3)) {\n let code = getKeycode(evt);\n if (code === 'NumLock') {\n location = 0;\n }\n }\n\n if ((location === undefined) || (location > 3)) {\n location = 0;\n }\n\n // The original Meta key now gets confused with the Windows key\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1020141\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1232918\n if (key === 'Meta') {\n let code = getKeycode(evt);\n if (code === 'AltLeft') {\n return KeyTable.XK_Meta_L;\n } else if (code === 'AltRight') {\n return KeyTable.XK_Meta_R;\n }\n }\n\n // macOS has Clear instead of NumLock, but the remote system is\n // probably not macOS, so lying here is probably best...\n if (key === 'Clear') {\n let code = getKeycode(evt);\n if (code === 'NumLock') {\n return KeyTable.XK_Num_Lock;\n }\n }\n\n // Windows sends alternating symbols for some keys when using a\n // Japanese layout. We have no way of synchronising with the IM\n // running on the remote system, so we send some combined keysym\n // instead and hope for the best.\n if (browser.isWindows()) {\n switch (key) {\n case 'Zenkaku':\n case 'Hankaku':\n return KeyTable.XK_Zenkaku_Hankaku;\n case 'Romaji':\n case 'KanaMode':\n return KeyTable.XK_Romaji;\n }\n }\n\n return DOMKeyTable[key][location];\n }\n\n // Now we need to look at the Unicode symbol instead\n\n // Special key? (FIXME: Should have been caught earlier)\n if (key.length !== 1) {\n return null;\n }\n\n const codepoint = key.charCodeAt();\n if (codepoint) {\n return keysyms.lookup(codepoint);\n }\n\n return null;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\nimport * as Log from '../util/logging.js';\nimport { stopEvent } from '../util/events.js';\nimport * as KeyboardUtil from \"./util.js\";\nimport KeyTable from \"./keysym.js\";\nimport * as browser from \"../util/browser.js\";\n\n//\n// Keyboard event handler\n//\n\nexport default class Keyboard {\n constructor(target) {\n this._target = target || null;\n\n this._keyDownList = {}; // List of depressed keys\n // (even if they are happy)\n this._altGrArmed = false; // Windows AltGr detection\n\n // keep these here so we can refer to them later\n this._eventHandlers = {\n 'keyup': this._handleKeyUp.bind(this),\n 'keydown': this._handleKeyDown.bind(this),\n 'blur': this._allKeysUp.bind(this),\n };\n\n // ===== EVENT HANDLERS =====\n\n this.onkeyevent = () => {}; // Handler for key press/release\n }\n\n // ===== PRIVATE METHODS =====\n\n _sendKeyEvent(keysym, code, down) {\n if (down) {\n this._keyDownList[code] = keysym;\n } else {\n // Do we really think this key is down?\n if (!(code in this._keyDownList)) {\n return;\n }\n delete this._keyDownList[code];\n }\n\n Log.Debug(\"onkeyevent \" + (down ? \"down\" : \"up\") +\n \", keysym: \" + keysym, \", code: \" + code);\n this.onkeyevent(keysym, code, down);\n }\n\n _getKeyCode(e) {\n const code = KeyboardUtil.getKeycode(e);\n if (code !== 'Unidentified') {\n return code;\n }\n\n // Unstable, but we don't have anything else to go on\n if (e.keyCode) {\n // 229 is used for composition events\n if (e.keyCode !== 229) {\n return 'Platform' + e.keyCode;\n }\n }\n\n // A precursor to the final DOM3 standard. Unfortunately it\n // is not layout independent, so it is as bad as using keyCode\n if (e.keyIdentifier) {\n // Non-character key?\n if (e.keyIdentifier.substr(0, 2) !== 'U+') {\n return e.keyIdentifier;\n }\n\n const codepoint = parseInt(e.keyIdentifier.substr(2), 16);\n const char = String.fromCharCode(codepoint).toUpperCase();\n\n return 'Platform' + char.charCodeAt();\n }\n\n return 'Unidentified';\n }\n\n _handleKeyDown(e) {\n const code = this._getKeyCode(e);\n let keysym = KeyboardUtil.getKeysym(e);\n\n // Windows doesn't have a proper AltGr, but handles it using\n // fake Ctrl+Alt. However the remote end might not be Windows,\n // so we need to merge those in to a single AltGr event. We\n // detect this case by seeing the two key events directly after\n // each other with a very short time between them (<50ms).\n if (this._altGrArmed) {\n this._altGrArmed = false;\n clearTimeout(this._altGrTimeout);\n\n if ((code === \"AltRight\") &&\n ((e.timeStamp - this._altGrCtrlTime) < 50)) {\n // FIXME: We fail to detect this if either Ctrl key is\n // first manually pressed as Windows then no\n // longer sends the fake Ctrl down event. It\n // does however happily send real Ctrl events\n // even when AltGr is already down. Some\n // browsers detect this for us though and set the\n // key to \"AltGraph\".\n keysym = KeyTable.XK_ISO_Level3_Shift;\n } else {\n this._sendKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n }\n }\n\n // We cannot handle keys we cannot track, but we also need\n // to deal with virtual keyboards which omit key info\n if (code === 'Unidentified') {\n if (keysym) {\n // If it's a virtual keyboard then it should be\n // sufficient to just send press and release right\n // after each other\n this._sendKeyEvent(keysym, code, true);\n this._sendKeyEvent(keysym, code, false);\n }\n\n stopEvent(e);\n return;\n }\n\n // Alt behaves more like AltGraph on macOS, so shuffle the\n // keys around a bit to make things more sane for the remote\n // server. This method is used by RealVNC and TigerVNC (and\n // possibly others).\n if (browser.isMac() || browser.isIOS()) {\n switch (keysym) {\n case KeyTable.XK_Super_L:\n keysym = KeyTable.XK_Alt_L;\n break;\n case KeyTable.XK_Super_R:\n keysym = KeyTable.XK_Super_L;\n break;\n case KeyTable.XK_Alt_L:\n keysym = KeyTable.XK_Mode_switch;\n break;\n case KeyTable.XK_Alt_R:\n keysym = KeyTable.XK_ISO_Level3_Shift;\n break;\n }\n }\n\n // Is this key already pressed? If so, then we must use the\n // same keysym or we'll confuse the server\n if (code in this._keyDownList) {\n keysym = this._keyDownList[code];\n }\n\n // macOS doesn't send proper key releases if a key is pressed\n // while meta is held down\n if ((browser.isMac() || browser.isIOS()) &&\n (e.metaKey && code !== 'MetaLeft' && code !== 'MetaRight')) {\n this._sendKeyEvent(keysym, code, true);\n this._sendKeyEvent(keysym, code, false);\n stopEvent(e);\n return;\n }\n\n // macOS doesn't send proper key events for modifiers, only\n // state change events. That gets extra confusing for CapsLock\n // which toggles on each press, but not on release. So pretend\n // it was a quick press and release of the button.\n if ((browser.isMac() || browser.isIOS()) && (code === 'CapsLock')) {\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true);\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false);\n stopEvent(e);\n return;\n }\n\n // Windows doesn't send proper key releases for a bunch of\n // Japanese IM keys so we have to fake the release right away\n const jpBadKeys = [ KeyTable.XK_Zenkaku_Hankaku,\n KeyTable.XK_Eisu_toggle,\n KeyTable.XK_Katakana,\n KeyTable.XK_Hiragana,\n KeyTable.XK_Romaji ];\n if (browser.isWindows() && jpBadKeys.includes(keysym)) {\n this._sendKeyEvent(keysym, code, true);\n this._sendKeyEvent(keysym, code, false);\n stopEvent(e);\n return;\n }\n\n stopEvent(e);\n\n // Possible start of AltGr sequence? (see above)\n if ((code === \"ControlLeft\") && browser.isWindows() &&\n !(\"ControlLeft\" in this._keyDownList)) {\n this._altGrArmed = true;\n this._altGrTimeout = setTimeout(this._handleAltGrTimeout.bind(this), 100);\n this._altGrCtrlTime = e.timeStamp;\n return;\n }\n\n this._sendKeyEvent(keysym, code, true);\n }\n\n _handleKeyUp(e) {\n stopEvent(e);\n\n const code = this._getKeyCode(e);\n\n // We can't get a release in the middle of an AltGr sequence, so\n // abort that detection\n if (this._altGrArmed) {\n this._altGrArmed = false;\n clearTimeout(this._altGrTimeout);\n this._sendKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n }\n\n // See comment in _handleKeyDown()\n if ((browser.isMac() || browser.isIOS()) && (code === 'CapsLock')) {\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true);\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false);\n return;\n }\n\n this._sendKeyEvent(this._keyDownList[code], code, false);\n\n // Windows has a rather nasty bug where it won't send key\n // release events for a Shift button if the other Shift is still\n // pressed\n if (browser.isWindows() && ((code === 'ShiftLeft') ||\n (code === 'ShiftRight'))) {\n if ('ShiftRight' in this._keyDownList) {\n this._sendKeyEvent(this._keyDownList['ShiftRight'],\n 'ShiftRight', false);\n }\n if ('ShiftLeft' in this._keyDownList) {\n this._sendKeyEvent(this._keyDownList['ShiftLeft'],\n 'ShiftLeft', false);\n }\n }\n }\n\n _handleAltGrTimeout() {\n this._altGrArmed = false;\n clearTimeout(this._altGrTimeout);\n this._sendKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n }\n\n _allKeysUp() {\n Log.Debug(\">> Keyboard.allKeysUp\");\n for (let code in this._keyDownList) {\n this._sendKeyEvent(this._keyDownList[code], code, false);\n }\n Log.Debug(\"<< Keyboard.allKeysUp\");\n }\n\n // ===== PUBLIC METHODS =====\n\n grab() {\n //Log.Debug(\">> Keyboard.grab\");\n\n this._target.addEventListener('keydown', this._eventHandlers.keydown);\n this._target.addEventListener('keyup', this._eventHandlers.keyup);\n\n // Release (key up) if window loses focus\n window.addEventListener('blur', this._eventHandlers.blur);\n\n //Log.Debug(\"<< Keyboard.grab\");\n }\n\n ungrab() {\n //Log.Debug(\">> Keyboard.ungrab\");\n\n this._target.removeEventListener('keydown', this._eventHandlers.keydown);\n this._target.removeEventListener('keyup', this._eventHandlers.keyup);\n window.removeEventListener('blur', this._eventHandlers.blur);\n\n // Release (key up) all keys that are in a down state\n this._allKeysUp();\n\n //Log.Debug(\">> Keyboard.ungrab\");\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nconst GH_NOGESTURE = 0;\nconst GH_ONETAP = 1;\nconst GH_TWOTAP = 2;\nconst GH_THREETAP = 4;\nconst GH_DRAG = 8;\nconst GH_LONGPRESS = 16;\nconst GH_TWODRAG = 32;\nconst GH_PINCH = 64;\n\nconst GH_INITSTATE = 127;\n\nconst GH_MOVE_THRESHOLD = 50;\nconst GH_ANGLE_THRESHOLD = 90; // Degrees\n\n// Timeout when waiting for gestures (ms)\nconst GH_MULTITOUCH_TIMEOUT = 250;\n\n// Maximum time between press and release for a tap (ms)\nconst GH_TAP_TIMEOUT = 1000;\n\n// Timeout when waiting for longpress (ms)\nconst GH_LONGPRESS_TIMEOUT = 1000;\n\n// Timeout when waiting to decide between PINCH and TWODRAG (ms)\nconst GH_TWOTOUCH_TIMEOUT = 50;\n\nexport default class GestureHandler {\n constructor() {\n this._target = null;\n\n this._state = GH_INITSTATE;\n\n this._tracked = [];\n this._ignored = [];\n\n this._waitingRelease = false;\n this._releaseStart = 0.0;\n\n this._longpressTimeoutId = null;\n this._twoTouchTimeoutId = null;\n\n this._boundEventHandler = this._eventHandler.bind(this);\n }\n\n attach(target) {\n this.detach();\n\n this._target = target;\n this._target.addEventListener('touchstart',\n this._boundEventHandler);\n this._target.addEventListener('touchmove',\n this._boundEventHandler);\n this._target.addEventListener('touchend',\n this._boundEventHandler);\n this._target.addEventListener('touchcancel',\n this._boundEventHandler);\n }\n\n detach() {\n if (!this._target) {\n return;\n }\n\n this._stopLongpressTimeout();\n this._stopTwoTouchTimeout();\n\n this._target.removeEventListener('touchstart',\n this._boundEventHandler);\n this._target.removeEventListener('touchmove',\n this._boundEventHandler);\n this._target.removeEventListener('touchend',\n this._boundEventHandler);\n this._target.removeEventListener('touchcancel',\n this._boundEventHandler);\n this._target = null;\n }\n\n _eventHandler(e) {\n let fn;\n\n e.stopPropagation();\n e.preventDefault();\n\n switch (e.type) {\n case 'touchstart':\n fn = this._touchStart;\n break;\n case 'touchmove':\n fn = this._touchMove;\n break;\n case 'touchend':\n case 'touchcancel':\n fn = this._touchEnd;\n break;\n }\n\n for (let i = 0; i < e.changedTouches.length; i++) {\n let touch = e.changedTouches[i];\n fn.call(this, touch.identifier, touch.clientX, touch.clientY);\n }\n }\n\n _touchStart(id, x, y) {\n // Ignore any new touches if there is already an active gesture,\n // or we're in a cleanup state\n if (this._hasDetectedGesture() || (this._state === GH_NOGESTURE)) {\n this._ignored.push(id);\n return;\n }\n\n // Did it take too long between touches that we should no longer\n // consider this a single gesture?\n if ((this._tracked.length > 0) &&\n ((Date.now() - this._tracked[0].started) > GH_MULTITOUCH_TIMEOUT)) {\n this._state = GH_NOGESTURE;\n this._ignored.push(id);\n return;\n }\n\n // If we're waiting for fingers to release then we should no longer\n // recognize new touches\n if (this._waitingRelease) {\n this._state = GH_NOGESTURE;\n this._ignored.push(id);\n return;\n }\n\n this._tracked.push({\n id: id,\n started: Date.now(),\n active: true,\n firstX: x,\n firstY: y,\n lastX: x,\n lastY: y,\n angle: 0\n });\n\n switch (this._tracked.length) {\n case 1:\n this._startLongpressTimeout();\n break;\n\n case 2:\n this._state &= ~(GH_ONETAP | GH_DRAG | GH_LONGPRESS);\n this._stopLongpressTimeout();\n break;\n\n case 3:\n this._state &= ~(GH_TWOTAP | GH_TWODRAG | GH_PINCH);\n break;\n\n default:\n this._state = GH_NOGESTURE;\n }\n }\n\n _touchMove(id, x, y) {\n let touch = this._tracked.find(t => t.id === id);\n\n // If this is an update for a touch we're not tracking, ignore it\n if (touch === undefined) {\n return;\n }\n\n // Update the touches last position with the event coordinates\n touch.lastX = x;\n touch.lastY = y;\n\n let deltaX = x - touch.firstX;\n let deltaY = y - touch.firstY;\n\n // Update angle when the touch has moved\n if ((touch.firstX !== touch.lastX) ||\n (touch.firstY !== touch.lastY)) {\n touch.angle = Math.atan2(deltaY, deltaX) * 180 / Math.PI;\n }\n\n if (!this._hasDetectedGesture()) {\n // Ignore moves smaller than the minimum threshold\n if (Math.hypot(deltaX, deltaY) < GH_MOVE_THRESHOLD) {\n return;\n }\n\n // Can't be a tap or long press as we've seen movement\n this._state &= ~(GH_ONETAP | GH_TWOTAP | GH_THREETAP | GH_LONGPRESS);\n this._stopLongpressTimeout();\n\n if (this._tracked.length !== 1) {\n this._state &= ~(GH_DRAG);\n }\n if (this._tracked.length !== 2) {\n this._state &= ~(GH_TWODRAG | GH_PINCH);\n }\n\n // We need to figure out which of our different two touch gestures\n // this might be\n if (this._tracked.length === 2) {\n\n // The other touch is the one where the id doesn't match\n let prevTouch = this._tracked.find(t => t.id !== id);\n\n // How far the previous touch point has moved since start\n let prevDeltaMove = Math.hypot(prevTouch.firstX - prevTouch.lastX,\n prevTouch.firstY - prevTouch.lastY);\n\n // We know that the current touch moved far enough,\n // but unless both touches moved further than their\n // threshold we don't want to disqualify any gestures\n if (prevDeltaMove > GH_MOVE_THRESHOLD) {\n\n // The angle difference between the direction of the touch points\n let deltaAngle = Math.abs(touch.angle - prevTouch.angle);\n deltaAngle = Math.abs(((deltaAngle + 180) % 360) - 180);\n\n // PINCH or TWODRAG can be eliminated depending on the angle\n if (deltaAngle > GH_ANGLE_THRESHOLD) {\n this._state &= ~GH_TWODRAG;\n } else {\n this._state &= ~GH_PINCH;\n }\n\n if (this._isTwoTouchTimeoutRunning()) {\n this._stopTwoTouchTimeout();\n }\n } else if (!this._isTwoTouchTimeoutRunning()) {\n // We can't determine the gesture right now, let's\n // wait and see if more events are on their way\n this._startTwoTouchTimeout();\n }\n }\n\n if (!this._hasDetectedGesture()) {\n return;\n }\n\n this._pushEvent('gesturestart');\n }\n\n this._pushEvent('gesturemove');\n }\n\n _touchEnd(id, x, y) {\n // Check if this is an ignored touch\n if (this._ignored.indexOf(id) !== -1) {\n // Remove this touch from ignored\n this._ignored.splice(this._ignored.indexOf(id), 1);\n\n // And reset the state if there are no more touches\n if ((this._ignored.length === 0) &&\n (this._tracked.length === 0)) {\n this._state = GH_INITSTATE;\n this._waitingRelease = false;\n }\n return;\n }\n\n // We got a touchend before the timer triggered,\n // this cannot result in a gesture anymore.\n if (!this._hasDetectedGesture() &&\n this._isTwoTouchTimeoutRunning()) {\n this._stopTwoTouchTimeout();\n this._state = GH_NOGESTURE;\n }\n\n // Some gestures don't trigger until a touch is released\n if (!this._hasDetectedGesture()) {\n // Can't be a gesture that relies on movement\n this._state &= ~(GH_DRAG | GH_TWODRAG | GH_PINCH);\n // Or something that relies on more time\n this._state &= ~GH_LONGPRESS;\n this._stopLongpressTimeout();\n\n if (!this._waitingRelease) {\n this._releaseStart = Date.now();\n this._waitingRelease = true;\n\n // Can't be a tap that requires more touches than we current have\n switch (this._tracked.length) {\n case 1:\n this._state &= ~(GH_TWOTAP | GH_THREETAP);\n break;\n\n case 2:\n this._state &= ~(GH_ONETAP | GH_THREETAP);\n break;\n }\n }\n }\n\n // Waiting for all touches to release? (i.e. some tap)\n if (this._waitingRelease) {\n // Were all touches released at roughly the same time?\n if ((Date.now() - this._releaseStart) > GH_MULTITOUCH_TIMEOUT) {\n this._state = GH_NOGESTURE;\n }\n\n // Did too long time pass between press and release?\n if (this._tracked.some(t => (Date.now() - t.started) > GH_TAP_TIMEOUT)) {\n this._state = GH_NOGESTURE;\n }\n\n let touch = this._tracked.find(t => t.id === id);\n touch.active = false;\n\n // Are we still waiting for more releases?\n if (this._hasDetectedGesture()) {\n this._pushEvent('gesturestart');\n } else {\n // Have we reached a dead end?\n if (this._state !== GH_NOGESTURE) {\n return;\n }\n }\n }\n\n if (this._hasDetectedGesture()) {\n this._pushEvent('gestureend');\n }\n\n // Ignore any remaining touches until they are ended\n for (let i = 0; i < this._tracked.length; i++) {\n if (this._tracked[i].active) {\n this._ignored.push(this._tracked[i].id);\n }\n }\n this._tracked = [];\n\n this._state = GH_NOGESTURE;\n\n // Remove this touch from ignored if it's in there\n if (this._ignored.indexOf(id) !== -1) {\n this._ignored.splice(this._ignored.indexOf(id), 1);\n }\n\n // We reset the state if ignored is empty\n if ((this._ignored.length === 0)) {\n this._state = GH_INITSTATE;\n this._waitingRelease = false;\n }\n }\n\n _hasDetectedGesture() {\n if (this._state === GH_NOGESTURE) {\n return false;\n }\n // Check to see if the bitmask value is a power of 2\n // (i.e. only one bit set). If it is, we have a state.\n if (this._state & (this._state - 1)) {\n return false;\n }\n\n // For taps we also need to have all touches released\n // before we've fully detected the gesture\n if (this._state & (GH_ONETAP | GH_TWOTAP | GH_THREETAP)) {\n if (this._tracked.some(t => t.active)) {\n return false;\n }\n }\n\n return true;\n }\n\n _startLongpressTimeout() {\n this._stopLongpressTimeout();\n this._longpressTimeoutId = setTimeout(() => this._longpressTimeout(),\n GH_LONGPRESS_TIMEOUT);\n }\n\n _stopLongpressTimeout() {\n clearTimeout(this._longpressTimeoutId);\n this._longpressTimeoutId = null;\n }\n\n _longpressTimeout() {\n if (this._hasDetectedGesture()) {\n throw new Error(\"A longpress gesture failed, conflict with a different gesture\");\n }\n\n this._state = GH_LONGPRESS;\n this._pushEvent('gesturestart');\n }\n\n _startTwoTouchTimeout() {\n this._stopTwoTouchTimeout();\n this._twoTouchTimeoutId = setTimeout(() => this._twoTouchTimeout(),\n GH_TWOTOUCH_TIMEOUT);\n }\n\n _stopTwoTouchTimeout() {\n clearTimeout(this._twoTouchTimeoutId);\n this._twoTouchTimeoutId = null;\n }\n\n _isTwoTouchTimeoutRunning() {\n return this._twoTouchTimeoutId !== null;\n }\n\n _twoTouchTimeout() {\n if (this._tracked.length === 0) {\n throw new Error(\"A pinch or two drag gesture failed, no tracked touches\");\n }\n\n // How far each touch point has moved since start\n let avgM = this._getAverageMovement();\n let avgMoveH = Math.abs(avgM.x);\n let avgMoveV = Math.abs(avgM.y);\n\n // The difference in the distance between where\n // the touch points started and where they are now\n let avgD = this._getAverageDistance();\n let deltaTouchDistance = Math.abs(Math.hypot(avgD.first.x, avgD.first.y) -\n Math.hypot(avgD.last.x, avgD.last.y));\n\n if ((avgMoveV < deltaTouchDistance) &&\n (avgMoveH < deltaTouchDistance)) {\n this._state = GH_PINCH;\n } else {\n this._state = GH_TWODRAG;\n }\n\n this._pushEvent('gesturestart');\n this._pushEvent('gesturemove');\n }\n\n _pushEvent(type) {\n let detail = { type: this._stateToGesture(this._state) };\n\n // For most gesture events the current (average) position is the\n // most useful\n let avg = this._getPosition();\n let pos = avg.last;\n\n // However we have a slight distance to detect gestures, so for the\n // first gesture event we want to use the first positions we saw\n if (type === 'gesturestart') {\n pos = avg.first;\n }\n\n // For these gestures, we always want the event coordinates\n // to be where the gesture began, not the current touch location.\n switch (this._state) {\n case GH_TWODRAG:\n case GH_PINCH:\n pos = avg.first;\n break;\n }\n\n detail['clientX'] = pos.x;\n detail['clientY'] = pos.y;\n\n // FIXME: other coordinates?\n\n // Some gestures also have a magnitude\n if (this._state === GH_PINCH) {\n let distance = this._getAverageDistance();\n if (type === 'gesturestart') {\n detail['magnitudeX'] = distance.first.x;\n detail['magnitudeY'] = distance.first.y;\n } else {\n detail['magnitudeX'] = distance.last.x;\n detail['magnitudeY'] = distance.last.y;\n }\n } else if (this._state === GH_TWODRAG) {\n if (type === 'gesturestart') {\n detail['magnitudeX'] = 0.0;\n detail['magnitudeY'] = 0.0;\n } else {\n let movement = this._getAverageMovement();\n detail['magnitudeX'] = movement.x;\n detail['magnitudeY'] = movement.y;\n }\n }\n\n let gev = new CustomEvent(type, { detail: detail });\n this._target.dispatchEvent(gev);\n }\n\n _stateToGesture(state) {\n switch (state) {\n case GH_ONETAP:\n return 'onetap';\n case GH_TWOTAP:\n return 'twotap';\n case GH_THREETAP:\n return 'threetap';\n case GH_DRAG:\n return 'drag';\n case GH_LONGPRESS:\n return 'longpress';\n case GH_TWODRAG:\n return 'twodrag';\n case GH_PINCH:\n return 'pinch';\n }\n\n throw new Error(\"Unknown gesture state: \" + state);\n }\n\n _getPosition() {\n if (this._tracked.length === 0) {\n throw new Error(\"Failed to get gesture position, no tracked touches\");\n }\n\n let size = this._tracked.length;\n let fx = 0, fy = 0, lx = 0, ly = 0;\n\n for (let i = 0; i < this._tracked.length; i++) {\n fx += this._tracked[i].firstX;\n fy += this._tracked[i].firstY;\n lx += this._tracked[i].lastX;\n ly += this._tracked[i].lastY;\n }\n\n return { first: { x: fx / size,\n y: fy / size },\n last: { x: lx / size,\n y: ly / size } };\n }\n\n _getAverageMovement() {\n if (this._tracked.length === 0) {\n throw new Error(\"Failed to get gesture movement, no tracked touches\");\n }\n\n let totalH, totalV;\n totalH = totalV = 0;\n let size = this._tracked.length;\n\n for (let i = 0; i < this._tracked.length; i++) {\n totalH += this._tracked[i].lastX - this._tracked[i].firstX;\n totalV += this._tracked[i].lastY - this._tracked[i].firstY;\n }\n\n return { x: totalH / size,\n y: totalV / size };\n }\n\n _getAverageDistance() {\n if (this._tracked.length === 0) {\n throw new Error(\"Failed to get gesture distance, no tracked touches\");\n }\n\n // Distance between the first and last tracked touches\n\n let first = this._tracked[0];\n let last = this._tracked[this._tracked.length - 1];\n\n let fdx = Math.abs(last.firstX - first.firstX);\n let fdy = Math.abs(last.firstY - first.firstY);\n\n let ldx = Math.abs(last.lastX - first.lastX);\n let ldy = Math.abs(last.lastY - first.lastY);\n\n return { first: { x: fdx, y: fdy },\n last: { x: ldx, y: ldy } };\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\nimport { supportsCursorURIs, isTouchDevice } from './browser.js';\n\nconst useFallback = !supportsCursorURIs || isTouchDevice;\n\nexport default class Cursor {\n constructor() {\n this._target = null;\n\n this._canvas = document.createElement('canvas');\n\n if (useFallback) {\n this._canvas.style.position = 'fixed';\n this._canvas.style.zIndex = '65535';\n this._canvas.style.pointerEvents = 'none';\n // Safari on iOS can select the cursor image\n // https://bugs.webkit.org/show_bug.cgi?id=249223\n this._canvas.style.userSelect = 'none';\n this._canvas.style.WebkitUserSelect = 'none';\n // Can't use \"display\" because of Firefox bug #1445997\n this._canvas.style.visibility = 'hidden';\n }\n\n this._position = { x: 0, y: 0 };\n this._hotSpot = { x: 0, y: 0 };\n\n this._eventHandlers = {\n 'mouseover': this._handleMouseOver.bind(this),\n 'mouseleave': this._handleMouseLeave.bind(this),\n 'mousemove': this._handleMouseMove.bind(this),\n 'mouseup': this._handleMouseUp.bind(this),\n };\n }\n\n attach(target) {\n if (this._target) {\n this.detach();\n }\n\n this._target = target;\n\n if (useFallback) {\n document.body.appendChild(this._canvas);\n\n const options = { capture: true, passive: true };\n this._target.addEventListener('mouseover', this._eventHandlers.mouseover, options);\n this._target.addEventListener('mouseleave', this._eventHandlers.mouseleave, options);\n this._target.addEventListener('mousemove', this._eventHandlers.mousemove, options);\n this._target.addEventListener('mouseup', this._eventHandlers.mouseup, options);\n }\n\n this.clear();\n }\n\n detach() {\n if (!this._target) {\n return;\n }\n\n if (useFallback) {\n const options = { capture: true, passive: true };\n this._target.removeEventListener('mouseover', this._eventHandlers.mouseover, options);\n this._target.removeEventListener('mouseleave', this._eventHandlers.mouseleave, options);\n this._target.removeEventListener('mousemove', this._eventHandlers.mousemove, options);\n this._target.removeEventListener('mouseup', this._eventHandlers.mouseup, options);\n\n document.body.removeChild(this._canvas);\n }\n\n this._target = null;\n }\n\n change(rgba, hotx, hoty, w, h) {\n if ((w === 0) || (h === 0)) {\n this.clear();\n return;\n }\n\n this._position.x = this._position.x + this._hotSpot.x - hotx;\n this._position.y = this._position.y + this._hotSpot.y - hoty;\n this._hotSpot.x = hotx;\n this._hotSpot.y = hoty;\n\n let ctx = this._canvas.getContext('2d');\n\n this._canvas.width = w;\n this._canvas.height = h;\n\n let img = new ImageData(new Uint8ClampedArray(rgba), w, h);\n ctx.clearRect(0, 0, w, h);\n ctx.putImageData(img, 0, 0);\n\n if (useFallback) {\n this._updatePosition();\n } else {\n let url = this._canvas.toDataURL();\n this._target.style.cursor = 'url(' + url + ')' + hotx + ' ' + hoty + ', default';\n }\n }\n\n clear() {\n this._target.style.cursor = 'none';\n this._canvas.width = 0;\n this._canvas.height = 0;\n this._position.x = this._position.x + this._hotSpot.x;\n this._position.y = this._position.y + this._hotSpot.y;\n this._hotSpot.x = 0;\n this._hotSpot.y = 0;\n }\n\n // Mouse events might be emulated, this allows\n // moving the cursor in such cases\n move(clientX, clientY) {\n if (!useFallback) {\n return;\n }\n // clientX/clientY are relative the _visual viewport_,\n // but our position is relative the _layout viewport_,\n // so try to compensate when we can\n if (window.visualViewport) {\n this._position.x = clientX + window.visualViewport.offsetLeft;\n this._position.y = clientY + window.visualViewport.offsetTop;\n } else {\n this._position.x = clientX;\n this._position.y = clientY;\n }\n this._updatePosition();\n let target = document.elementFromPoint(clientX, clientY);\n this._updateVisibility(target);\n }\n\n _handleMouseOver(event) {\n // This event could be because we're entering the target, or\n // moving around amongst its sub elements. Let the move handler\n // sort things out.\n this._handleMouseMove(event);\n }\n\n _handleMouseLeave(event) {\n // Check if we should show the cursor on the element we are leaving to\n this._updateVisibility(event.relatedTarget);\n }\n\n _handleMouseMove(event) {\n this._updateVisibility(event.target);\n\n this._position.x = event.clientX - this._hotSpot.x;\n this._position.y = event.clientY - this._hotSpot.y;\n\n this._updatePosition();\n }\n\n _handleMouseUp(event) {\n // We might get this event because of a drag operation that\n // moved outside of the target. Check what's under the cursor\n // now and adjust visibility based on that.\n let target = document.elementFromPoint(event.clientX, event.clientY);\n this._updateVisibility(target);\n\n // Captures end with a mouseup but we can't know the event order of\n // mouseup vs releaseCapture.\n //\n // In the cases when releaseCapture comes first, the code above is\n // enough.\n //\n // In the cases when the mouseup comes first, we need wait for the\n // browser to flush all events and then check again if the cursor\n // should be visible.\n if (this._captureIsActive()) {\n window.setTimeout(() => {\n // We might have detached at this point\n if (!this._target) {\n return;\n }\n // Refresh the target from elementFromPoint since queued events\n // might have altered the DOM\n target = document.elementFromPoint(event.clientX,\n event.clientY);\n this._updateVisibility(target);\n }, 0);\n }\n }\n\n _showCursor() {\n if (this._canvas.style.visibility === 'hidden') {\n this._canvas.style.visibility = '';\n }\n }\n\n _hideCursor() {\n if (this._canvas.style.visibility !== 'hidden') {\n this._canvas.style.visibility = 'hidden';\n }\n }\n\n // Should we currently display the cursor?\n // (i.e. are we over the target, or a child of the target without a\n // different cursor set)\n _shouldShowCursor(target) {\n if (!target) {\n return false;\n }\n // Easy case\n if (target === this._target) {\n return true;\n }\n // Other part of the DOM?\n if (!this._target.contains(target)) {\n return false;\n }\n // Has the child its own cursor?\n // FIXME: How can we tell that a sub element has an\n // explicit \"cursor: none;\"?\n if (window.getComputedStyle(target).cursor !== 'none') {\n return false;\n }\n return true;\n }\n\n _updateVisibility(target) {\n // When the cursor target has capture we want to show the cursor.\n // So, if a capture is active - look at the captured element instead.\n if (this._captureIsActive()) {\n target = document.captureElement;\n }\n if (this._shouldShowCursor(target)) {\n this._showCursor();\n } else {\n this._hideCursor();\n }\n }\n\n _updatePosition() {\n this._canvas.style.left = this._position.x + \"px\";\n this._canvas.style.top = this._position.y + \"px\";\n }\n\n _captureIsActive() {\n return document.captureElement &&\n document.documentElement.contains(document.captureElement);\n }\n}\n","/*\n * Websock: high-performance buffering wrapper\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * Websock is similar to the standard WebSocket / RTCDataChannel object\n * but with extra buffer handling.\n *\n * Websock has built-in receive queue buffering; the message event\n * does not contain actual data but is simply a notification that\n * there is new data available. Several rQ* methods are available to\n * read binary data off of the receive queue.\n */\n\nimport * as Log from './util/logging.js';\n\n// this has performance issues in some versions Chromium, and\n// doesn't gain a tremendous amount of performance increase in Firefox\n// at the moment. It may be valuable to turn it on in the future.\nconst MAX_RQ_GROW_SIZE = 40 * 1024 * 1024; // 40 MiB\n\n// Constants pulled from RTCDataChannelState enum\n// https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState#RTCDataChannelState_enum\nconst DataChannel = {\n CONNECTING: \"connecting\",\n OPEN: \"open\",\n CLOSING: \"closing\",\n CLOSED: \"closed\"\n};\n\nconst ReadyStates = {\n CONNECTING: [WebSocket.CONNECTING, DataChannel.CONNECTING],\n OPEN: [WebSocket.OPEN, DataChannel.OPEN],\n CLOSING: [WebSocket.CLOSING, DataChannel.CLOSING],\n CLOSED: [WebSocket.CLOSED, DataChannel.CLOSED],\n};\n\n// Properties a raw channel must have, WebSocket and RTCDataChannel are two examples\nconst rawChannelProps = [\n \"send\",\n \"close\",\n \"binaryType\",\n \"onerror\",\n \"onmessage\",\n \"onopen\",\n \"protocol\",\n \"readyState\",\n];\n\nexport default class Websock {\n constructor() {\n this._websocket = null; // WebSocket or RTCDataChannel object\n\n this._rQi = 0; // Receive queue index\n this._rQlen = 0; // Next write position in the receive queue\n this._rQbufferSize = 1024 * 1024 * 4; // Receive queue buffer size (4 MiB)\n // called in init: this._rQ = new Uint8Array(this._rQbufferSize);\n this._rQ = null; // Receive queue\n\n this._sQbufferSize = 1024 * 10; // 10 KiB\n // called in init: this._sQ = new Uint8Array(this._sQbufferSize);\n this._sQlen = 0;\n this._sQ = null; // Send queue\n\n this._eventHandlers = {\n message: () => {},\n open: () => {},\n close: () => {},\n error: () => {}\n };\n }\n\n // Getters and Setters\n\n get readyState() {\n let subState;\n\n if (this._websocket === null) {\n return \"unused\";\n }\n\n subState = this._websocket.readyState;\n\n if (ReadyStates.CONNECTING.includes(subState)) {\n return \"connecting\";\n } else if (ReadyStates.OPEN.includes(subState)) {\n return \"open\";\n } else if (ReadyStates.CLOSING.includes(subState)) {\n return \"closing\";\n } else if (ReadyStates.CLOSED.includes(subState)) {\n return \"closed\";\n }\n\n return \"unknown\";\n }\n\n get sQ() {\n return this._sQ;\n }\n\n get rQ() {\n return this._rQ;\n }\n\n get rQi() {\n return this._rQi;\n }\n\n set rQi(val) {\n this._rQi = val;\n }\n\n // Receive Queue\n get rQlen() {\n return this._rQlen - this._rQi;\n }\n\n rQpeek8() {\n return this._rQ[this._rQi];\n }\n\n rQskipBytes(bytes) {\n this._rQi += bytes;\n }\n\n rQshift8() {\n return this._rQshift(1);\n }\n\n rQshift16() {\n return this._rQshift(2);\n }\n\n rQshift32() {\n return this._rQshift(4);\n }\n\n // TODO(directxman12): test performance with these vs a DataView\n _rQshift(bytes) {\n let res = 0;\n for (let byte = bytes - 1; byte >= 0; byte--) {\n res += this._rQ[this._rQi++] << (byte * 8);\n }\n return res;\n }\n\n rQshiftStr(len) {\n if (typeof(len) === 'undefined') { len = this.rQlen; }\n let str = \"\";\n // Handle large arrays in steps to avoid long strings on the stack\n for (let i = 0; i < len; i += 4096) {\n let part = this.rQshiftBytes(Math.min(4096, len - i));\n str += String.fromCharCode.apply(null, part);\n }\n return str;\n }\n\n rQshiftBytes(len) {\n if (typeof(len) === 'undefined') { len = this.rQlen; }\n this._rQi += len;\n return new Uint8Array(this._rQ.buffer, this._rQi - len, len);\n }\n\n rQshiftTo(target, len) {\n if (len === undefined) { len = this.rQlen; }\n // TODO: make this just use set with views when using a ArrayBuffer to store the rQ\n target.set(new Uint8Array(this._rQ.buffer, this._rQi, len));\n this._rQi += len;\n }\n\n rQslice(start, end = this.rQlen) {\n return new Uint8Array(this._rQ.buffer, this._rQi + start, end - start);\n }\n\n // Check to see if we must wait for 'num' bytes (default to FBU.bytes)\n // to be available in the receive queue. Return true if we need to\n // wait (and possibly print a debug message), otherwise false.\n rQwait(msg, num, goback) {\n if (this.rQlen < num) {\n if (goback) {\n if (this._rQi < goback) {\n throw new Error(\"rQwait cannot backup \" + goback + \" bytes\");\n }\n this._rQi -= goback;\n }\n return true; // true means need more data\n }\n return false;\n }\n\n // Send Queue\n\n flush() {\n if (this._sQlen > 0 && this.readyState === 'open') {\n this._websocket.send(this._encodeMessage());\n this._sQlen = 0;\n }\n }\n\n send(arr) {\n this._sQ.set(arr, this._sQlen);\n this._sQlen += arr.length;\n this.flush();\n }\n\n sendString(str) {\n this.send(str.split('').map(chr => chr.charCodeAt(0)));\n }\n\n // Event Handlers\n off(evt) {\n this._eventHandlers[evt] = () => {};\n }\n\n on(evt, handler) {\n this._eventHandlers[evt] = handler;\n }\n\n _allocateBuffers() {\n this._rQ = new Uint8Array(this._rQbufferSize);\n this._sQ = new Uint8Array(this._sQbufferSize);\n }\n\n init() {\n this._allocateBuffers();\n this._rQi = 0;\n this._websocket = null;\n }\n\n open(uri, protocols) {\n this.attach(new WebSocket(uri, protocols));\n }\n\n attach(rawChannel) {\n this.init();\n\n // Must get object and class methods to be compatible with the tests.\n const channelProps = [...Object.keys(rawChannel), ...Object.getOwnPropertyNames(Object.getPrototypeOf(rawChannel))];\n for (let i = 0; i < rawChannelProps.length; i++) {\n const prop = rawChannelProps[i];\n if (channelProps.indexOf(prop) < 0) {\n throw new Error('Raw channel missing property: ' + prop);\n }\n }\n\n this._websocket = rawChannel;\n this._websocket.binaryType = \"arraybuffer\";\n this._websocket.onmessage = this._recvMessage.bind(this);\n\n this._websocket.onopen = () => {\n Log.Debug('>> WebSock.onopen');\n if (this._websocket.protocol) {\n Log.Info(\"Server choose sub-protocol: \" + this._websocket.protocol);\n }\n\n this._eventHandlers.open();\n Log.Debug(\"<< WebSock.onopen\");\n };\n\n this._websocket.onclose = (e) => {\n Log.Debug(\">> WebSock.onclose\");\n this._eventHandlers.close(e);\n Log.Debug(\"<< WebSock.onclose\");\n };\n\n this._websocket.onerror = (e) => {\n Log.Debug(\">> WebSock.onerror: \" + e);\n this._eventHandlers.error(e);\n Log.Debug(\"<< WebSock.onerror: \" + e);\n };\n }\n\n close() {\n if (this._websocket) {\n if (this.readyState === 'connecting' ||\n this.readyState === 'open') {\n Log.Info(\"Closing WebSocket connection\");\n this._websocket.close();\n }\n\n this._websocket.onmessage = () => {};\n }\n }\n\n // private methods\n _encodeMessage() {\n // Put in a binary arraybuffer\n // according to the spec, you can send ArrayBufferViews with the send method\n return new Uint8Array(this._sQ.buffer, 0, this._sQlen);\n }\n\n // We want to move all the unread data to the start of the queue,\n // e.g. compacting.\n // The function also expands the receive que if needed, and for\n // performance reasons we combine these two actions to avoid\n // unneccessary copying.\n _expandCompactRQ(minFit) {\n // if we're using less than 1/8th of the buffer even with the incoming bytes, compact in place\n // instead of resizing\n const requiredBufferSize = (this._rQlen - this._rQi + minFit) * 8;\n const resizeNeeded = this._rQbufferSize < requiredBufferSize;\n\n if (resizeNeeded) {\n // Make sure we always *at least* double the buffer size, and have at least space for 8x\n // the current amount of data\n this._rQbufferSize = Math.max(this._rQbufferSize * 2, requiredBufferSize);\n }\n\n // we don't want to grow unboundedly\n if (this._rQbufferSize > MAX_RQ_GROW_SIZE) {\n this._rQbufferSize = MAX_RQ_GROW_SIZE;\n if (this._rQbufferSize - this.rQlen < minFit) {\n throw new Error(\"Receive Queue buffer exceeded \" + MAX_RQ_GROW_SIZE + \" bytes, and the new message could not fit\");\n }\n }\n\n if (resizeNeeded) {\n const oldRQbuffer = this._rQ.buffer;\n this._rQ = new Uint8Array(this._rQbufferSize);\n this._rQ.set(new Uint8Array(oldRQbuffer, this._rQi, this._rQlen - this._rQi));\n } else {\n this._rQ.copyWithin(0, this._rQi, this._rQlen);\n }\n\n this._rQlen = this._rQlen - this._rQi;\n this._rQi = 0;\n }\n\n // push arraybuffer values onto the end of the receive que\n _DecodeMessage(data) {\n const u8 = new Uint8Array(data);\n if (u8.length > this._rQbufferSize - this._rQlen) {\n this._expandCompactRQ(u8.length);\n }\n this._rQ.set(u8, this._rQlen);\n this._rQlen += u8.length;\n }\n\n _recvMessage(e) {\n this._DecodeMessage(e.data);\n if (this.rQlen > 0) {\n this._eventHandlers.message();\n if (this._rQlen == this._rQi) {\n // All data has now been processed, this means we\n // can reset the receive queue.\n this._rQlen = 0;\n this._rQi = 0;\n }\n } else {\n Log.Debug(\"Ignoring empty message\");\n }\n }\n}\n","/*\n * Ported from Flashlight VNC ActionScript implementation:\n * http://www.wizhelp.com/flashlight-vnc/\n *\n * Full attribution follows:\n *\n * -------------------------------------------------------------------------\n *\n * This DES class has been extracted from package Acme.Crypto for use in VNC.\n * The unnecessary odd parity code has been removed.\n *\n * These changes are:\n * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n *\n\n * DesCipher - the DES encryption method\n *\n * The meat of this code is by Dave Zimmerman , and is:\n *\n * Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved.\n *\n * Permission to use, copy, modify, and distribute this software\n * and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and\n * without fee is hereby granted, provided that this copyright notice is kept\n * intact.\n *\n * WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY\n * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE\n * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR\n * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.\n *\n * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE\n * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE\n * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT\n * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE\n * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE\n * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE\n * PHYSICAL OR ENVIRONMENTAL DAMAGE (\"HIGH RISK ACTIVITIES\"). WIDGET WORKSHOP\n * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR\n * HIGH RISK ACTIVITIES.\n *\n *\n * The rest is:\n *\n * Copyright (C) 1996 by Jef Poskanzer . All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * Visit the ACME Labs Java page for up-to-date versions of this and other\n * fine Java utilities: http://www.acme.com/java/\n */\n\n/* eslint-disable comma-spacing */\n\n// Tables, permutations, S-boxes, etc.\nconst PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3,\n 25, 7,15, 6,26,19,12, 1,40,51,30,36,46,54,29,39,\n 50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ],\n totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28];\n\nconst z = 0x0;\nlet a,b,c,d,e,f;\na=1<<16; b=1<<24; c=a|b; d=1<<2; e=1<<10; f=d|e;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z|d,a|d,b|z,b|e,a|z,c|e,z|f,a|f,c|e,\n z|f,b|d,c|f,c|z,a|e,z|z,z|d,c|f,z|z,a|f,c|z,z|e,b|d,b|e,z|e,a|d];\na=1<<18; b=1<<28; c=a|b; d=1<<6; e=1<<12; f=d|e;\nconst SP8 = [b|f,z|e,a|z,c|f,b|z,b|f,z|d,b|z,a|d,c|z,c|f,a|e,c|e,a|f,z|e,z|d,\n c|z,b|d,b|e,z|f,a|e,a|d,c|d,c|e,z|f,z|z,z|z,c|d,b|d,b|e,a|f,a|z,\n a|f,a|z,c|e,z|e,z|d,c|d,z|e,a|f,b|e,z|d,b|d,c|z,c|d,b|z,a|z,b|f,\n z|z,c|f,a|d,b|d,c|z,b|e,b|f,z|z,c|f,a|e,a|e,z|f,z|f,a|d,b|z,c|e];\n\n/* eslint-enable comma-spacing */\n\nexport default class DES {\n constructor(password) {\n this.keys = [];\n\n // Set the key.\n const pc1m = [], pcr = [], kn = [];\n\n for (let j = 0, l = 56; j < 56; ++j, l -= 8) {\n l += l < -5 ? 65 : l < -3 ? 31 : l < -1 ? 63 : l === 27 ? 35 : 0; // PC1\n const m = l & 0x7;\n pc1m[j] = ((password[l >>> 3] & (1<>> 10;\n this.keys[KnLi] |= (raw1 & 0x00000fc0) >>> 6;\n ++KnLi;\n this.keys[KnLi] = (raw0 & 0x0003f000) << 12;\n this.keys[KnLi] |= (raw0 & 0x0000003f) << 16;\n this.keys[KnLi] |= (raw1 & 0x0003f000) >>> 4;\n this.keys[KnLi] |= (raw1 & 0x0000003f);\n ++KnLi;\n }\n }\n\n // Encrypt 8 bytes of text\n enc8(text) {\n const b = text.slice();\n let i = 0, l, r, x; // left, right, accumulator\n\n // Squash 8 bytes to 2 ints\n l = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];\n r = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];\n\n x = ((l >>> 4) ^ r) & 0x0f0f0f0f;\n r ^= x;\n l ^= (x << 4);\n x = ((l >>> 16) ^ r) & 0x0000ffff;\n r ^= x;\n l ^= (x << 16);\n x = ((r >>> 2) ^ l) & 0x33333333;\n l ^= x;\n r ^= (x << 2);\n x = ((r >>> 8) ^ l) & 0x00ff00ff;\n l ^= x;\n r ^= (x << 8);\n r = (r << 1) | ((r >>> 31) & 1);\n x = (l ^ r) & 0xaaaaaaaa;\n l ^= x;\n r ^= x;\n l = (l << 1) | ((l >>> 31) & 1);\n\n for (let i = 0, keysi = 0; i < 8; ++i) {\n x = (r << 28) | (r >>> 4);\n x ^= this.keys[keysi++];\n let fval = SP7[x & 0x3f];\n fval |= SP5[(x >>> 8) & 0x3f];\n fval |= SP3[(x >>> 16) & 0x3f];\n fval |= SP1[(x >>> 24) & 0x3f];\n x = r ^ this.keys[keysi++];\n fval |= SP8[x & 0x3f];\n fval |= SP6[(x >>> 8) & 0x3f];\n fval |= SP4[(x >>> 16) & 0x3f];\n fval |= SP2[(x >>> 24) & 0x3f];\n l ^= fval;\n x = (l << 28) | (l >>> 4);\n x ^= this.keys[keysi++];\n fval = SP7[x & 0x3f];\n fval |= SP5[(x >>> 8) & 0x3f];\n fval |= SP3[(x >>> 16) & 0x3f];\n fval |= SP1[(x >>> 24) & 0x3f];\n x = l ^ this.keys[keysi++];\n fval |= SP8[x & 0x0000003f];\n fval |= SP6[(x >>> 8) & 0x3f];\n fval |= SP4[(x >>> 16) & 0x3f];\n fval |= SP2[(x >>> 24) & 0x3f];\n r ^= fval;\n }\n\n r = (r << 31) | (r >>> 1);\n x = (l ^ r) & 0xaaaaaaaa;\n l ^= x;\n r ^= x;\n l = (l << 31) | (l >>> 1);\n x = ((l >>> 8) ^ r) & 0x00ff00ff;\n r ^= x;\n l ^= (x << 8);\n x = ((l >>> 2) ^ r) & 0x33333333;\n r ^= x;\n l ^= (x << 2);\n x = ((r >>> 16) ^ l) & 0x0000ffff;\n l ^= x;\n r ^= (x << 16);\n x = ((r >>> 4) ^ l) & 0x0f0f0f0f;\n l ^= x;\n r ^= (x << 4);\n\n // Spread ints to bytes\n x = [r, l];\n for (i = 0; i < 8; i++) {\n b[i] = (x[i>>>2] >>> (8 * (3 - (i % 4)))) % 256;\n if (b[i] < 0) { b[i] += 256; } // unsigned\n }\n return b;\n }\n\n // Encrypt 16 bytes of text using passwd as key\n encrypt(t) {\n return this.enc8(t.slice(0, 8)).concat(this.enc8(t.slice(8, 16)));\n }\n}\n","/*\n * This file is auto-generated from keymaps.csv\n * Database checksum sha256(76d68c10e97d37fe2ea459e210125ae41796253fb217e900bf2983ade13a7920)\n * To re-generate, run:\n * keymap-gen code-map --lang=js keymaps.csv html atset1\n*/\nexport default {\n \"Again\": 0xe005, /* html:Again (Again) -> linux:129 (KEY_AGAIN) -> atset1:57349 */\n \"AltLeft\": 0x38, /* html:AltLeft (AltLeft) -> linux:56 (KEY_LEFTALT) -> atset1:56 */\n \"AltRight\": 0xe038, /* html:AltRight (AltRight) -> linux:100 (KEY_RIGHTALT) -> atset1:57400 */\n \"ArrowDown\": 0xe050, /* html:ArrowDown (ArrowDown) -> linux:108 (KEY_DOWN) -> atset1:57424 */\n \"ArrowLeft\": 0xe04b, /* html:ArrowLeft (ArrowLeft) -> linux:105 (KEY_LEFT) -> atset1:57419 */\n \"ArrowRight\": 0xe04d, /* html:ArrowRight (ArrowRight) -> linux:106 (KEY_RIGHT) -> atset1:57421 */\n \"ArrowUp\": 0xe048, /* html:ArrowUp (ArrowUp) -> linux:103 (KEY_UP) -> atset1:57416 */\n \"AudioVolumeDown\": 0xe02e, /* html:AudioVolumeDown (AudioVolumeDown) -> linux:114 (KEY_VOLUMEDOWN) -> atset1:57390 */\n \"AudioVolumeMute\": 0xe020, /* html:AudioVolumeMute (AudioVolumeMute) -> linux:113 (KEY_MUTE) -> atset1:57376 */\n \"AudioVolumeUp\": 0xe030, /* html:AudioVolumeUp (AudioVolumeUp) -> linux:115 (KEY_VOLUMEUP) -> atset1:57392 */\n \"Backquote\": 0x29, /* html:Backquote (Backquote) -> linux:41 (KEY_GRAVE) -> atset1:41 */\n \"Backslash\": 0x2b, /* html:Backslash (Backslash) -> linux:43 (KEY_BACKSLASH) -> atset1:43 */\n \"Backspace\": 0xe, /* html:Backspace (Backspace) -> linux:14 (KEY_BACKSPACE) -> atset1:14 */\n \"BracketLeft\": 0x1a, /* html:BracketLeft (BracketLeft) -> linux:26 (KEY_LEFTBRACE) -> atset1:26 */\n \"BracketRight\": 0x1b, /* html:BracketRight (BracketRight) -> linux:27 (KEY_RIGHTBRACE) -> atset1:27 */\n \"BrowserBack\": 0xe06a, /* html:BrowserBack (BrowserBack) -> linux:158 (KEY_BACK) -> atset1:57450 */\n \"BrowserFavorites\": 0xe066, /* html:BrowserFavorites (BrowserFavorites) -> linux:156 (KEY_BOOKMARKS) -> atset1:57446 */\n \"BrowserForward\": 0xe069, /* html:BrowserForward (BrowserForward) -> linux:159 (KEY_FORWARD) -> atset1:57449 */\n \"BrowserHome\": 0xe032, /* html:BrowserHome (BrowserHome) -> linux:172 (KEY_HOMEPAGE) -> atset1:57394 */\n \"BrowserRefresh\": 0xe067, /* html:BrowserRefresh (BrowserRefresh) -> linux:173 (KEY_REFRESH) -> atset1:57447 */\n \"BrowserSearch\": 0xe065, /* html:BrowserSearch (BrowserSearch) -> linux:217 (KEY_SEARCH) -> atset1:57445 */\n \"BrowserStop\": 0xe068, /* html:BrowserStop (BrowserStop) -> linux:128 (KEY_STOP) -> atset1:57448 */\n \"CapsLock\": 0x3a, /* html:CapsLock (CapsLock) -> linux:58 (KEY_CAPSLOCK) -> atset1:58 */\n \"Comma\": 0x33, /* html:Comma (Comma) -> linux:51 (KEY_COMMA) -> atset1:51 */\n \"ContextMenu\": 0xe05d, /* html:ContextMenu (ContextMenu) -> linux:127 (KEY_COMPOSE) -> atset1:57437 */\n \"ControlLeft\": 0x1d, /* html:ControlLeft (ControlLeft) -> linux:29 (KEY_LEFTCTRL) -> atset1:29 */\n \"ControlRight\": 0xe01d, /* html:ControlRight (ControlRight) -> linux:97 (KEY_RIGHTCTRL) -> atset1:57373 */\n \"Convert\": 0x79, /* html:Convert (Convert) -> linux:92 (KEY_HENKAN) -> atset1:121 */\n \"Copy\": 0xe078, /* html:Copy (Copy) -> linux:133 (KEY_COPY) -> atset1:57464 */\n \"Cut\": 0xe03c, /* html:Cut (Cut) -> linux:137 (KEY_CUT) -> atset1:57404 */\n \"Delete\": 0xe053, /* html:Delete (Delete) -> linux:111 (KEY_DELETE) -> atset1:57427 */\n \"Digit0\": 0xb, /* html:Digit0 (Digit0) -> linux:11 (KEY_0) -> atset1:11 */\n \"Digit1\": 0x2, /* html:Digit1 (Digit1) -> linux:2 (KEY_1) -> atset1:2 */\n \"Digit2\": 0x3, /* html:Digit2 (Digit2) -> linux:3 (KEY_2) -> atset1:3 */\n \"Digit3\": 0x4, /* html:Digit3 (Digit3) -> linux:4 (KEY_3) -> atset1:4 */\n \"Digit4\": 0x5, /* html:Digit4 (Digit4) -> linux:5 (KEY_4) -> atset1:5 */\n \"Digit5\": 0x6, /* html:Digit5 (Digit5) -> linux:6 (KEY_5) -> atset1:6 */\n \"Digit6\": 0x7, /* html:Digit6 (Digit6) -> linux:7 (KEY_6) -> atset1:7 */\n \"Digit7\": 0x8, /* html:Digit7 (Digit7) -> linux:8 (KEY_7) -> atset1:8 */\n \"Digit8\": 0x9, /* html:Digit8 (Digit8) -> linux:9 (KEY_8) -> atset1:9 */\n \"Digit9\": 0xa, /* html:Digit9 (Digit9) -> linux:10 (KEY_9) -> atset1:10 */\n \"Eject\": 0xe07d, /* html:Eject (Eject) -> linux:162 (KEY_EJECTCLOSECD) -> atset1:57469 */\n \"End\": 0xe04f, /* html:End (End) -> linux:107 (KEY_END) -> atset1:57423 */\n \"Enter\": 0x1c, /* html:Enter (Enter) -> linux:28 (KEY_ENTER) -> atset1:28 */\n \"Equal\": 0xd, /* html:Equal (Equal) -> linux:13 (KEY_EQUAL) -> atset1:13 */\n \"Escape\": 0x1, /* html:Escape (Escape) -> linux:1 (KEY_ESC) -> atset1:1 */\n \"F1\": 0x3b, /* html:F1 (F1) -> linux:59 (KEY_F1) -> atset1:59 */\n \"F10\": 0x44, /* html:F10 (F10) -> linux:68 (KEY_F10) -> atset1:68 */\n \"F11\": 0x57, /* html:F11 (F11) -> linux:87 (KEY_F11) -> atset1:87 */\n \"F12\": 0x58, /* html:F12 (F12) -> linux:88 (KEY_F12) -> atset1:88 */\n \"F13\": 0x5d, /* html:F13 (F13) -> linux:183 (KEY_F13) -> atset1:93 */\n \"F14\": 0x5e, /* html:F14 (F14) -> linux:184 (KEY_F14) -> atset1:94 */\n \"F15\": 0x5f, /* html:F15 (F15) -> linux:185 (KEY_F15) -> atset1:95 */\n \"F16\": 0x55, /* html:F16 (F16) -> linux:186 (KEY_F16) -> atset1:85 */\n \"F17\": 0xe003, /* html:F17 (F17) -> linux:187 (KEY_F17) -> atset1:57347 */\n \"F18\": 0xe077, /* html:F18 (F18) -> linux:188 (KEY_F18) -> atset1:57463 */\n \"F19\": 0xe004, /* html:F19 (F19) -> linux:189 (KEY_F19) -> atset1:57348 */\n \"F2\": 0x3c, /* html:F2 (F2) -> linux:60 (KEY_F2) -> atset1:60 */\n \"F20\": 0x5a, /* html:F20 (F20) -> linux:190 (KEY_F20) -> atset1:90 */\n \"F21\": 0x74, /* html:F21 (F21) -> linux:191 (KEY_F21) -> atset1:116 */\n \"F22\": 0xe079, /* html:F22 (F22) -> linux:192 (KEY_F22) -> atset1:57465 */\n \"F23\": 0x6d, /* html:F23 (F23) -> linux:193 (KEY_F23) -> atset1:109 */\n \"F24\": 0x6f, /* html:F24 (F24) -> linux:194 (KEY_F24) -> atset1:111 */\n \"F3\": 0x3d, /* html:F3 (F3) -> linux:61 (KEY_F3) -> atset1:61 */\n \"F4\": 0x3e, /* html:F4 (F4) -> linux:62 (KEY_F4) -> atset1:62 */\n \"F5\": 0x3f, /* html:F5 (F5) -> linux:63 (KEY_F5) -> atset1:63 */\n \"F6\": 0x40, /* html:F6 (F6) -> linux:64 (KEY_F6) -> atset1:64 */\n \"F7\": 0x41, /* html:F7 (F7) -> linux:65 (KEY_F7) -> atset1:65 */\n \"F8\": 0x42, /* html:F8 (F8) -> linux:66 (KEY_F8) -> atset1:66 */\n \"F9\": 0x43, /* html:F9 (F9) -> linux:67 (KEY_F9) -> atset1:67 */\n \"Find\": 0xe041, /* html:Find (Find) -> linux:136 (KEY_FIND) -> atset1:57409 */\n \"Help\": 0xe075, /* html:Help (Help) -> linux:138 (KEY_HELP) -> atset1:57461 */\n \"Hiragana\": 0x77, /* html:Hiragana (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */\n \"Home\": 0xe047, /* html:Home (Home) -> linux:102 (KEY_HOME) -> atset1:57415 */\n \"Insert\": 0xe052, /* html:Insert (Insert) -> linux:110 (KEY_INSERT) -> atset1:57426 */\n \"IntlBackslash\": 0x56, /* html:IntlBackslash (IntlBackslash) -> linux:86 (KEY_102ND) -> atset1:86 */\n \"IntlRo\": 0x73, /* html:IntlRo (IntlRo) -> linux:89 (KEY_RO) -> atset1:115 */\n \"IntlYen\": 0x7d, /* html:IntlYen (IntlYen) -> linux:124 (KEY_YEN) -> atset1:125 */\n \"KanaMode\": 0x70, /* html:KanaMode (KanaMode) -> linux:93 (KEY_KATAKANAHIRAGANA) -> atset1:112 */\n \"Katakana\": 0x78, /* html:Katakana (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */\n \"KeyA\": 0x1e, /* html:KeyA (KeyA) -> linux:30 (KEY_A) -> atset1:30 */\n \"KeyB\": 0x30, /* html:KeyB (KeyB) -> linux:48 (KEY_B) -> atset1:48 */\n \"KeyC\": 0x2e, /* html:KeyC (KeyC) -> linux:46 (KEY_C) -> atset1:46 */\n \"KeyD\": 0x20, /* html:KeyD (KeyD) -> linux:32 (KEY_D) -> atset1:32 */\n \"KeyE\": 0x12, /* html:KeyE (KeyE) -> linux:18 (KEY_E) -> atset1:18 */\n \"KeyF\": 0x21, /* html:KeyF (KeyF) -> linux:33 (KEY_F) -> atset1:33 */\n \"KeyG\": 0x22, /* html:KeyG (KeyG) -> linux:34 (KEY_G) -> atset1:34 */\n \"KeyH\": 0x23, /* html:KeyH (KeyH) -> linux:35 (KEY_H) -> atset1:35 */\n \"KeyI\": 0x17, /* html:KeyI (KeyI) -> linux:23 (KEY_I) -> atset1:23 */\n \"KeyJ\": 0x24, /* html:KeyJ (KeyJ) -> linux:36 (KEY_J) -> atset1:36 */\n \"KeyK\": 0x25, /* html:KeyK (KeyK) -> linux:37 (KEY_K) -> atset1:37 */\n \"KeyL\": 0x26, /* html:KeyL (KeyL) -> linux:38 (KEY_L) -> atset1:38 */\n \"KeyM\": 0x32, /* html:KeyM (KeyM) -> linux:50 (KEY_M) -> atset1:50 */\n \"KeyN\": 0x31, /* html:KeyN (KeyN) -> linux:49 (KEY_N) -> atset1:49 */\n \"KeyO\": 0x18, /* html:KeyO (KeyO) -> linux:24 (KEY_O) -> atset1:24 */\n \"KeyP\": 0x19, /* html:KeyP (KeyP) -> linux:25 (KEY_P) -> atset1:25 */\n \"KeyQ\": 0x10, /* html:KeyQ (KeyQ) -> linux:16 (KEY_Q) -> atset1:16 */\n \"KeyR\": 0x13, /* html:KeyR (KeyR) -> linux:19 (KEY_R) -> atset1:19 */\n \"KeyS\": 0x1f, /* html:KeyS (KeyS) -> linux:31 (KEY_S) -> atset1:31 */\n \"KeyT\": 0x14, /* html:KeyT (KeyT) -> linux:20 (KEY_T) -> atset1:20 */\n \"KeyU\": 0x16, /* html:KeyU (KeyU) -> linux:22 (KEY_U) -> atset1:22 */\n \"KeyV\": 0x2f, /* html:KeyV (KeyV) -> linux:47 (KEY_V) -> atset1:47 */\n \"KeyW\": 0x11, /* html:KeyW (KeyW) -> linux:17 (KEY_W) -> atset1:17 */\n \"KeyX\": 0x2d, /* html:KeyX (KeyX) -> linux:45 (KEY_X) -> atset1:45 */\n \"KeyY\": 0x15, /* html:KeyY (KeyY) -> linux:21 (KEY_Y) -> atset1:21 */\n \"KeyZ\": 0x2c, /* html:KeyZ (KeyZ) -> linux:44 (KEY_Z) -> atset1:44 */\n \"Lang1\": 0x72, /* html:Lang1 (Lang1) -> linux:122 (KEY_HANGEUL) -> atset1:114 */\n \"Lang2\": 0x71, /* html:Lang2 (Lang2) -> linux:123 (KEY_HANJA) -> atset1:113 */\n \"Lang3\": 0x78, /* html:Lang3 (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */\n \"Lang4\": 0x77, /* html:Lang4 (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */\n \"Lang5\": 0x76, /* html:Lang5 (Lang5) -> linux:85 (KEY_ZENKAKUHANKAKU) -> atset1:118 */\n \"LaunchApp1\": 0xe06b, /* html:LaunchApp1 (LaunchApp1) -> linux:157 (KEY_COMPUTER) -> atset1:57451 */\n \"LaunchApp2\": 0xe021, /* html:LaunchApp2 (LaunchApp2) -> linux:140 (KEY_CALC) -> atset1:57377 */\n \"LaunchMail\": 0xe06c, /* html:LaunchMail (LaunchMail) -> linux:155 (KEY_MAIL) -> atset1:57452 */\n \"MediaPlayPause\": 0xe022, /* html:MediaPlayPause (MediaPlayPause) -> linux:164 (KEY_PLAYPAUSE) -> atset1:57378 */\n \"MediaSelect\": 0xe06d, /* html:MediaSelect (MediaSelect) -> linux:226 (KEY_MEDIA) -> atset1:57453 */\n \"MediaStop\": 0xe024, /* html:MediaStop (MediaStop) -> linux:166 (KEY_STOPCD) -> atset1:57380 */\n \"MediaTrackNext\": 0xe019, /* html:MediaTrackNext (MediaTrackNext) -> linux:163 (KEY_NEXTSONG) -> atset1:57369 */\n \"MediaTrackPrevious\": 0xe010, /* html:MediaTrackPrevious (MediaTrackPrevious) -> linux:165 (KEY_PREVIOUSSONG) -> atset1:57360 */\n \"MetaLeft\": 0xe05b, /* html:MetaLeft (MetaLeft) -> linux:125 (KEY_LEFTMETA) -> atset1:57435 */\n \"MetaRight\": 0xe05c, /* html:MetaRight (MetaRight) -> linux:126 (KEY_RIGHTMETA) -> atset1:57436 */\n \"Minus\": 0xc, /* html:Minus (Minus) -> linux:12 (KEY_MINUS) -> atset1:12 */\n \"NonConvert\": 0x7b, /* html:NonConvert (NonConvert) -> linux:94 (KEY_MUHENKAN) -> atset1:123 */\n \"NumLock\": 0x45, /* html:NumLock (NumLock) -> linux:69 (KEY_NUMLOCK) -> atset1:69 */\n \"Numpad0\": 0x52, /* html:Numpad0 (Numpad0) -> linux:82 (KEY_KP0) -> atset1:82 */\n \"Numpad1\": 0x4f, /* html:Numpad1 (Numpad1) -> linux:79 (KEY_KP1) -> atset1:79 */\n \"Numpad2\": 0x50, /* html:Numpad2 (Numpad2) -> linux:80 (KEY_KP2) -> atset1:80 */\n \"Numpad3\": 0x51, /* html:Numpad3 (Numpad3) -> linux:81 (KEY_KP3) -> atset1:81 */\n \"Numpad4\": 0x4b, /* html:Numpad4 (Numpad4) -> linux:75 (KEY_KP4) -> atset1:75 */\n \"Numpad5\": 0x4c, /* html:Numpad5 (Numpad5) -> linux:76 (KEY_KP5) -> atset1:76 */\n \"Numpad6\": 0x4d, /* html:Numpad6 (Numpad6) -> linux:77 (KEY_KP6) -> atset1:77 */\n \"Numpad7\": 0x47, /* html:Numpad7 (Numpad7) -> linux:71 (KEY_KP7) -> atset1:71 */\n \"Numpad8\": 0x48, /* html:Numpad8 (Numpad8) -> linux:72 (KEY_KP8) -> atset1:72 */\n \"Numpad9\": 0x49, /* html:Numpad9 (Numpad9) -> linux:73 (KEY_KP9) -> atset1:73 */\n \"NumpadAdd\": 0x4e, /* html:NumpadAdd (NumpadAdd) -> linux:78 (KEY_KPPLUS) -> atset1:78 */\n \"NumpadComma\": 0x7e, /* html:NumpadComma (NumpadComma) -> linux:121 (KEY_KPCOMMA) -> atset1:126 */\n \"NumpadDecimal\": 0x53, /* html:NumpadDecimal (NumpadDecimal) -> linux:83 (KEY_KPDOT) -> atset1:83 */\n \"NumpadDivide\": 0xe035, /* html:NumpadDivide (NumpadDivide) -> linux:98 (KEY_KPSLASH) -> atset1:57397 */\n \"NumpadEnter\": 0xe01c, /* html:NumpadEnter (NumpadEnter) -> linux:96 (KEY_KPENTER) -> atset1:57372 */\n \"NumpadEqual\": 0x59, /* html:NumpadEqual (NumpadEqual) -> linux:117 (KEY_KPEQUAL) -> atset1:89 */\n \"NumpadMultiply\": 0x37, /* html:NumpadMultiply (NumpadMultiply) -> linux:55 (KEY_KPASTERISK) -> atset1:55 */\n \"NumpadParenLeft\": 0xe076, /* html:NumpadParenLeft (NumpadParenLeft) -> linux:179 (KEY_KPLEFTPAREN) -> atset1:57462 */\n \"NumpadParenRight\": 0xe07b, /* html:NumpadParenRight (NumpadParenRight) -> linux:180 (KEY_KPRIGHTPAREN) -> atset1:57467 */\n \"NumpadSubtract\": 0x4a, /* html:NumpadSubtract (NumpadSubtract) -> linux:74 (KEY_KPMINUS) -> atset1:74 */\n \"Open\": 0x64, /* html:Open (Open) -> linux:134 (KEY_OPEN) -> atset1:100 */\n \"PageDown\": 0xe051, /* html:PageDown (PageDown) -> linux:109 (KEY_PAGEDOWN) -> atset1:57425 */\n \"PageUp\": 0xe049, /* html:PageUp (PageUp) -> linux:104 (KEY_PAGEUP) -> atset1:57417 */\n \"Paste\": 0x65, /* html:Paste (Paste) -> linux:135 (KEY_PASTE) -> atset1:101 */\n \"Pause\": 0xe046, /* html:Pause (Pause) -> linux:119 (KEY_PAUSE) -> atset1:57414 */\n \"Period\": 0x34, /* html:Period (Period) -> linux:52 (KEY_DOT) -> atset1:52 */\n \"Power\": 0xe05e, /* html:Power (Power) -> linux:116 (KEY_POWER) -> atset1:57438 */\n \"PrintScreen\": 0x54, /* html:PrintScreen (PrintScreen) -> linux:99 (KEY_SYSRQ) -> atset1:84 */\n \"Props\": 0xe006, /* html:Props (Props) -> linux:130 (KEY_PROPS) -> atset1:57350 */\n \"Quote\": 0x28, /* html:Quote (Quote) -> linux:40 (KEY_APOSTROPHE) -> atset1:40 */\n \"ScrollLock\": 0x46, /* html:ScrollLock (ScrollLock) -> linux:70 (KEY_SCROLLLOCK) -> atset1:70 */\n \"Semicolon\": 0x27, /* html:Semicolon (Semicolon) -> linux:39 (KEY_SEMICOLON) -> atset1:39 */\n \"ShiftLeft\": 0x2a, /* html:ShiftLeft (ShiftLeft) -> linux:42 (KEY_LEFTSHIFT) -> atset1:42 */\n \"ShiftRight\": 0x36, /* html:ShiftRight (ShiftRight) -> linux:54 (KEY_RIGHTSHIFT) -> atset1:54 */\n \"Slash\": 0x35, /* html:Slash (Slash) -> linux:53 (KEY_SLASH) -> atset1:53 */\n \"Sleep\": 0xe05f, /* html:Sleep (Sleep) -> linux:142 (KEY_SLEEP) -> atset1:57439 */\n \"Space\": 0x39, /* html:Space (Space) -> linux:57 (KEY_SPACE) -> atset1:57 */\n \"Suspend\": 0xe025, /* html:Suspend (Suspend) -> linux:205 (KEY_SUSPEND) -> atset1:57381 */\n \"Tab\": 0xf, /* html:Tab (Tab) -> linux:15 (KEY_TAB) -> atset1:15 */\n \"Undo\": 0xe007, /* html:Undo (Undo) -> linux:131 (KEY_UNDO) -> atset1:57351 */\n \"WakeUp\": 0xe063, /* html:WakeUp (WakeUp) -> linux:143 (KEY_WAKEUP) -> atset1:57443 */\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nexport const encodings = {\n encodingRaw: 0,\n encodingCopyRect: 1,\n encodingRRE: 2,\n encodingHextile: 5,\n encodingTight: 7,\n encodingZRLE: 16,\n encodingTightPNG: -260,\n encodingJPEG: 21,\n\n pseudoEncodingQualityLevel9: -23,\n pseudoEncodingQualityLevel0: -32,\n pseudoEncodingDesktopSize: -223,\n pseudoEncodingLastRect: -224,\n pseudoEncodingCursor: -239,\n pseudoEncodingQEMUExtendedKeyEvent: -258,\n pseudoEncodingDesktopName: -307,\n pseudoEncodingExtendedDesktopSize: -308,\n pseudoEncodingXvp: -309,\n pseudoEncodingFence: -312,\n pseudoEncodingContinuousUpdates: -313,\n pseudoEncodingCompressLevel9: -247,\n pseudoEncodingCompressLevel0: -256,\n pseudoEncodingVMwareCursor: 0x574d5664,\n pseudoEncodingExtendedClipboard: 0xc0a1e5ce\n};\n\nexport function encodingName(num) {\n switch (num) {\n case encodings.encodingRaw: return \"Raw\";\n case encodings.encodingCopyRect: return \"CopyRect\";\n case encodings.encodingRRE: return \"RRE\";\n case encodings.encodingHextile: return \"Hextile\";\n case encodings.encodingTight: return \"Tight\";\n case encodings.encodingZRLE: return \"ZRLE\";\n case encodings.encodingTightPNG: return \"TightPNG\";\n case encodings.encodingJPEG: return \"JPEG\";\n default: return \"[unknown encoding \" + num + \"]\";\n }\n}\n","import Base64 from './base64.js';\nimport { encodeUTF8 } from './util/strings.js';\nimport EventTargetMixin from './util/eventtarget.js';\n\nexport class AESEAXCipher {\n constructor() {\n this._rawKey = null;\n this._ctrKey = null;\n this._cbcKey = null;\n this._zeroBlock = new Uint8Array(16);\n this._prefixBlock0 = this._zeroBlock;\n this._prefixBlock1 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);\n this._prefixBlock2 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]);\n }\n\n async _encryptBlock(block) {\n const encrypted = await window.crypto.subtle.encrypt({\n name: \"AES-CBC\",\n iv: this._zeroBlock,\n }, this._cbcKey, block);\n return new Uint8Array(encrypted).slice(0, 16);\n }\n\n async _initCMAC() {\n const k1 = await this._encryptBlock(this._zeroBlock);\n const k2 = new Uint8Array(16);\n const v = k1[0] >>> 6;\n for (let i = 0; i < 15; i++) {\n k2[i] = (k1[i + 1] >> 6) | (k1[i] << 2);\n k1[i] = (k1[i + 1] >> 7) | (k1[i] << 1);\n }\n const lut = [0x0, 0x87, 0x0e, 0x89];\n k2[14] ^= v >>> 1;\n k2[15] = (k1[15] << 2) ^ lut[v];\n k1[15] = (k1[15] << 1) ^ lut[v >> 1];\n this._k1 = k1;\n this._k2 = k2;\n }\n\n async _encryptCTR(data, counter) {\n const encrypted = await window.crypto.subtle.encrypt({\n \"name\": \"AES-CTR\",\n counter: counter,\n length: 128\n }, this._ctrKey, data);\n return new Uint8Array(encrypted);\n }\n\n async _decryptCTR(data, counter) {\n const decrypted = await window.crypto.subtle.decrypt({\n \"name\": \"AES-CTR\",\n counter: counter,\n length: 128\n }, this._ctrKey, data);\n return new Uint8Array(decrypted);\n }\n\n async _computeCMAC(data, prefixBlock) {\n if (prefixBlock.length !== 16) {\n return null;\n }\n const n = Math.floor(data.length / 16);\n const m = Math.ceil(data.length / 16);\n const r = data.length - n * 16;\n const cbcData = new Uint8Array((m + 1) * 16);\n cbcData.set(prefixBlock);\n cbcData.set(data, 16);\n if (r === 0) {\n for (let i = 0; i < 16; i++) {\n cbcData[n * 16 + i] ^= this._k1[i];\n }\n } else {\n cbcData[(n + 1) * 16 + r] = 0x80;\n for (let i = 0; i < 16; i++) {\n cbcData[(n + 1) * 16 + i] ^= this._k2[i];\n }\n }\n let cbcEncrypted = await window.crypto.subtle.encrypt({\n name: \"AES-CBC\",\n iv: this._zeroBlock,\n }, this._cbcKey, cbcData);\n\n cbcEncrypted = new Uint8Array(cbcEncrypted);\n const mac = cbcEncrypted.slice(cbcEncrypted.length - 32, cbcEncrypted.length - 16);\n return mac;\n }\n\n async setKey(key) {\n this._rawKey = key;\n this._ctrKey = await window.crypto.subtle.importKey(\n \"raw\", key, {\"name\": \"AES-CTR\"}, false, [\"encrypt\", \"decrypt\"]);\n this._cbcKey = await window.crypto.subtle.importKey(\n \"raw\", key, {\"name\": \"AES-CBC\"}, false, [\"encrypt\", \"decrypt\"]);\n await this._initCMAC();\n }\n\n async encrypt(message, associatedData, nonce) {\n const nCMAC = await this._computeCMAC(nonce, this._prefixBlock0);\n const encrypted = await this._encryptCTR(message, nCMAC);\n const adCMAC = await this._computeCMAC(associatedData, this._prefixBlock1);\n const mac = await this._computeCMAC(encrypted, this._prefixBlock2);\n for (let i = 0; i < 16; i++) {\n mac[i] ^= nCMAC[i] ^ adCMAC[i];\n }\n const res = new Uint8Array(16 + encrypted.length);\n res.set(encrypted);\n res.set(mac, encrypted.length);\n return res;\n }\n\n async decrypt(encrypted, associatedData, nonce, mac) {\n const nCMAC = await this._computeCMAC(nonce, this._prefixBlock0);\n const adCMAC = await this._computeCMAC(associatedData, this._prefixBlock1);\n const computedMac = await this._computeCMAC(encrypted, this._prefixBlock2);\n for (let i = 0; i < 16; i++) {\n computedMac[i] ^= nCMAC[i] ^ adCMAC[i];\n }\n if (computedMac.length !== mac.length) {\n return null;\n }\n for (let i = 0; i < mac.length; i++) {\n if (computedMac[i] !== mac[i]) {\n return null;\n }\n }\n const res = await this._decryptCTR(encrypted, nCMAC);\n return res;\n }\n}\n\nexport class RA2Cipher {\n constructor() {\n this._cipher = new AESEAXCipher();\n this._counter = new Uint8Array(16);\n }\n\n async setKey(key) {\n await this._cipher.setKey(key);\n }\n\n async makeMessage(message) {\n const ad = new Uint8Array([(message.length & 0xff00) >>> 8, message.length & 0xff]);\n const encrypted = await this._cipher.encrypt(message, ad, this._counter);\n for (let i = 0; i < 16 && this._counter[i]++ === 255; i++);\n const res = new Uint8Array(message.length + 2 + 16);\n res.set(ad);\n res.set(encrypted, 2);\n return res;\n }\n\n async receiveMessage(length, encrypted, mac) {\n const ad = new Uint8Array([(length & 0xff00) >>> 8, length & 0xff]);\n const res = await this._cipher.decrypt(encrypted, ad, this._counter, mac);\n for (let i = 0; i < 16 && this._counter[i]++ === 255; i++);\n return res;\n }\n}\n\nexport class RSACipher {\n constructor(keyLength) {\n this._key = null;\n this._keyLength = keyLength;\n this._keyBytes = Math.ceil(keyLength / 8);\n this._n = null;\n this._e = null;\n this._d = null;\n this._nBigInt = null;\n this._eBigInt = null;\n this._dBigInt = null;\n }\n\n _base64urlDecode(data) {\n data = data.replace(/-/g, \"+\").replace(/_/g, \"/\");\n data = data.padEnd(Math.ceil(data.length / 4) * 4, \"=\");\n return Base64.decode(data);\n }\n\n _u8ArrayToBigInt(arr) {\n let hex = '0x';\n for (let i = 0; i < arr.length; i++) {\n hex += arr[i].toString(16).padStart(2, '0');\n }\n return BigInt(hex);\n }\n\n _padArray(arr, length) {\n const res = new Uint8Array(length);\n res.set(arr, length - arr.length);\n return res;\n }\n\n _bigIntToU8Array(bigint, padLength=0) {\n let hex = bigint.toString(16);\n if (padLength === 0) {\n padLength = Math.ceil(hex.length / 2) * 2;\n }\n hex = hex.padStart(padLength * 2, '0');\n const length = hex.length / 2;\n const arr = new Uint8Array(length);\n for (let i = 0; i < length; i++) {\n arr[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);\n }\n return arr;\n }\n\n _modPow(b, e, m) {\n if (m === 1n) {\n return 0;\n }\n let r = 1n;\n b = b % m;\n while (e > 0) {\n if (e % 2n === 1n) {\n r = (r * b) % m;\n }\n e = e / 2n;\n b = (b * b) % m;\n }\n return r;\n }\n\n async generateKey() {\n this._key = await window.crypto.subtle.generateKey(\n {\n name: \"RSA-OAEP\",\n modulusLength: this._keyLength,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: {name: \"SHA-256\"},\n },\n true, [\"encrypt\", \"decrypt\"]);\n const privateKey = await window.crypto.subtle.exportKey(\"jwk\", this._key.privateKey);\n this._n = this._padArray(this._base64urlDecode(privateKey.n), this._keyBytes);\n this._nBigInt = this._u8ArrayToBigInt(this._n);\n this._e = this._padArray(this._base64urlDecode(privateKey.e), this._keyBytes);\n this._eBigInt = this._u8ArrayToBigInt(this._e);\n this._d = this._padArray(this._base64urlDecode(privateKey.d), this._keyBytes);\n this._dBigInt = this._u8ArrayToBigInt(this._d);\n }\n\n setPublicKey(n, e) {\n if (n.length !== this._keyBytes || e.length !== this._keyBytes) {\n return;\n }\n this._n = new Uint8Array(this._keyBytes);\n this._e = new Uint8Array(this._keyBytes);\n this._n.set(n);\n this._e.set(e);\n this._nBigInt = this._u8ArrayToBigInt(this._n);\n this._eBigInt = this._u8ArrayToBigInt(this._e);\n }\n\n encrypt(message) {\n if (message.length > this._keyBytes - 11) {\n return null;\n }\n const ps = new Uint8Array(this._keyBytes - message.length - 3);\n window.crypto.getRandomValues(ps);\n for (let i = 0; i < ps.length; i++) {\n ps[i] = Math.floor(ps[i] * 254 / 255 + 1);\n }\n const em = new Uint8Array(this._keyBytes);\n em[1] = 0x02;\n em.set(ps, 2);\n em.set(message, ps.length + 3);\n const emBigInt = this._u8ArrayToBigInt(em);\n const c = this._modPow(emBigInt, this._eBigInt, this._nBigInt);\n return this._bigIntToU8Array(c, this._keyBytes);\n }\n\n decrypt(message) {\n if (message.length !== this._keyBytes) {\n return null;\n }\n const msgBigInt = this._u8ArrayToBigInt(message);\n const emBigInt = this._modPow(msgBigInt, this._dBigInt, this._nBigInt);\n const em = this._bigIntToU8Array(emBigInt, this._keyBytes);\n if (em[0] !== 0x00 || em[1] !== 0x02) {\n return null;\n }\n let i = 2;\n for (; i < em.length; i++) {\n if (em[i] === 0x00) {\n break;\n }\n }\n if (i === em.length) {\n return null;\n }\n return em.slice(i + 1, em.length);\n }\n\n get keyLength() {\n return this._keyLength;\n }\n\n get n() {\n return this._n;\n }\n\n get e() {\n return this._e;\n }\n\n get d() {\n return this._d;\n }\n}\n\nexport default class RSAAESAuthenticationState extends EventTargetMixin {\n constructor(sock, getCredentials) {\n super();\n this._hasStarted = false;\n this._checkSock = null;\n this._checkCredentials = null;\n this._approveServerResolve = null;\n this._sockReject = null;\n this._credentialsReject = null;\n this._approveServerReject = null;\n this._sock = sock;\n this._getCredentials = getCredentials;\n }\n\n _waitSockAsync(len) {\n return new Promise((resolve, reject) => {\n const hasData = () => !this._sock.rQwait('RA2', len);\n if (hasData()) {\n resolve();\n } else {\n this._checkSock = () => {\n if (hasData()) {\n resolve();\n this._checkSock = null;\n this._sockReject = null;\n }\n };\n this._sockReject = reject;\n }\n });\n }\n\n _waitApproveKeyAsync() {\n return new Promise((resolve, reject) => {\n this._approveServerResolve = resolve;\n this._approveServerReject = reject;\n });\n }\n\n _waitCredentialsAsync(subtype) {\n const hasCredentials = () => {\n if (subtype === 1 && this._getCredentials().username !== undefined &&\n this._getCredentials().password !== undefined) {\n return true;\n } else if (subtype === 2 && this._getCredentials().password !== undefined) {\n return true;\n }\n return false;\n };\n return new Promise((resolve, reject) => {\n if (hasCredentials()) {\n resolve();\n } else {\n this._checkCredentials = () => {\n if (hasCredentials()) {\n resolve();\n this._checkCredentials = null;\n this._credentialsReject = null;\n }\n };\n this._credentialsReject = reject;\n }\n });\n }\n\n checkInternalEvents() {\n if (this._checkSock !== null) {\n this._checkSock();\n }\n if (this._checkCredentials !== null) {\n this._checkCredentials();\n }\n }\n\n approveServer() {\n if (this._approveServerResolve !== null) {\n this._approveServerResolve();\n this._approveServerResolve = null;\n }\n }\n\n disconnect() {\n if (this._sockReject !== null) {\n this._sockReject(new Error(\"disconnect normally\"));\n this._sockReject = null;\n }\n if (this._credentialsReject !== null) {\n this._credentialsReject(new Error(\"disconnect normally\"));\n this._credentialsReject = null;\n }\n if (this._approveServerReject !== null) {\n this._approveServerReject(new Error(\"disconnect normally\"));\n this._approveServerReject = null;\n }\n }\n\n async negotiateRA2neAuthAsync() {\n this._hasStarted = true;\n // 1: Receive server public key\n await this._waitSockAsync(4);\n const serverKeyLengthBuffer = this._sock.rQslice(0, 4);\n const serverKeyLength = this._sock.rQshift32();\n if (serverKeyLength < 1024) {\n throw new Error(\"RA2: server public key is too short: \" + serverKeyLength);\n } else if (serverKeyLength > 8192) {\n throw new Error(\"RA2: server public key is too long: \" + serverKeyLength);\n }\n const serverKeyBytes = Math.ceil(serverKeyLength / 8);\n await this._waitSockAsync(serverKeyBytes * 2);\n const serverN = this._sock.rQshiftBytes(serverKeyBytes);\n const serverE = this._sock.rQshiftBytes(serverKeyBytes);\n const serverRSACipher = new RSACipher(serverKeyLength);\n serverRSACipher.setPublicKey(serverN, serverE);\n const serverPublickey = new Uint8Array(4 + serverKeyBytes * 2);\n serverPublickey.set(serverKeyLengthBuffer);\n serverPublickey.set(serverN, 4);\n serverPublickey.set(serverE, 4 + serverKeyBytes);\n\n // verify server public key\n this.dispatchEvent(new CustomEvent(\"serververification\", {\n detail: { type: \"RSA\", publickey: serverPublickey }\n }));\n await this._waitApproveKeyAsync();\n\n // 2: Send client public key\n const clientKeyLength = 2048;\n const clientKeyBytes = Math.ceil(clientKeyLength / 8);\n const clientRSACipher = new RSACipher(clientKeyLength);\n await clientRSACipher.generateKey();\n const clientN = clientRSACipher.n;\n const clientE = clientRSACipher.e;\n const clientPublicKey = new Uint8Array(4 + clientKeyBytes * 2);\n clientPublicKey[0] = (clientKeyLength & 0xff000000) >>> 24;\n clientPublicKey[1] = (clientKeyLength & 0xff0000) >>> 16;\n clientPublicKey[2] = (clientKeyLength & 0xff00) >>> 8;\n clientPublicKey[3] = clientKeyLength & 0xff;\n clientPublicKey.set(clientN, 4);\n clientPublicKey.set(clientE, 4 + clientKeyBytes);\n this._sock.send(clientPublicKey);\n\n // 3: Send client random\n const clientRandom = new Uint8Array(16);\n window.crypto.getRandomValues(clientRandom);\n const clientEncryptedRandom = serverRSACipher.encrypt(clientRandom);\n const clientRandomMessage = new Uint8Array(2 + serverKeyBytes);\n clientRandomMessage[0] = (serverKeyBytes & 0xff00) >>> 8;\n clientRandomMessage[1] = serverKeyBytes & 0xff;\n clientRandomMessage.set(clientEncryptedRandom, 2);\n this._sock.send(clientRandomMessage);\n\n // 4: Receive server random\n await this._waitSockAsync(2);\n if (this._sock.rQshift16() !== clientKeyBytes) {\n throw new Error(\"RA2: wrong encrypted message length\");\n }\n const serverEncryptedRandom = this._sock.rQshiftBytes(clientKeyBytes);\n const serverRandom = clientRSACipher.decrypt(serverEncryptedRandom);\n if (serverRandom === null || serverRandom.length !== 16) {\n throw new Error(\"RA2: corrupted server encrypted random\");\n }\n\n // 5: Compute session keys and set ciphers\n let clientSessionKey = new Uint8Array(32);\n let serverSessionKey = new Uint8Array(32);\n clientSessionKey.set(serverRandom);\n clientSessionKey.set(clientRandom, 16);\n serverSessionKey.set(clientRandom);\n serverSessionKey.set(serverRandom, 16);\n clientSessionKey = await window.crypto.subtle.digest(\"SHA-1\", clientSessionKey);\n clientSessionKey = new Uint8Array(clientSessionKey).slice(0, 16);\n serverSessionKey = await window.crypto.subtle.digest(\"SHA-1\", serverSessionKey);\n serverSessionKey = new Uint8Array(serverSessionKey).slice(0, 16);\n const clientCipher = new RA2Cipher();\n await clientCipher.setKey(clientSessionKey);\n const serverCipher = new RA2Cipher();\n await serverCipher.setKey(serverSessionKey);\n\n // 6: Compute and exchange hashes\n let serverHash = new Uint8Array(8 + serverKeyBytes * 2 + clientKeyBytes * 2);\n let clientHash = new Uint8Array(8 + serverKeyBytes * 2 + clientKeyBytes * 2);\n serverHash.set(serverPublickey);\n serverHash.set(clientPublicKey, 4 + serverKeyBytes * 2);\n clientHash.set(clientPublicKey);\n clientHash.set(serverPublickey, 4 + clientKeyBytes * 2);\n serverHash = await window.crypto.subtle.digest(\"SHA-1\", serverHash);\n clientHash = await window.crypto.subtle.digest(\"SHA-1\", clientHash);\n serverHash = new Uint8Array(serverHash);\n clientHash = new Uint8Array(clientHash);\n this._sock.send(await clientCipher.makeMessage(clientHash));\n await this._waitSockAsync(2 + 20 + 16);\n if (this._sock.rQshift16() !== 20) {\n throw new Error(\"RA2: wrong server hash\");\n }\n const serverHashReceived = await serverCipher.receiveMessage(\n 20, this._sock.rQshiftBytes(20), this._sock.rQshiftBytes(16));\n if (serverHashReceived === null) {\n throw new Error(\"RA2: failed to authenticate the message\");\n }\n for (let i = 0; i < 20; i++) {\n if (serverHashReceived[i] !== serverHash[i]) {\n throw new Error(\"RA2: wrong server hash\");\n }\n }\n\n // 7: Receive subtype\n await this._waitSockAsync(2 + 1 + 16);\n if (this._sock.rQshift16() !== 1) {\n throw new Error(\"RA2: wrong subtype\");\n }\n let subtype = (await serverCipher.receiveMessage(\n 1, this._sock.rQshiftBytes(1), this._sock.rQshiftBytes(16)));\n if (subtype === null) {\n throw new Error(\"RA2: failed to authenticate the message\");\n }\n subtype = subtype[0];\n if (subtype === 1) {\n if (this._getCredentials().username === undefined ||\n this._getCredentials().password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n }\n } else if (subtype === 2) {\n if (this._getCredentials().password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"password\"] } }));\n }\n } else {\n throw new Error(\"RA2: wrong subtype\");\n }\n await this._waitCredentialsAsync(subtype);\n let username;\n if (subtype === 1) {\n username = encodeUTF8(this._getCredentials().username).slice(0, 255);\n } else {\n username = \"\";\n }\n const password = encodeUTF8(this._getCredentials().password).slice(0, 255);\n const credentials = new Uint8Array(username.length + password.length + 2);\n credentials[0] = username.length;\n credentials[username.length + 1] = password.length;\n for (let i = 0; i < username.length; i++) {\n credentials[i + 1] = username.charCodeAt(i);\n }\n for (let i = 0; i < password.length; i++) {\n credentials[username.length + 2 + i] = password.charCodeAt(i);\n }\n this._sock.send(await clientCipher.makeMessage(credentials));\n }\n\n get hasStarted() {\n return this._hasStarted;\n }\n\n set hasStarted(s) {\n this._hasStarted = s;\n }\n}","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2021 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Performs MD5 hashing on a string of binary characters, returns an array of bytes\n */\n\nexport function MD5(d) {\n let r = M(V(Y(X(d), 8 * d.length)));\n return r;\n}\n\nfunction M(d) {\n let f = new Uint8Array(d.length);\n for (let i=0;i> 2);\n for (let m = 0; m < r.length; m++) r[m] = 0;\n for (let m = 0; m < 8 * d.length; m += 8) r[m >> 5] |= (255 & d.charCodeAt(m / 8)) << m % 32;\n return r;\n}\n\nfunction V(d) {\n let r = \"\";\n for (let m = 0; m < 32 * d.length; m += 8) r += String.fromCharCode(d[m >> 5] >>> m % 32 & 255);\n return r;\n}\n\nfunction Y(d, g) {\n d[g >> 5] |= 128 << g % 32, d[14 + (g + 64 >>> 9 << 4)] = g;\n let m = 1732584193, f = -271733879, r = -1732584194, i = 271733878;\n for (let n = 0; n < d.length; n += 16) {\n let h = m,\n t = f,\n g = r,\n e = i;\n f = ii(f = ii(f = ii(f = ii(f = hh(f = hh(f = hh(f = hh(f = gg(f = gg(f = gg(f = gg(f = ff(f = ff(f = ff(f = ff(f, r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 0], 7, -680876936), f, r, d[n + 1], 12, -389564586), m, f, d[n + 2], 17, 606105819), i, m, d[n + 3], 22, -1044525330), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 4], 7, -176418897), f, r, d[n + 5], 12, 1200080426), m, f, d[n + 6], 17, -1473231341), i, m, d[n + 7], 22, -45705983), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 8], 7, 1770035416), f, r, d[n + 9], 12, -1958414417), m, f, d[n + 10], 17, -42063), i, m, d[n + 11], 22, -1990404162), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 12], 7, 1804603682), f, r, d[n + 13], 12, -40341101), m, f, d[n + 14], 17, -1502002290), i, m, d[n + 15], 22, 1236535329), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 1], 5, -165796510), f, r, d[n + 6], 9, -1069501632), m, f, d[n + 11], 14, 643717713), i, m, d[n + 0], 20, -373897302), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 5], 5, -701558691), f, r, d[n + 10], 9, 38016083), m, f, d[n + 15], 14, -660478335), i, m, d[n + 4], 20, -405537848), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 9], 5, 568446438), f, r, d[n + 14], 9, -1019803690), m, f, d[n + 3], 14, -187363961), i, m, d[n + 8], 20, 1163531501), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 13], 5, -1444681467), f, r, d[n + 2], 9, -51403784), m, f, d[n + 7], 14, 1735328473), i, m, d[n + 12], 20, -1926607734), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 5], 4, -378558), f, r, d[n + 8], 11, -2022574463), m, f, d[n + 11], 16, 1839030562), i, m, d[n + 14], 23, -35309556), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 1], 4, -1530992060), f, r, d[n + 4], 11, 1272893353), m, f, d[n + 7], 16, -155497632), i, m, d[n + 10], 23, -1094730640), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 13], 4, 681279174), f, r, d[n + 0], 11, -358537222), m, f, d[n + 3], 16, -722521979), i, m, d[n + 6], 23, 76029189), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 9], 4, -640364487), f, r, d[n + 12], 11, -421815835), m, f, d[n + 15], 16, 530742520), i, m, d[n + 2], 23, -995338651), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 0], 6, -198630844), f, r, d[n + 7], 10, 1126891415), m, f, d[n + 14], 15, -1416354905), i, m, d[n + 5], 21, -57434055), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 12], 6, 1700485571), f, r, d[n + 3], 10, -1894986606), m, f, d[n + 10], 15, -1051523), i, m, d[n + 1], 21, -2054922799), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 8], 6, 1873313359), f, r, d[n + 15], 10, -30611744), m, f, d[n + 6], 15, -1560198380), i, m, d[n + 13], 21, 1309151649), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 4], 6, -145523070), f, r, d[n + 11], 10, -1120210379), m, f, d[n + 2], 15, 718787259), i, m, d[n + 9], 21, -343485551), m = add(m, h), f = add(f, t), r = add(r, g), i = add(i, e);\n }\n return Array(m, f, r, i);\n}\n\nfunction cmn(d, g, m, f, r, i) {\n return add(rol(add(add(g, d), add(f, i)), r), m);\n}\n\nfunction ff(d, g, m, f, r, i, n) {\n return cmn(g & m | ~g & f, d, g, r, i, n);\n}\n\nfunction gg(d, g, m, f, r, i, n) {\n return cmn(g & f | m & ~f, d, g, r, i, n);\n}\n\nfunction hh(d, g, m, f, r, i, n) {\n return cmn(g ^ m ^ f, d, g, r, i, n);\n}\n\nfunction ii(d, g, m, f, r, i, n) {\n return cmn(m ^ (g | ~f), d, g, r, i, n);\n}\n\nfunction add(d, g) {\n let m = (65535 & d) + (65535 & g);\n return (d >> 16) + (g >> 16) + (m >> 16) << 16 | 65535 & m;\n}\n\nfunction rol(d, g) {\n return d << g | d >>> 32 - g;\n}","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class RawDecoder {\n constructor() {\n this._lines = 0;\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if ((width === 0) || (height === 0)) {\n return true;\n }\n\n if (this._lines === 0) {\n this._lines = height;\n }\n\n const pixelSize = depth == 8 ? 1 : 4;\n const bytesPerLine = width * pixelSize;\n\n if (sock.rQwait(\"RAW\", bytesPerLine)) {\n return false;\n }\n\n const curY = y + (height - this._lines);\n const currHeight = Math.min(this._lines,\n Math.floor(sock.rQlen / bytesPerLine));\n const pixels = width * currHeight;\n\n let data = sock.rQ;\n let index = sock.rQi;\n\n // Convert data if needed\n if (depth == 8) {\n const newdata = new Uint8Array(pixels * 4);\n for (let i = 0; i < pixels; i++) {\n newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3;\n newdata[i * 4 + 1] = ((data[index + i] >> 2) & 0x3) * 255 / 3;\n newdata[i * 4 + 2] = ((data[index + i] >> 4) & 0x3) * 255 / 3;\n newdata[i * 4 + 3] = 255;\n }\n data = newdata;\n index = 0;\n }\n\n // Max sure the image is fully opaque\n for (let i = 0; i < pixels; i++) {\n data[index + i * 4 + 3] = 255;\n }\n\n display.blitImage(x, curY, width, currHeight, data, index);\n sock.rQskipBytes(currHeight * bytesPerLine);\n this._lines -= currHeight;\n if (this._lines > 0) {\n return false;\n }\n\n return true;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class CopyRectDecoder {\n decodeRect(x, y, width, height, sock, display, depth) {\n if (sock.rQwait(\"COPYRECT\", 4)) {\n return false;\n }\n\n let deltaX = sock.rQshift16();\n let deltaY = sock.rQshift16();\n\n if ((width === 0) || (height === 0)) {\n return true;\n }\n\n display.copyImage(deltaX, deltaY, x, y, width, height);\n\n return true;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class RREDecoder {\n constructor() {\n this._subrects = 0;\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._subrects === 0) {\n if (sock.rQwait(\"RRE\", 4 + 4)) {\n return false;\n }\n\n this._subrects = sock.rQshift32();\n\n let color = sock.rQshiftBytes(4); // Background\n display.fillRect(x, y, width, height, color);\n }\n\n while (this._subrects > 0) {\n if (sock.rQwait(\"RRE\", 4 + 8)) {\n return false;\n }\n\n let color = sock.rQshiftBytes(4);\n let sx = sock.rQshift16();\n let sy = sock.rQshift16();\n let swidth = sock.rQshift16();\n let sheight = sock.rQshift16();\n display.fillRect(x + sx, y + sy, swidth, sheight, color);\n\n this._subrects--;\n }\n\n return true;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport * as Log from '../util/logging.js';\n\nexport default class HextileDecoder {\n constructor() {\n this._tiles = 0;\n this._lastsubencoding = 0;\n this._tileBuffer = new Uint8Array(16 * 16 * 4);\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._tiles === 0) {\n this._tilesX = Math.ceil(width / 16);\n this._tilesY = Math.ceil(height / 16);\n this._totalTiles = this._tilesX * this._tilesY;\n this._tiles = this._totalTiles;\n }\n\n while (this._tiles > 0) {\n let bytes = 1;\n\n if (sock.rQwait(\"HEXTILE\", bytes)) {\n return false;\n }\n\n let rQ = sock.rQ;\n let rQi = sock.rQi;\n\n let subencoding = rQ[rQi]; // Peek\n if (subencoding > 30) { // Raw\n throw new Error(\"Illegal hextile subencoding (subencoding: \" +\n subencoding + \")\");\n }\n\n const currTile = this._totalTiles - this._tiles;\n const tileX = currTile % this._tilesX;\n const tileY = Math.floor(currTile / this._tilesX);\n const tx = x + tileX * 16;\n const ty = y + tileY * 16;\n const tw = Math.min(16, (x + width) - tx);\n const th = Math.min(16, (y + height) - ty);\n\n // Figure out how much we are expecting\n if (subencoding & 0x01) { // Raw\n bytes += tw * th * 4;\n } else {\n if (subencoding & 0x02) { // Background\n bytes += 4;\n }\n if (subencoding & 0x04) { // Foreground\n bytes += 4;\n }\n if (subencoding & 0x08) { // AnySubrects\n bytes++; // Since we aren't shifting it off\n\n if (sock.rQwait(\"HEXTILE\", bytes)) {\n return false;\n }\n\n let subrects = rQ[rQi + bytes - 1]; // Peek\n if (subencoding & 0x10) { // SubrectsColoured\n bytes += subrects * (4 + 2);\n } else {\n bytes += subrects * 2;\n }\n }\n }\n\n if (sock.rQwait(\"HEXTILE\", bytes)) {\n return false;\n }\n\n // We know the encoding and have a whole tile\n rQi++;\n if (subencoding === 0) {\n if (this._lastsubencoding & 0x01) {\n // Weird: ignore blanks are RAW\n Log.Debug(\" Ignoring blank after RAW\");\n } else {\n display.fillRect(tx, ty, tw, th, this._background);\n }\n } else if (subencoding & 0x01) { // Raw\n let pixels = tw * th;\n // Max sure the image is fully opaque\n for (let i = 0;i < pixels;i++) {\n rQ[rQi + i * 4 + 3] = 255;\n }\n display.blitImage(tx, ty, tw, th, rQ, rQi);\n rQi += bytes - 1;\n } else {\n if (subencoding & 0x02) { // Background\n this._background = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];\n rQi += 4;\n }\n if (subencoding & 0x04) { // Foreground\n this._foreground = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];\n rQi += 4;\n }\n\n this._startTile(tx, ty, tw, th, this._background);\n if (subencoding & 0x08) { // AnySubrects\n let subrects = rQ[rQi];\n rQi++;\n\n for (let s = 0; s < subrects; s++) {\n let color;\n if (subencoding & 0x10) { // SubrectsColoured\n color = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];\n rQi += 4;\n } else {\n color = this._foreground;\n }\n const xy = rQ[rQi];\n rQi++;\n const sx = (xy >> 4);\n const sy = (xy & 0x0f);\n\n const wh = rQ[rQi];\n rQi++;\n const sw = (wh >> 4) + 1;\n const sh = (wh & 0x0f) + 1;\n\n this._subTile(sx, sy, sw, sh, color);\n }\n }\n this._finishTile(display);\n }\n sock.rQi = rQi;\n this._lastsubencoding = subencoding;\n this._tiles--;\n }\n\n return true;\n }\n\n // start updating a tile\n _startTile(x, y, width, height, color) {\n this._tileX = x;\n this._tileY = y;\n this._tileW = width;\n this._tileH = height;\n\n const red = color[0];\n const green = color[1];\n const blue = color[2];\n\n const data = this._tileBuffer;\n for (let i = 0; i < width * height * 4; i += 4) {\n data[i] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n data[i + 3] = 255;\n }\n }\n\n // update sub-rectangle of the current tile\n _subTile(x, y, w, h, color) {\n const red = color[0];\n const green = color[1];\n const blue = color[2];\n const xend = x + w;\n const yend = y + h;\n\n const data = this._tileBuffer;\n const width = this._tileW;\n for (let j = y; j < yend; j++) {\n for (let i = x; i < xend; i++) {\n const p = (i + (j * width)) * 4;\n data[p] = red;\n data[p + 1] = green;\n data[p + 2] = blue;\n data[p + 3] = 255;\n }\n }\n }\n\n // draw the current tile to the screen\n _finishTile(display) {\n display.blitImage(this._tileX, this._tileY,\n this._tileW, this._tileH,\n this._tileBuffer, 0);\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * (c) 2012 Michael Tinglof, Joe Balaz, Les Piech (Mercuri.ca)\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport * as Log from '../util/logging.js';\nimport Inflator from \"../inflator.js\";\n\nexport default class TightDecoder {\n constructor() {\n this._ctl = null;\n this._filter = null;\n this._numColors = 0;\n this._palette = new Uint8Array(1024); // 256 * 4 (max palette size * max bytes-per-pixel)\n this._len = 0;\n\n this._zlibs = [];\n for (let i = 0; i < 4; i++) {\n this._zlibs[i] = new Inflator();\n }\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._ctl === null) {\n if (sock.rQwait(\"TIGHT compression-control\", 1)) {\n return false;\n }\n\n this._ctl = sock.rQshift8();\n\n // Reset streams if the server requests it\n for (let i = 0; i < 4; i++) {\n if ((this._ctl >> i) & 1) {\n this._zlibs[i].reset();\n Log.Info(\"Reset zlib stream \" + i);\n }\n }\n\n // Figure out filter\n this._ctl = this._ctl >> 4;\n }\n\n let ret;\n\n if (this._ctl === 0x08) {\n ret = this._fillRect(x, y, width, height,\n sock, display, depth);\n } else if (this._ctl === 0x09) {\n ret = this._jpegRect(x, y, width, height,\n sock, display, depth);\n } else if (this._ctl === 0x0A) {\n ret = this._pngRect(x, y, width, height,\n sock, display, depth);\n } else if ((this._ctl & 0x08) == 0) {\n ret = this._basicRect(this._ctl, x, y, width, height,\n sock, display, depth);\n } else {\n throw new Error(\"Illegal tight compression received (ctl: \" +\n this._ctl + \")\");\n }\n\n if (ret) {\n this._ctl = null;\n }\n\n return ret;\n }\n\n _fillRect(x, y, width, height, sock, display, depth) {\n if (sock.rQwait(\"TIGHT\", 3)) {\n return false;\n }\n\n const rQi = sock.rQi;\n const rQ = sock.rQ;\n\n display.fillRect(x, y, width, height,\n [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2]], false);\n sock.rQskipBytes(3);\n\n return true;\n }\n\n _jpegRect(x, y, width, height, sock, display, depth) {\n let data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n display.imageRect(x, y, width, height, \"image/jpeg\", data);\n\n return true;\n }\n\n _pngRect(x, y, width, height, sock, display, depth) {\n throw new Error(\"PNG received in standard Tight rect\");\n }\n\n _basicRect(ctl, x, y, width, height, sock, display, depth) {\n if (this._filter === null) {\n if (ctl & 0x4) {\n if (sock.rQwait(\"TIGHT\", 1)) {\n return false;\n }\n\n this._filter = sock.rQshift8();\n } else {\n // Implicit CopyFilter\n this._filter = 0;\n }\n }\n\n let streamId = ctl & 0x3;\n\n let ret;\n\n switch (this._filter) {\n case 0: // CopyFilter\n ret = this._copyFilter(streamId, x, y, width, height,\n sock, display, depth);\n break;\n case 1: // PaletteFilter\n ret = this._paletteFilter(streamId, x, y, width, height,\n sock, display, depth);\n break;\n case 2: // GradientFilter\n ret = this._gradientFilter(streamId, x, y, width, height,\n sock, display, depth);\n break;\n default:\n throw new Error(\"Illegal tight filter received (ctl: \" +\n this._filter + \")\");\n }\n\n if (ret) {\n this._filter = null;\n }\n\n return ret;\n }\n\n _copyFilter(streamId, x, y, width, height, sock, display, depth) {\n const uncompressedSize = width * height * 3;\n let data;\n\n if (uncompressedSize === 0) {\n return true;\n }\n\n if (uncompressedSize < 12) {\n if (sock.rQwait(\"TIGHT\", uncompressedSize)) {\n return false;\n }\n\n data = sock.rQshiftBytes(uncompressedSize);\n } else {\n data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n this._zlibs[streamId].setInput(data);\n data = this._zlibs[streamId].inflate(uncompressedSize);\n this._zlibs[streamId].setInput(null);\n }\n\n let rgbx = new Uint8Array(width * height * 4);\n for (let i = 0, j = 0; i < width * height * 4; i += 4, j += 3) {\n rgbx[i] = data[j];\n rgbx[i + 1] = data[j + 1];\n rgbx[i + 2] = data[j + 2];\n rgbx[i + 3] = 255; // Alpha\n }\n\n display.blitImage(x, y, width, height, rgbx, 0, false);\n\n return true;\n }\n\n _paletteFilter(streamId, x, y, width, height, sock, display, depth) {\n if (this._numColors === 0) {\n if (sock.rQwait(\"TIGHT palette\", 1)) {\n return false;\n }\n\n const numColors = sock.rQpeek8() + 1;\n const paletteSize = numColors * 3;\n\n if (sock.rQwait(\"TIGHT palette\", 1 + paletteSize)) {\n return false;\n }\n\n this._numColors = numColors;\n sock.rQskipBytes(1);\n\n sock.rQshiftTo(this._palette, paletteSize);\n }\n\n const bpp = (this._numColors <= 2) ? 1 : 8;\n const rowSize = Math.floor((width * bpp + 7) / 8);\n const uncompressedSize = rowSize * height;\n\n let data;\n\n if (uncompressedSize === 0) {\n return true;\n }\n\n if (uncompressedSize < 12) {\n if (sock.rQwait(\"TIGHT\", uncompressedSize)) {\n return false;\n }\n\n data = sock.rQshiftBytes(uncompressedSize);\n } else {\n data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n this._zlibs[streamId].setInput(data);\n data = this._zlibs[streamId].inflate(uncompressedSize);\n this._zlibs[streamId].setInput(null);\n }\n\n // Convert indexed (palette based) image data to RGB\n if (this._numColors == 2) {\n this._monoRect(x, y, width, height, data, this._palette, display);\n } else {\n this._paletteRect(x, y, width, height, data, this._palette, display);\n }\n\n this._numColors = 0;\n\n return true;\n }\n\n _monoRect(x, y, width, height, data, palette, display) {\n // Convert indexed (palette based) image data to RGB\n // TODO: reduce number of calculations inside loop\n const dest = this._getScratchBuffer(width * height * 4);\n const w = Math.floor((width + 7) / 8);\n const w1 = Math.floor(width / 8);\n\n for (let y = 0; y < height; y++) {\n let dp, sp, x;\n for (x = 0; x < w1; x++) {\n for (let b = 7; b >= 0; b--) {\n dp = (y * width + x * 8 + 7 - b) * 4;\n sp = (data[y * w + x] >> b & 1) * 3;\n dest[dp] = palette[sp];\n dest[dp + 1] = palette[sp + 1];\n dest[dp + 2] = palette[sp + 2];\n dest[dp + 3] = 255;\n }\n }\n\n for (let b = 7; b >= 8 - width % 8; b--) {\n dp = (y * width + x * 8 + 7 - b) * 4;\n sp = (data[y * w + x] >> b & 1) * 3;\n dest[dp] = palette[sp];\n dest[dp + 1] = palette[sp + 1];\n dest[dp + 2] = palette[sp + 2];\n dest[dp + 3] = 255;\n }\n }\n\n display.blitImage(x, y, width, height, dest, 0, false);\n }\n\n _paletteRect(x, y, width, height, data, palette, display) {\n // Convert indexed (palette based) image data to RGB\n const dest = this._getScratchBuffer(width * height * 4);\n const total = width * height * 4;\n for (let i = 0, j = 0; i < total; i += 4, j++) {\n const sp = data[j] * 3;\n dest[i] = palette[sp];\n dest[i + 1] = palette[sp + 1];\n dest[i + 2] = palette[sp + 2];\n dest[i + 3] = 255;\n }\n\n display.blitImage(x, y, width, height, dest, 0, false);\n }\n\n _gradientFilter(streamId, x, y, width, height, sock, display, depth) {\n throw new Error(\"Gradient filter not implemented\");\n }\n\n _readData(sock) {\n if (this._len === 0) {\n if (sock.rQwait(\"TIGHT\", 3)) {\n return null;\n }\n\n let byte;\n\n byte = sock.rQshift8();\n this._len = byte & 0x7f;\n if (byte & 0x80) {\n byte = sock.rQshift8();\n this._len |= (byte & 0x7f) << 7;\n if (byte & 0x80) {\n byte = sock.rQshift8();\n this._len |= byte << 14;\n }\n }\n }\n\n if (sock.rQwait(\"TIGHT\", this._len)) {\n return null;\n }\n\n let data = sock.rQshiftBytes(this._len);\n this._len = 0;\n\n return data;\n }\n\n _getScratchBuffer(size) {\n if (!this._scratchBuffer || (this._scratchBuffer.length < size)) {\n this._scratchBuffer = new Uint8Array(size);\n }\n return this._scratchBuffer;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport TightDecoder from './tight.js';\n\nexport default class TightPNGDecoder extends TightDecoder {\n _pngRect(x, y, width, height, sock, display, depth) {\n let data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n display.imageRect(x, y, width, height, \"image/png\", data);\n\n return true;\n }\n\n _basicRect(ctl, x, y, width, height, sock, display, depth) {\n throw new Error(\"BasicCompression received in TightPNG rect\");\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2021 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport Inflate from \"../inflator.js\";\n\nconst ZRLE_TILE_WIDTH = 64;\nconst ZRLE_TILE_HEIGHT = 64;\n\nexport default class ZRLEDecoder {\n constructor() {\n this._length = 0;\n this._inflator = new Inflate();\n\n this._pixelBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);\n this._tileBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._length === 0) {\n if (sock.rQwait(\"ZLib data length\", 4)) {\n return false;\n }\n this._length = sock.rQshift32();\n }\n if (sock.rQwait(\"Zlib data\", this._length)) {\n return false;\n }\n\n const data = sock.rQshiftBytes(this._length);\n\n this._inflator.setInput(data);\n\n for (let ty = y; ty < y + height; ty += ZRLE_TILE_HEIGHT) {\n let th = Math.min(ZRLE_TILE_HEIGHT, y + height - ty);\n\n for (let tx = x; tx < x + width; tx += ZRLE_TILE_WIDTH) {\n let tw = Math.min(ZRLE_TILE_WIDTH, x + width - tx);\n\n const tileSize = tw * th;\n const subencoding = this._inflator.inflate(1)[0];\n if (subencoding === 0) {\n // raw data\n const data = this._readPixels(tileSize);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else if (subencoding === 1) {\n // solid\n const background = this._readPixels(1);\n display.fillRect(tx, ty, tw, th, [background[0], background[1], background[2]]);\n } else if (subencoding >= 2 && subencoding <= 16) {\n const data = this._decodePaletteTile(subencoding, tileSize, tw, th);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else if (subencoding === 128) {\n const data = this._decodeRLETile(tileSize);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else if (subencoding >= 130 && subencoding <= 255) {\n const data = this._decodeRLEPaletteTile(subencoding - 128, tileSize);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else {\n throw new Error('Unknown subencoding: ' + subencoding);\n }\n }\n }\n this._length = 0;\n return true;\n }\n\n _getBitsPerPixelInPalette(paletteSize) {\n if (paletteSize <= 2) {\n return 1;\n } else if (paletteSize <= 4) {\n return 2;\n } else if (paletteSize <= 16) {\n return 4;\n }\n }\n\n _readPixels(pixels) {\n let data = this._pixelBuffer;\n const buffer = this._inflator.inflate(3*pixels);\n for (let i = 0, j = 0; i < pixels*4; i += 4, j += 3) {\n data[i] = buffer[j];\n data[i + 1] = buffer[j + 1];\n data[i + 2] = buffer[j + 2];\n data[i + 3] = 255; // Add the Alpha\n }\n return data;\n }\n\n _decodePaletteTile(paletteSize, tileSize, tilew, tileh) {\n const data = this._tileBuffer;\n const palette = this._readPixels(paletteSize);\n const bitsPerPixel = this._getBitsPerPixelInPalette(paletteSize);\n const mask = (1 << bitsPerPixel) - 1;\n\n let offset = 0;\n let encoded = this._inflator.inflate(1)[0];\n\n for (let y=0; y>shift) & mask;\n\n data[offset] = palette[indexInPalette * 4];\n data[offset + 1] = palette[indexInPalette * 4 + 1];\n data[offset + 2] = palette[indexInPalette * 4 + 2];\n data[offset + 3] = palette[indexInPalette * 4 + 3];\n offset += 4;\n shift-=bitsPerPixel;\n }\n if (shift<8-bitsPerPixel && y= 128) {\n indexInPalette -= 128;\n length = this._readRLELength();\n }\n if (indexInPalette > paletteSize) {\n throw new Error('Too big index in palette: ' + indexInPalette + ', palette size: ' + paletteSize);\n }\n if (offset + length > tileSize) {\n throw new Error('Too big rle length in palette mode: ' + length + ', allowed length is: ' + (tileSize - offset));\n }\n\n for (let j = 0; j < length; j++) {\n data[offset * 4] = palette[indexInPalette * 4];\n data[offset * 4 + 1] = palette[indexInPalette * 4 + 1];\n data[offset * 4 + 2] = palette[indexInPalette * 4 + 2];\n data[offset * 4 + 3] = palette[indexInPalette * 4 + 3];\n offset++;\n }\n }\n return data;\n }\n\n _readRLELength() {\n let length = 0;\n let current = 0;\n do {\n current = this._inflator.inflate(1)[0];\n length += current;\n } while (current === 255);\n return length + 1;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class JPEGDecoder {\n constructor() {\n // RealVNC will reuse the quantization tables\n // and Huffman tables, so we need to cache them.\n this._quantTables = [];\n this._huffmanTables = [];\n this._cachedQuantTables = [];\n this._cachedHuffmanTables = [];\n\n this._jpegLength = 0;\n this._segments = [];\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n // A rect of JPEG encodings is simply a JPEG file\n if (!this._parseJPEG(sock.rQslice(0))) {\n return false;\n }\n const data = sock.rQshiftBytes(this._jpegLength);\n if (this._quantTables.length != 0 && this._huffmanTables.length != 0) {\n // If there are quantization tables and Huffman tables in the JPEG\n // image, we can directly render it.\n display.imageRect(x, y, width, height, \"image/jpeg\", data);\n return true;\n } else {\n // Otherwise we need to insert cached tables.\n const sofIndex = this._segments.findIndex(\n x => x[1] == 0xC0 || x[1] == 0xC2\n );\n if (sofIndex == -1) {\n throw new Error(\"Illegal JPEG image without SOF\");\n }\n let segments = this._segments.slice(0, sofIndex);\n segments = segments.concat(this._quantTables.length ?\n this._quantTables :\n this._cachedQuantTables);\n segments.push(this._segments[sofIndex]);\n segments = segments.concat(this._huffmanTables.length ?\n this._huffmanTables :\n this._cachedHuffmanTables,\n this._segments.slice(sofIndex + 1));\n let length = 0;\n for (let i = 0; i < segments.length; i++) {\n length += segments[i].length;\n }\n const data = new Uint8Array(length);\n length = 0;\n for (let i = 0; i < segments.length; i++) {\n data.set(segments[i], length);\n length += segments[i].length;\n }\n display.imageRect(x, y, width, height, \"image/jpeg\", data);\n return true;\n }\n }\n\n _parseJPEG(buffer) {\n if (this._quantTables.length != 0) {\n this._cachedQuantTables = this._quantTables;\n }\n if (this._huffmanTables.length != 0) {\n this._cachedHuffmanTables = this._huffmanTables;\n }\n this._quantTables = [];\n this._huffmanTables = [];\n this._segments = [];\n let i = 0;\n let bufferLength = buffer.length;\n while (true) {\n let j = i;\n if (j + 2 > bufferLength) {\n return false;\n }\n if (buffer[j] != 0xFF) {\n throw new Error(\"Illegal JPEG marker received (byte: \" +\n buffer[j] + \")\");\n }\n const type = buffer[j+1];\n j += 2;\n if (type == 0xD9) {\n this._jpegLength = j;\n this._segments.push(buffer.slice(i, j));\n return true;\n } else if (type == 0xDA) {\n // start of scan\n let hasFoundEndOfScan = false;\n for (let k = j + 3; k + 1 < bufferLength; k++) {\n if (buffer[k] == 0xFF && buffer[k+1] != 0x00 &&\n !(buffer[k+1] >= 0xD0 && buffer[k+1] <= 0xD7)) {\n j = k;\n hasFoundEndOfScan = true;\n break;\n }\n }\n if (!hasFoundEndOfScan) {\n return false;\n }\n this._segments.push(buffer.slice(i, j));\n i = j;\n continue;\n } else if (type >= 0xD0 && type < 0xD9 || type == 0x01) {\n // No length after marker\n this._segments.push(buffer.slice(i, j));\n i = j;\n continue;\n }\n if (j + 2 > bufferLength) {\n return false;\n }\n const length = (buffer[j] << 8) + buffer[j+1] - 2;\n if (length < 0) {\n throw new Error(\"Illegal JPEG length received (length: \" +\n length + \")\");\n }\n j += 2;\n if (j + length > bufferLength) {\n return false;\n }\n j += length;\n const segment = buffer.slice(i, j);\n if (type == 0xC4) {\n // Huffman tables\n this._huffmanTables.push(segment);\n } else if (type == 0xDB) {\n // Quantization tables\n this._quantTables.push(segment);\n }\n this._segments.push(segment);\n i = j;\n }\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport { toUnsigned32bit, toSigned32bit } from './util/int.js';\nimport * as Log from './util/logging.js';\nimport { encodeUTF8, decodeUTF8 } from './util/strings.js';\nimport { dragThreshold } from './util/browser.js';\nimport { clientToElement } from './util/element.js';\nimport { setCapture } from './util/events.js';\nimport EventTargetMixin from './util/eventtarget.js';\nimport Display from \"./display.js\";\nimport Inflator from \"./inflator.js\";\nimport Deflator from \"./deflator.js\";\nimport Keyboard from \"./input/keyboard.js\";\nimport GestureHandler from \"./input/gesturehandler.js\";\nimport Cursor from \"./util/cursor.js\";\nimport Websock from \"./websock.js\";\nimport DES from \"./des.js\";\nimport KeyTable from \"./input/keysym.js\";\nimport XtScancode from \"./input/xtscancodes.js\";\nimport { encodings } from \"./encodings.js\";\nimport RSAAESAuthenticationState from \"./ra2.js\";\nimport { MD5 } from \"./util/md5.js\";\n\nimport RawDecoder from \"./decoders/raw.js\";\nimport CopyRectDecoder from \"./decoders/copyrect.js\";\nimport RREDecoder from \"./decoders/rre.js\";\nimport HextileDecoder from \"./decoders/hextile.js\";\nimport TightDecoder from \"./decoders/tight.js\";\nimport TightPNGDecoder from \"./decoders/tightpng.js\";\nimport ZRLEDecoder from \"./decoders/zrle.js\";\nimport JPEGDecoder from \"./decoders/jpeg.js\";\n\n// How many seconds to wait for a disconnect to finish\nconst DISCONNECT_TIMEOUT = 3;\nconst DEFAULT_BACKGROUND = 'rgb(40, 40, 40)';\n\n// Minimum wait (ms) between two mouse moves\nconst MOUSE_MOVE_DELAY = 17;\n\n// Wheel thresholds\nconst WHEEL_STEP = 50; // Pixels needed for one step\nconst WHEEL_LINE_HEIGHT = 19; // Assumed pixels for one line step\n\n// Gesture thresholds\nconst GESTURE_ZOOMSENS = 75;\nconst GESTURE_SCRLSENS = 50;\nconst DOUBLE_TAP_TIMEOUT = 1000;\nconst DOUBLE_TAP_THRESHOLD = 50;\n\n// Security types\nconst securityTypeNone = 1;\nconst securityTypeVNCAuth = 2;\nconst securityTypeRA2ne = 6;\nconst securityTypeTight = 16;\nconst securityTypeVeNCrypt = 19;\nconst securityTypeXVP = 22;\nconst securityTypeARD = 30;\nconst securityTypeMSLogonII = 113;\n\n// Special Tight security types\nconst securityTypeUnixLogon = 129;\n\n// VeNCrypt security types\nconst securityTypePlain = 256;\n\n// Extended clipboard pseudo-encoding formats\nconst extendedClipboardFormatText = 1;\n/*eslint-disable no-unused-vars */\nconst extendedClipboardFormatRtf = 1 << 1;\nconst extendedClipboardFormatHtml = 1 << 2;\nconst extendedClipboardFormatDib = 1 << 3;\nconst extendedClipboardFormatFiles = 1 << 4;\n/*eslint-enable */\n\n// Extended clipboard pseudo-encoding actions\nconst extendedClipboardActionCaps = 1 << 24;\nconst extendedClipboardActionRequest = 1 << 25;\nconst extendedClipboardActionPeek = 1 << 26;\nconst extendedClipboardActionNotify = 1 << 27;\nconst extendedClipboardActionProvide = 1 << 28;\n\nexport default class RFB extends EventTargetMixin {\n constructor(target, urlOrChannel, options) {\n if (!target) {\n throw new Error(\"Must specify target\");\n }\n if (!urlOrChannel) {\n throw new Error(\"Must specify URL, WebSocket or RTCDataChannel\");\n }\n\n // We rely on modern APIs which might not be available in an\n // insecure context\n if (!window.isSecureContext) {\n Log.Error(\"noVNC requires a secure context (TLS). Expect crashes!\");\n }\n\n super();\n\n this._target = target;\n\n if (typeof urlOrChannel === \"string\") {\n this._url = urlOrChannel;\n } else {\n this._url = null;\n this._rawChannel = urlOrChannel;\n }\n\n // Connection details\n options = options || {};\n this._rfbCredentials = options.credentials || {};\n this._shared = 'shared' in options ? !!options.shared : true;\n this._repeaterID = options.repeaterID || '';\n this._wsProtocols = options.wsProtocols || [];\n\n // Internal state\n this._rfbConnectionState = '';\n this._rfbInitState = '';\n this._rfbAuthScheme = -1;\n this._rfbCleanDisconnect = true;\n this._rfbRSAAESAuthenticationState = null;\n\n // Server capabilities\n this._rfbVersion = 0;\n this._rfbMaxVersion = 3.8;\n this._rfbTightVNC = false;\n this._rfbVeNCryptState = 0;\n this._rfbXvpVer = 0;\n\n this._fbWidth = 0;\n this._fbHeight = 0;\n\n this._fbName = \"\";\n\n this._capabilities = { power: false };\n\n this._supportsFence = false;\n\n this._supportsContinuousUpdates = false;\n this._enabledContinuousUpdates = false;\n\n this._supportsSetDesktopSize = false;\n this._screenID = 0;\n this._screenFlags = 0;\n\n this._qemuExtKeyEventSupported = false;\n\n this._clipboardText = null;\n this._clipboardServerCapabilitiesActions = {};\n this._clipboardServerCapabilitiesFormats = {};\n\n // Internal objects\n this._sock = null; // Websock object\n this._display = null; // Display object\n this._flushing = false; // Display flushing state\n this._keyboard = null; // Keyboard input handler object\n this._gestures = null; // Gesture input handler object\n this._resizeObserver = null; // Resize observer object\n\n // Timers\n this._disconnTimer = null; // disconnection timer\n this._resizeTimeout = null; // resize rate limiting\n this._mouseMoveTimer = null;\n\n // Decoder states\n this._decoders = {};\n\n this._FBU = {\n rects: 0,\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n encoding: null,\n };\n\n // Mouse state\n this._mousePos = {};\n this._mouseButtonMask = 0;\n this._mouseLastMoveTime = 0;\n this._viewportDragging = false;\n this._viewportDragPos = {};\n this._viewportHasMoved = false;\n this._accumulatedWheelDeltaX = 0;\n this._accumulatedWheelDeltaY = 0;\n\n // Gesture state\n this._gestureLastTapTime = null;\n this._gestureFirstDoubleTapEv = null;\n this._gestureLastMagnitudeX = 0;\n this._gestureLastMagnitudeY = 0;\n\n // Bound event handlers\n this._eventHandlers = {\n focusCanvas: this._focusCanvas.bind(this),\n handleResize: this._handleResize.bind(this),\n handleMouse: this._handleMouse.bind(this),\n handleWheel: this._handleWheel.bind(this),\n handleGesture: this._handleGesture.bind(this),\n handleRSAAESCredentialsRequired: this._handleRSAAESCredentialsRequired.bind(this),\n handleRSAAESServerVerification: this._handleRSAAESServerVerification.bind(this),\n };\n\n // main setup\n Log.Debug(\">> RFB.constructor\");\n\n // Create DOM elements\n this._screen = document.createElement('div');\n this._screen.style.display = 'flex';\n this._screen.style.width = '100%';\n this._screen.style.height = '100%';\n this._screen.style.overflow = 'auto';\n this._screen.style.background = DEFAULT_BACKGROUND;\n this._canvas = document.createElement('canvas');\n this._canvas.style.margin = 'auto';\n // Some browsers add an outline on focus\n this._canvas.style.outline = 'none';\n this._canvas.width = 0;\n this._canvas.height = 0;\n this._canvas.tabIndex = -1;\n this._screen.appendChild(this._canvas);\n\n // Cursor\n this._cursor = new Cursor();\n\n // XXX: TightVNC 2.8.11 sends no cursor at all until Windows changes\n // it. Result: no cursor at all until a window border or an edit field\n // is hit blindly. But there are also VNC servers that draw the cursor\n // in the framebuffer and don't send the empty local cursor. There is\n // no way to satisfy both sides.\n //\n // The spec is unclear on this \"initial cursor\" issue. Many other\n // viewers (TigerVNC, RealVNC, Remmina) display an arrow as the\n // initial cursor instead.\n this._cursorImage = RFB.cursors.none;\n\n // populate decoder array with objects\n this._decoders[encodings.encodingRaw] = new RawDecoder();\n this._decoders[encodings.encodingCopyRect] = new CopyRectDecoder();\n this._decoders[encodings.encodingRRE] = new RREDecoder();\n this._decoders[encodings.encodingHextile] = new HextileDecoder();\n this._decoders[encodings.encodingTight] = new TightDecoder();\n this._decoders[encodings.encodingTightPNG] = new TightPNGDecoder();\n this._decoders[encodings.encodingZRLE] = new ZRLEDecoder();\n this._decoders[encodings.encodingJPEG] = new JPEGDecoder();\n\n // NB: nothing that needs explicit teardown should be done\n // before this point, since this can throw an exception\n try {\n this._display = new Display(this._canvas);\n } catch (exc) {\n Log.Error(\"Display exception: \" + exc);\n throw exc;\n }\n this._display.onflush = this._onFlush.bind(this);\n\n this._keyboard = new Keyboard(this._canvas);\n this._keyboard.onkeyevent = this._handleKeyEvent.bind(this);\n\n this._gestures = new GestureHandler();\n\n this._sock = new Websock();\n this._sock.on('open', this._socketOpen.bind(this));\n this._sock.on('close', this._socketClose.bind(this));\n this._sock.on('message', this._handleMessage.bind(this));\n this._sock.on('error', this._socketError.bind(this));\n\n this._expectedClientWidth = null;\n this._expectedClientHeight = null;\n this._resizeObserver = new ResizeObserver(this._eventHandlers.handleResize);\n\n // All prepared, kick off the connection\n this._updateConnectionState('connecting');\n\n Log.Debug(\"<< RFB.constructor\");\n\n // ===== PROPERTIES =====\n\n this.dragViewport = false;\n this.focusOnClick = true;\n\n this._viewOnly = false;\n this._clipViewport = false;\n this._clippingViewport = false;\n this._scaleViewport = false;\n this._resizeSession = false;\n\n this._showDotCursor = false;\n if (options.showDotCursor !== undefined) {\n Log.Warn(\"Specifying showDotCursor as a RFB constructor argument is deprecated\");\n this._showDotCursor = options.showDotCursor;\n }\n\n this._qualityLevel = 6;\n this._compressionLevel = 2;\n }\n\n // ===== PROPERTIES =====\n\n get viewOnly() { return this._viewOnly; }\n set viewOnly(viewOnly) {\n this._viewOnly = viewOnly;\n\n if (this._rfbConnectionState === \"connecting\" ||\n this._rfbConnectionState === \"connected\") {\n if (viewOnly) {\n this._keyboard.ungrab();\n } else {\n this._keyboard.grab();\n }\n }\n }\n\n get capabilities() { return this._capabilities; }\n\n get clippingViewport() { return this._clippingViewport; }\n _setClippingViewport(on) {\n if (on === this._clippingViewport) {\n return;\n }\n this._clippingViewport = on;\n this.dispatchEvent(new CustomEvent(\"clippingviewport\",\n { detail: this._clippingViewport }));\n }\n\n get touchButton() { return 0; }\n set touchButton(button) { Log.Warn(\"Using old API!\"); }\n\n get clipViewport() { return this._clipViewport; }\n set clipViewport(viewport) {\n this._clipViewport = viewport;\n this._updateClip();\n }\n\n get scaleViewport() { return this._scaleViewport; }\n set scaleViewport(scale) {\n this._scaleViewport = scale;\n // Scaling trumps clipping, so we may need to adjust\n // clipping when enabling or disabling scaling\n if (scale && this._clipViewport) {\n this._updateClip();\n }\n this._updateScale();\n if (!scale && this._clipViewport) {\n this._updateClip();\n }\n }\n\n get resizeSession() { return this._resizeSession; }\n set resizeSession(resize) {\n this._resizeSession = resize;\n if (resize) {\n this._requestRemoteResize();\n }\n }\n\n get showDotCursor() { return this._showDotCursor; }\n set showDotCursor(show) {\n this._showDotCursor = show;\n this._refreshCursor();\n }\n\n get background() { return this._screen.style.background; }\n set background(cssValue) { this._screen.style.background = cssValue; }\n\n get qualityLevel() {\n return this._qualityLevel;\n }\n set qualityLevel(qualityLevel) {\n if (!Number.isInteger(qualityLevel) || qualityLevel < 0 || qualityLevel > 9) {\n Log.Error(\"qualityLevel must be an integer between 0 and 9\");\n return;\n }\n\n if (this._qualityLevel === qualityLevel) {\n return;\n }\n\n this._qualityLevel = qualityLevel;\n\n if (this._rfbConnectionState === 'connected') {\n this._sendEncodings();\n }\n }\n\n get compressionLevel() {\n return this._compressionLevel;\n }\n set compressionLevel(compressionLevel) {\n if (!Number.isInteger(compressionLevel) || compressionLevel < 0 || compressionLevel > 9) {\n Log.Error(\"compressionLevel must be an integer between 0 and 9\");\n return;\n }\n\n if (this._compressionLevel === compressionLevel) {\n return;\n }\n\n this._compressionLevel = compressionLevel;\n\n if (this._rfbConnectionState === 'connected') {\n this._sendEncodings();\n }\n }\n\n // ===== PUBLIC METHODS =====\n\n disconnect() {\n this._updateConnectionState('disconnecting');\n this._sock.off('error');\n this._sock.off('message');\n this._sock.off('open');\n if (this._rfbRSAAESAuthenticationState !== null) {\n this._rfbRSAAESAuthenticationState.disconnect();\n }\n }\n\n approveServer() {\n if (this._rfbRSAAESAuthenticationState !== null) {\n this._rfbRSAAESAuthenticationState.approveServer();\n }\n }\n\n sendCredentials(creds) {\n this._rfbCredentials = creds;\n this._resumeAuthentication();\n }\n\n sendCtrlAltDel() {\n if (this._rfbConnectionState !== 'connected' || this._viewOnly) { return; }\n Log.Info(\"Sending Ctrl-Alt-Del\");\n\n this.sendKey(KeyTable.XK_Control_L, \"ControlLeft\", true);\n this.sendKey(KeyTable.XK_Alt_L, \"AltLeft\", true);\n this.sendKey(KeyTable.XK_Delete, \"Delete\", true);\n this.sendKey(KeyTable.XK_Delete, \"Delete\", false);\n this.sendKey(KeyTable.XK_Alt_L, \"AltLeft\", false);\n this.sendKey(KeyTable.XK_Control_L, \"ControlLeft\", false);\n }\n\n machineShutdown() {\n this._xvpOp(1, 2);\n }\n\n machineReboot() {\n this._xvpOp(1, 3);\n }\n\n machineReset() {\n this._xvpOp(1, 4);\n }\n\n // Send a key press. If 'down' is not specified then send a down key\n // followed by an up key.\n sendKey(keysym, code, down) {\n if (this._rfbConnectionState !== 'connected' || this._viewOnly) { return; }\n\n if (down === undefined) {\n this.sendKey(keysym, code, true);\n this.sendKey(keysym, code, false);\n return;\n }\n\n const scancode = XtScancode[code];\n\n if (this._qemuExtKeyEventSupported && scancode) {\n // 0 is NoSymbol\n keysym = keysym || 0;\n\n Log.Info(\"Sending key (\" + (down ? \"down\" : \"up\") + \"): keysym \" + keysym + \", scancode \" + scancode);\n\n RFB.messages.QEMUExtendedKeyEvent(this._sock, keysym, down, scancode);\n } else {\n if (!keysym) {\n return;\n }\n Log.Info(\"Sending keysym (\" + (down ? \"down\" : \"up\") + \"): \" + keysym);\n RFB.messages.keyEvent(this._sock, keysym, down ? 1 : 0);\n }\n }\n\n focus(options) {\n this._canvas.focus(options);\n }\n\n blur() {\n this._canvas.blur();\n }\n\n clipboardPasteFrom(text) {\n if (this._rfbConnectionState !== 'connected' || this._viewOnly) { return; }\n\n if (this._clipboardServerCapabilitiesFormats[extendedClipboardFormatText] &&\n this._clipboardServerCapabilitiesActions[extendedClipboardActionNotify]) {\n\n this._clipboardText = text;\n RFB.messages.extendedClipboardNotify(this._sock, [extendedClipboardFormatText]);\n } else {\n let length, i;\n let data;\n\n length = 0;\n // eslint-disable-next-line no-unused-vars\n for (let codePoint of text) {\n length++;\n }\n\n data = new Uint8Array(length);\n\n i = 0;\n for (let codePoint of text) {\n let code = codePoint.codePointAt(0);\n\n /* Only ISO 8859-1 is supported */\n if (code > 0xff) {\n code = 0x3f; // '?'\n }\n\n data[i++] = code;\n }\n\n RFB.messages.clientCutText(this._sock, data);\n }\n }\n\n getImageData() {\n return this._display.getImageData();\n }\n\n toDataURL(type, encoderOptions) {\n return this._display.toDataURL(type, encoderOptions);\n }\n\n toBlob(callback, type, quality) {\n return this._display.toBlob(callback, type, quality);\n }\n\n // ===== PRIVATE METHODS =====\n\n _connect() {\n Log.Debug(\">> RFB.connect\");\n\n if (this._url) {\n Log.Info(`connecting to ${this._url}`);\n this._sock.open(this._url, this._wsProtocols);\n } else {\n Log.Info(`attaching ${this._rawChannel} to Websock`);\n this._sock.attach(this._rawChannel);\n\n if (this._sock.readyState === 'closed') {\n throw Error(\"Cannot use already closed WebSocket/RTCDataChannel\");\n }\n\n if (this._sock.readyState === 'open') {\n // FIXME: _socketOpen() can in theory call _fail(), which\n // isn't allowed this early, but I'm not sure that can\n // happen without a bug messing up our state variables\n this._socketOpen();\n }\n }\n\n // Make our elements part of the page\n this._target.appendChild(this._screen);\n\n this._gestures.attach(this._canvas);\n\n this._cursor.attach(this._canvas);\n this._refreshCursor();\n\n // Monitor size changes of the screen element\n this._resizeObserver.observe(this._screen);\n\n // Always grab focus on some kind of click event\n this._canvas.addEventListener(\"mousedown\", this._eventHandlers.focusCanvas);\n this._canvas.addEventListener(\"touchstart\", this._eventHandlers.focusCanvas);\n\n // Mouse events\n this._canvas.addEventListener('mousedown', this._eventHandlers.handleMouse);\n this._canvas.addEventListener('mouseup', this._eventHandlers.handleMouse);\n this._canvas.addEventListener('mousemove', this._eventHandlers.handleMouse);\n // Prevent middle-click pasting (see handler for why we bind to document)\n this._canvas.addEventListener('click', this._eventHandlers.handleMouse);\n // preventDefault() on mousedown doesn't stop this event for some\n // reason so we have to explicitly block it\n this._canvas.addEventListener('contextmenu', this._eventHandlers.handleMouse);\n\n // Wheel events\n this._canvas.addEventListener(\"wheel\", this._eventHandlers.handleWheel);\n\n // Gesture events\n this._canvas.addEventListener(\"gesturestart\", this._eventHandlers.handleGesture);\n this._canvas.addEventListener(\"gesturemove\", this._eventHandlers.handleGesture);\n this._canvas.addEventListener(\"gestureend\", this._eventHandlers.handleGesture);\n\n Log.Debug(\"<< RFB.connect\");\n }\n\n _disconnect() {\n Log.Debug(\">> RFB.disconnect\");\n this._cursor.detach();\n this._canvas.removeEventListener(\"gesturestart\", this._eventHandlers.handleGesture);\n this._canvas.removeEventListener(\"gesturemove\", this._eventHandlers.handleGesture);\n this._canvas.removeEventListener(\"gestureend\", this._eventHandlers.handleGesture);\n this._canvas.removeEventListener(\"wheel\", this._eventHandlers.handleWheel);\n this._canvas.removeEventListener('mousedown', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('mouseup', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('mousemove', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('click', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('contextmenu', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener(\"mousedown\", this._eventHandlers.focusCanvas);\n this._canvas.removeEventListener(\"touchstart\", this._eventHandlers.focusCanvas);\n this._resizeObserver.disconnect();\n this._keyboard.ungrab();\n this._gestures.detach();\n this._sock.close();\n try {\n this._target.removeChild(this._screen);\n } catch (e) {\n if (e.name === 'NotFoundError') {\n // Some cases where the initial connection fails\n // can disconnect before the _screen is created\n } else {\n throw e;\n }\n }\n clearTimeout(this._resizeTimeout);\n clearTimeout(this._mouseMoveTimer);\n Log.Debug(\"<< RFB.disconnect\");\n }\n\n _socketOpen() {\n if ((this._rfbConnectionState === 'connecting') &&\n (this._rfbInitState === '')) {\n this._rfbInitState = 'ProtocolVersion';\n Log.Debug(\"Starting VNC handshake\");\n } else {\n this._fail(\"Unexpected server connection while \" +\n this._rfbConnectionState);\n }\n }\n\n _socketClose(e) {\n Log.Debug(\"WebSocket on-close event\");\n let msg = \"\";\n if (e.code) {\n msg = \"(code: \" + e.code;\n if (e.reason) {\n msg += \", reason: \" + e.reason;\n }\n msg += \")\";\n }\n switch (this._rfbConnectionState) {\n case 'connecting':\n this._fail(\"Connection closed \" + msg);\n break;\n case 'connected':\n // Handle disconnects that were initiated server-side\n this._updateConnectionState('disconnecting');\n this._updateConnectionState('disconnected');\n break;\n case 'disconnecting':\n // Normal disconnection path\n this._updateConnectionState('disconnected');\n break;\n case 'disconnected':\n this._fail(\"Unexpected server disconnect \" +\n \"when already disconnected \" + msg);\n break;\n default:\n this._fail(\"Unexpected server disconnect before connecting \" +\n msg);\n break;\n }\n this._sock.off('close');\n // Delete reference to raw channel to allow cleanup.\n this._rawChannel = null;\n }\n\n _socketError(e) {\n Log.Warn(\"WebSocket on-error event\");\n }\n\n _focusCanvas(event) {\n if (!this.focusOnClick) {\n return;\n }\n\n this.focus({ preventScroll: true });\n }\n\n _setDesktopName(name) {\n this._fbName = name;\n this.dispatchEvent(new CustomEvent(\n \"desktopname\",\n { detail: { name: this._fbName } }));\n }\n\n _saveExpectedClientSize() {\n this._expectedClientWidth = this._screen.clientWidth;\n this._expectedClientHeight = this._screen.clientHeight;\n }\n\n _currentClientSize() {\n return [this._screen.clientWidth, this._screen.clientHeight];\n }\n\n _clientHasExpectedSize() {\n const [currentWidth, currentHeight] = this._currentClientSize();\n return currentWidth == this._expectedClientWidth &&\n currentHeight == this._expectedClientHeight;\n }\n\n _handleResize() {\n // Don't change anything if the client size is already as expected\n if (this._clientHasExpectedSize()) {\n return;\n }\n // If the window resized then our screen element might have\n // as well. Update the viewport dimensions.\n window.requestAnimationFrame(() => {\n this._updateClip();\n this._updateScale();\n });\n\n if (this._resizeSession) {\n // Request changing the resolution of the remote display to\n // the size of the local browser viewport.\n\n // In order to not send multiple requests before the browser-resize\n // is finished we wait 0.5 seconds before sending the request.\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = setTimeout(this._requestRemoteResize.bind(this), 500);\n }\n }\n\n // Update state of clipping in Display object, and make sure the\n // configured viewport matches the current screen size\n _updateClip() {\n const curClip = this._display.clipViewport;\n let newClip = this._clipViewport;\n\n if (this._scaleViewport) {\n // Disable viewport clipping if we are scaling\n newClip = false;\n }\n\n if (curClip !== newClip) {\n this._display.clipViewport = newClip;\n }\n\n if (newClip) {\n // When clipping is enabled, the screen is limited to\n // the size of the container.\n const size = this._screenSize();\n this._display.viewportChangeSize(size.w, size.h);\n this._fixScrollbars();\n this._setClippingViewport(size.w < this._display.width ||\n size.h < this._display.height);\n } else {\n this._setClippingViewport(false);\n }\n\n // When changing clipping we might show or hide scrollbars.\n // This causes the expected client dimensions to change.\n if (curClip !== newClip) {\n this._saveExpectedClientSize();\n }\n }\n\n _updateScale() {\n if (!this._scaleViewport) {\n this._display.scale = 1.0;\n } else {\n const size = this._screenSize();\n this._display.autoscale(size.w, size.h);\n }\n this._fixScrollbars();\n }\n\n // Requests a change of remote desktop size. This message is an extension\n // and may only be sent if we have received an ExtendedDesktopSize message\n _requestRemoteResize() {\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = null;\n\n if (!this._resizeSession || this._viewOnly ||\n !this._supportsSetDesktopSize) {\n return;\n }\n\n const size = this._screenSize();\n\n RFB.messages.setDesktopSize(this._sock,\n Math.floor(size.w), Math.floor(size.h),\n this._screenID, this._screenFlags);\n\n Log.Debug('Requested new desktop size: ' +\n size.w + 'x' + size.h);\n }\n\n // Gets the the size of the available screen\n _screenSize() {\n let r = this._screen.getBoundingClientRect();\n return { w: r.width, h: r.height };\n }\n\n _fixScrollbars() {\n // This is a hack because Safari on macOS screws up the calculation\n // for when scrollbars are needed. We get scrollbars when making the\n // browser smaller, despite remote resize being enabled. So to fix it\n // we temporarily toggle them off and on.\n const orig = this._screen.style.overflow;\n this._screen.style.overflow = 'hidden';\n // Force Safari to recalculate the layout by asking for\n // an element's dimensions\n this._screen.getBoundingClientRect();\n this._screen.style.overflow = orig;\n }\n\n /*\n * Connection states:\n * connecting\n * connected\n * disconnecting\n * disconnected - permanent state\n */\n _updateConnectionState(state) {\n const oldstate = this._rfbConnectionState;\n\n if (state === oldstate) {\n Log.Debug(\"Already in state '\" + state + \"', ignoring\");\n return;\n }\n\n // The 'disconnected' state is permanent for each RFB object\n if (oldstate === 'disconnected') {\n Log.Error(\"Tried changing state of a disconnected RFB object\");\n return;\n }\n\n // Ensure proper transitions before doing anything\n switch (state) {\n case 'connected':\n if (oldstate !== 'connecting') {\n Log.Error(\"Bad transition to connected state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n case 'disconnected':\n if (oldstate !== 'disconnecting') {\n Log.Error(\"Bad transition to disconnected state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n case 'connecting':\n if (oldstate !== '') {\n Log.Error(\"Bad transition to connecting state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n case 'disconnecting':\n if (oldstate !== 'connected' && oldstate !== 'connecting') {\n Log.Error(\"Bad transition to disconnecting state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n default:\n Log.Error(\"Unknown connection state: \" + state);\n return;\n }\n\n // State change actions\n\n this._rfbConnectionState = state;\n\n Log.Debug(\"New state '\" + state + \"', was '\" + oldstate + \"'.\");\n\n if (this._disconnTimer && state !== 'disconnecting') {\n Log.Debug(\"Clearing disconnect timer\");\n clearTimeout(this._disconnTimer);\n this._disconnTimer = null;\n\n // make sure we don't get a double event\n this._sock.off('close');\n }\n\n switch (state) {\n case 'connecting':\n this._connect();\n break;\n\n case 'connected':\n this.dispatchEvent(new CustomEvent(\"connect\", { detail: {} }));\n break;\n\n case 'disconnecting':\n this._disconnect();\n\n this._disconnTimer = setTimeout(() => {\n Log.Error(\"Disconnection timed out.\");\n this._updateConnectionState('disconnected');\n }, DISCONNECT_TIMEOUT * 1000);\n break;\n\n case 'disconnected':\n this.dispatchEvent(new CustomEvent(\n \"disconnect\", { detail:\n { clean: this._rfbCleanDisconnect } }));\n break;\n }\n }\n\n /* Print errors and disconnect\n *\n * The parameter 'details' is used for information that\n * should be logged but not sent to the user interface.\n */\n _fail(details) {\n switch (this._rfbConnectionState) {\n case 'disconnecting':\n Log.Error(\"Failed when disconnecting: \" + details);\n break;\n case 'connected':\n Log.Error(\"Failed while connected: \" + details);\n break;\n case 'connecting':\n Log.Error(\"Failed when connecting: \" + details);\n break;\n default:\n Log.Error(\"RFB failure: \" + details);\n break;\n }\n this._rfbCleanDisconnect = false; //This is sent to the UI\n\n // Transition to disconnected without waiting for socket to close\n this._updateConnectionState('disconnecting');\n this._updateConnectionState('disconnected');\n\n return false;\n }\n\n _setCapability(cap, val) {\n this._capabilities[cap] = val;\n this.dispatchEvent(new CustomEvent(\"capabilities\",\n { detail: { capabilities: this._capabilities } }));\n }\n\n _handleMessage() {\n if (this._sock.rQlen === 0) {\n Log.Warn(\"handleMessage called on an empty receive queue\");\n return;\n }\n\n switch (this._rfbConnectionState) {\n case 'disconnected':\n Log.Error(\"Got data while disconnected\");\n break;\n case 'connected':\n while (true) {\n if (this._flushing) {\n break;\n }\n if (!this._normalMsg()) {\n break;\n }\n if (this._sock.rQlen === 0) {\n break;\n }\n }\n break;\n case 'connecting':\n while (this._rfbConnectionState === 'connecting') {\n if (!this._initMsg()) {\n break;\n }\n }\n break;\n default:\n Log.Error(\"Got data while in an invalid state\");\n break;\n }\n }\n\n _handleKeyEvent(keysym, code, down) {\n this.sendKey(keysym, code, down);\n }\n\n _handleMouse(ev) {\n /*\n * We don't check connection status or viewOnly here as the\n * mouse events might be used to control the viewport\n */\n\n if (ev.type === 'click') {\n /*\n * Note: This is only needed for the 'click' event as it fails\n * to fire properly for the target element so we have\n * to listen on the document element instead.\n */\n if (ev.target !== this._canvas) {\n return;\n }\n }\n\n // FIXME: if we're in view-only and not dragging,\n // should we stop events?\n ev.stopPropagation();\n ev.preventDefault();\n\n if ((ev.type === 'click') || (ev.type === 'contextmenu')) {\n return;\n }\n\n let pos = clientToElement(ev.clientX, ev.clientY,\n this._canvas);\n\n switch (ev.type) {\n case 'mousedown':\n setCapture(this._canvas);\n this._handleMouseButton(pos.x, pos.y,\n true, 1 << ev.button);\n break;\n case 'mouseup':\n this._handleMouseButton(pos.x, pos.y,\n false, 1 << ev.button);\n break;\n case 'mousemove':\n this._handleMouseMove(pos.x, pos.y);\n break;\n }\n }\n\n _handleMouseButton(x, y, down, bmask) {\n if (this.dragViewport) {\n if (down && !this._viewportDragging) {\n this._viewportDragging = true;\n this._viewportDragPos = {'x': x, 'y': y};\n this._viewportHasMoved = false;\n\n // Skip sending mouse events\n return;\n } else {\n this._viewportDragging = false;\n\n // If we actually performed a drag then we are done\n // here and should not send any mouse events\n if (this._viewportHasMoved) {\n return;\n }\n\n // Otherwise we treat this as a mouse click event.\n // Send the button down event here, as the button up\n // event is sent at the end of this function.\n this._sendMouse(x, y, bmask);\n }\n }\n\n // Flush waiting move event first\n if (this._mouseMoveTimer !== null) {\n clearTimeout(this._mouseMoveTimer);\n this._mouseMoveTimer = null;\n this._sendMouse(x, y, this._mouseButtonMask);\n }\n\n if (down) {\n this._mouseButtonMask |= bmask;\n } else {\n this._mouseButtonMask &= ~bmask;\n }\n\n this._sendMouse(x, y, this._mouseButtonMask);\n }\n\n _handleMouseMove(x, y) {\n if (this._viewportDragging) {\n const deltaX = this._viewportDragPos.x - x;\n const deltaY = this._viewportDragPos.y - y;\n\n if (this._viewportHasMoved || (Math.abs(deltaX) > dragThreshold ||\n Math.abs(deltaY) > dragThreshold)) {\n this._viewportHasMoved = true;\n\n this._viewportDragPos = {'x': x, 'y': y};\n this._display.viewportChangePos(deltaX, deltaY);\n }\n\n // Skip sending mouse events\n return;\n }\n\n this._mousePos = { 'x': x, 'y': y };\n\n // Limit many mouse move events to one every MOUSE_MOVE_DELAY ms\n if (this._mouseMoveTimer == null) {\n\n const timeSinceLastMove = Date.now() - this._mouseLastMoveTime;\n if (timeSinceLastMove > MOUSE_MOVE_DELAY) {\n this._sendMouse(x, y, this._mouseButtonMask);\n this._mouseLastMoveTime = Date.now();\n } else {\n // Too soon since the latest move, wait the remaining time\n this._mouseMoveTimer = setTimeout(() => {\n this._handleDelayedMouseMove();\n }, MOUSE_MOVE_DELAY - timeSinceLastMove);\n }\n }\n }\n\n _handleDelayedMouseMove() {\n this._mouseMoveTimer = null;\n this._sendMouse(this._mousePos.x, this._mousePos.y,\n this._mouseButtonMask);\n this._mouseLastMoveTime = Date.now();\n }\n\n _sendMouse(x, y, mask) {\n if (this._rfbConnectionState !== 'connected') { return; }\n if (this._viewOnly) { return; } // View only, skip mouse events\n\n RFB.messages.pointerEvent(this._sock, this._display.absX(x),\n this._display.absY(y), mask);\n }\n\n _handleWheel(ev) {\n if (this._rfbConnectionState !== 'connected') { return; }\n if (this._viewOnly) { return; } // View only, skip mouse events\n\n ev.stopPropagation();\n ev.preventDefault();\n\n let pos = clientToElement(ev.clientX, ev.clientY,\n this._canvas);\n\n let dX = ev.deltaX;\n let dY = ev.deltaY;\n\n // Pixel units unless it's non-zero.\n // Note that if deltamode is line or page won't matter since we aren't\n // sending the mouse wheel delta to the server anyway.\n // The difference between pixel and line can be important however since\n // we have a threshold that can be smaller than the line height.\n if (ev.deltaMode !== 0) {\n dX *= WHEEL_LINE_HEIGHT;\n dY *= WHEEL_LINE_HEIGHT;\n }\n\n // Mouse wheel events are sent in steps over VNC. This means that the VNC\n // protocol can't handle a wheel event with specific distance or speed.\n // Therefor, if we get a lot of small mouse wheel events we combine them.\n this._accumulatedWheelDeltaX += dX;\n this._accumulatedWheelDeltaY += dY;\n\n // Generate a mouse wheel step event when the accumulated delta\n // for one of the axes is large enough.\n if (Math.abs(this._accumulatedWheelDeltaX) >= WHEEL_STEP) {\n if (this._accumulatedWheelDeltaX < 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 5);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 5);\n } else if (this._accumulatedWheelDeltaX > 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 6);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 6);\n }\n\n this._accumulatedWheelDeltaX = 0;\n }\n if (Math.abs(this._accumulatedWheelDeltaY) >= WHEEL_STEP) {\n if (this._accumulatedWheelDeltaY < 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 3);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 3);\n } else if (this._accumulatedWheelDeltaY > 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 4);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 4);\n }\n\n this._accumulatedWheelDeltaY = 0;\n }\n }\n\n _fakeMouseMove(ev, elementX, elementY) {\n this._handleMouseMove(elementX, elementY);\n this._cursor.move(ev.detail.clientX, ev.detail.clientY);\n }\n\n _handleTapEvent(ev, bmask) {\n let pos = clientToElement(ev.detail.clientX, ev.detail.clientY,\n this._canvas);\n\n // If the user quickly taps multiple times we assume they meant to\n // hit the same spot, so slightly adjust coordinates\n\n if ((this._gestureLastTapTime !== null) &&\n ((Date.now() - this._gestureLastTapTime) < DOUBLE_TAP_TIMEOUT) &&\n (this._gestureFirstDoubleTapEv.detail.type === ev.detail.type)) {\n let dx = this._gestureFirstDoubleTapEv.detail.clientX - ev.detail.clientX;\n let dy = this._gestureFirstDoubleTapEv.detail.clientY - ev.detail.clientY;\n let distance = Math.hypot(dx, dy);\n\n if (distance < DOUBLE_TAP_THRESHOLD) {\n pos = clientToElement(this._gestureFirstDoubleTapEv.detail.clientX,\n this._gestureFirstDoubleTapEv.detail.clientY,\n this._canvas);\n } else {\n this._gestureFirstDoubleTapEv = ev;\n }\n } else {\n this._gestureFirstDoubleTapEv = ev;\n }\n this._gestureLastTapTime = Date.now();\n\n this._fakeMouseMove(this._gestureFirstDoubleTapEv, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, true, bmask);\n this._handleMouseButton(pos.x, pos.y, false, bmask);\n }\n\n _handleGesture(ev) {\n let magnitude;\n\n let pos = clientToElement(ev.detail.clientX, ev.detail.clientY,\n this._canvas);\n switch (ev.type) {\n case 'gesturestart':\n switch (ev.detail.type) {\n case 'onetap':\n this._handleTapEvent(ev, 0x1);\n break;\n case 'twotap':\n this._handleTapEvent(ev, 0x4);\n break;\n case 'threetap':\n this._handleTapEvent(ev, 0x2);\n break;\n case 'drag':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, true, 0x1);\n break;\n case 'longpress':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, true, 0x4);\n break;\n\n case 'twodrag':\n this._gestureLastMagnitudeX = ev.detail.magnitudeX;\n this._gestureLastMagnitudeY = ev.detail.magnitudeY;\n this._fakeMouseMove(ev, pos.x, pos.y);\n break;\n case 'pinch':\n this._gestureLastMagnitudeX = Math.hypot(ev.detail.magnitudeX,\n ev.detail.magnitudeY);\n this._fakeMouseMove(ev, pos.x, pos.y);\n break;\n }\n break;\n\n case 'gesturemove':\n switch (ev.detail.type) {\n case 'onetap':\n case 'twotap':\n case 'threetap':\n break;\n case 'drag':\n case 'longpress':\n this._fakeMouseMove(ev, pos.x, pos.y);\n break;\n case 'twodrag':\n // Always scroll in the same position.\n // We don't know if the mouse was moved so we need to move it\n // every update.\n this._fakeMouseMove(ev, pos.x, pos.y);\n while ((ev.detail.magnitudeY - this._gestureLastMagnitudeY) > GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x8);\n this._handleMouseButton(pos.x, pos.y, false, 0x8);\n this._gestureLastMagnitudeY += GESTURE_SCRLSENS;\n }\n while ((ev.detail.magnitudeY - this._gestureLastMagnitudeY) < -GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x10);\n this._handleMouseButton(pos.x, pos.y, false, 0x10);\n this._gestureLastMagnitudeY -= GESTURE_SCRLSENS;\n }\n while ((ev.detail.magnitudeX - this._gestureLastMagnitudeX) > GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x20);\n this._handleMouseButton(pos.x, pos.y, false, 0x20);\n this._gestureLastMagnitudeX += GESTURE_SCRLSENS;\n }\n while ((ev.detail.magnitudeX - this._gestureLastMagnitudeX) < -GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x40);\n this._handleMouseButton(pos.x, pos.y, false, 0x40);\n this._gestureLastMagnitudeX -= GESTURE_SCRLSENS;\n }\n break;\n case 'pinch':\n // Always scroll in the same position.\n // We don't know if the mouse was moved so we need to move it\n // every update.\n this._fakeMouseMove(ev, pos.x, pos.y);\n magnitude = Math.hypot(ev.detail.magnitudeX, ev.detail.magnitudeY);\n if (Math.abs(magnitude - this._gestureLastMagnitudeX) > GESTURE_ZOOMSENS) {\n this._handleKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n while ((magnitude - this._gestureLastMagnitudeX) > GESTURE_ZOOMSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x8);\n this._handleMouseButton(pos.x, pos.y, false, 0x8);\n this._gestureLastMagnitudeX += GESTURE_ZOOMSENS;\n }\n while ((magnitude - this._gestureLastMagnitudeX) < -GESTURE_ZOOMSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x10);\n this._handleMouseButton(pos.x, pos.y, false, 0x10);\n this._gestureLastMagnitudeX -= GESTURE_ZOOMSENS;\n }\n }\n this._handleKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", false);\n break;\n }\n break;\n\n case 'gestureend':\n switch (ev.detail.type) {\n case 'onetap':\n case 'twotap':\n case 'threetap':\n case 'pinch':\n case 'twodrag':\n break;\n case 'drag':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, false, 0x1);\n break;\n case 'longpress':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, false, 0x4);\n break;\n }\n break;\n }\n }\n\n // Message Handlers\n\n _negotiateProtocolVersion() {\n if (this._sock.rQwait(\"version\", 12)) {\n return false;\n }\n\n const sversion = this._sock.rQshiftStr(12).substr(4, 7);\n Log.Info(\"Server ProtocolVersion: \" + sversion);\n let isRepeater = 0;\n switch (sversion) {\n case \"000.000\": // UltraVNC repeater\n isRepeater = 1;\n break;\n case \"003.003\":\n case \"003.006\": // UltraVNC\n this._rfbVersion = 3.3;\n break;\n case \"003.007\":\n this._rfbVersion = 3.7;\n break;\n case \"003.008\":\n case \"003.889\": // Apple Remote Desktop\n case \"004.000\": // Intel AMT KVM\n case \"004.001\": // RealVNC 4.6\n case \"005.000\": // RealVNC 5.3\n this._rfbVersion = 3.8;\n break;\n default:\n return this._fail(\"Invalid server version \" + sversion);\n }\n\n if (isRepeater) {\n let repeaterID = \"ID:\" + this._repeaterID;\n while (repeaterID.length < 250) {\n repeaterID += \"\\0\";\n }\n this._sock.sendString(repeaterID);\n return true;\n }\n\n if (this._rfbVersion > this._rfbMaxVersion) {\n this._rfbVersion = this._rfbMaxVersion;\n }\n\n const cversion = \"00\" + parseInt(this._rfbVersion, 10) +\n \".00\" + ((this._rfbVersion * 10) % 10);\n this._sock.sendString(\"RFB \" + cversion + \"\\n\");\n Log.Debug('Sent ProtocolVersion: ' + cversion);\n\n this._rfbInitState = 'Security';\n }\n\n _isSupportedSecurityType(type) {\n const clientTypes = [\n securityTypeNone,\n securityTypeVNCAuth,\n securityTypeRA2ne,\n securityTypeTight,\n securityTypeVeNCrypt,\n securityTypeXVP,\n securityTypeARD,\n securityTypeMSLogonII,\n securityTypePlain,\n ];\n\n return clientTypes.includes(type);\n }\n\n _negotiateSecurity() {\n if (this._rfbVersion >= 3.7) {\n // Server sends supported list, client decides\n const numTypes = this._sock.rQshift8();\n if (this._sock.rQwait(\"security type\", numTypes, 1)) { return false; }\n\n if (numTypes === 0) {\n this._rfbInitState = \"SecurityReason\";\n this._securityContext = \"no security types\";\n this._securityStatus = 1;\n return true;\n }\n\n const types = this._sock.rQshiftBytes(numTypes);\n Log.Debug(\"Server security types: \" + types);\n\n // Look for a matching security type in the order that the\n // server prefers\n this._rfbAuthScheme = -1;\n for (let type of types) {\n if (this._isSupportedSecurityType(type)) {\n this._rfbAuthScheme = type;\n break;\n }\n }\n\n if (this._rfbAuthScheme === -1) {\n return this._fail(\"Unsupported security types (types: \" + types + \")\");\n }\n\n this._sock.send([this._rfbAuthScheme]);\n } else {\n // Server decides\n if (this._sock.rQwait(\"security scheme\", 4)) { return false; }\n this._rfbAuthScheme = this._sock.rQshift32();\n\n if (this._rfbAuthScheme == 0) {\n this._rfbInitState = \"SecurityReason\";\n this._securityContext = \"authentication scheme\";\n this._securityStatus = 1;\n return true;\n }\n }\n\n this._rfbInitState = 'Authentication';\n Log.Debug('Authenticating using scheme: ' + this._rfbAuthScheme);\n\n return true;\n }\n\n _handleSecurityReason() {\n if (this._sock.rQwait(\"reason length\", 4)) {\n return false;\n }\n const strlen = this._sock.rQshift32();\n let reason = \"\";\n\n if (strlen > 0) {\n if (this._sock.rQwait(\"reason\", strlen, 4)) { return false; }\n reason = this._sock.rQshiftStr(strlen);\n }\n\n if (reason !== \"\") {\n this.dispatchEvent(new CustomEvent(\n \"securityfailure\",\n { detail: { status: this._securityStatus,\n reason: reason } }));\n\n return this._fail(\"Security negotiation failed on \" +\n this._securityContext +\n \" (reason: \" + reason + \")\");\n } else {\n this.dispatchEvent(new CustomEvent(\n \"securityfailure\",\n { detail: { status: this._securityStatus } }));\n\n return this._fail(\"Security negotiation failed on \" +\n this._securityContext);\n }\n }\n\n // authentication\n _negotiateXvpAuth() {\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined ||\n this._rfbCredentials.target === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\", \"target\"] } }));\n return false;\n }\n\n const xvpAuthStr = String.fromCharCode(this._rfbCredentials.username.length) +\n String.fromCharCode(this._rfbCredentials.target.length) +\n this._rfbCredentials.username +\n this._rfbCredentials.target;\n this._sock.sendString(xvpAuthStr);\n this._rfbAuthScheme = securityTypeVNCAuth;\n return this._negotiateAuthentication();\n }\n\n // VeNCrypt authentication, currently only supports version 0.2 and only Plain subtype\n _negotiateVeNCryptAuth() {\n\n // waiting for VeNCrypt version\n if (this._rfbVeNCryptState == 0) {\n if (this._sock.rQwait(\"vencrypt version\", 2)) { return false; }\n\n const major = this._sock.rQshift8();\n const minor = this._sock.rQshift8();\n\n if (!(major == 0 && minor == 2)) {\n return this._fail(\"Unsupported VeNCrypt version \" + major + \".\" + minor);\n }\n\n this._sock.send([0, 2]);\n this._rfbVeNCryptState = 1;\n }\n\n // waiting for ACK\n if (this._rfbVeNCryptState == 1) {\n if (this._sock.rQwait(\"vencrypt ack\", 1)) { return false; }\n\n const res = this._sock.rQshift8();\n\n if (res != 0) {\n return this._fail(\"VeNCrypt failure \" + res);\n }\n\n this._rfbVeNCryptState = 2;\n }\n // must fall through here (i.e. no \"else if\"), beacause we may have already received\n // the subtypes length and won't be called again\n\n if (this._rfbVeNCryptState == 2) { // waiting for subtypes length\n if (this._sock.rQwait(\"vencrypt subtypes length\", 1)) { return false; }\n\n const subtypesLength = this._sock.rQshift8();\n if (subtypesLength < 1) {\n return this._fail(\"VeNCrypt subtypes empty\");\n }\n\n this._rfbVeNCryptSubtypesLength = subtypesLength;\n this._rfbVeNCryptState = 3;\n }\n\n // waiting for subtypes list\n if (this._rfbVeNCryptState == 3) {\n if (this._sock.rQwait(\"vencrypt subtypes\", 4 * this._rfbVeNCryptSubtypesLength)) { return false; }\n\n const subtypes = [];\n for (let i = 0; i < this._rfbVeNCryptSubtypesLength; i++) {\n subtypes.push(this._sock.rQshift32());\n }\n\n // Look for a matching security type in the order that the\n // server prefers\n this._rfbAuthScheme = -1;\n for (let type of subtypes) {\n // Avoid getting in to a loop\n if (type === securityTypeVeNCrypt) {\n continue;\n }\n\n if (this._isSupportedSecurityType(type)) {\n this._rfbAuthScheme = type;\n break;\n }\n }\n\n if (this._rfbAuthScheme === -1) {\n return this._fail(\"Unsupported security types (types: \" + subtypes + \")\");\n }\n\n this._sock.send([this._rfbAuthScheme >> 24,\n this._rfbAuthScheme >> 16,\n this._rfbAuthScheme >> 8,\n this._rfbAuthScheme]);\n\n this._rfbVeNCryptState == 4;\n return true;\n }\n }\n\n _negotiatePlainAuth() {\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n return false;\n }\n\n const user = encodeUTF8(this._rfbCredentials.username);\n const pass = encodeUTF8(this._rfbCredentials.password);\n\n this._sock.send([\n (user.length >> 24) & 0xFF,\n (user.length >> 16) & 0xFF,\n (user.length >> 8) & 0xFF,\n user.length & 0xFF\n ]);\n this._sock.send([\n (pass.length >> 24) & 0xFF,\n (pass.length >> 16) & 0xFF,\n (pass.length >> 8) & 0xFF,\n pass.length & 0xFF\n ]);\n this._sock.sendString(user);\n this._sock.sendString(pass);\n\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n _negotiateStdVNCAuth() {\n if (this._sock.rQwait(\"auth challenge\", 16)) { return false; }\n\n if (this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"password\"] } }));\n return false;\n }\n\n // TODO(directxman12): make genDES not require an Array\n const challenge = Array.prototype.slice.call(this._sock.rQshiftBytes(16));\n const response = RFB.genDES(this._rfbCredentials.password, challenge);\n this._sock.send(response);\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n _negotiateARDAuth() {\n\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n return false;\n }\n\n if (this._rfbCredentials.ardPublicKey != undefined &&\n this._rfbCredentials.ardCredentials != undefined) {\n // if the async web crypto is done return the results\n this._sock.send(this._rfbCredentials.ardCredentials);\n this._sock.send(this._rfbCredentials.ardPublicKey);\n this._rfbCredentials.ardCredentials = null;\n this._rfbCredentials.ardPublicKey = null;\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n if (this._sock.rQwait(\"read ard\", 4)) { return false; }\n\n let generator = this._sock.rQshiftBytes(2); // DH base generator value\n\n let keyLength = this._sock.rQshift16();\n\n if (this._sock.rQwait(\"read ard keylength\", keyLength*2, 4)) { return false; }\n\n // read the server values\n let prime = this._sock.rQshiftBytes(keyLength); // predetermined prime modulus\n let serverPublicKey = this._sock.rQshiftBytes(keyLength); // other party's public key\n\n let clientPrivateKey = window.crypto.getRandomValues(new Uint8Array(keyLength));\n let padding = Array.from(window.crypto.getRandomValues(new Uint8Array(64)), byte => String.fromCharCode(65+byte%26)).join('');\n\n this._negotiateARDAuthAsync(generator, keyLength, prime, serverPublicKey, clientPrivateKey, padding);\n\n return false;\n }\n\n _modPow(base, exponent, modulus) {\n\n let baseHex = \"0x\"+Array.from(base, byte => ('0' + (byte & 0xFF).toString(16)).slice(-2)).join('');\n let exponentHex = \"0x\"+Array.from(exponent, byte => ('0' + (byte & 0xFF).toString(16)).slice(-2)).join('');\n let modulusHex = \"0x\"+Array.from(modulus, byte => ('0' + (byte & 0xFF).toString(16)).slice(-2)).join('');\n\n let b = BigInt(baseHex);\n let e = BigInt(exponentHex);\n let m = BigInt(modulusHex);\n let r = 1n;\n b = b % m;\n while (e > 0) {\n if (e % 2n === 1n) {\n r = (r * b) % m;\n }\n e = e / 2n;\n b = (b * b) % m;\n }\n let hexResult = r.toString(16);\n\n while (hexResult.length/2 String.fromCharCode(byte)).join('');\n let aesKey = await window.crypto.subtle.importKey(\"raw\", MD5(keyString), {name: \"AES-CBC\"}, false, [\"encrypt\"]);\n let data = new Uint8Array(string.length);\n for (let i = 0; i < string.length; ++i) {\n data[i] = string.charCodeAt(i);\n }\n let encrypted = new Uint8Array(data.length);\n for (let i=0;i 0 && this._sock.rQwait(\"tunnel capabilities\", 16 * numTunnels, 4)) { return false; }\n\n this._rfbTightVNC = true;\n\n if (numTunnels > 0) {\n this._negotiateTightTunnels(numTunnels);\n return false; // wait until we receive the sub auth to continue\n }\n }\n\n // second pass, do the sub-auth negotiation\n if (this._sock.rQwait(\"sub auth count\", 4)) { return false; }\n const subAuthCount = this._sock.rQshift32();\n if (subAuthCount === 0) { // empty sub-auth list received means 'no auth' subtype selected\n this._rfbInitState = 'SecurityResult';\n return true;\n }\n\n if (this._sock.rQwait(\"sub auth capabilities\", 16 * subAuthCount, 4)) { return false; }\n\n const clientSupportedTypes = {\n 'STDVNOAUTH__': 1,\n 'STDVVNCAUTH_': 2,\n 'TGHTULGNAUTH': 129\n };\n\n const serverSupportedTypes = [];\n\n for (let i = 0; i < subAuthCount; i++) {\n this._sock.rQshift32(); // capNum\n const capabilities = this._sock.rQshiftStr(12);\n serverSupportedTypes.push(capabilities);\n }\n\n Log.Debug(\"Server Tight authentication types: \" + serverSupportedTypes);\n\n for (let authType in clientSupportedTypes) {\n if (serverSupportedTypes.indexOf(authType) != -1) {\n this._sock.send([0, 0, 0, clientSupportedTypes[authType]]);\n Log.Debug(\"Selected authentication type: \" + authType);\n\n switch (authType) {\n case 'STDVNOAUTH__': // no auth\n this._rfbInitState = 'SecurityResult';\n return true;\n case 'STDVVNCAUTH_':\n this._rfbAuthScheme = securityTypeVNCAuth;\n return true;\n case 'TGHTULGNAUTH':\n this._rfbAuthScheme = securityTypeUnixLogon;\n return true;\n default:\n return this._fail(\"Unsupported tiny auth scheme \" +\n \"(scheme: \" + authType + \")\");\n }\n }\n }\n\n return this._fail(\"No supported sub-auth types!\");\n }\n\n _handleRSAAESCredentialsRequired(event) {\n this.dispatchEvent(event);\n }\n\n _handleRSAAESServerVerification(event) {\n this.dispatchEvent(event);\n }\n\n _negotiateRA2neAuth() {\n if (this._rfbRSAAESAuthenticationState === null) {\n this._rfbRSAAESAuthenticationState = new RSAAESAuthenticationState(this._sock, () => this._rfbCredentials);\n this._rfbRSAAESAuthenticationState.addEventListener(\n \"serververification\", this._eventHandlers.handleRSAAESServerVerification);\n this._rfbRSAAESAuthenticationState.addEventListener(\n \"credentialsrequired\", this._eventHandlers.handleRSAAESCredentialsRequired);\n }\n this._rfbRSAAESAuthenticationState.checkInternalEvents();\n if (!this._rfbRSAAESAuthenticationState.hasStarted) {\n this._rfbRSAAESAuthenticationState.negotiateRA2neAuthAsync()\n .catch((e) => {\n if (e.message !== \"disconnect normally\") {\n this._fail(e.message);\n }\n }).then(() => {\n this.dispatchEvent(new CustomEvent('securityresult'));\n this._rfbInitState = \"SecurityResult\";\n return true;\n }).finally(() => {\n this._rfbRSAAESAuthenticationState.removeEventListener(\n \"serververification\", this._eventHandlers.handleRSAAESServerVerification);\n this._rfbRSAAESAuthenticationState.removeEventListener(\n \"credentialsrequired\", this._eventHandlers.handleRSAAESCredentialsRequired);\n this._rfbRSAAESAuthenticationState = null;\n });\n }\n return false;\n }\n\n _negotiateMSLogonIIAuth() {\n if (this._sock.rQwait(\"mslogonii dh param\", 24)) { return false; }\n\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n return false;\n }\n\n const g = this._sock.rQshiftBytes(8);\n const p = this._sock.rQshiftBytes(8);\n const A = this._sock.rQshiftBytes(8);\n const b = window.crypto.getRandomValues(new Uint8Array(8));\n const B = new Uint8Array(this._modPow(g, b, p));\n const secret = new Uint8Array(this._modPow(A, b, p));\n\n const des = new DES(secret);\n const username = encodeUTF8(this._rfbCredentials.username).substring(0, 255);\n const password = encodeUTF8(this._rfbCredentials.password).substring(0, 63);\n const usernameBytes = new Uint8Array(256);\n const passwordBytes = new Uint8Array(64);\n window.crypto.getRandomValues(usernameBytes);\n window.crypto.getRandomValues(passwordBytes);\n for (let i = 0; i < username.length; i++) {\n usernameBytes[i] = username.charCodeAt(i);\n }\n usernameBytes[username.length] = 0;\n for (let i = 0; i < password.length; i++) {\n passwordBytes[i] = password.charCodeAt(i);\n }\n passwordBytes[password.length] = 0;\n let x = new Uint8Array(secret);\n for (let i = 0; i < 32; i++) {\n for (let j = 0; j < 8; j++) {\n x[j] ^= usernameBytes[i * 8 + j];\n }\n x = des.enc8(x);\n usernameBytes.set(x, i * 8);\n }\n x = new Uint8Array(secret);\n for (let i = 0; i < 8; i++) {\n for (let j = 0; j < 8; j++) {\n x[j] ^= passwordBytes[i * 8 + j];\n }\n x = des.enc8(x);\n passwordBytes.set(x, i * 8);\n }\n this._sock.send(B);\n this._sock.send(usernameBytes);\n this._sock.send(passwordBytes);\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n _negotiateAuthentication() {\n switch (this._rfbAuthScheme) {\n case securityTypeNone:\n this._rfbInitState = 'SecurityResult';\n return true;\n\n case securityTypeXVP:\n return this._negotiateXvpAuth();\n\n case securityTypeARD:\n return this._negotiateARDAuth();\n\n case securityTypeVNCAuth:\n return this._negotiateStdVNCAuth();\n\n case securityTypeTight:\n return this._negotiateTightAuth();\n\n case securityTypeVeNCrypt:\n return this._negotiateVeNCryptAuth();\n\n case securityTypePlain:\n return this._negotiatePlainAuth();\n\n case securityTypeUnixLogon:\n return this._negotiateTightUnixAuth();\n\n case securityTypeRA2ne:\n return this._negotiateRA2neAuth();\n\n case securityTypeMSLogonII:\n return this._negotiateMSLogonIIAuth();\n\n default:\n return this._fail(\"Unsupported auth scheme (scheme: \" +\n this._rfbAuthScheme + \")\");\n }\n }\n\n _handleSecurityResult() {\n // There is no security choice, and hence no security result\n // until RFB 3.7\n if (this._rfbVersion < 3.7) {\n this._rfbInitState = 'ClientInitialisation';\n return true;\n }\n\n if (this._sock.rQwait('VNC auth response ', 4)) { return false; }\n\n const status = this._sock.rQshift32();\n\n if (status === 0) { // OK\n this._rfbInitState = 'ClientInitialisation';\n Log.Debug('Authentication OK');\n return true;\n } else {\n if (this._rfbVersion >= 3.8) {\n this._rfbInitState = \"SecurityReason\";\n this._securityContext = \"security result\";\n this._securityStatus = status;\n return true;\n } else {\n this.dispatchEvent(new CustomEvent(\n \"securityfailure\",\n { detail: { status: status } }));\n\n return this._fail(\"Security handshake failed\");\n }\n }\n }\n\n _negotiateServerInit() {\n if (this._sock.rQwait(\"server initialization\", 24)) { return false; }\n\n /* Screen size */\n const width = this._sock.rQshift16();\n const height = this._sock.rQshift16();\n\n /* PIXEL_FORMAT */\n const bpp = this._sock.rQshift8();\n const depth = this._sock.rQshift8();\n const bigEndian = this._sock.rQshift8();\n const trueColor = this._sock.rQshift8();\n\n const redMax = this._sock.rQshift16();\n const greenMax = this._sock.rQshift16();\n const blueMax = this._sock.rQshift16();\n const redShift = this._sock.rQshift8();\n const greenShift = this._sock.rQshift8();\n const blueShift = this._sock.rQshift8();\n this._sock.rQskipBytes(3); // padding\n\n // NB(directxman12): we don't want to call any callbacks or print messages until\n // *after* we're past the point where we could backtrack\n\n /* Connection name/title */\n const nameLength = this._sock.rQshift32();\n if (this._sock.rQwait('server init name', nameLength, 24)) { return false; }\n let name = this._sock.rQshiftStr(nameLength);\n name = decodeUTF8(name, true);\n\n if (this._rfbTightVNC) {\n if (this._sock.rQwait('TightVNC extended server init header', 8, 24 + nameLength)) { return false; }\n // In TightVNC mode, ServerInit message is extended\n const numServerMessages = this._sock.rQshift16();\n const numClientMessages = this._sock.rQshift16();\n const numEncodings = this._sock.rQshift16();\n this._sock.rQskipBytes(2); // padding\n\n const totalMessagesLength = (numServerMessages + numClientMessages + numEncodings) * 16;\n if (this._sock.rQwait('TightVNC extended server init header', totalMessagesLength, 32 + nameLength)) { return false; }\n\n // we don't actually do anything with the capability information that TIGHT sends,\n // so we just skip the all of this.\n\n // TIGHT server message capabilities\n this._sock.rQskipBytes(16 * numServerMessages);\n\n // TIGHT client message capabilities\n this._sock.rQskipBytes(16 * numClientMessages);\n\n // TIGHT encoding capabilities\n this._sock.rQskipBytes(16 * numEncodings);\n }\n\n // NB(directxman12): these are down here so that we don't run them multiple times\n // if we backtrack\n Log.Info(\"Screen: \" + width + \"x\" + height +\n \", bpp: \" + bpp + \", depth: \" + depth +\n \", bigEndian: \" + bigEndian +\n \", trueColor: \" + trueColor +\n \", redMax: \" + redMax +\n \", greenMax: \" + greenMax +\n \", blueMax: \" + blueMax +\n \", redShift: \" + redShift +\n \", greenShift: \" + greenShift +\n \", blueShift: \" + blueShift);\n\n // we're past the point where we could backtrack, so it's safe to call this\n this._setDesktopName(name);\n this._resize(width, height);\n\n if (!this._viewOnly) { this._keyboard.grab(); }\n\n this._fbDepth = 24;\n\n if (this._fbName === \"Intel(r) AMT KVM\") {\n Log.Warn(\"Intel AMT KVM only supports 8/16 bit depths. Using low color mode.\");\n this._fbDepth = 8;\n }\n\n RFB.messages.pixelFormat(this._sock, this._fbDepth, true);\n this._sendEncodings();\n RFB.messages.fbUpdateRequest(this._sock, false, 0, 0, this._fbWidth, this._fbHeight);\n\n this._updateConnectionState('connected');\n return true;\n }\n\n _sendEncodings() {\n const encs = [];\n\n // In preference order\n encs.push(encodings.encodingCopyRect);\n // Only supported with full depth support\n if (this._fbDepth == 24) {\n encs.push(encodings.encodingTight);\n encs.push(encodings.encodingTightPNG);\n encs.push(encodings.encodingZRLE);\n encs.push(encodings.encodingJPEG);\n encs.push(encodings.encodingHextile);\n encs.push(encodings.encodingRRE);\n }\n encs.push(encodings.encodingRaw);\n\n // Psuedo-encoding settings\n encs.push(encodings.pseudoEncodingQualityLevel0 + this._qualityLevel);\n encs.push(encodings.pseudoEncodingCompressLevel0 + this._compressionLevel);\n\n encs.push(encodings.pseudoEncodingDesktopSize);\n encs.push(encodings.pseudoEncodingLastRect);\n encs.push(encodings.pseudoEncodingQEMUExtendedKeyEvent);\n encs.push(encodings.pseudoEncodingExtendedDesktopSize);\n encs.push(encodings.pseudoEncodingXvp);\n encs.push(encodings.pseudoEncodingFence);\n encs.push(encodings.pseudoEncodingContinuousUpdates);\n encs.push(encodings.pseudoEncodingDesktopName);\n encs.push(encodings.pseudoEncodingExtendedClipboard);\n\n if (this._fbDepth == 24) {\n encs.push(encodings.pseudoEncodingVMwareCursor);\n encs.push(encodings.pseudoEncodingCursor);\n }\n\n RFB.messages.clientEncodings(this._sock, encs);\n }\n\n /* RFB protocol initialization states:\n * ProtocolVersion\n * Security\n * Authentication\n * SecurityResult\n * ClientInitialization - not triggered by server message\n * ServerInitialization\n */\n _initMsg() {\n switch (this._rfbInitState) {\n case 'ProtocolVersion':\n return this._negotiateProtocolVersion();\n\n case 'Security':\n return this._negotiateSecurity();\n\n case 'Authentication':\n return this._negotiateAuthentication();\n\n case 'SecurityResult':\n return this._handleSecurityResult();\n\n case 'SecurityReason':\n return this._handleSecurityReason();\n\n case 'ClientInitialisation':\n this._sock.send([this._shared ? 1 : 0]); // ClientInitialisation\n this._rfbInitState = 'ServerInitialisation';\n return true;\n\n case 'ServerInitialisation':\n return this._negotiateServerInit();\n\n default:\n return this._fail(\"Unknown init state (state: \" +\n this._rfbInitState + \")\");\n }\n }\n\n // Resume authentication handshake after it was paused for some\n // reason, e.g. waiting for a password from the user\n _resumeAuthentication() {\n // We use setTimeout() so it's run in its own context, just like\n // it originally did via the WebSocket's event handler\n setTimeout(this._initMsg.bind(this), 0);\n }\n\n _handleSetColourMapMsg() {\n Log.Debug(\"SetColorMapEntries\");\n\n return this._fail(\"Unexpected SetColorMapEntries message\");\n }\n\n _handleServerCutText() {\n Log.Debug(\"ServerCutText\");\n\n if (this._sock.rQwait(\"ServerCutText header\", 7, 1)) { return false; }\n\n this._sock.rQskipBytes(3); // Padding\n\n let length = this._sock.rQshift32();\n length = toSigned32bit(length);\n\n if (this._sock.rQwait(\"ServerCutText content\", Math.abs(length), 8)) { return false; }\n\n if (length >= 0) {\n //Standard msg\n const text = this._sock.rQshiftStr(length);\n if (this._viewOnly) {\n return true;\n }\n\n this.dispatchEvent(new CustomEvent(\n \"clipboard\",\n { detail: { text: text } }));\n\n } else {\n //Extended msg.\n length = Math.abs(length);\n const flags = this._sock.rQshift32();\n let formats = flags & 0x0000FFFF;\n let actions = flags & 0xFF000000;\n\n let isCaps = (!!(actions & extendedClipboardActionCaps));\n if (isCaps) {\n this._clipboardServerCapabilitiesFormats = {};\n this._clipboardServerCapabilitiesActions = {};\n\n // Update our server capabilities for Formats\n for (let i = 0; i <= 15; i++) {\n let index = 1 << i;\n\n // Check if format flag is set.\n if ((formats & index)) {\n this._clipboardServerCapabilitiesFormats[index] = true;\n // We don't send unsolicited clipboard, so we\n // ignore the size\n this._sock.rQshift32();\n }\n }\n\n // Update our server capabilities for Actions\n for (let i = 24; i <= 31; i++) {\n let index = 1 << i;\n this._clipboardServerCapabilitiesActions[index] = !!(actions & index);\n }\n\n /* Caps handling done, send caps with the clients\n capabilities set as a response */\n let clientActions = [\n extendedClipboardActionCaps,\n extendedClipboardActionRequest,\n extendedClipboardActionPeek,\n extendedClipboardActionNotify,\n extendedClipboardActionProvide\n ];\n RFB.messages.extendedClipboardCaps(this._sock, clientActions, {extendedClipboardFormatText: 0});\n\n } else if (actions === extendedClipboardActionRequest) {\n if (this._viewOnly) {\n return true;\n }\n\n // Check if server has told us it can handle Provide and there is clipboard data to send.\n if (this._clipboardText != null &&\n this._clipboardServerCapabilitiesActions[extendedClipboardActionProvide]) {\n\n if (formats & extendedClipboardFormatText) {\n RFB.messages.extendedClipboardProvide(this._sock, [extendedClipboardFormatText], [this._clipboardText]);\n }\n }\n\n } else if (actions === extendedClipboardActionPeek) {\n if (this._viewOnly) {\n return true;\n }\n\n if (this._clipboardServerCapabilitiesActions[extendedClipboardActionNotify]) {\n\n if (this._clipboardText != null) {\n RFB.messages.extendedClipboardNotify(this._sock, [extendedClipboardFormatText]);\n } else {\n RFB.messages.extendedClipboardNotify(this._sock, []);\n }\n }\n\n } else if (actions === extendedClipboardActionNotify) {\n if (this._viewOnly) {\n return true;\n }\n\n if (this._clipboardServerCapabilitiesActions[extendedClipboardActionRequest]) {\n\n if (formats & extendedClipboardFormatText) {\n RFB.messages.extendedClipboardRequest(this._sock, [extendedClipboardFormatText]);\n }\n }\n\n } else if (actions === extendedClipboardActionProvide) {\n if (this._viewOnly) {\n return true;\n }\n\n if (!(formats & extendedClipboardFormatText)) {\n return true;\n }\n // Ignore what we had in our clipboard client side.\n this._clipboardText = null;\n\n // FIXME: Should probably verify that this data was actually requested\n let zlibStream = this._sock.rQshiftBytes(length - 4);\n let streamInflator = new Inflator();\n let textData = null;\n\n streamInflator.setInput(zlibStream);\n for (let i = 0; i <= 15; i++) {\n let format = 1 << i;\n\n if (formats & format) {\n\n let size = 0x00;\n let sizeArray = streamInflator.inflate(4);\n\n size |= (sizeArray[0] << 24);\n size |= (sizeArray[1] << 16);\n size |= (sizeArray[2] << 8);\n size |= (sizeArray[3]);\n let chunk = streamInflator.inflate(size);\n\n if (format === extendedClipboardFormatText) {\n textData = chunk;\n }\n }\n }\n streamInflator.setInput(null);\n\n if (textData !== null) {\n let tmpText = \"\";\n for (let i = 0; i < textData.length; i++) {\n tmpText += String.fromCharCode(textData[i]);\n }\n textData = tmpText;\n\n textData = decodeUTF8(textData);\n if ((textData.length > 0) && \"\\0\" === textData.charAt(textData.length - 1)) {\n textData = textData.slice(0, -1);\n }\n\n textData = textData.replace(\"\\r\\n\", \"\\n\");\n\n this.dispatchEvent(new CustomEvent(\n \"clipboard\",\n { detail: { text: textData } }));\n }\n } else {\n return this._fail(\"Unexpected action in extended clipboard message: \" + actions);\n }\n }\n return true;\n }\n\n _handleServerFenceMsg() {\n if (this._sock.rQwait(\"ServerFence header\", 8, 1)) { return false; }\n this._sock.rQskipBytes(3); // Padding\n let flags = this._sock.rQshift32();\n let length = this._sock.rQshift8();\n\n if (this._sock.rQwait(\"ServerFence payload\", length, 9)) { return false; }\n\n if (length > 64) {\n Log.Warn(\"Bad payload length (\" + length + \") in fence response\");\n length = 64;\n }\n\n const payload = this._sock.rQshiftStr(length);\n\n this._supportsFence = true;\n\n /*\n * Fence flags\n *\n * (1<<0) - BlockBefore\n * (1<<1) - BlockAfter\n * (1<<2) - SyncNext\n * (1<<31) - Request\n */\n\n if (!(flags & (1<<31))) {\n return this._fail(\"Unexpected fence response\");\n }\n\n // Filter out unsupported flags\n // FIXME: support syncNext\n flags &= (1<<0) | (1<<1);\n\n // BlockBefore and BlockAfter are automatically handled by\n // the fact that we process each incoming message\n // synchronuosly.\n RFB.messages.clientFence(this._sock, flags, payload);\n\n return true;\n }\n\n _handleXvpMsg() {\n if (this._sock.rQwait(\"XVP version and message\", 3, 1)) { return false; }\n this._sock.rQskipBytes(1); // Padding\n const xvpVer = this._sock.rQshift8();\n const xvpMsg = this._sock.rQshift8();\n\n switch (xvpMsg) {\n case 0: // XVP_FAIL\n Log.Error(\"XVP Operation Failed\");\n break;\n case 1: // XVP_INIT\n this._rfbXvpVer = xvpVer;\n Log.Info(\"XVP extensions enabled (version \" + this._rfbXvpVer + \")\");\n this._setCapability(\"power\", true);\n break;\n default:\n this._fail(\"Illegal server XVP message (msg: \" + xvpMsg + \")\");\n break;\n }\n\n return true;\n }\n\n _normalMsg() {\n let msgType;\n if (this._FBU.rects > 0) {\n msgType = 0;\n } else {\n msgType = this._sock.rQshift8();\n }\n\n let first, ret;\n switch (msgType) {\n case 0: // FramebufferUpdate\n ret = this._framebufferUpdate();\n if (ret && !this._enabledContinuousUpdates) {\n RFB.messages.fbUpdateRequest(this._sock, true, 0, 0,\n this._fbWidth, this._fbHeight);\n }\n return ret;\n\n case 1: // SetColorMapEntries\n return this._handleSetColourMapMsg();\n\n case 2: // Bell\n Log.Debug(\"Bell\");\n this.dispatchEvent(new CustomEvent(\n \"bell\",\n { detail: {} }));\n return true;\n\n case 3: // ServerCutText\n return this._handleServerCutText();\n\n case 150: // EndOfContinuousUpdates\n first = !this._supportsContinuousUpdates;\n this._supportsContinuousUpdates = true;\n this._enabledContinuousUpdates = false;\n if (first) {\n this._enabledContinuousUpdates = true;\n this._updateContinuousUpdates();\n Log.Info(\"Enabling continuous updates.\");\n } else {\n // FIXME: We need to send a framebufferupdaterequest here\n // if we add support for turning off continuous updates\n }\n return true;\n\n case 248: // ServerFence\n return this._handleServerFenceMsg();\n\n case 250: // XVP\n return this._handleXvpMsg();\n\n default:\n this._fail(\"Unexpected server message (type \" + msgType + \")\");\n Log.Debug(\"sock.rQslice(0, 30): \" + this._sock.rQslice(0, 30));\n return true;\n }\n }\n\n _onFlush() {\n this._flushing = false;\n // Resume processing\n if (this._sock.rQlen > 0) {\n this._handleMessage();\n }\n }\n\n _framebufferUpdate() {\n if (this._FBU.rects === 0) {\n if (this._sock.rQwait(\"FBU header\", 3, 1)) { return false; }\n this._sock.rQskipBytes(1); // Padding\n this._FBU.rects = this._sock.rQshift16();\n\n // Make sure the previous frame is fully rendered first\n // to avoid building up an excessive queue\n if (this._display.pending()) {\n this._flushing = true;\n this._display.flush();\n return false;\n }\n }\n\n while (this._FBU.rects > 0) {\n if (this._FBU.encoding === null) {\n if (this._sock.rQwait(\"rect header\", 12)) { return false; }\n /* New FramebufferUpdate */\n\n const hdr = this._sock.rQshiftBytes(12);\n this._FBU.x = (hdr[0] << 8) + hdr[1];\n this._FBU.y = (hdr[2] << 8) + hdr[3];\n this._FBU.width = (hdr[4] << 8) + hdr[5];\n this._FBU.height = (hdr[6] << 8) + hdr[7];\n this._FBU.encoding = parseInt((hdr[8] << 24) + (hdr[9] << 16) +\n (hdr[10] << 8) + hdr[11], 10);\n }\n\n if (!this._handleRect()) {\n return false;\n }\n\n this._FBU.rects--;\n this._FBU.encoding = null;\n }\n\n this._display.flip();\n\n return true; // We finished this FBU\n }\n\n _handleRect() {\n switch (this._FBU.encoding) {\n case encodings.pseudoEncodingLastRect:\n this._FBU.rects = 1; // Will be decreased when we return\n return true;\n\n case encodings.pseudoEncodingVMwareCursor:\n return this._handleVMwareCursor();\n\n case encodings.pseudoEncodingCursor:\n return this._handleCursor();\n\n case encodings.pseudoEncodingQEMUExtendedKeyEvent:\n this._qemuExtKeyEventSupported = true;\n return true;\n\n case encodings.pseudoEncodingDesktopName:\n return this._handleDesktopName();\n\n case encodings.pseudoEncodingDesktopSize:\n this._resize(this._FBU.width, this._FBU.height);\n return true;\n\n case encodings.pseudoEncodingExtendedDesktopSize:\n return this._handleExtendedDesktopSize();\n\n default:\n return this._handleDataRect();\n }\n }\n\n _handleVMwareCursor() {\n const hotx = this._FBU.x; // hotspot-x\n const hoty = this._FBU.y; // hotspot-y\n const w = this._FBU.width;\n const h = this._FBU.height;\n if (this._sock.rQwait(\"VMware cursor encoding\", 1)) {\n return false;\n }\n\n const cursorType = this._sock.rQshift8();\n\n this._sock.rQshift8(); //Padding\n\n let rgba;\n const bytesPerPixel = 4;\n\n //Classic cursor\n if (cursorType == 0) {\n //Used to filter away unimportant bits.\n //OR is used for correct conversion in js.\n const PIXEL_MASK = 0xffffff00 | 0;\n rgba = new Array(w * h * bytesPerPixel);\n\n if (this._sock.rQwait(\"VMware cursor classic encoding\",\n (w * h * bytesPerPixel) * 2, 2)) {\n return false;\n }\n\n let andMask = new Array(w * h);\n for (let pixel = 0; pixel < (w * h); pixel++) {\n andMask[pixel] = this._sock.rQshift32();\n }\n\n let xorMask = new Array(w * h);\n for (let pixel = 0; pixel < (w * h); pixel++) {\n xorMask[pixel] = this._sock.rQshift32();\n }\n\n for (let pixel = 0; pixel < (w * h); pixel++) {\n if (andMask[pixel] == 0) {\n //Fully opaque pixel\n let bgr = xorMask[pixel];\n let r = bgr >> 8 & 0xff;\n let g = bgr >> 16 & 0xff;\n let b = bgr >> 24 & 0xff;\n\n rgba[(pixel * bytesPerPixel) ] = r; //r\n rgba[(pixel * bytesPerPixel) + 1 ] = g; //g\n rgba[(pixel * bytesPerPixel) + 2 ] = b; //b\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff; //a\n\n } else if ((andMask[pixel] & PIXEL_MASK) ==\n PIXEL_MASK) {\n //Only screen value matters, no mouse colouring\n if (xorMask[pixel] == 0) {\n //Transparent pixel\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0x00;\n\n } else if ((xorMask[pixel] & PIXEL_MASK) ==\n PIXEL_MASK) {\n //Inverted pixel, not supported in browsers.\n //Fully opaque instead.\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff;\n\n } else {\n //Unhandled xorMask\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff;\n }\n\n } else {\n //Unhandled andMask\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff;\n }\n }\n\n //Alpha cursor.\n } else if (cursorType == 1) {\n if (this._sock.rQwait(\"VMware cursor alpha encoding\",\n (w * h * 4), 2)) {\n return false;\n }\n\n rgba = new Array(w * h * bytesPerPixel);\n\n for (let pixel = 0; pixel < (w * h); pixel++) {\n let data = this._sock.rQshift32();\n\n rgba[(pixel * 4) ] = data >> 24 & 0xff; //r\n rgba[(pixel * 4) + 1 ] = data >> 16 & 0xff; //g\n rgba[(pixel * 4) + 2 ] = data >> 8 & 0xff; //b\n rgba[(pixel * 4) + 3 ] = data & 0xff; //a\n }\n\n } else {\n Log.Warn(\"The given cursor type is not supported: \"\n + cursorType + \" given.\");\n return false;\n }\n\n this._updateCursor(rgba, hotx, hoty, w, h);\n\n return true;\n }\n\n _handleCursor() {\n const hotx = this._FBU.x; // hotspot-x\n const hoty = this._FBU.y; // hotspot-y\n const w = this._FBU.width;\n const h = this._FBU.height;\n\n const pixelslength = w * h * 4;\n const masklength = Math.ceil(w / 8) * h;\n\n let bytes = pixelslength + masklength;\n if (this._sock.rQwait(\"cursor encoding\", bytes)) {\n return false;\n }\n\n // Decode from BGRX pixels + bit mask to RGBA\n const pixels = this._sock.rQshiftBytes(pixelslength);\n const mask = this._sock.rQshiftBytes(masklength);\n let rgba = new Uint8Array(w * h * 4);\n\n let pixIdx = 0;\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n let maskIdx = y * Math.ceil(w / 8) + Math.floor(x / 8);\n let alpha = (mask[maskIdx] << (x % 8)) & 0x80 ? 255 : 0;\n rgba[pixIdx ] = pixels[pixIdx + 2];\n rgba[pixIdx + 1] = pixels[pixIdx + 1];\n rgba[pixIdx + 2] = pixels[pixIdx];\n rgba[pixIdx + 3] = alpha;\n pixIdx += 4;\n }\n }\n\n this._updateCursor(rgba, hotx, hoty, w, h);\n\n return true;\n }\n\n _handleDesktopName() {\n if (this._sock.rQwait(\"DesktopName\", 4)) {\n return false;\n }\n\n let length = this._sock.rQshift32();\n\n if (this._sock.rQwait(\"DesktopName\", length, 4)) {\n return false;\n }\n\n let name = this._sock.rQshiftStr(length);\n name = decodeUTF8(name, true);\n\n this._setDesktopName(name);\n\n return true;\n }\n\n _handleExtendedDesktopSize() {\n if (this._sock.rQwait(\"ExtendedDesktopSize\", 4)) {\n return false;\n }\n\n const numberOfScreens = this._sock.rQpeek8();\n\n let bytes = 4 + (numberOfScreens * 16);\n if (this._sock.rQwait(\"ExtendedDesktopSize\", bytes)) {\n return false;\n }\n\n const firstUpdate = !this._supportsSetDesktopSize;\n this._supportsSetDesktopSize = true;\n\n // Normally we only apply the current resize mode after a\n // window resize event. However there is no such trigger on the\n // initial connect. And we don't know if the server supports\n // resizing until we've gotten here.\n if (firstUpdate) {\n this._requestRemoteResize();\n }\n\n this._sock.rQskipBytes(1); // number-of-screens\n this._sock.rQskipBytes(3); // padding\n\n for (let i = 0; i < numberOfScreens; i += 1) {\n // Save the id and flags of the first screen\n if (i === 0) {\n this._screenID = this._sock.rQshiftBytes(4); // id\n this._sock.rQskipBytes(2); // x-position\n this._sock.rQskipBytes(2); // y-position\n this._sock.rQskipBytes(2); // width\n this._sock.rQskipBytes(2); // height\n this._screenFlags = this._sock.rQshiftBytes(4); // flags\n } else {\n this._sock.rQskipBytes(16);\n }\n }\n\n /*\n * The x-position indicates the reason for the change:\n *\n * 0 - server resized on its own\n * 1 - this client requested the resize\n * 2 - another client requested the resize\n */\n\n // We need to handle errors when we requested the resize.\n if (this._FBU.x === 1 && this._FBU.y !== 0) {\n let msg = \"\";\n // The y-position indicates the status code from the server\n switch (this._FBU.y) {\n case 1:\n msg = \"Resize is administratively prohibited\";\n break;\n case 2:\n msg = \"Out of resources\";\n break;\n case 3:\n msg = \"Invalid screen layout\";\n break;\n default:\n msg = \"Unknown reason\";\n break;\n }\n Log.Warn(\"Server did not accept the resize request: \"\n + msg);\n } else {\n this._resize(this._FBU.width, this._FBU.height);\n }\n\n return true;\n }\n\n _handleDataRect() {\n let decoder = this._decoders[this._FBU.encoding];\n if (!decoder) {\n this._fail(\"Unsupported encoding (encoding: \" +\n this._FBU.encoding + \")\");\n return false;\n }\n\n try {\n return decoder.decodeRect(this._FBU.x, this._FBU.y,\n this._FBU.width, this._FBU.height,\n this._sock, this._display,\n this._fbDepth);\n } catch (err) {\n this._fail(\"Error decoding rect: \" + err);\n return false;\n }\n }\n\n _updateContinuousUpdates() {\n if (!this._enabledContinuousUpdates) { return; }\n\n RFB.messages.enableContinuousUpdates(this._sock, true, 0, 0,\n this._fbWidth, this._fbHeight);\n }\n\n _resize(width, height) {\n this._fbWidth = width;\n this._fbHeight = height;\n\n this._display.resize(this._fbWidth, this._fbHeight);\n\n // Adjust the visible viewport based on the new dimensions\n this._updateClip();\n this._updateScale();\n\n this._updateContinuousUpdates();\n\n // Keep this size until browser client size changes\n this._saveExpectedClientSize();\n }\n\n _xvpOp(ver, op) {\n if (this._rfbXvpVer < ver) { return; }\n Log.Info(\"Sending XVP operation \" + op + \" (version \" + ver + \")\");\n RFB.messages.xvpOp(this._sock, ver, op);\n }\n\n _updateCursor(rgba, hotx, hoty, w, h) {\n this._cursorImage = {\n rgbaPixels: rgba,\n hotx: hotx, hoty: hoty, w: w, h: h,\n };\n this._refreshCursor();\n }\n\n _shouldShowDotCursor() {\n // Called when this._cursorImage is updated\n if (!this._showDotCursor) {\n // User does not want to see the dot, so...\n return false;\n }\n\n // The dot should not be shown if the cursor is already visible,\n // i.e. contains at least one not-fully-transparent pixel.\n // So iterate through all alpha bytes in rgba and stop at the\n // first non-zero.\n for (let i = 3; i < this._cursorImage.rgbaPixels.length; i += 4) {\n if (this._cursorImage.rgbaPixels[i]) {\n return false;\n }\n }\n\n // At this point, we know that the cursor is fully transparent, and\n // the user wants to see the dot instead of this.\n return true;\n }\n\n _refreshCursor() {\n if (this._rfbConnectionState !== \"connecting\" &&\n this._rfbConnectionState !== \"connected\") {\n return;\n }\n const image = this._shouldShowDotCursor() ? RFB.cursors.dot : this._cursorImage;\n this._cursor.change(image.rgbaPixels,\n image.hotx, image.hoty,\n image.w, image.h\n );\n }\n\n static genDES(password, challenge) {\n const passwordChars = password.split('').map(c => c.charCodeAt(0));\n return (new DES(passwordChars)).encrypt(challenge);\n }\n}\n\n// Class Methods\nRFB.messages = {\n keyEvent(sock, keysym, down) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 4; // msg-type\n buff[offset + 1] = down;\n\n buff[offset + 2] = 0;\n buff[offset + 3] = 0;\n\n buff[offset + 4] = (keysym >> 24);\n buff[offset + 5] = (keysym >> 16);\n buff[offset + 6] = (keysym >> 8);\n buff[offset + 7] = keysym;\n\n sock._sQlen += 8;\n sock.flush();\n },\n\n QEMUExtendedKeyEvent(sock, keysym, down, keycode) {\n function getRFBkeycode(xtScanCode) {\n const upperByte = (keycode >> 8);\n const lowerByte = (keycode & 0x00ff);\n if (upperByte === 0xe0 && lowerByte < 0x7f) {\n return lowerByte | 0x80;\n }\n return xtScanCode;\n }\n\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 255; // msg-type\n buff[offset + 1] = 0; // sub msg-type\n\n buff[offset + 2] = (down >> 8);\n buff[offset + 3] = down;\n\n buff[offset + 4] = (keysym >> 24);\n buff[offset + 5] = (keysym >> 16);\n buff[offset + 6] = (keysym >> 8);\n buff[offset + 7] = keysym;\n\n const RFBkeycode = getRFBkeycode(keycode);\n\n buff[offset + 8] = (RFBkeycode >> 24);\n buff[offset + 9] = (RFBkeycode >> 16);\n buff[offset + 10] = (RFBkeycode >> 8);\n buff[offset + 11] = RFBkeycode;\n\n sock._sQlen += 12;\n sock.flush();\n },\n\n pointerEvent(sock, x, y, mask) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 5; // msg-type\n\n buff[offset + 1] = mask;\n\n buff[offset + 2] = x >> 8;\n buff[offset + 3] = x;\n\n buff[offset + 4] = y >> 8;\n buff[offset + 5] = y;\n\n sock._sQlen += 6;\n sock.flush();\n },\n\n // Used to build Notify and Request data.\n _buildExtendedClipboardFlags(actions, formats) {\n let data = new Uint8Array(4);\n let formatFlag = 0x00000000;\n let actionFlag = 0x00000000;\n\n for (let i = 0; i < actions.length; i++) {\n actionFlag |= actions[i];\n }\n\n for (let i = 0; i < formats.length; i++) {\n formatFlag |= formats[i];\n }\n\n data[0] = actionFlag >> 24; // Actions\n data[1] = 0x00; // Reserved\n data[2] = 0x00; // Reserved\n data[3] = formatFlag; // Formats\n\n return data;\n },\n\n extendedClipboardProvide(sock, formats, inData) {\n // Deflate incomming data and their sizes\n let deflator = new Deflator();\n let dataToDeflate = [];\n\n for (let i = 0; i < formats.length; i++) {\n // We only support the format Text at this time\n if (formats[i] != extendedClipboardFormatText) {\n throw new Error(\"Unsupported extended clipboard format for Provide message.\");\n }\n\n // Change lone \\r or \\n into \\r\\n as defined in rfbproto\n inData[i] = inData[i].replace(/\\r\\n|\\r|\\n/gm, \"\\r\\n\");\n\n // Check if it already has \\0\n let text = encodeUTF8(inData[i] + \"\\0\");\n\n dataToDeflate.push( (text.length >> 24) & 0xFF,\n (text.length >> 16) & 0xFF,\n (text.length >> 8) & 0xFF,\n (text.length & 0xFF));\n\n for (let j = 0; j < text.length; j++) {\n dataToDeflate.push(text.charCodeAt(j));\n }\n }\n\n let deflatedData = deflator.deflate(new Uint8Array(dataToDeflate));\n\n // Build data to send\n let data = new Uint8Array(4 + deflatedData.length);\n data.set(RFB.messages._buildExtendedClipboardFlags([extendedClipboardActionProvide],\n formats));\n data.set(deflatedData, 4);\n\n RFB.messages.clientCutText(sock, data, true);\n },\n\n extendedClipboardNotify(sock, formats) {\n let flags = RFB.messages._buildExtendedClipboardFlags([extendedClipboardActionNotify],\n formats);\n RFB.messages.clientCutText(sock, flags, true);\n },\n\n extendedClipboardRequest(sock, formats) {\n let flags = RFB.messages._buildExtendedClipboardFlags([extendedClipboardActionRequest],\n formats);\n RFB.messages.clientCutText(sock, flags, true);\n },\n\n extendedClipboardCaps(sock, actions, formats) {\n let formatKeys = Object.keys(formats);\n let data = new Uint8Array(4 + (4 * formatKeys.length));\n\n formatKeys.map(x => parseInt(x));\n formatKeys.sort((a, b) => a - b);\n\n data.set(RFB.messages._buildExtendedClipboardFlags(actions, []));\n\n let loopOffset = 4;\n for (let i = 0; i < formatKeys.length; i++) {\n data[loopOffset] = formats[formatKeys[i]] >> 24;\n data[loopOffset + 1] = formats[formatKeys[i]] >> 16;\n data[loopOffset + 2] = formats[formatKeys[i]] >> 8;\n data[loopOffset + 3] = formats[formatKeys[i]] >> 0;\n\n loopOffset += 4;\n data[3] |= (1 << formatKeys[i]); // Update our format flags\n }\n\n RFB.messages.clientCutText(sock, data, true);\n },\n\n clientCutText(sock, data, extended = false) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 6; // msg-type\n\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = 0; // padding\n buff[offset + 3] = 0; // padding\n\n let length;\n if (extended) {\n length = toUnsigned32bit(-data.length);\n } else {\n length = data.length;\n }\n\n buff[offset + 4] = length >> 24;\n buff[offset + 5] = length >> 16;\n buff[offset + 6] = length >> 8;\n buff[offset + 7] = length;\n\n sock._sQlen += 8;\n\n // We have to keep track of from where in the data we begin creating the\n // buffer for the flush in the next iteration.\n let dataOffset = 0;\n\n let remaining = data.length;\n while (remaining > 0) {\n\n let flushSize = Math.min(remaining, (sock._sQbufferSize - sock._sQlen));\n for (let i = 0; i < flushSize; i++) {\n buff[sock._sQlen + i] = data[dataOffset + i];\n }\n\n sock._sQlen += flushSize;\n sock.flush();\n\n remaining -= flushSize;\n dataOffset += flushSize;\n }\n\n },\n\n setDesktopSize(sock, width, height, id, flags) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 251; // msg-type\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = width >> 8; // width\n buff[offset + 3] = width;\n buff[offset + 4] = height >> 8; // height\n buff[offset + 5] = height;\n\n buff[offset + 6] = 1; // number-of-screens\n buff[offset + 7] = 0; // padding\n\n // screen array\n buff[offset + 8] = id >> 24; // id\n buff[offset + 9] = id >> 16;\n buff[offset + 10] = id >> 8;\n buff[offset + 11] = id;\n buff[offset + 12] = 0; // x-position\n buff[offset + 13] = 0;\n buff[offset + 14] = 0; // y-position\n buff[offset + 15] = 0;\n buff[offset + 16] = width >> 8; // width\n buff[offset + 17] = width;\n buff[offset + 18] = height >> 8; // height\n buff[offset + 19] = height;\n buff[offset + 20] = flags >> 24; // flags\n buff[offset + 21] = flags >> 16;\n buff[offset + 22] = flags >> 8;\n buff[offset + 23] = flags;\n\n sock._sQlen += 24;\n sock.flush();\n },\n\n clientFence(sock, flags, payload) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 248; // msg-type\n\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = 0; // padding\n buff[offset + 3] = 0; // padding\n\n buff[offset + 4] = flags >> 24; // flags\n buff[offset + 5] = flags >> 16;\n buff[offset + 6] = flags >> 8;\n buff[offset + 7] = flags;\n\n const n = payload.length;\n\n buff[offset + 8] = n; // length\n\n for (let i = 0; i < n; i++) {\n buff[offset + 9 + i] = payload.charCodeAt(i);\n }\n\n sock._sQlen += 9 + n;\n sock.flush();\n },\n\n enableContinuousUpdates(sock, enable, x, y, width, height) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 150; // msg-type\n buff[offset + 1] = enable; // enable-flag\n\n buff[offset + 2] = x >> 8; // x\n buff[offset + 3] = x;\n buff[offset + 4] = y >> 8; // y\n buff[offset + 5] = y;\n buff[offset + 6] = width >> 8; // width\n buff[offset + 7] = width;\n buff[offset + 8] = height >> 8; // height\n buff[offset + 9] = height;\n\n sock._sQlen += 10;\n sock.flush();\n },\n\n pixelFormat(sock, depth, trueColor) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n let bpp;\n\n if (depth > 16) {\n bpp = 32;\n } else if (depth > 8) {\n bpp = 16;\n } else {\n bpp = 8;\n }\n\n const bits = Math.floor(depth/3);\n\n buff[offset] = 0; // msg-type\n\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = 0; // padding\n buff[offset + 3] = 0; // padding\n\n buff[offset + 4] = bpp; // bits-per-pixel\n buff[offset + 5] = depth; // depth\n buff[offset + 6] = 0; // little-endian\n buff[offset + 7] = trueColor ? 1 : 0; // true-color\n\n buff[offset + 8] = 0; // red-max\n buff[offset + 9] = (1 << bits) - 1; // red-max\n\n buff[offset + 10] = 0; // green-max\n buff[offset + 11] = (1 << bits) - 1; // green-max\n\n buff[offset + 12] = 0; // blue-max\n buff[offset + 13] = (1 << bits) - 1; // blue-max\n\n buff[offset + 14] = bits * 0; // red-shift\n buff[offset + 15] = bits * 1; // green-shift\n buff[offset + 16] = bits * 2; // blue-shift\n\n buff[offset + 17] = 0; // padding\n buff[offset + 18] = 0; // padding\n buff[offset + 19] = 0; // padding\n\n sock._sQlen += 20;\n sock.flush();\n },\n\n clientEncodings(sock, encodings) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 2; // msg-type\n buff[offset + 1] = 0; // padding\n\n buff[offset + 2] = encodings.length >> 8;\n buff[offset + 3] = encodings.length;\n\n let j = offset + 4;\n for (let i = 0; i < encodings.length; i++) {\n const enc = encodings[i];\n buff[j] = enc >> 24;\n buff[j + 1] = enc >> 16;\n buff[j + 2] = enc >> 8;\n buff[j + 3] = enc;\n\n j += 4;\n }\n\n sock._sQlen += j - offset;\n sock.flush();\n },\n\n fbUpdateRequest(sock, incremental, x, y, w, h) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n if (typeof(x) === \"undefined\") { x = 0; }\n if (typeof(y) === \"undefined\") { y = 0; }\n\n buff[offset] = 3; // msg-type\n buff[offset + 1] = incremental ? 1 : 0;\n\n buff[offset + 2] = (x >> 8) & 0xFF;\n buff[offset + 3] = x & 0xFF;\n\n buff[offset + 4] = (y >> 8) & 0xFF;\n buff[offset + 5] = y & 0xFF;\n\n buff[offset + 6] = (w >> 8) & 0xFF;\n buff[offset + 7] = w & 0xFF;\n\n buff[offset + 8] = (h >> 8) & 0xFF;\n buff[offset + 9] = h & 0xFF;\n\n sock._sQlen += 10;\n sock.flush();\n },\n\n xvpOp(sock, ver, op) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 250; // msg-type\n buff[offset + 1] = 0; // padding\n\n buff[offset + 2] = ver;\n buff[offset + 3] = op;\n\n sock._sQlen += 4;\n sock.flush();\n }\n};\n\nRFB.cursors = {\n none: {\n rgbaPixels: new Uint8Array(),\n w: 0, h: 0,\n hotx: 0, hoty: 0,\n },\n\n dot: {\n /* eslint-disable indent */\n rgbaPixels: new Uint8Array([\n 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 255, 255,\n 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255,\n 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 255, 255,\n ]),\n /* eslint-enable indent */\n w: 3, h: 3,\n hotx: 1, hoty: 1,\n }\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('img',_vm._b({attrs:{\"src\":_vm.pathToBrandedImage}},'img',_vm.$attrs,false))\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n","import mod from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./BrandImage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./BrandImage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./BrandImage.vue?vue&type=template&id=096aa8de&\"\nimport script from \"./BrandImage.vue?vue&type=script&lang=js&\"\nexport * from \"./BrandImage.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsole.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsole.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./NovncConsole.vue?vue&type=template&id=d269b192&scoped=true&\"\nimport script from \"./NovncConsole.vue?vue&type=script&lang=js&\"\nexport * from \"./NovncConsole.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NovncConsole.vue?vue&type=style&index=0&id=d269b192&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"d269b192\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./NovncConsoleWrapper.vue?vue&type=template&id=c325098a&scoped=true&\"\nimport script from \"./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"\nexport * from \"./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NovncConsoleWrapper.vue?vue&type=style&index=0&id=c325098a&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"c325098a\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./VNCConsolePage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./VNCConsolePage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./VNCConsolePage.vue?vue&type=template&id=bbdc6168&\"\nimport script from \"./VNCConsolePage.vue?vue&type=script&lang=js&\"\nexport * from \"./VNCConsolePage.vue?vue&type=script&lang=js&\"\nimport style0 from \"./VNCConsolePage.vue?vue&type=style&index=0&id=bbdc6168&prod&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import { importTypes } from '@rancher/auto-import';\nimport { ActionLocation, IPlugin } from '@shell/core/types';\nimport { VM_RESOURCE_NAME, PRODUCT_NAME } from './constants';\nimport { startVMAction, stopVMAction } from './actions';\nimport SerialConsolePage from './components/SerialConsolePage.vue';\nimport VNCConsolePage from './components/VNCConsolePage.vue';\n\n// Init the package\nexport default function (plugin: IPlugin) {\n // Auto-import model, detail, edit from the folders\n importTypes(plugin);\n\n // Provide plugin metadata from package.json\n plugin.metadata = require('./package.json');\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n plugin.addProduct(require('./product'));\n plugin.addAction(ActionLocation.TABLE, { resource: [VM_RESOURCE_NAME] }, startVMAction);\n plugin.addAction(ActionLocation.TABLE, { resource: [VM_RESOURCE_NAME] }, stopVMAction);\n plugin.addRoute({\n name: `${PRODUCT_NAME}-c-cluster-vm-serialconsole`,\n path: `/:product/c/:cluster/console/:namespace/:vm/serial`,\n component: SerialConsolePage,\n meta: {\n product: PRODUCT_NAME,\n },\n });\n plugin.addRoute({\n name: `${PRODUCT_NAME}-c-cluster-vm-vncconsole`,\n path: `/:product/c/:cluster/console/:namespace/:vm/vnc`,\n component: VNCConsolePage,\n meta: {\n product: PRODUCT_NAME,\n },\n });\n}\n","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n","import { get } from './object';\nimport { strPad } from './string';\n\n// Based on https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/runtime/lib/type-of.js\n// and https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/runtime/lib/mixins/array.js\n/*\nCopyright (c) 2019 Yehuda Katz, Tom Dale and Ember.js contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n// ........................................\n// TYPING & ARRAY MESSAGING\n//\nconst TYPE_MAP = {\n '[object Boolean]': 'boolean',\n '[object Number]': 'number',\n '[object String]': 'string',\n '[object Function]': 'function',\n '[object Array]': 'array',\n '[object Date]': 'date',\n '[object RegExp]': 'regexp',\n '[object Object]': 'object',\n '[object FileList]': 'filelist',\n};\n\nconst { toString } = Object.prototype;\n\n/**\n Returns a consistent type for the passed object.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive or String object. |\n | 'number' | Number primitive or Number object. |\n | 'boolean' | Boolean primitive or Boolean object. |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'regexp' | An instance of RegExp |\n | 'date' | An instance of Date |\n | 'filelist' | An instance of FileList |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object |\n\n Examples:\n\n import { typeOf } from '@shell/utils/type-of';\n\n typeOf(); // 'undefined'\n typeOf(null); // 'null'\n typeOf(undefined); // 'undefined'\n typeOf('michael'); // 'string'\n typeOf(new String('michael')); // 'string'\n typeOf(101); // 'number'\n typeOf(new Number(101)); // 'number'\n typeOf(true); // 'boolean'\n typeOf(new Boolean(true)); // 'boolean'\n typeOf(A); // 'function'\n typeOf([1, 2, 90]); // 'array'\n typeOf(/abc/); // 'regexp'\n typeOf(new Date()); // 'date'\n typeOf(event.target.files); // 'filelist'\n typeOf(new Error('teamocil')); // 'error'\n\n // 'normal' JavaScript object\n typeOf({ a: 'b' }); // 'object'\n*/\nexport function typeOf(item) {\n if (item === null) {\n return 'null';\n }\n if (item === undefined) {\n return 'undefined';\n }\n let ret = TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'object') {\n if (item instanceof Error) {\n ret = 'error';\n } else if (item instanceof Date) {\n ret = 'date';\n }\n }\n\n return ret;\n}\n\nexport function spaceship(a, b) {\n const diff = a - b;\n\n return (diff > 0) - (diff < 0);\n}\n\nconst TYPE_ORDER = {\n undefined: 0,\n null: 1,\n boolean: 2,\n number: 3,\n string: 4,\n array: 5,\n object: 6,\n instance: 7,\n function: 8,\n class: 9,\n date: 10,\n};\n\nexport function compare(a, b) {\n const typeA = typeOf(a);\n const typeB = typeOf(b);\n\n const res = spaceship(TYPE_ORDER[typeA], TYPE_ORDER[typeB]);\n\n if ( res ) {\n return res;\n }\n\n switch (typeA) {\n case 'boolean':\n case 'number':\n return spaceship(a, b);\n\n case 'string':\n return spaceship(a.localeCompare(b), 0);\n\n case 'array': {\n const aLen = a.length;\n const bLen = b.length;\n const len = Math.min(aLen, bLen);\n\n for (let i = 0; i < len; i++) {\n const r = compare(a[i], b[i]);\n\n if (r !== 0) {\n return r;\n }\n }\n\n // all elements are equal now\n // shorter array should be ordered first\n return spaceship(aLen, bLen);\n }\n case 'date':\n return spaceship(a.getTime(), b.getTime());\n }\n\n return 0;\n}\n\nexport function parseField(str) {\n const parts = str.split(/:/);\n\n if ( parts.length === 2 && parts[1] === 'desc' ) {\n return { field: parts[0], reverse: true };\n } else {\n return { field: str, reverse: false };\n }\n}\n\nexport function sortBy(ary, keys, desc) {\n if ( !Array.isArray(keys) ) {\n keys = [keys];\n }\n\n return (ary || []).slice().sort((objA, objB) => {\n for ( let i = 0 ; i < keys.length ; i++ ) {\n const parsed = parseField(keys[i]);\n const a = get(objA, parsed.field);\n const b = get(objB, parsed.field);\n let res = compare(a, b);\n\n if ( res ) {\n if ( desc ) {\n res *= -1;\n }\n\n if ( parsed.reverse ) {\n res *= -1;\n }\n\n return res;\n }\n }\n\n return 0;\n });\n}\n\n// Turn foo1-bar2 into foo0000000001-bar0000000002 so that the numbers sort numerically\nconst splitRegex = /([^\\d]+)/;\nconst notNumericRegex = /^[0-9]+$/;\n\nexport function sortableNumericSuffix(str) {\n if ( typeof str !== 'string' ) {\n return str;\n }\n\n return str.split(splitRegex).map((x) => x.match(notNumericRegex) ? strPad(x, 10, '0') : x).join('').trim();\n}\n\nexport function isNumeric(num) {\n return !!`${ num }`.match(notNumericRegex);\n}\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cronstrue\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cronstrue\"] = factory();\n\telse\n\t\troot[\"cronstrue\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 4);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar stringUtilities_1 = __webpack_require__(1);\nvar cronParser_1 = __webpack_require__(2);\nvar ExpressionDescriptor = (function () {\n function ExpressionDescriptor(expression, options) {\n this.expression = expression;\n this.options = options;\n this.expressionParts = new Array(5);\n if (ExpressionDescriptor.locales[options.locale]) {\n this.i18n = ExpressionDescriptor.locales[options.locale];\n }\n else {\n console.warn(\"Locale '\" + options.locale + \"' could not be found; falling back to 'en'.\");\n this.i18n = ExpressionDescriptor.locales[\"en\"];\n }\n if (options.use24HourTimeFormat === undefined) {\n options.use24HourTimeFormat = this.i18n.use24HourTimeFormatByDefault();\n }\n }\n ExpressionDescriptor.toString = function (expression, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.throwExceptionOnParseError, throwExceptionOnParseError = _c === void 0 ? true : _c, _d = _b.verbose, verbose = _d === void 0 ? false : _d, _e = _b.dayOfWeekStartIndexZero, dayOfWeekStartIndexZero = _e === void 0 ? true : _e, use24HourTimeFormat = _b.use24HourTimeFormat, _f = _b.locale, locale = _f === void 0 ? \"en\" : _f;\n var options = {\n throwExceptionOnParseError: throwExceptionOnParseError,\n verbose: verbose,\n dayOfWeekStartIndexZero: dayOfWeekStartIndexZero,\n use24HourTimeFormat: use24HourTimeFormat,\n locale: locale\n };\n var descripter = new ExpressionDescriptor(expression, options);\n return descripter.getFullDescription();\n };\n ExpressionDescriptor.initialize = function (localesLoader) {\n ExpressionDescriptor.specialCharacters = [\"/\", \"-\", \",\", \"*\"];\n localesLoader.load(ExpressionDescriptor.locales);\n };\n ExpressionDescriptor.prototype.getFullDescription = function () {\n var description = \"\";\n try {\n var parser = new cronParser_1.CronParser(this.expression, this.options.dayOfWeekStartIndexZero);\n this.expressionParts = parser.parse();\n var timeSegment = this.getTimeOfDayDescription();\n var dayOfMonthDesc = this.getDayOfMonthDescription();\n var monthDesc = this.getMonthDescription();\n var dayOfWeekDesc = this.getDayOfWeekDescription();\n var yearDesc = this.getYearDescription();\n description += timeSegment + dayOfMonthDesc + dayOfWeekDesc + monthDesc + yearDesc;\n description = this.transformVerbosity(description, this.options.verbose);\n description = description.charAt(0).toLocaleUpperCase() + description.substr(1);\n }\n catch (ex) {\n if (!this.options.throwExceptionOnParseError) {\n description = this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();\n }\n else {\n throw \"\" + ex;\n }\n }\n return description;\n };\n ExpressionDescriptor.prototype.getTimeOfDayDescription = function () {\n var secondsExpression = this.expressionParts[0];\n var minuteExpression = this.expressionParts[1];\n var hourExpression = this.expressionParts[2];\n var description = \"\";\n if (!stringUtilities_1.StringUtilities.containsAny(minuteExpression, ExpressionDescriptor.specialCharacters) &&\n !stringUtilities_1.StringUtilities.containsAny(hourExpression, ExpressionDescriptor.specialCharacters) &&\n !stringUtilities_1.StringUtilities.containsAny(secondsExpression, ExpressionDescriptor.specialCharacters)) {\n description += this.i18n.atSpace() + this.formatTime(hourExpression, minuteExpression, secondsExpression);\n }\n else if (!secondsExpression &&\n minuteExpression.indexOf(\"-\") > -1 &&\n !(minuteExpression.indexOf(\",\") > -1) &&\n !(minuteExpression.indexOf(\"/\") > -1) &&\n !stringUtilities_1.StringUtilities.containsAny(hourExpression, ExpressionDescriptor.specialCharacters)) {\n var minuteParts = minuteExpression.split(\"-\");\n description += stringUtilities_1.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(), this.formatTime(hourExpression, minuteParts[0], \"\"), this.formatTime(hourExpression, minuteParts[1], \"\"));\n }\n else if (!secondsExpression &&\n hourExpression.indexOf(\",\") > -1 &&\n hourExpression.indexOf(\"-\") == -1 &&\n hourExpression.indexOf(\"/\") == -1 &&\n !stringUtilities_1.StringUtilities.containsAny(minuteExpression, ExpressionDescriptor.specialCharacters)) {\n var hourParts = hourExpression.split(\",\");\n description += this.i18n.at();\n for (var i = 0; i < hourParts.length; i++) {\n description += \" \";\n description += this.formatTime(hourParts[i], minuteExpression, \"\");\n if (i < hourParts.length - 2) {\n description += \",\";\n }\n if (i == hourParts.length - 2) {\n description += this.i18n.spaceAnd();\n }\n }\n }\n else {\n var secondsDescription = this.getSecondsDescription();\n var minutesDescription = this.getMinutesDescription();\n var hoursDescription = this.getHoursDescription();\n description += secondsDescription;\n if (description.length > 0 && minutesDescription.length > 0) {\n description += \", \";\n }\n description += minutesDescription;\n if (description.length > 0 && hoursDescription.length > 0) {\n description += \", \";\n }\n description += hoursDescription;\n }\n return description;\n };\n ExpressionDescriptor.prototype.getSecondsDescription = function () {\n var _this = this;\n var description = this.getSegmentDescription(this.expressionParts[0], this.i18n.everySecond(), function (s) {\n return s;\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Seconds(), s);\n }, function (s) {\n return _this.i18n.secondsX0ThroughX1PastTheMinute();\n }, function (s) {\n return s == \"0\"\n ? \"\"\n : parseInt(s) < 20\n ? _this.i18n.atX0SecondsPastTheMinute()\n : _this.i18n.atX0SecondsPastTheMinuteGt20() || _this.i18n.atX0SecondsPastTheMinute();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getMinutesDescription = function () {\n var _this = this;\n var secondsExpression = this.expressionParts[0];\n var hourExpression = this.expressionParts[2];\n var description = this.getSegmentDescription(this.expressionParts[1], this.i18n.everyMinute(), function (s) {\n return s;\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Minutes(), s);\n }, function (s) {\n return _this.i18n.minutesX0ThroughX1PastTheHour();\n }, function (s) {\n try {\n return s == \"0\" && hourExpression.indexOf(\"/\") == -1 && secondsExpression == \"\"\n ? _this.i18n.everyHour()\n : parseInt(s) < 20\n ? _this.i18n.atX0MinutesPastTheHour()\n : _this.i18n.atX0MinutesPastTheHourGt20() || _this.i18n.atX0MinutesPastTheHour();\n }\n catch (e) {\n return _this.i18n.atX0MinutesPastTheHour();\n }\n });\n return description;\n };\n ExpressionDescriptor.prototype.getHoursDescription = function () {\n var _this = this;\n var expression = this.expressionParts[2];\n var description = this.getSegmentDescription(expression, this.i18n.everyHour(), function (s) {\n return _this.formatTime(s, \"0\", \"\");\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Hours(), s);\n }, function (s) {\n return _this.i18n.betweenX0AndX1();\n }, function (s) {\n return _this.i18n.atX0();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getDayOfWeekDescription = function () {\n var _this = this;\n var daysOfWeekNames = this.i18n.daysOfTheWeek();\n var description = null;\n if (this.expressionParts[5] == \"*\") {\n description = \"\";\n }\n else {\n description = this.getSegmentDescription(this.expressionParts[5], this.i18n.commaEveryDay(), function (s) {\n var exp = s;\n if (s.indexOf(\"#\") > -1) {\n exp = s.substr(0, s.indexOf(\"#\"));\n }\n else if (s.indexOf(\"L\") > -1) {\n exp = exp.replace(\"L\", \"\");\n }\n return daysOfWeekNames[parseInt(exp)];\n }, function (s) {\n if (parseInt(s) == 1) {\n return \"\";\n }\n else {\n return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0DaysOfTheWeek(), s);\n }\n }, function (s) {\n return _this.i18n.commaX0ThroughX1();\n }, function (s) {\n var format = null;\n if (s.indexOf(\"#\") > -1) {\n var dayOfWeekOfMonthNumber = s.substring(s.indexOf(\"#\") + 1);\n var dayOfWeekOfMonthDescription = null;\n switch (dayOfWeekOfMonthNumber) {\n case \"1\":\n dayOfWeekOfMonthDescription = _this.i18n.first();\n break;\n case \"2\":\n dayOfWeekOfMonthDescription = _this.i18n.second();\n break;\n case \"3\":\n dayOfWeekOfMonthDescription = _this.i18n.third();\n break;\n case \"4\":\n dayOfWeekOfMonthDescription = _this.i18n.fourth();\n break;\n case \"5\":\n dayOfWeekOfMonthDescription = _this.i18n.fifth();\n break;\n }\n format = _this.i18n.commaOnThe() + dayOfWeekOfMonthDescription + _this.i18n.spaceX0OfTheMonth();\n }\n else if (s.indexOf(\"L\") > -1) {\n format = _this.i18n.commaOnTheLastX0OfTheMonth();\n }\n else {\n var domSpecified = _this.expressionParts[3] != \"*\";\n format = domSpecified ? _this.i18n.commaAndOnX0() : _this.i18n.commaOnlyOnX0();\n }\n return format;\n });\n }\n return description;\n };\n ExpressionDescriptor.prototype.getMonthDescription = function () {\n var _this = this;\n var monthNames = this.i18n.monthsOfTheYear();\n var description = this.getSegmentDescription(this.expressionParts[4], \"\", function (s) {\n return monthNames[parseInt(s) - 1];\n }, function (s) {\n if (parseInt(s) == 1) {\n return \"\";\n }\n else {\n return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Months(), s);\n }\n }, function (s) {\n return _this.i18n.commaMonthX0ThroughMonthX1() || _this.i18n.commaX0ThroughX1();\n }, function (s) {\n return _this.i18n.commaOnlyInMonthX0 ? _this.i18n.commaOnlyInMonthX0() : _this.i18n.commaOnlyInX0();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getDayOfMonthDescription = function () {\n var _this = this;\n var description = null;\n var expression = this.expressionParts[3];\n switch (expression) {\n case \"L\":\n description = this.i18n.commaOnTheLastDayOfTheMonth();\n break;\n case \"WL\":\n case \"LW\":\n description = this.i18n.commaOnTheLastWeekdayOfTheMonth();\n break;\n default:\n var weekDayNumberMatches = expression.match(/(\\d{1,2}W)|(W\\d{1,2})/);\n if (weekDayNumberMatches) {\n var dayNumber = parseInt(weekDayNumberMatches[0].replace(\"W\", \"\"));\n var dayString = dayNumber == 1\n ? this.i18n.firstWeekday()\n : stringUtilities_1.StringUtilities.format(this.i18n.weekdayNearestDayX0(), dayNumber.toString());\n description = stringUtilities_1.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(), dayString);\n break;\n }\n else {\n var lastDayOffSetMatches = expression.match(/L-(\\d{1,2})/);\n if (lastDayOffSetMatches) {\n var offSetDays = lastDayOffSetMatches[1];\n description = stringUtilities_1.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(), offSetDays);\n break;\n }\n else if (expression == \"*\" && this.expressionParts[5] != \"*\") {\n return \"\";\n }\n else {\n description = this.getSegmentDescription(expression, this.i18n.commaEveryDay(), function (s) {\n return s == \"L\" ? _this.i18n.lastDay() : ((_this.i18n.dayX0) ? stringUtilities_1.StringUtilities.format(_this.i18n.dayX0(), s) : s);\n }, function (s) {\n return s == \"1\" ? _this.i18n.commaEveryDay() : _this.i18n.commaEveryX0Days();\n }, function (s) {\n return _this.i18n.commaBetweenDayX0AndX1OfTheMonth();\n }, function (s) {\n return _this.i18n.commaOnDayX0OfTheMonth();\n });\n }\n break;\n }\n }\n return description;\n };\n ExpressionDescriptor.prototype.getYearDescription = function () {\n var _this = this;\n var description = this.getSegmentDescription(this.expressionParts[6], \"\", function (s) {\n return /^\\d+$/.test(s) ? new Date(parseInt(s), 1).getFullYear().toString() : s;\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Years(), s);\n }, function (s) {\n return _this.i18n.commaYearX0ThroughYearX1() || _this.i18n.commaX0ThroughX1();\n }, function (s) {\n return _this.i18n.commaOnlyInYearX0 ? _this.i18n.commaOnlyInYearX0() : _this.i18n.commaOnlyInX0();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getSegmentDescription = function (expression, allDescription, getSingleItemDescription, getIntervalDescriptionFormat, getBetweenDescriptionFormat, getDescriptionFormat) {\n var _this = this;\n var description = null;\n if (!expression) {\n description = \"\";\n }\n else if (expression === \"*\") {\n description = allDescription;\n }\n else if (!stringUtilities_1.StringUtilities.containsAny(expression, [\"/\", \"-\", \",\"])) {\n description = stringUtilities_1.StringUtilities.format(getDescriptionFormat(expression), getSingleItemDescription(expression));\n }\n else if (expression.indexOf(\"/\") > -1) {\n var segments = expression.split(\"/\");\n description = stringUtilities_1.StringUtilities.format(getIntervalDescriptionFormat(segments[1]), segments[1]);\n if (segments[0].indexOf(\"-\") > -1) {\n var betweenSegmentDescription = this.generateBetweenSegmentDescription(segments[0], getBetweenDescriptionFormat, getSingleItemDescription);\n if (betweenSegmentDescription.indexOf(\", \") != 0) {\n description += \", \";\n }\n description += betweenSegmentDescription;\n }\n else if (!stringUtilities_1.StringUtilities.containsAny(segments[0], [\"*\", \",\"])) {\n var rangeItemDescription = stringUtilities_1.StringUtilities.format(getDescriptionFormat(segments[0]), getSingleItemDescription(segments[0]));\n rangeItemDescription = rangeItemDescription.replace(\", \", \"\");\n description += stringUtilities_1.StringUtilities.format(this.i18n.commaStartingX0(), rangeItemDescription);\n }\n }\n else if (expression.indexOf(\",\") > -1) {\n var segments = expression.split(\",\");\n var descriptionContent = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (i > 0 && segments.length > 2) {\n descriptionContent += \",\";\n if (i < segments.length - 1) {\n descriptionContent += \" \";\n }\n }\n if (i > 0 && segments.length > 1 && (i == segments.length - 1 || segments.length == 2)) {\n descriptionContent += this.i18n.spaceAnd() + \" \";\n }\n if (segments[i].indexOf(\"-\") > -1) {\n var betweenSegmentDescription = this.generateBetweenSegmentDescription(segments[i], function (s) {\n return _this.i18n.commaX0ThroughX1();\n }, getSingleItemDescription);\n betweenSegmentDescription = betweenSegmentDescription.replace(\", \", \"\");\n descriptionContent += betweenSegmentDescription;\n }\n else {\n descriptionContent += getSingleItemDescription(segments[i]);\n }\n }\n description = stringUtilities_1.StringUtilities.format(getDescriptionFormat(expression), descriptionContent);\n }\n else if (expression.indexOf(\"-\") > -1) {\n description = this.generateBetweenSegmentDescription(expression, getBetweenDescriptionFormat, getSingleItemDescription);\n }\n return description;\n };\n ExpressionDescriptor.prototype.generateBetweenSegmentDescription = function (betweenExpression, getBetweenDescriptionFormat, getSingleItemDescription) {\n var description = \"\";\n var betweenSegments = betweenExpression.split(\"-\");\n var betweenSegment1Description = getSingleItemDescription(betweenSegments[0]);\n var betweenSegment2Description = getSingleItemDescription(betweenSegments[1]);\n betweenSegment2Description = betweenSegment2Description.replace(\":00\", \":59\");\n var betweenDescriptionFormat = getBetweenDescriptionFormat(betweenExpression);\n description += stringUtilities_1.StringUtilities.format(betweenDescriptionFormat, betweenSegment1Description, betweenSegment2Description);\n return description;\n };\n ExpressionDescriptor.prototype.formatTime = function (hourExpression, minuteExpression, secondExpression) {\n var hour = parseInt(hourExpression);\n var period = \"\";\n var setPeriodBeforeTime = false;\n if (!this.options.use24HourTimeFormat) {\n setPeriodBeforeTime = this.i18n.setPeriodBeforeTime && this.i18n.setPeriodBeforeTime();\n period = setPeriodBeforeTime ? this.getPeriod(hour) + \" \" : \" \" + this.getPeriod(hour);\n if (hour > 12) {\n hour -= 12;\n }\n if (hour === 0) {\n hour = 12;\n }\n }\n var minute = minuteExpression;\n var second = \"\";\n if (secondExpression) {\n second = \":\" + (\"00\" + secondExpression).substring(secondExpression.length);\n }\n return \"\" + (setPeriodBeforeTime ? period : \"\") + (\"00\" + hour.toString()).substring(hour.toString().length) + \":\" + (\"00\" + minute.toString()).substring(minute.toString().length) + second + (!setPeriodBeforeTime ? period : \"\");\n };\n ExpressionDescriptor.prototype.transformVerbosity = function (description, useVerboseFormat) {\n if (!useVerboseFormat) {\n description = description.replace(new RegExp(\", \" + this.i18n.everyMinute(), \"g\"), \"\");\n description = description.replace(new RegExp(\", \" + this.i18n.everyHour(), \"g\"), \"\");\n description = description.replace(new RegExp(this.i18n.commaEveryDay(), \"g\"), \"\");\n description = description.replace(/\\, ?$/, \"\");\n }\n return description;\n };\n ExpressionDescriptor.prototype.getPeriod = function (hour) {\n return hour >= 12 ? this.i18n.pm && this.i18n.pm() || \"PM\" : this.i18n.am && this.i18n.am() || \"AM\";\n };\n ExpressionDescriptor.locales = {};\n return ExpressionDescriptor;\n}());\nexports.ExpressionDescriptor = ExpressionDescriptor;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StringUtilities = (function () {\n function StringUtilities() {\n }\n StringUtilities.format = function (template) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n return template.replace(/%s/g, function () {\n return values.shift();\n });\n };\n StringUtilities.containsAny = function (text, searchStrings) {\n return searchStrings.some(function (c) {\n return text.indexOf(c) > -1;\n });\n };\n return StringUtilities;\n}());\nexports.StringUtilities = StringUtilities;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CronParser = (function () {\n function CronParser(expression, dayOfWeekStartIndexZero) {\n if (dayOfWeekStartIndexZero === void 0) { dayOfWeekStartIndexZero = true; }\n this.expression = expression;\n this.dayOfWeekStartIndexZero = dayOfWeekStartIndexZero;\n }\n CronParser.prototype.parse = function () {\n var parsed = this.extractParts(this.expression);\n this.normalize(parsed);\n this.validate(parsed);\n return parsed;\n };\n CronParser.prototype.extractParts = function (expression) {\n if (!this.expression) {\n throw new Error(\"Expression is empty\");\n }\n var parsed = expression.trim().split(/[ ]+/);\n if (parsed.length < 5) {\n throw new Error(\"Expression has only \" + parsed.length + \" part\" + (parsed.length == 1 ? \"\" : \"s\") + \". At least 5 parts are required.\");\n }\n else if (parsed.length == 5) {\n parsed.unshift(\"\");\n parsed.push(\"\");\n }\n else if (parsed.length == 6) {\n if (/\\d{4}$/.test(parsed[5])) {\n parsed.unshift(\"\");\n }\n else {\n parsed.push(\"\");\n }\n }\n else if (parsed.length > 7) {\n throw new Error(\"Expression has \" + parsed.length + \" parts; too many!\");\n }\n return parsed;\n };\n CronParser.prototype.normalize = function (expressionParts) {\n var _this = this;\n expressionParts[3] = expressionParts[3].replace(\"?\", \"*\");\n expressionParts[5] = expressionParts[5].replace(\"?\", \"*\");\n expressionParts[2] = expressionParts[2].replace(\"?\", \"*\");\n if (expressionParts[0].indexOf(\"0/\") == 0) {\n expressionParts[0] = expressionParts[0].replace(\"0/\", \"*/\");\n }\n if (expressionParts[1].indexOf(\"0/\") == 0) {\n expressionParts[1] = expressionParts[1].replace(\"0/\", \"*/\");\n }\n if (expressionParts[2].indexOf(\"0/\") == 0) {\n expressionParts[2] = expressionParts[2].replace(\"0/\", \"*/\");\n }\n if (expressionParts[3].indexOf(\"1/\") == 0) {\n expressionParts[3] = expressionParts[3].replace(\"1/\", \"*/\");\n }\n if (expressionParts[4].indexOf(\"1/\") == 0) {\n expressionParts[4] = expressionParts[4].replace(\"1/\", \"*/\");\n }\n if (expressionParts[5].indexOf(\"1/\") == 0) {\n expressionParts[5] = expressionParts[5].replace(\"1/\", \"*/\");\n }\n if (expressionParts[6].indexOf(\"1/\") == 0) {\n expressionParts[6] = expressionParts[6].replace(\"1/\", \"*/\");\n }\n expressionParts[5] = expressionParts[5].replace(/(^\\d)|([^#/\\s]\\d)/g, function (t) {\n var dowDigits = t.replace(/\\D/, \"\");\n var dowDigitsAdjusted = dowDigits;\n if (_this.dayOfWeekStartIndexZero) {\n if (dowDigits == \"7\") {\n dowDigitsAdjusted = \"0\";\n }\n }\n else {\n dowDigitsAdjusted = (parseInt(dowDigits) - 1).toString();\n }\n return t.replace(dowDigits, dowDigitsAdjusted);\n });\n if (expressionParts[5] == \"L\") {\n expressionParts[5] = \"6\";\n }\n if (expressionParts[3] == \"?\") {\n expressionParts[3] = \"*\";\n }\n if (expressionParts[3].indexOf(\"W\") > -1 &&\n (expressionParts[3].indexOf(\",\") > -1 || expressionParts[3].indexOf(\"-\") > -1)) {\n throw new Error(\"The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.\");\n }\n var days = {\n SUN: 0,\n MON: 1,\n TUE: 2,\n WED: 3,\n THU: 4,\n FRI: 5,\n SAT: 6\n };\n for (var day in days) {\n expressionParts[5] = expressionParts[5].replace(new RegExp(day, \"gi\"), days[day].toString());\n }\n var months = {\n JAN: 1,\n FEB: 2,\n MAR: 3,\n APR: 4,\n MAY: 5,\n JUN: 6,\n JUL: 7,\n AUG: 8,\n SEP: 9,\n OCT: 10,\n NOV: 11,\n DEC: 12\n };\n for (var month in months) {\n expressionParts[4] = expressionParts[4].replace(new RegExp(month, \"gi\"), months[month].toString());\n }\n if (expressionParts[0] == \"0\") {\n expressionParts[0] = \"\";\n }\n if (!/\\*|\\-|\\,|\\//.test(expressionParts[2]) &&\n (/\\*|\\//.test(expressionParts[1]) || /\\*|\\//.test(expressionParts[0]))) {\n expressionParts[2] += \"-\" + expressionParts[2];\n }\n for (var i = 0; i < expressionParts.length; i++) {\n if (expressionParts[i] == \"*/1\") {\n expressionParts[i] = \"*\";\n }\n if (expressionParts[i].indexOf(\"/\") > -1 && !/^\\*|\\-|\\,/.test(expressionParts[i])) {\n var stepRangeThrough = null;\n switch (i) {\n case 4:\n stepRangeThrough = \"12\";\n break;\n case 5:\n stepRangeThrough = \"6\";\n break;\n case 6:\n stepRangeThrough = \"9999\";\n break;\n default:\n stepRangeThrough = null;\n break;\n }\n if (stepRangeThrough != null) {\n var parts = expressionParts[i].split(\"/\");\n expressionParts[i] = parts[0] + \"-\" + stepRangeThrough + \"/\" + parts[1];\n }\n }\n }\n };\n CronParser.prototype.validate = function (parsed) {\n this.assertNoInvalidCharacters(\"DOW\", parsed[5]);\n this.assertNoInvalidCharacters(\"DOM\", parsed[3]);\n };\n CronParser.prototype.assertNoInvalidCharacters = function (partDescription, expression) {\n var invalidChars = expression.match(/[A-KM-VX-Z]+/gi);\n if (invalidChars && invalidChars.length) {\n throw new Error(partDescription + \" part contains invalid values: '\" + invalidChars.toString() + \"'\");\n }\n };\n return CronParser;\n}());\nexports.CronParser = CronParser;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar en = (function () {\n function en() {\n }\n en.prototype.atX0SecondsPastTheMinuteGt20 = function () {\n return null;\n };\n en.prototype.atX0MinutesPastTheHourGt20 = function () {\n return null;\n };\n en.prototype.commaMonthX0ThroughMonthX1 = function () {\n return null;\n };\n en.prototype.commaYearX0ThroughYearX1 = function () {\n return null;\n };\n en.prototype.use24HourTimeFormatByDefault = function () {\n return false;\n };\n en.prototype.anErrorOccuredWhenGeneratingTheExpressionD = function () {\n return \"An error occured when generating the expression description. Check the cron expression syntax.\";\n };\n en.prototype.everyMinute = function () {\n return \"every minute\";\n };\n en.prototype.everyHour = function () {\n return \"every hour\";\n };\n en.prototype.atSpace = function () {\n return \"At \";\n };\n en.prototype.everyMinuteBetweenX0AndX1 = function () {\n return \"Every minute between %s and %s\";\n };\n en.prototype.at = function () {\n return \"At\";\n };\n en.prototype.spaceAnd = function () {\n return \" and\";\n };\n en.prototype.everySecond = function () {\n return \"every second\";\n };\n en.prototype.everyX0Seconds = function () {\n return \"every %s seconds\";\n };\n en.prototype.secondsX0ThroughX1PastTheMinute = function () {\n return \"seconds %s through %s past the minute\";\n };\n en.prototype.atX0SecondsPastTheMinute = function () {\n return \"at %s seconds past the minute\";\n };\n en.prototype.everyX0Minutes = function () {\n return \"every %s minutes\";\n };\n en.prototype.minutesX0ThroughX1PastTheHour = function () {\n return \"minutes %s through %s past the hour\";\n };\n en.prototype.atX0MinutesPastTheHour = function () {\n return \"at %s minutes past the hour\";\n };\n en.prototype.everyX0Hours = function () {\n return \"every %s hours\";\n };\n en.prototype.betweenX0AndX1 = function () {\n return \"between %s and %s\";\n };\n en.prototype.atX0 = function () {\n return \"at %s\";\n };\n en.prototype.commaEveryDay = function () {\n return \", every day\";\n };\n en.prototype.commaEveryX0DaysOfTheWeek = function () {\n return \", every %s days of the week\";\n };\n en.prototype.commaX0ThroughX1 = function () {\n return \", %s through %s\";\n };\n en.prototype.first = function () {\n return \"first\";\n };\n en.prototype.second = function () {\n return \"second\";\n };\n en.prototype.third = function () {\n return \"third\";\n };\n en.prototype.fourth = function () {\n return \"fourth\";\n };\n en.prototype.fifth = function () {\n return \"fifth\";\n };\n en.prototype.commaOnThe = function () {\n return \", on the \";\n };\n en.prototype.spaceX0OfTheMonth = function () {\n return \" %s of the month\";\n };\n en.prototype.lastDay = function () {\n return \"the last day\";\n };\n en.prototype.commaOnTheLastX0OfTheMonth = function () {\n return \", on the last %s of the month\";\n };\n en.prototype.commaOnlyOnX0 = function () {\n return \", only on %s\";\n };\n en.prototype.commaAndOnX0 = function () {\n return \", and on %s\";\n };\n en.prototype.commaEveryX0Months = function () {\n return \", every %s months\";\n };\n en.prototype.commaOnlyInX0 = function () {\n return \", only in %s\";\n };\n en.prototype.commaOnTheLastDayOfTheMonth = function () {\n return \", on the last day of the month\";\n };\n en.prototype.commaOnTheLastWeekdayOfTheMonth = function () {\n return \", on the last weekday of the month\";\n };\n en.prototype.commaDaysBeforeTheLastDayOfTheMonth = function () {\n return \", %s days before the last day of the month\";\n };\n en.prototype.firstWeekday = function () {\n return \"first weekday\";\n };\n en.prototype.weekdayNearestDayX0 = function () {\n return \"weekday nearest day %s\";\n };\n en.prototype.commaOnTheX0OfTheMonth = function () {\n return \", on the %s of the month\";\n };\n en.prototype.commaEveryX0Days = function () {\n return \", every %s days\";\n };\n en.prototype.commaBetweenDayX0AndX1OfTheMonth = function () {\n return \", between day %s and %s of the month\";\n };\n en.prototype.commaOnDayX0OfTheMonth = function () {\n return \", on day %s of the month\";\n };\n en.prototype.commaEveryHour = function () {\n return \", every hour\";\n };\n en.prototype.commaEveryX0Years = function () {\n return \", every %s years\";\n };\n en.prototype.commaStartingX0 = function () {\n return \", starting %s\";\n };\n en.prototype.daysOfTheWeek = function () {\n return [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n };\n en.prototype.monthsOfTheYear = function () {\n return [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n };\n return en;\n}());\nexports.en = en;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar expressionDescriptor_ts_1 = __webpack_require__(0);\nvar enLocaleLoader_1 = __webpack_require__(5);\nexpressionDescriptor_ts_1.ExpressionDescriptor.initialize(new enLocaleLoader_1.enLocaleLoader());\nexports.default = expressionDescriptor_ts_1.ExpressionDescriptor;\nvar toString = expressionDescriptor_ts_1.ExpressionDescriptor.toString;\nexports.toString = toString;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar en_1 = __webpack_require__(3);\nvar enLocaleLoader = (function () {\n function enLocaleLoader() {\n }\n enLocaleLoader.prototype.load = function (availableLocales) {\n availableLocales[\"en\"] = new en_1.en();\n };\n return enLocaleLoader;\n}());\nexports.enLocaleLoader = enLocaleLoader;\n\n\n/***/ })\n/******/ ]);\n});","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var map = {\n\t\"./csp/dark/rancher-logo.svg\": \"858f\",\n\t\"./csp/favicon.png\": \"44a5\",\n\t\"./csp/metadata\": \"7f57\",\n\t\"./csp/metadata.json\": \"7f57\",\n\t\"./csp/rancher-logo.svg\": \"b5af\",\n\t\"./federal/dark/rancher-logo.svg\": \"0749\",\n\t\"./federal/metadata\": \"66fa\",\n\t\"./federal/metadata.json\": \"66fa\",\n\t\"./federal/rancher-logo.svg\": \"ad96\",\n\t\"./rgs/dark/rancher-logo.svg\": \"b160\",\n\t\"./rgs/metadata\": \"45d2\",\n\t\"./rgs/metadata.json\": \"45d2\",\n\t\"./rgs/rancher-logo.svg\": \"bd3e\",\n\t\"./suse/dark/rancher-logo.svg\": \"d5dc\",\n\t\"./suse/favicon.png\": \"f595\",\n\t\"./suse/metadata\": \"1d5f\",\n\t\"./suse/metadata.json\": \"1d5f\",\n\t\"./suse/rancher-logo.svg\": \"4816\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"21de\";","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\nfunction negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n}\n\nmodule.exports = negate;\n","module.exports = __webpack_public_path__ + \"img/half-logo.ed04f313.svg\";","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","module.exports = __webpack_public_path__ + \"img/harvester.765f68bd.png\";","export function camelToTitle(str) {\n return dasherize((str || '')).split('-').map((str) => {\n return ucFirst(str);\n }).join(' ');\n}\n\nexport function ucFirst(str) {\n str = str || '';\n\n return str.substr(0, 1).toUpperCase() + str.substr(1);\n}\n\nexport function lcFirst(str) {\n str = str || '';\n\n return str.substr(0, 1).toLowerCase() + str.substr(1);\n}\n\nexport function strPad(str, toLength, padChars = ' ', right = false) {\n str = `${ str }`;\n\n if (str.length >= toLength) {\n return str;\n }\n\n const neededLen = toLength - str.length + 1;\n const padStr = (new Array(neededLen)).join(padChars).substr(0, neededLen);\n\n if (right) {\n return str + padStr;\n } else {\n return padStr + str;\n }\n}\n\n// Turn thing1 into thing00000001 so that the numbers sort numerically\nexport function sortableNumericSuffix(str) {\n str = str || '';\n const match = str.match(/^(.*[^0-9])([0-9]+)$/);\n\n if (match) {\n return match[1] + strPad(match[2], 8, '0');\n }\n\n return str;\n}\n\nconst entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\n\nexport function escapeHtml(html) {\n return String(html).replace(/[&<>\"']/g, (s) => {\n return entityMap[s];\n });\n}\n\n/**\n * Return HTML markup from escaped HTML string, allowing specific tags\n * @param text string\n * @returns string\n */\nexport function decodeHtml(text) {\n const div = document.createElement('div');\n\n div.innerHTML = text;\n\n return div.textContent || div.innerText || '';\n}\n\nexport function escapeRegex(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\nexport function random32(count) {\n count = Math.max(0, count || 1);\n\n const out = [];\n let i;\n\n if (window.crypto && window.crypto.getRandomValues) {\n const tmp = new Uint32Array(count);\n\n window.crypto.getRandomValues(tmp);\n for (i = 0; i < tmp.length; i++) {\n out[i] = tmp[i];\n }\n } else {\n for (i = 0; i < count; i++) {\n out[i] = Math.random() * 4294967296; // Math.pow(2,32);\n }\n }\n\n if (count === 1) {\n return out[0];\n } else {\n return out;\n }\n}\n\nconst alpha = 'abcdefghijklmnopqrstuvwxyz';\nconst num = '0123456789';\nconst sym = '!@#$%^&*()_+-=[]{};:,./<>?|';\n\nexport const CHARSET = {\n NUMERIC: num,\n NO_VOWELS: 'bcdfghjklmnpqrstvwxz2456789',\n ALPHA: alpha + alpha.toUpperCase(),\n ALPHA_NUM: alpha + alpha.toUpperCase() + num,\n ALPHA_LOWER: alpha,\n ALPHA_UPPER: alpha.toUpperCase(),\n HEX: `${ num }ABCDEF`,\n PASSWORD: alpha + alpha.toUpperCase() + num + alpha + alpha.toUpperCase() + num + sym,\n // ^-- includes alpha / ALPHA / num twice to reduce the occurrence of symbols\n};\n\nexport function randomStr(length = 16, chars = CHARSET.ALPHA_NUM) {\n if (!chars || !chars.length) {\n return null;\n }\n\n return random32(length).map((val) => {\n return chars[val % chars.length];\n }).join('');\n}\n\nexport function formatPercent(value, maxPrecision = 2) {\n if (value < 1 && maxPrecision >= 2) {\n return `${ Math.round(value * 100) / 100 }%`;\n } else if (value < 10 && maxPrecision >= 1) {\n return `${ Math.round(value * 10) / 10 }%`;\n } else {\n return `${ Math.round(value) }%`;\n }\n}\n\nexport function pluralize(str) {\n if ( str.match(/.*[^aeiou]y$/i) ) {\n return `${ str.substr(0, str.length - 1) }ies`;\n } else if ( str.endsWith('ics') ) {\n return str;\n } else if ( str.endsWith('s') ) {\n return `${ str }es`;\n } else {\n return `${ str }s`;\n }\n}\n\nexport function resourceNames(names, plusMore, t) {\n return names.reduce((res, name, i) => {\n if (i >= 5) {\n return res;\n }\n res += `${ escapeHtml( name ) }`;\n if (i === names.length - 1) {\n res += plusMore;\n } else {\n res += i === names.length - 2 ? t('generic.and') : t('generic.comma');\n }\n\n return res;\n }, '');\n}\n\nexport function indent(lines, count = 2, token = ' ', afterRegex = null) {\n if (typeof lines === 'string') {\n lines = lines.split(/\\n/);\n } else {\n lines = lines || [];\n }\n\n const padStr = (new Array(count + 1)).join(token);\n\n const out = lines.map((line) => {\n let prefix = '';\n let suffix = line;\n\n if (afterRegex) {\n const match = line.match(afterRegex);\n\n if (match) {\n prefix = match[match.length - 1];\n suffix = line.substr(match[0].length);\n }\n }\n\n return `${ prefix }${ padStr }${ suffix }`;\n });\n\n const str = out.join('\\n');\n\n return str;\n}\n\nconst decamelizeRegex = /([a-z\\d])([A-Z])/g;\n\nexport function decamelize(str) {\n return str.replace(decamelizeRegex, '$1_$2').toLowerCase();\n}\n\nconst dasherizeRegex = /[ _]/g;\n\nexport function dasherize(str) {\n return decamelize(str).replace(dasherizeRegex, '-');\n}\n\nexport function asciiLike(str) {\n str = str || '';\n\n if ( str.match(/[^\\r\\n\\t\\x20-\\x7F]/) ) {\n return false;\n }\n\n return true;\n}\n\nexport function coerceStringTypeToScalarType(val, type) {\n if ( type === 'float' ) {\n // Coerce strings to floats\n val = parseFloat(val) || null; // NaN becomes null\n } else if ( type === 'int' ) {\n // Coerce strings to ints\n val = parseInt(val, 10);\n\n if ( isNaN(val) ) {\n val = null;\n }\n } else if ( type === 'boolean') {\n // Coerce strings to boolean\n if (val.toLowerCase() === 'true') {\n val = true;\n } else if (val.toLowerCase() === 'false') {\n val = false;\n }\n }\n\n return val;\n}\n\nexport function matchesSomeRegex(stringRaw, regexes = []) {\n return regexes.some((regexRaw) => {\n const string = stringRaw || '';\n const regex = ensureRegex(regexRaw);\n\n return string.match(regex);\n });\n}\n\nexport function ensureRegex(strOrRegex, exact = true) {\n if ( typeof strOrRegex === 'string' ) {\n if ( exact ) {\n return new RegExp(`^${ escapeRegex(strOrRegex) }$`, 'i');\n } else {\n return new RegExp(`${ escapeRegex(strOrRegex) }`, 'i');\n }\n }\n\n return strOrRegex;\n}\n\nexport function nlToBr(value) {\n return escapeHtml(value || '').replace(/(\\r\\n|\\r|\\n)/g, '
\\n');\n}\n\nconst quotedMatch = /[^.\"']+|\"([^\"]*)\"|'([^']*)'/g;\n\nexport function splitObjectPath(path) {\n if ( path.includes('\"') || path.includes(\"'\") ) {\n // Path with quoted section\n return path.match(quotedMatch).map((x) => x.replace(/['\"]/g, ''));\n }\n\n // Regular path\n return path.split('.');\n}\n\nexport function joinObjectPath(ary) {\n let out = '';\n\n for ( const p of ary ) {\n if ( p.includes('.') ) {\n out += `.\"${ p }\"`;\n } else {\n out += `.${ p }`;\n }\n }\n\n if ( out.startsWith('.') ) {\n out = out.substr(1);\n }\n\n return out;\n}\n\nexport function shortenedImage(image) {\n return (image || '')\n .replace(/^(index\\.)?docker.io\\/(library\\/)?/, '')\n .replace(/:latest$/, '')\n .replace(/^(.*@sha256:)([0-9a-f]{8})[0-9a-f]+$/i, '$1$2…');\n}\n\nexport function isIpv4(ip) {\n const reg = /^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/;\n\n return reg.test(ip);\n}\n\nexport function sanitizeKey(k) {\n return (k || '').replace(/[^a-z0-9./_-]/ig, '');\n}\n\nexport function sanitizeValue(v) {\n return (v || '').replace(/[^a-z0-9._-]/ig, '');\n}\n\nexport function sanitizeIP(v) {\n return (v || '').replace(/[^a-z0-9.:_-]/ig, '');\n}\n","module.exports = __webpack_public_path__ + \"img/login-landscape.911b980e.svg\";","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","// style-loader: Adds some css to the DOM by adding a \n","import mod from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Loading.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Loading.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Loading.vue?vue&type=template&id=23723280&scoped=true&\"\nimport script from \"./Loading.vue?vue&type=script&lang=js&\"\nexport * from \"./Loading.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Loading.vue?vue&type=style&index=0&id=23723280&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"23723280\",\n null\n \n)\n\nexport default component.exports","export function queryParamsFor(current, qp, defaults = {}) {\n const query = Object.assign({}, current || {});\n\n for ( const key of Object.keys(qp) ) {\n const val = qp[key];\n\n if ( typeof defaults[key] === 'undefined' ) {\n // There is no default\n query[key] = qp[key];\n } else if ( defaults[key] === false ) {\n // Value-less boolean flags\n if ( val ) {\n query[key] = null;\n } else {\n delete query[key];\n }\n } else if ( val === defaults[key] ) {\n // The value is the default\n delete query[key];\n } else {\n // The value is not the default\n query[key] = val;\n }\n }\n\n return query;\n}\n\nexport function getClusterFromRoute(to) {\n let cluster = to.params?.cluster;\n\n if (!cluster) {\n cluster = findMeta(to, 'cluster');\n }\n\n return cluster;\n}\n\nexport function getProductFromRoute(to) {\n let product = to.params?.product;\n\n if ( !product ) {\n const match = to.name?.match(/^c-cluster-([^-]+)/);\n\n if ( match ) {\n product = match[1];\n }\n }\n\n // If still no product, see if the route indicates the product via route metadata\n if (!product) {\n product = findMeta(to, 'product');\n }\n\n return product;\n}\n\nexport const getPackageFromRoute = (route) => {\n if (!route?.meta) {\n return;\n }\n // Sometimes meta is an array... sometimes not\n const arraySafe = Array.isArray(route.meta) ? route.meta : [route.meta];\n\n return arraySafe.find((m) => !!m.pkg)?.pkg;\n};\n\nexport const getResourceFromRoute = (to) => {\n let resource = to.params?.resource;\n\n if (!resource) {\n resource = findMeta(to, 'resource');\n }\n\n return resource;\n};\n\n/**\n * Given a route it will look through the matching parent routes to see if any match the fn (predicate) criteria\n *\n * @param {*} to a VueRouter Route object\n * @param {*} fn fn is a predicate which is passed a matched route. It will return true to indicate there was a matching route and false otherwise\n * @returns true if a matching route was found, false otherwise\n */\nexport const routeMatched = (to, fn) => {\n const matched = to?.matched || [];\n\n return !!matched.find(fn);\n};\n\n/**\n * Checks to see if the route requires authentication by taking a look at the route and it's parents 'meta' to see if it\n * contains { requiresAuthentication: true }\n * @param {*} to a VueRouter Route object\n * @returns true if the route requires authentication, false otherwise\n */\nexport const routeRequiresAuthentication = (to) => {\n return routeMatched(to, (matched) => matched.meta?.requiresAuthentication);\n};\n\nfunction findMeta(route, key) {\n if (route?.meta) {\n const meta = Array.isArray(route.meta) ? route.meta : [route.meta];\n\n for (let i = 0; i < meta.length; i++) {\n if (meta[i][key]) {\n return meta[i][key];\n }\n }\n }\n\n return undefined;\n}\n","import { ActionLocation, CardLocation, ExtensionPoint } from '@shell/core/types';\nimport { isMac } from '@shell/utils/platform';\nimport { ucFirst, randomStr } from '@shell/utils/string';\nimport {\n _EDIT, _CONFIG, _DETAIL, _LIST, _CREATE\n} from '@shell/config/query-params';\nimport { getProductFromRoute } from '@shell/utils/router';\nimport { isEqual } from '@shell/utils/object';\n\nfunction checkRouteProduct($route, locationConfigParam) {\n const product = getProductFromRoute($route);\n\n // alias for the homepage\n if (locationConfigParam === 'home' && $route.name === 'home') {\n return true;\n } else if (locationConfigParam === product) {\n return true;\n }\n\n return false;\n}\n\nfunction checkRouteMode({ name, query }, locationConfigParam) {\n if (locationConfigParam === _EDIT && query.mode && query.mode === _EDIT && !query.as) {\n return true;\n } else if (locationConfigParam === _CONFIG && query.as && query.as === _CONFIG) {\n return true;\n } else if (locationConfigParam === _DETAIL && !query.as && name.includes('-id') && (!query.mode || query?.mode !== _EDIT)) {\n return true;\n // alias to target all list views\n } else if (locationConfigParam === _LIST && !name.includes('-id') && name.includes('-resource')) {\n return true;\n // alias to target create views\n } else if (locationConfigParam === _CREATE && name.endsWith('-create')) {\n return true;\n }\n\n return false;\n}\n\nfunction checkExtensionRouteBinding($route, locationConfig, context) {\n // if no configuration is passed, consider it as global\n if (!Object.keys(locationConfig).length) {\n return true;\n }\n\n const { params } = $route;\n\n // \"params\" to be checked based on the locationConfig\n // This has become overloaded with mode and context\n const paramsToCheck = [\n 'product',\n 'resource',\n 'namespace',\n 'cluster',\n 'id',\n 'mode',\n 'path',\n 'hash',\n // url query params\n 'queryParam',\n // Custom context specific params provided by the extension, not to be confused with location params\n 'context',\n ];\n\n let res = true;\n\n for (let i = 0; i < paramsToCheck.length; i++) {\n const param = paramsToCheck[i];\n\n if (locationConfig[param]) {\n const asArray = Array.isArray(locationConfig[param]) ? locationConfig[param] : [locationConfig[param]];\n\n for (let x = 0; x < asArray.length; x++) {\n const locationConfigParam = asArray[x];\n\n if (locationConfigParam) {\n if (param === 'hash') {\n res = $route.hash ? $route.hash.includes(locationConfigParam) : false;\n // handle \"product\" in a separate way...\n } else if (param === 'product') {\n res = checkRouteProduct($route, locationConfigParam);\n // also handle \"mode\" in a separate way because it mainly depends on query params\n } else if (param === 'mode') {\n res = checkRouteMode($route, locationConfigParam);\n } else if (param === 'resource') {\n // Match exact resource but also allow resource of '*' to match any resource\n res = (params[param] && locationConfigParam === '*') || locationConfigParam === params[param];\n } else if (param === 'context') {\n // Need all keys and values to match\n res = isEqual(locationConfigParam, context);\n // evaluate queryParam in route\n } else if (param === 'queryParam') {\n res = isEqual(locationConfigParam, $route.query);\n // evaluate path in route\n } else if (param === 'path' && locationConfigParam.urlPath) {\n if (locationConfigParam.endsWith) {\n res = $route.path.endsWith(locationConfigParam.urlPath);\n } else if (!Object.keys(locationConfigParam).includes('exact') || locationConfigParam.exact) {\n res = locationConfigParam.urlPath === $route.path;\n } else {\n res = $route.path.includes(locationConfigParam.urlPath);\n }\n } else if (locationConfigParam === params[param]) {\n res = true;\n } else {\n res = false;\n }\n }\n\n // If a single location config param is good then this is an param (aka ['pods', 'configmap'] = pods or configmaps)\n if (res) {\n break;\n }\n }\n\n // If a single param (set of location config params) is bad then this is not an acceptable location\n if (!res) {\n break;\n }\n }\n }\n\n return res;\n}\n\nexport function getApplicableExtensionEnhancements(pluginCtx, actionType, uiArea, currRoute, translationCtx = pluginCtx, context) {\n const extensionEnhancements = [];\n\n // gate it so that we prevent errors on older versions of dashboard\n if (pluginCtx.$plugin?.getUIConfig) {\n const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);\n\n actions.forEach((action, i) => {\n if (checkExtensionRouteBinding(currRoute, action.locationConfig, context || {})) {\n // ADD CARD PLUGIN UI ENHANCEMENT\n if (actionType === ExtensionPoint.CARD) {\n // intercept to apply translation\n if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {\n actions[i].label = translationCtx.t(action.labelKey);\n }\n\n // ADD ACTION PLUGIN UI ENHANCEMENT\n } else if (actionType === ExtensionPoint.ACTION) {\n // TABLE ACTION\n if (uiArea === ActionLocation.TABLE) {\n // intercept to apply translation\n if (action.labelKey) {\n actions[i].label = translationCtx.t(action.labelKey);\n }\n\n // bulkable flag\n actions[i].bulkable = actions[i].multiple || actions[i].bulkable;\n\n // populate action identifier to prevent errors\n if (!actions[i].action) {\n actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;\n }\n }\n\n // extract simplified shortcut definition on plugin - HEADER ACTION\n if (uiArea === ActionLocation.HEADER && action.shortcut) {\n // if it's a string, then assume CTRL for windows and META for mac\n if (typeof action.shortcut === 'string') {\n actions[i].shortcutLabel = () => {\n return isMac ? `(\\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;\n };\n actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };\n // correct check for an Object type in JS... handle the object passed\n } else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {\n actions[i].shortcutKey = action.shortcut;\n const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];\n let scLabel = '';\n\n keyboardCombo.forEach((key, i) => {\n if (i < keyboardCombo.length - 1) {\n if (key === 'meta') {\n key = '\\u2318';\n } else {\n key = ucFirst(key);\n }\n scLabel += `${ key }`;\n scLabel += '-';\n } else {\n scLabel += `${ key.toUpperCase() }`;\n }\n });\n\n actions[i].shortcutLabel = () => {\n return `(${ scLabel })`;\n };\n }\n }\n }\n\n extensionEnhancements.push(actions[i]);\n }\n });\n }\n\n return extensionEnhancements;\n}\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","module.exports = __webpack_public_path__ + \"img/banner.a83d2a9b.svg\";","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","export function importTypes($plugin) { \n $plugin.register('list', 'kubevirt.io.virtualmachine', () => import(/* webpackChunkName: \"list\" */'@pkg/list/kubevirt.io.virtualmachine.vue'));\n $plugin.register('models', 'kubevirt.io.virtualmachine', () => require(/* webpackChunkName: \"models\" */'@pkg/models/kubevirt.io.virtualmachine.js'));\n $plugin.register('models', 'kubevirt.io.virtualmachineinstance', () => require(/* webpackChunkName: \"models\" */'@pkg/models/kubevirt.io.virtualmachineinstance.js'));\n $plugin.register('l10n', 'en-us', () => import('@pkg/l10n/en-us.yaml'));\n $plugin.register('formatters', 'IPAddress', () => import(/* webpackChunkName: \"formatters\" */'@pkg/formatters/IPAddress.vue'));\n $plugin.register('formatters', 'VMState', () => import(/* webpackChunkName: \"formatters\" */'@pkg/formatters/VMState.vue'));\n};\n","import { Action } from '@rancher/shell/core/types';\nimport VirtualMachineModel from './models/kubevirt.io.virtualmachine';\n\n// NOTE: a workaround for properties not defined on VirtualMachine's parent classes\ntype VirtualMachine = VirtualMachineModel & {\n spec: any;\n save: any;\n};\n\nconst startVMs: Action['invoke'] = function (opts, resources: VirtualMachine[]) {\n resources.map((resource) => {\n resource.spec.running = true;\n resource.save();\n });\n};\n\nconst stopVMs: Action['invoke'] = function (opts, resources: VirtualMachine[]) {\n resources.map((resource) => {\n resource.spec.running = false;\n resource.save();\n });\n};\n\nconst canStopVM: Action['enabled'] = (resource: VirtualMachine) => resource.canStop;\nconst canStartVM: Action['enabled'] = (resource: VirtualMachine) => resource.canStart;\n\nexport const startVMAction: Action = {\n label: 'Start',\n icon: 'icon icon-play',\n invoke: startVMs,\n enabled: canStartVM,\n multiple: true,\n};\n\nexport const stopVMAction: Action = {\n label: 'Stop',\n icon: 'icon icon-close',\n invoke: stopVMs,\n enabled: canStopVM,\n multiple: true,\n // disabled: true,\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.$fetchState.pending)?_c('Loading'):_c('SerialConsole',{ref:\"serialConsole\",model:{value:(_vm.vmi),callback:function ($$v) {_vm.vmi=$$v},expression:\"vmi\"}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"console-shell-container\"},[_c('div',{ref:\"xterm\",staticClass:\"shell-body\"}),_c('resize-observer',{on:{\"notify\":_vm.fit}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @author Toru Nagashima \n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap();\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap();\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event);\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n );\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n );\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true;\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault();\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n });\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true });\n\n // Define accessors\n const keys = Object.keys(event);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key));\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget;\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation();\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this);\n\n data.stopped = true;\n data.immediateStopped = true;\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation();\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this));\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true;\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this));\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n});\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype);\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event);\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value;\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event;\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto);\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event);\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n });\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n const isFunc = typeof descriptor.value === \"function\";\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n );\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);\n wrappers.set(proto, wrapper);\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nfunction wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event));\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nfunction isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nfunction setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase;\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nfunction setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget;\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nfunction setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener;\n}\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap();\n\n// Listener types\nconst CAPTURE = 1;\nconst BUBBLE = 2;\nconst ATTRIBUTE = 3;\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget);\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this);\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next;\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null; // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this);\n\n // Traverse to the tail while removing old value.\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n node = node.next;\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n };\n if (prev === null) {\n listeners.set(eventName, newNode);\n } else {\n prev.next = newNode;\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n );\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this);\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n });\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map());\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length);\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i];\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this);\n const optionsIsObj = isObject(options);\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n };\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName);\n if (node === undefined) {\n listeners.set(eventName, newNode);\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null;\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node;\n node = node.next;\n }\n\n // Add it.\n prev.next = newNode;\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this);\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n return\n }\n\n prev = node;\n node = node.next;\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this);\n const eventName = event.type;\n let node = listeners.get(eventName);\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event);\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null;\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n );\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent);\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err);\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent);\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next;\n }\n setPassiveListener(wrappedEvent, null);\n setEventPhase(wrappedEvent, 0);\n setCurrentTarget(wrappedEvent, null);\n\n return !wrappedEvent.defaultPrevented\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n});\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);\n}\n\nexport default EventTarget;\nexport { defineEventAttribute, EventTarget };\n//# sourceMappingURL=event-target-shim.mjs.map\n","type UriField = 'source' | 'protocol' | 'authority' | 'userInfo' | 'user' | 'password' | 'host' | 'port' | 'relative' | 'path' | 'directory' | 'file' | 'queryStr' | 'anchor'\ntype UriFields = {\n [key in UriField]: string; // eslint-disable-line no-unused-vars\n}\nexport type QueryParams = {\n [key: string]: string\n}\n\ninterface ParsedUri extends UriFields {\n query: QueryParams;\n}\n\nexport function addParam(url: string, key: string, val: string | string[]): string {\n let out = url + (url.includes('?') ? '&' : '?');\n\n // val can be a string or an array of strings\n if ( !Array.isArray(val) ) {\n val = [val];\n }\n out += val.map((v) => {\n if ( v === null ) {\n return `${ encodeURIComponent(key) }`;\n } else {\n return `${ encodeURIComponent(key) }=${ encodeURIComponent(v) }`;\n }\n }).join('&');\n\n return out;\n}\n\nexport function addParams(url: string, params: QueryParams): string {\n if ( params && typeof params === 'object' ) {\n Object.keys(params).forEach((key) => {\n url = addParam(url, key, params[key]);\n });\n }\n\n return url;\n}\n\nexport function removeParam(url: string, key: string): string {\n const parsed = parse(url);\n\n if ( parsed.query?.[key] ) {\n delete parsed.query[key];\n }\n\n return stringify(parsed);\n}\n\nexport function parseLinkHeader(str: string): Record {\n const out: { [key: string]: string} = { };\n const lines = (str || '').split(',');\n\n for ( const line of lines ) {\n const match = line.match(/^\\s*<([^>]+)>\\s*;\\s*rel\\s*=\"(.*)\"/);\n\n if ( match ) {\n out[match[2].toLowerCase()] = match[1];\n }\n }\n\n return out;\n}\n\nexport function isMaybeSecure(port: number, proto: string): boolean {\n const protocol = proto.toLowerCase();\n\n return portMatch([port], [443, 8443], ['443']) || protocol === 'https';\n}\n\nexport function portMatch(ports: number[], equals: number[], endsWith: string[]): boolean {\n for (let i = 0; i < ports.length; i++) {\n const port = ports[i];\n\n if (equals.includes(port)) {\n return true;\n }\n\n for (let j = 0; j < endsWith.length; j++) {\n const suffix = `${ endsWith[j] }`;\n const portStr = `${ port }`;\n\n if (portStr !== suffix && portStr.endsWith(suffix)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\n// parseUri 1.2.2\n// (c) Steven Levithan \n// https://javascriptsource.com/parseuri/\n// MIT License\nexport function parse(str: string): ParsedUri {\n const o = parse.options;\n const m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n\n if (!m) {\n throw new Error(`Cannot parse as uri: ${ str }`);\n }\n const uri = {} as ParsedUri;\n let i = 14;\n\n while (i--) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri.query = {};\n uri.queryStr.replace(o.q.parser, (_, $1: string, $2: string): string => {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n\n return '';\n });\n\n return uri;\n}\n\nparse.options = {\n strictMode: false,\n key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'queryStr', 'anchor'],\n q: {\n name: 'query',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n} as {\n strictMode: boolean,\n key: UriField[],\n q: {\n name: 'query',\n parser: RegExp\n },\n parser: {\n strict: RegExp,\n loose: RegExp\n }\n};\n\nexport function stringify(uri: ParsedUri): string {\n let out = `${ uri.protocol }://`;\n\n if ( uri.user && uri.password ) {\n out += `${ uri.user }:${ uri.password }@`;\n } else if ( uri.user ) {\n out += `${ uri.user }@`;\n }\n\n out += uri.host;\n\n if ( uri.port ) {\n out += `:${ uri.port }`;\n }\n\n out += uri.path || '/';\n\n out = addParams(out, uri.query || {});\n\n if ( uri.anchor ) {\n out += `#${ uri.anchor }`;\n }\n\n return out;\n}\n","import { EventTarget } from 'event-target-shim';\nimport { isSafari } from '@shell/utils/platform';\nimport { addParam } from '@shell/utils/url';\n\nlet sockId = 1;\nlet warningShown = false;\nlet wasConnected = false;\n\nconst INSECURE = 'ws://';\nconst SECURE = 'wss://';\n\nconst STATE_DISCONNECTED = 'disconnected';\n\nexport const addEventListener = EventTarget.addEventListener;\nexport const STATE_CONNECTING = 'connecting';\nexport const STATE_CONNECTED = 'connected';\nconst STATE_CLOSING = 'closing';\nconst STATE_RECONNECTING = 'reconnecting';\n\nexport const EVENT_CONNECTING = STATE_CONNECTING;\nexport const EVENT_CONNECTED = STATE_CONNECTED;\nexport const EVENT_DISCONNECTED = STATE_DISCONNECTED;\nexport const EVENT_MESSAGE = 'message';\nexport const EVENT_FRAME_TIMEOUT = 'frame_timeout';\nexport const EVENT_CONNECT_ERROR = 'connect_error';\nexport const EVENT_DISCONNECT_ERROR = 'disconnect_error';\n\nexport const NO_WATCH = 'NO_WATCH';\nexport const NO_SCHEMA = 'NO_SCHEMA';\nexport const NO_PERMS = 'NO_PERMS';\nexport const REVISION_TOO_OLD = 'TOO_OLD';\n\nexport default class Socket extends EventTarget {\n url;\n autoReconnect = true;\n frameTimeout = 35000;\n metadata = {};\n hasBeenOpen = false;\n hasReconnected = false;\n protocol = null;\n maxTries = null;\n tries = 0;\n idAsTimestamp = false;\n\n // \"Private\"\n socket = null;\n state = STATE_DISCONNECTED;\n framesReceived = 0;\n frameTimer;\n reconnectTimer;\n disconnectCallBacks = [];\n disconnectedAt = 0;\n closingId = 0;\n autoReconnectUrl = null;\n\n constructor(url, autoReconnect = true, frameTimeout = null, protocol = null, maxTries = null, idAsTimestamp = false) {\n super();\n\n this.setUrl(url);\n this.autoReconnect = autoReconnect;\n this.protocol = protocol;\n // maxTries = null === never stop trying to reconnect\n // allow maxTries to be defined on individual sockets bc not all will clearly warn the user that we've stopped trying\n this.maxTries = maxTries;\n this.idAsTimestamp = idAsTimestamp;\n\n if ( frameTimeout !== null ) {\n this.frameTimeout = frameTimeout;\n }\n }\n\n setUrl(url) {\n if ( !url.match(/wss?:\\/\\//) ) {\n url = self.location.origin.replace(/^http/, 'ws') + url;\n }\n\n if ( self.location.protocol === 'https:' && url.startsWith(INSECURE) ) {\n url = SECURE + url.substr(INSECURE.length);\n }\n\n this.url = url;\n }\n\n connect(metadata = {}) {\n if ( this.socket ) {\n console.error('Socket refusing to connect while another socket exists'); // eslint-disable-line no-console\n\n return;\n }\n\n if (this.state !== STATE_RECONNECTING) {\n this.state = STATE_CONNECTING;\n }\n\n Object.assign(this.metadata, metadata);\n\n const id = this.idAsTimestamp ? new Date().getTime() : sockId++;\n const url = addParam(this.url, 'sockId', id);\n\n this._baseLog('connecting', { id, url: url.replace(/\\?.*/, '') });\n\n let socket;\n\n this.tries++;\n\n if ( this.protocol ) {\n socket = new WebSocket(url, this.protocol);\n } else {\n socket = new WebSocket(url);\n }\n\n socket.sockId = id;\n socket.metadata = this.metadata;\n socket.onmessage = this._onmessage.bind(this);\n socket.onopen = this._opened.bind(this);\n socket.onerror = this._error.bind(this);\n socket.onclose = this._closed.bind(this);\n\n this.socket = socket;\n this.state = STATE_CONNECTING;\n\n this.dispatchEvent(new CustomEvent(EVENT_CONNECTING));\n }\n\n send(data) {\n if ( this.socket && this.state === STATE_CONNECTED ) {\n this.socket.send(data);\n\n return true;\n }\n\n return false;\n }\n\n disconnect(callBack) {\n if ( callBack ) {\n this.disconnectCallBacks.push(callBack);\n }\n\n const self = this;\n const promise = new Promise((resolve, reject) => {\n if ( this.state === STATE_DISCONNECTED ) {\n resolve();\n }\n\n function onError(e) {\n reject(e);\n self.removeEventListener(EVENT_CONNECT_ERROR, onError);\n }\n\n this.addEventListener(EVENT_CONNECT_ERROR, onError);\n\n this.disconnectCallBacks.push(() => {\n this.removeEventListener(EVENT_CONNECT_ERROR, onError);\n resolve();\n });\n });\n\n this.autoReconnect = false;\n this._close();\n\n return promise;\n }\n\n reconnect(metadata = {}) {\n Object.assign(this.metadata, metadata);\n\n if ( this.state === STATE_CONNECTING ) {\n this._log('Ignoring reconnect for socket in connecting');\n\n return;\n }\n\n if ( this.socket ) {\n this._close();\n } else {\n this.connect(metadata);\n }\n }\n\n getMetadata() {\n if ( this.socket ) {\n return this.socket.metadata;\n } else {\n return {};\n }\n }\n\n getId() {\n if ( this.socket ) {\n return this.socket.sockId;\n } else {\n return 0;\n }\n }\n\n isConnected() {\n return this.state === STATE_CONNECTED;\n }\n\n setAutoReconnect(autoReconnect) {\n this.autoReconnect = autoReconnect;\n }\n\n /**\n * Supply an async fn that will provide a new url to reconnect to\n */\n setAutoReconnectUrl(autoReconnectUrl) {\n this.autoReconnectUrl = autoReconnectUrl;\n }\n\n // \"Private\"\n _close() {\n const socket = this.socket;\n\n if ( !socket ) {\n return;\n }\n\n try {\n this._log('closing');\n this.closingId = socket.sockId;\n socket.onopen = null;\n socket.onerror = null;\n socket.onmessage = null;\n socket.close();\n } catch (e) {\n this._log('exception', { e: e.toString() });\n // Continue anyway...\n }\n\n this.state = STATE_CLOSING;\n }\n\n _opened() {\n this._log('opened');\n const now = (new Date()).getTime();\n\n const atTime = this.disconnectedAt;\n let afterMilliseconds = 0;\n\n if ( atTime ) {\n afterMilliseconds = now - atTime;\n }\n\n if ( this.hasBeenOpen ) {\n this.hasReconnected = true;\n }\n\n this.hasBeenOpen = true;\n this.state = STATE_CONNECTED;\n this.framesReceived = 0;\n this.disconnectedAt = 0;\n\n this.dispatchEvent(new CustomEvent(EVENT_CONNECTED, { detail: { tries: this.tries, afterMilliseconds } }));\n this.tries = 0;\n this._resetWatchdog();\n clearTimeout(this.reconnectTimer);\n }\n\n _onmessage(event) {\n this._resetWatchdog();\n this.tries = 0;\n this.framesReceived++;\n\n this.dispatchEvent(new CustomEvent(EVENT_MESSAGE, { detail: event }));\n }\n\n _resetWatchdog() {\n clearTimeout(this.frameTimer);\n\n const timeout = this.frameTimeout;\n\n if ( timeout && this.state === STATE_CONNECTED) {\n this.frameTimer = setTimeout(() => {\n this._log(`watchdog expired after${ timeout }. Closing`);\n this._close();\n this.dispatchEvent(new CustomEvent(EVENT_FRAME_TIMEOUT));\n }, timeout);\n }\n }\n\n _error() {\n this.closingId = (this.socket ? this.socket.sockId : 0);\n this._log('error');\n }\n\n _closed(event) {\n const { code, reason, wasClean } = event;\n\n this._baseLog('closed', {\n id: this.closingId || this.socket?.sockId || 'unknown', code, reason, clean: wasClean\n });\n\n this.closingId = 0;\n this.socket = null;\n clearTimeout(this.reconnectTimer);\n clearTimeout(this.frameTimer);\n\n const callBacks = this.disconnectCallBacks;\n\n while ( callBacks.length ) {\n const fn = callBacks.pop();\n\n if ( fn ) {\n fn.apply(this);\n }\n }\n\n if ( [STATE_CONNECTED, STATE_CLOSING].includes(this.state) ) {\n wasConnected = true;\n }\n\n if ( !this.disconnectedAt ) {\n this.disconnectedAt = (new Date()).getTime();\n }\n\n if ( !warningShown && !wasConnected ) {\n this.autoReconnect = false;\n this.state = STATE_DISCONNECTED;\n\n const e = new CustomEvent(EVENT_CONNECT_ERROR, { detail: { isSafari } });\n\n this.dispatchEvent(e);\n warningShown = true;\n } else if ( this.autoReconnect ) {\n this.state = STATE_RECONNECTING;\n\n if (this.maxTries && this.tries > 1 && this.tries <= this.maxTries) {\n // dispatch an event which will trigger a growl from steve-plugin sockets warning users that we've lost connection and are attempting to reconnect\n const e = new CustomEvent(EVENT_CONNECT_ERROR);\n\n this.dispatchEvent(e);\n }\n\n if (this.maxTries && this.tries > this.maxTries) {\n this._log('closed. Will not reconnect (hit max attempts)');\n this.state = STATE_DISCONNECTED;\n // dispatch an event which will trigger a growl from steve-plugin sockets warning users that we've given up trying to reconnect\n this.dispatchEvent(new CustomEvent(EVENT_DISCONNECT_ERROR));\n } else {\n const reconnect = () => {\n this._log('closed. Attempting to reconnect');\n const delay = Math.max(1000, Math.min(1000 * this.tries, 30000));\n\n this.reconnectTimer = setTimeout(() => {\n this.connect();\n }, delay);\n };\n\n if (this.autoReconnectUrl) {\n this.autoReconnectUrl()\n .then((url) => {\n this.setUrl(url);\n\n reconnect();\n })\n .catch((e) => {\n console.error('Failed to fetch socket auto reconnect url', e); // eslint-disable-line no-console\n });\n } else {\n reconnect();\n }\n }\n } else {\n this.state = STATE_DISCONNECTED;\n }\n\n if ( this.state === STATE_DISCONNECTED ) {\n this.dispatchEvent(new CustomEvent(EVENT_DISCONNECTED));\n } else if ( this.state === STATE_RECONNECTING ) {\n this.dispatchEvent(new CustomEvent(EVENT_CONNECTING));\n }\n }\n\n /**\n * `console.log` the provided summary statement, with default information to identify the socket and the provided props\n */\n _log(summary, props) {\n this._baseLog(summary, {\n state: this.state, id: this.socket?.sockId || 0, ...props\n });\n }\n\n /**\n * `console.log` the provided summary statement and props\n *\n * This does not contain information to identify the socket and can be used in scenarios where it's not known or default\n */\n _baseLog(summary, props) {\n const message = [summary];\n const values = Object.entries(props || {});\n\n message.unshift('Socket ');\n\n if (values.length) {\n message.push(' (');\n values.forEach(([key, value], index) => {\n if (index !== 0) {\n message.push(`, `);\n }\n message.push(`${ key }=${ value }`);\n });\n message.push(')');\n }\n\n console.log(message.join('')); // eslint-disable-line no-console\n }\n}\n","\n\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsole.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsole.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./SerialConsole.vue?vue&type=template&id=a61c3450&\"\nimport script from \"./SerialConsole.vue?vue&type=script&lang=js&\"\nexport * from \"./SerialConsole.vue?vue&type=script&lang=js&\"\nimport style0 from \"./SerialConsole.vue?vue&type=style&index=0&id=a61c3450&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsolePage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./SerialConsolePage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./SerialConsolePage.vue?vue&type=template&id=3bf18937&scoped=true&\"\nimport script from \"./SerialConsolePage.vue?vue&type=script&lang=js&\"\nexport * from \"./SerialConsolePage.vue?vue&type=script&lang=js&\"\nimport style0 from \"./SerialConsolePage.vue?vue&type=style&index=0&id=3bf18937&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3bf18937\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.$fetchState.pending)?_c('Loading'):_c('NovncConsoleWrapper',{ref:\"console\",staticClass:\"novnc-wrapper\",model:{value:(_vm.vmi),callback:function ($$v) {_vm.vmi=$$v},expression:\"vmi\"}})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{attrs:{\"id\":\"app\"}},[_c('div',{staticClass:\"vm-console\"},[_c('div',{staticClass:\"combination-keys\"},[_c('v-popover',{ref:\"popover\",attrs:{\"placement\":\"top\",\"trigger\":\"click\",\"container\":false},on:{\"auto-hide\":function($event){_vm.keysRecord = []}}},[_c('button',{staticClass:\"btn btn-sm bg-primary\"},[_vm._v(\" \"+_vm._s(_vm.t('kubevirt.virtualMachine.detail.console.shortKeys'))+\" \")]),_c('template',{slot:\"popover\"},[_c('novnc-console-item',{attrs:{\"items\":_vm.keymap,\"path\":_vm.keysRecord,\"pos\":0},on:{\"update\":_vm.update,\"sendKeys\":_vm.sendKeys}})],1)],2),(_vm.hasSoftRebootAction)?_c('button',{staticClass:\"btn btn-sm bg-primary\",on:{\"click\":_vm.softReboot}},[_vm._v(\" \"+_vm._s(_vm.t('kubevirt.action.softreboot'))+\" \")]):_vm._e()],1),(_vm.url && !_vm.isDown)?_c('NovncConsole',{ref:\"novncConsole\",attrs:{\"url\":_vm.url}}):_vm._e(),(_vm.isDown)?_c('p',[_vm._v(\" \"+_vm._s(_vm.t('kubevirt.virtualMachine.detail.console.down'))+\" \")]):_vm._e()],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/* eslint-disable key-spacing */\n\nexport default {\n XK_VoidSymbol: 0xffffff, /* Void symbol */\n\n XK_BackSpace: 0xff08, /* Back space, back char */\n XK_Tab: 0xff09,\n XK_Linefeed: 0xff0a, /* Linefeed, LF */\n XK_Clear: 0xff0b,\n XK_Return: 0xff0d, /* Return, enter */\n XK_Pause: 0xff13, /* Pause, hold */\n XK_Scroll_Lock: 0xff14,\n XK_Sys_Req: 0xff15,\n XK_Escape: 0xff1b,\n XK_Delete: 0xffff, /* Delete, rubout */\n\n /* International & multi-key character composition */\n\n XK_Multi_key: 0xff20, /* Multi-key character compose */\n XK_Codeinput: 0xff37,\n XK_SingleCandidate: 0xff3c,\n XK_MultipleCandidate: 0xff3d,\n XK_PreviousCandidate: 0xff3e,\n\n /* Japanese keyboard support */\n\n XK_Kanji: 0xff21, /* Kanji, Kanji convert */\n XK_Muhenkan: 0xff22, /* Cancel Conversion */\n XK_Henkan_Mode: 0xff23, /* Start/Stop Conversion */\n XK_Henkan: 0xff23, /* Alias for Henkan_Mode */\n XK_Romaji: 0xff24, /* to Romaji */\n XK_Hiragana: 0xff25, /* to Hiragana */\n XK_Katakana: 0xff26, /* to Katakana */\n XK_Hiragana_Katakana: 0xff27, /* Hiragana/Katakana toggle */\n XK_Zenkaku: 0xff28, /* to Zenkaku */\n XK_Hankaku: 0xff29, /* to Hankaku */\n XK_Zenkaku_Hankaku: 0xff2a, /* Zenkaku/Hankaku toggle */\n XK_Touroku: 0xff2b, /* Add to Dictionary */\n XK_Massyo: 0xff2c, /* Delete from Dictionary */\n XK_Kana_Lock: 0xff2d, /* Kana Lock */\n XK_Kana_Shift: 0xff2e, /* Kana Shift */\n XK_Eisu_Shift: 0xff2f, /* Alphanumeric Shift */\n XK_Eisu_toggle: 0xff30, /* Alphanumeric toggle */\n XK_Kanji_Bangou: 0xff37, /* Codeinput */\n XK_Zen_Koho: 0xff3d, /* Multiple/All Candidate(s) */\n XK_Mae_Koho: 0xff3e, /* Previous Candidate */\n\n /* Cursor control & motion */\n\n XK_Home: 0xff50,\n XK_Left: 0xff51, /* Move left, left arrow */\n XK_Up: 0xff52, /* Move up, up arrow */\n XK_Right: 0xff53, /* Move right, right arrow */\n XK_Down: 0xff54, /* Move down, down arrow */\n XK_Prior: 0xff55, /* Prior, previous */\n XK_Page_Up: 0xff55,\n XK_Next: 0xff56, /* Next */\n XK_Page_Down: 0xff56,\n XK_End: 0xff57, /* EOL */\n XK_Begin: 0xff58, /* BOL */\n\n\n /* Misc functions */\n\n XK_Select: 0xff60, /* Select, mark */\n XK_Print: 0xff61,\n XK_Execute: 0xff62, /* Execute, run, do */\n XK_Insert: 0xff63, /* Insert, insert here */\n XK_Undo: 0xff65,\n XK_Redo: 0xff66, /* Redo, again */\n XK_Menu: 0xff67,\n XK_Find: 0xff68, /* Find, search */\n XK_Cancel: 0xff69, /* Cancel, stop, abort, exit */\n XK_Help: 0xff6a, /* Help */\n XK_Break: 0xff6b,\n XK_Mode_switch: 0xff7e, /* Character set switch */\n XK_script_switch: 0xff7e, /* Alias for mode_switch */\n XK_Num_Lock: 0xff7f,\n\n /* Keypad functions, keypad numbers cleverly chosen to map to ASCII */\n\n XK_KP_Space: 0xff80, /* Space */\n XK_KP_Tab: 0xff89,\n XK_KP_Enter: 0xff8d, /* Enter */\n XK_KP_F1: 0xff91, /* PF1, KP_A, ... */\n XK_KP_F2: 0xff92,\n XK_KP_F3: 0xff93,\n XK_KP_F4: 0xff94,\n XK_KP_Home: 0xff95,\n XK_KP_Left: 0xff96,\n XK_KP_Up: 0xff97,\n XK_KP_Right: 0xff98,\n XK_KP_Down: 0xff99,\n XK_KP_Prior: 0xff9a,\n XK_KP_Page_Up: 0xff9a,\n XK_KP_Next: 0xff9b,\n XK_KP_Page_Down: 0xff9b,\n XK_KP_End: 0xff9c,\n XK_KP_Begin: 0xff9d,\n XK_KP_Insert: 0xff9e,\n XK_KP_Delete: 0xff9f,\n XK_KP_Equal: 0xffbd, /* Equals */\n XK_KP_Multiply: 0xffaa,\n XK_KP_Add: 0xffab,\n XK_KP_Separator: 0xffac, /* Separator, often comma */\n XK_KP_Subtract: 0xffad,\n XK_KP_Decimal: 0xffae,\n XK_KP_Divide: 0xffaf,\n\n XK_KP_0: 0xffb0,\n XK_KP_1: 0xffb1,\n XK_KP_2: 0xffb2,\n XK_KP_3: 0xffb3,\n XK_KP_4: 0xffb4,\n XK_KP_5: 0xffb5,\n XK_KP_6: 0xffb6,\n XK_KP_7: 0xffb7,\n XK_KP_8: 0xffb8,\n XK_KP_9: 0xffb9,\n\n /*\n * Auxiliary functions; note the duplicate definitions for left and right\n * function keys; Sun keyboards and a few other manufacturers have such\n * function key groups on the left and/or right sides of the keyboard.\n * We've not found a keyboard with more than 35 function keys total.\n */\n\n XK_F1: 0xffbe,\n XK_F2: 0xffbf,\n XK_F3: 0xffc0,\n XK_F4: 0xffc1,\n XK_F5: 0xffc2,\n XK_F6: 0xffc3,\n XK_F7: 0xffc4,\n XK_F8: 0xffc5,\n XK_F9: 0xffc6,\n XK_F10: 0xffc7,\n XK_F11: 0xffc8,\n XK_L1: 0xffc8,\n XK_F12: 0xffc9,\n XK_L2: 0xffc9,\n XK_F13: 0xffca,\n XK_L3: 0xffca,\n XK_F14: 0xffcb,\n XK_L4: 0xffcb,\n XK_F15: 0xffcc,\n XK_L5: 0xffcc,\n XK_F16: 0xffcd,\n XK_L6: 0xffcd,\n XK_F17: 0xffce,\n XK_L7: 0xffce,\n XK_F18: 0xffcf,\n XK_L8: 0xffcf,\n XK_F19: 0xffd0,\n XK_L9: 0xffd0,\n XK_F20: 0xffd1,\n XK_L10: 0xffd1,\n XK_F21: 0xffd2,\n XK_R1: 0xffd2,\n XK_F22: 0xffd3,\n XK_R2: 0xffd3,\n XK_F23: 0xffd4,\n XK_R3: 0xffd4,\n XK_F24: 0xffd5,\n XK_R4: 0xffd5,\n XK_F25: 0xffd6,\n XK_R5: 0xffd6,\n XK_F26: 0xffd7,\n XK_R6: 0xffd7,\n XK_F27: 0xffd8,\n XK_R7: 0xffd8,\n XK_F28: 0xffd9,\n XK_R8: 0xffd9,\n XK_F29: 0xffda,\n XK_R9: 0xffda,\n XK_F30: 0xffdb,\n XK_R10: 0xffdb,\n XK_F31: 0xffdc,\n XK_R11: 0xffdc,\n XK_F32: 0xffdd,\n XK_R12: 0xffdd,\n XK_F33: 0xffde,\n XK_R13: 0xffde,\n XK_F34: 0xffdf,\n XK_R14: 0xffdf,\n XK_F35: 0xffe0,\n XK_R15: 0xffe0,\n\n /* Modifiers */\n\n XK_Shift_L: 0xffe1, /* Left shift */\n XK_Shift_R: 0xffe2, /* Right shift */\n XK_Control_L: 0xffe3, /* Left control */\n XK_Control_R: 0xffe4, /* Right control */\n XK_Caps_Lock: 0xffe5, /* Caps lock */\n XK_Shift_Lock: 0xffe6, /* Shift lock */\n\n XK_Meta_L: 0xffe7, /* Left meta */\n XK_Meta_R: 0xffe8, /* Right meta */\n XK_Alt_L: 0xffe9, /* Left alt */\n XK_Alt_R: 0xffea, /* Right alt */\n XK_Super_L: 0xffeb, /* Left super */\n XK_Super_R: 0xffec, /* Right super */\n XK_Hyper_L: 0xffed, /* Left hyper */\n XK_Hyper_R: 0xffee, /* Right hyper */\n\n /*\n * Keyboard (XKB) Extension function and modifier keys\n * (from Appendix C of \"The X Keyboard Extension: Protocol Specification\")\n * Byte 3 = 0xfe\n */\n\n XK_ISO_Level3_Shift: 0xfe03, /* AltGr */\n XK_ISO_Next_Group: 0xfe08,\n XK_ISO_Prev_Group: 0xfe0a,\n XK_ISO_First_Group: 0xfe0c,\n XK_ISO_Last_Group: 0xfe0e,\n\n /*\n * Latin 1\n * (ISO/IEC 8859-1: Unicode U+0020..U+00FF)\n * Byte 3: 0\n */\n\n XK_space: 0x0020, /* U+0020 SPACE */\n XK_exclam: 0x0021, /* U+0021 EXCLAMATION MARK */\n XK_quotedbl: 0x0022, /* U+0022 QUOTATION MARK */\n XK_numbersign: 0x0023, /* U+0023 NUMBER SIGN */\n XK_dollar: 0x0024, /* U+0024 DOLLAR SIGN */\n XK_percent: 0x0025, /* U+0025 PERCENT SIGN */\n XK_ampersand: 0x0026, /* U+0026 AMPERSAND */\n XK_apostrophe: 0x0027, /* U+0027 APOSTROPHE */\n XK_quoteright: 0x0027, /* deprecated */\n XK_parenleft: 0x0028, /* U+0028 LEFT PARENTHESIS */\n XK_parenright: 0x0029, /* U+0029 RIGHT PARENTHESIS */\n XK_asterisk: 0x002a, /* U+002A ASTERISK */\n XK_plus: 0x002b, /* U+002B PLUS SIGN */\n XK_comma: 0x002c, /* U+002C COMMA */\n XK_minus: 0x002d, /* U+002D HYPHEN-MINUS */\n XK_period: 0x002e, /* U+002E FULL STOP */\n XK_slash: 0x002f, /* U+002F SOLIDUS */\n XK_0: 0x0030, /* U+0030 DIGIT ZERO */\n XK_1: 0x0031, /* U+0031 DIGIT ONE */\n XK_2: 0x0032, /* U+0032 DIGIT TWO */\n XK_3: 0x0033, /* U+0033 DIGIT THREE */\n XK_4: 0x0034, /* U+0034 DIGIT FOUR */\n XK_5: 0x0035, /* U+0035 DIGIT FIVE */\n XK_6: 0x0036, /* U+0036 DIGIT SIX */\n XK_7: 0x0037, /* U+0037 DIGIT SEVEN */\n XK_8: 0x0038, /* U+0038 DIGIT EIGHT */\n XK_9: 0x0039, /* U+0039 DIGIT NINE */\n XK_colon: 0x003a, /* U+003A COLON */\n XK_semicolon: 0x003b, /* U+003B SEMICOLON */\n XK_less: 0x003c, /* U+003C LESS-THAN SIGN */\n XK_equal: 0x003d, /* U+003D EQUALS SIGN */\n XK_greater: 0x003e, /* U+003E GREATER-THAN SIGN */\n XK_question: 0x003f, /* U+003F QUESTION MARK */\n XK_at: 0x0040, /* U+0040 COMMERCIAL AT */\n XK_A: 0x0041, /* U+0041 LATIN CAPITAL LETTER A */\n XK_B: 0x0042, /* U+0042 LATIN CAPITAL LETTER B */\n XK_C: 0x0043, /* U+0043 LATIN CAPITAL LETTER C */\n XK_D: 0x0044, /* U+0044 LATIN CAPITAL LETTER D */\n XK_E: 0x0045, /* U+0045 LATIN CAPITAL LETTER E */\n XK_F: 0x0046, /* U+0046 LATIN CAPITAL LETTER F */\n XK_G: 0x0047, /* U+0047 LATIN CAPITAL LETTER G */\n XK_H: 0x0048, /* U+0048 LATIN CAPITAL LETTER H */\n XK_I: 0x0049, /* U+0049 LATIN CAPITAL LETTER I */\n XK_J: 0x004a, /* U+004A LATIN CAPITAL LETTER J */\n XK_K: 0x004b, /* U+004B LATIN CAPITAL LETTER K */\n XK_L: 0x004c, /* U+004C LATIN CAPITAL LETTER L */\n XK_M: 0x004d, /* U+004D LATIN CAPITAL LETTER M */\n XK_N: 0x004e, /* U+004E LATIN CAPITAL LETTER N */\n XK_O: 0x004f, /* U+004F LATIN CAPITAL LETTER O */\n XK_P: 0x0050, /* U+0050 LATIN CAPITAL LETTER P */\n XK_Q: 0x0051, /* U+0051 LATIN CAPITAL LETTER Q */\n XK_R: 0x0052, /* U+0052 LATIN CAPITAL LETTER R */\n XK_S: 0x0053, /* U+0053 LATIN CAPITAL LETTER S */\n XK_T: 0x0054, /* U+0054 LATIN CAPITAL LETTER T */\n XK_U: 0x0055, /* U+0055 LATIN CAPITAL LETTER U */\n XK_V: 0x0056, /* U+0056 LATIN CAPITAL LETTER V */\n XK_W: 0x0057, /* U+0057 LATIN CAPITAL LETTER W */\n XK_X: 0x0058, /* U+0058 LATIN CAPITAL LETTER X */\n XK_Y: 0x0059, /* U+0059 LATIN CAPITAL LETTER Y */\n XK_Z: 0x005a, /* U+005A LATIN CAPITAL LETTER Z */\n XK_bracketleft: 0x005b, /* U+005B LEFT SQUARE BRACKET */\n XK_backslash: 0x005c, /* U+005C REVERSE SOLIDUS */\n XK_bracketright: 0x005d, /* U+005D RIGHT SQUARE BRACKET */\n XK_asciicircum: 0x005e, /* U+005E CIRCUMFLEX ACCENT */\n XK_underscore: 0x005f, /* U+005F LOW LINE */\n XK_grave: 0x0060, /* U+0060 GRAVE ACCENT */\n XK_quoteleft: 0x0060, /* deprecated */\n XK_a: 0x0061, /* U+0061 LATIN SMALL LETTER A */\n XK_b: 0x0062, /* U+0062 LATIN SMALL LETTER B */\n XK_c: 0x0063, /* U+0063 LATIN SMALL LETTER C */\n XK_d: 0x0064, /* U+0064 LATIN SMALL LETTER D */\n XK_e: 0x0065, /* U+0065 LATIN SMALL LETTER E */\n XK_f: 0x0066, /* U+0066 LATIN SMALL LETTER F */\n XK_g: 0x0067, /* U+0067 LATIN SMALL LETTER G */\n XK_h: 0x0068, /* U+0068 LATIN SMALL LETTER H */\n XK_i: 0x0069, /* U+0069 LATIN SMALL LETTER I */\n XK_j: 0x006a, /* U+006A LATIN SMALL LETTER J */\n XK_k: 0x006b, /* U+006B LATIN SMALL LETTER K */\n XK_l: 0x006c, /* U+006C LATIN SMALL LETTER L */\n XK_m: 0x006d, /* U+006D LATIN SMALL LETTER M */\n XK_n: 0x006e, /* U+006E LATIN SMALL LETTER N */\n XK_o: 0x006f, /* U+006F LATIN SMALL LETTER O */\n XK_p: 0x0070, /* U+0070 LATIN SMALL LETTER P */\n XK_q: 0x0071, /* U+0071 LATIN SMALL LETTER Q */\n XK_r: 0x0072, /* U+0072 LATIN SMALL LETTER R */\n XK_s: 0x0073, /* U+0073 LATIN SMALL LETTER S */\n XK_t: 0x0074, /* U+0074 LATIN SMALL LETTER T */\n XK_u: 0x0075, /* U+0075 LATIN SMALL LETTER U */\n XK_v: 0x0076, /* U+0076 LATIN SMALL LETTER V */\n XK_w: 0x0077, /* U+0077 LATIN SMALL LETTER W */\n XK_x: 0x0078, /* U+0078 LATIN SMALL LETTER X */\n XK_y: 0x0079, /* U+0079 LATIN SMALL LETTER Y */\n XK_z: 0x007a, /* U+007A LATIN SMALL LETTER Z */\n XK_braceleft: 0x007b, /* U+007B LEFT CURLY BRACKET */\n XK_bar: 0x007c, /* U+007C VERTICAL LINE */\n XK_braceright: 0x007d, /* U+007D RIGHT CURLY BRACKET */\n XK_asciitilde: 0x007e, /* U+007E TILDE */\n\n XK_nobreakspace: 0x00a0, /* U+00A0 NO-BREAK SPACE */\n XK_exclamdown: 0x00a1, /* U+00A1 INVERTED EXCLAMATION MARK */\n XK_cent: 0x00a2, /* U+00A2 CENT SIGN */\n XK_sterling: 0x00a3, /* U+00A3 POUND SIGN */\n XK_currency: 0x00a4, /* U+00A4 CURRENCY SIGN */\n XK_yen: 0x00a5, /* U+00A5 YEN SIGN */\n XK_brokenbar: 0x00a6, /* U+00A6 BROKEN BAR */\n XK_section: 0x00a7, /* U+00A7 SECTION SIGN */\n XK_diaeresis: 0x00a8, /* U+00A8 DIAERESIS */\n XK_copyright: 0x00a9, /* U+00A9 COPYRIGHT SIGN */\n XK_ordfeminine: 0x00aa, /* U+00AA FEMININE ORDINAL INDICATOR */\n XK_guillemotleft: 0x00ab, /* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */\n XK_notsign: 0x00ac, /* U+00AC NOT SIGN */\n XK_hyphen: 0x00ad, /* U+00AD SOFT HYPHEN */\n XK_registered: 0x00ae, /* U+00AE REGISTERED SIGN */\n XK_macron: 0x00af, /* U+00AF MACRON */\n XK_degree: 0x00b0, /* U+00B0 DEGREE SIGN */\n XK_plusminus: 0x00b1, /* U+00B1 PLUS-MINUS SIGN */\n XK_twosuperior: 0x00b2, /* U+00B2 SUPERSCRIPT TWO */\n XK_threesuperior: 0x00b3, /* U+00B3 SUPERSCRIPT THREE */\n XK_acute: 0x00b4, /* U+00B4 ACUTE ACCENT */\n XK_mu: 0x00b5, /* U+00B5 MICRO SIGN */\n XK_paragraph: 0x00b6, /* U+00B6 PILCROW SIGN */\n XK_periodcentered: 0x00b7, /* U+00B7 MIDDLE DOT */\n XK_cedilla: 0x00b8, /* U+00B8 CEDILLA */\n XK_onesuperior: 0x00b9, /* U+00B9 SUPERSCRIPT ONE */\n XK_masculine: 0x00ba, /* U+00BA MASCULINE ORDINAL INDICATOR */\n XK_guillemotright: 0x00bb, /* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */\n XK_onequarter: 0x00bc, /* U+00BC VULGAR FRACTION ONE QUARTER */\n XK_onehalf: 0x00bd, /* U+00BD VULGAR FRACTION ONE HALF */\n XK_threequarters: 0x00be, /* U+00BE VULGAR FRACTION THREE QUARTERS */\n XK_questiondown: 0x00bf, /* U+00BF INVERTED QUESTION MARK */\n XK_Agrave: 0x00c0, /* U+00C0 LATIN CAPITAL LETTER A WITH GRAVE */\n XK_Aacute: 0x00c1, /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */\n XK_Acircumflex: 0x00c2, /* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */\n XK_Atilde: 0x00c3, /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */\n XK_Adiaeresis: 0x00c4, /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */\n XK_Aring: 0x00c5, /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */\n XK_AE: 0x00c6, /* U+00C6 LATIN CAPITAL LETTER AE */\n XK_Ccedilla: 0x00c7, /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */\n XK_Egrave: 0x00c8, /* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */\n XK_Eacute: 0x00c9, /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */\n XK_Ecircumflex: 0x00ca, /* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */\n XK_Ediaeresis: 0x00cb, /* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */\n XK_Igrave: 0x00cc, /* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */\n XK_Iacute: 0x00cd, /* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */\n XK_Icircumflex: 0x00ce, /* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */\n XK_Idiaeresis: 0x00cf, /* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */\n XK_ETH: 0x00d0, /* U+00D0 LATIN CAPITAL LETTER ETH */\n XK_Eth: 0x00d0, /* deprecated */\n XK_Ntilde: 0x00d1, /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */\n XK_Ograve: 0x00d2, /* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */\n XK_Oacute: 0x00d3, /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */\n XK_Ocircumflex: 0x00d4, /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */\n XK_Otilde: 0x00d5, /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */\n XK_Odiaeresis: 0x00d6, /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */\n XK_multiply: 0x00d7, /* U+00D7 MULTIPLICATION SIGN */\n XK_Oslash: 0x00d8, /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */\n XK_Ooblique: 0x00d8, /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */\n XK_Ugrave: 0x00d9, /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */\n XK_Uacute: 0x00da, /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */\n XK_Ucircumflex: 0x00db, /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */\n XK_Udiaeresis: 0x00dc, /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */\n XK_Yacute: 0x00dd, /* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */\n XK_THORN: 0x00de, /* U+00DE LATIN CAPITAL LETTER THORN */\n XK_Thorn: 0x00de, /* deprecated */\n XK_ssharp: 0x00df, /* U+00DF LATIN SMALL LETTER SHARP S */\n XK_agrave: 0x00e0, /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */\n XK_aacute: 0x00e1, /* U+00E1 LATIN SMALL LETTER A WITH ACUTE */\n XK_acircumflex: 0x00e2, /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */\n XK_atilde: 0x00e3, /* U+00E3 LATIN SMALL LETTER A WITH TILDE */\n XK_adiaeresis: 0x00e4, /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */\n XK_aring: 0x00e5, /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */\n XK_ae: 0x00e6, /* U+00E6 LATIN SMALL LETTER AE */\n XK_ccedilla: 0x00e7, /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */\n XK_egrave: 0x00e8, /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */\n XK_eacute: 0x00e9, /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */\n XK_ecircumflex: 0x00ea, /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */\n XK_ediaeresis: 0x00eb, /* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */\n XK_igrave: 0x00ec, /* U+00EC LATIN SMALL LETTER I WITH GRAVE */\n XK_iacute: 0x00ed, /* U+00ED LATIN SMALL LETTER I WITH ACUTE */\n XK_icircumflex: 0x00ee, /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */\n XK_idiaeresis: 0x00ef, /* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */\n XK_eth: 0x00f0, /* U+00F0 LATIN SMALL LETTER ETH */\n XK_ntilde: 0x00f1, /* U+00F1 LATIN SMALL LETTER N WITH TILDE */\n XK_ograve: 0x00f2, /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */\n XK_oacute: 0x00f3, /* U+00F3 LATIN SMALL LETTER O WITH ACUTE */\n XK_ocircumflex: 0x00f4, /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */\n XK_otilde: 0x00f5, /* U+00F5 LATIN SMALL LETTER O WITH TILDE */\n XK_odiaeresis: 0x00f6, /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */\n XK_division: 0x00f7, /* U+00F7 DIVISION SIGN */\n XK_oslash: 0x00f8, /* U+00F8 LATIN SMALL LETTER O WITH STROKE */\n XK_ooblique: 0x00f8, /* U+00F8 LATIN SMALL LETTER O WITH STROKE */\n XK_ugrave: 0x00f9, /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */\n XK_uacute: 0x00fa, /* U+00FA LATIN SMALL LETTER U WITH ACUTE */\n XK_ucircumflex: 0x00fb, /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */\n XK_udiaeresis: 0x00fc, /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */\n XK_yacute: 0x00fd, /* U+00FD LATIN SMALL LETTER Y WITH ACUTE */\n XK_thorn: 0x00fe, /* U+00FE LATIN SMALL LETTER THORN */\n XK_ydiaeresis: 0x00ff, /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */\n\n /*\n * Korean\n * Byte 3 = 0x0e\n */\n\n XK_Hangul: 0xff31, /* Hangul start/stop(toggle) */\n XK_Hangul_Hanja: 0xff34, /* Start Hangul->Hanja Conversion */\n XK_Hangul_Jeonja: 0xff38, /* Jeonja mode */\n\n /*\n * XFree86 vendor specific keysyms.\n *\n * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.\n */\n\n XF86XK_ModeLock: 0x1008FF01,\n XF86XK_MonBrightnessUp: 0x1008FF02,\n XF86XK_MonBrightnessDown: 0x1008FF03,\n XF86XK_KbdLightOnOff: 0x1008FF04,\n XF86XK_KbdBrightnessUp: 0x1008FF05,\n XF86XK_KbdBrightnessDown: 0x1008FF06,\n XF86XK_Standby: 0x1008FF10,\n XF86XK_AudioLowerVolume: 0x1008FF11,\n XF86XK_AudioMute: 0x1008FF12,\n XF86XK_AudioRaiseVolume: 0x1008FF13,\n XF86XK_AudioPlay: 0x1008FF14,\n XF86XK_AudioStop: 0x1008FF15,\n XF86XK_AudioPrev: 0x1008FF16,\n XF86XK_AudioNext: 0x1008FF17,\n XF86XK_HomePage: 0x1008FF18,\n XF86XK_Mail: 0x1008FF19,\n XF86XK_Start: 0x1008FF1A,\n XF86XK_Search: 0x1008FF1B,\n XF86XK_AudioRecord: 0x1008FF1C,\n XF86XK_Calculator: 0x1008FF1D,\n XF86XK_Memo: 0x1008FF1E,\n XF86XK_ToDoList: 0x1008FF1F,\n XF86XK_Calendar: 0x1008FF20,\n XF86XK_PowerDown: 0x1008FF21,\n XF86XK_ContrastAdjust: 0x1008FF22,\n XF86XK_RockerUp: 0x1008FF23,\n XF86XK_RockerDown: 0x1008FF24,\n XF86XK_RockerEnter: 0x1008FF25,\n XF86XK_Back: 0x1008FF26,\n XF86XK_Forward: 0x1008FF27,\n XF86XK_Stop: 0x1008FF28,\n XF86XK_Refresh: 0x1008FF29,\n XF86XK_PowerOff: 0x1008FF2A,\n XF86XK_WakeUp: 0x1008FF2B,\n XF86XK_Eject: 0x1008FF2C,\n XF86XK_ScreenSaver: 0x1008FF2D,\n XF86XK_WWW: 0x1008FF2E,\n XF86XK_Sleep: 0x1008FF2F,\n XF86XK_Favorites: 0x1008FF30,\n XF86XK_AudioPause: 0x1008FF31,\n XF86XK_AudioMedia: 0x1008FF32,\n XF86XK_MyComputer: 0x1008FF33,\n XF86XK_VendorHome: 0x1008FF34,\n XF86XK_LightBulb: 0x1008FF35,\n XF86XK_Shop: 0x1008FF36,\n XF86XK_History: 0x1008FF37,\n XF86XK_OpenURL: 0x1008FF38,\n XF86XK_AddFavorite: 0x1008FF39,\n XF86XK_HotLinks: 0x1008FF3A,\n XF86XK_BrightnessAdjust: 0x1008FF3B,\n XF86XK_Finance: 0x1008FF3C,\n XF86XK_Community: 0x1008FF3D,\n XF86XK_AudioRewind: 0x1008FF3E,\n XF86XK_BackForward: 0x1008FF3F,\n XF86XK_Launch0: 0x1008FF40,\n XF86XK_Launch1: 0x1008FF41,\n XF86XK_Launch2: 0x1008FF42,\n XF86XK_Launch3: 0x1008FF43,\n XF86XK_Launch4: 0x1008FF44,\n XF86XK_Launch5: 0x1008FF45,\n XF86XK_Launch6: 0x1008FF46,\n XF86XK_Launch7: 0x1008FF47,\n XF86XK_Launch8: 0x1008FF48,\n XF86XK_Launch9: 0x1008FF49,\n XF86XK_LaunchA: 0x1008FF4A,\n XF86XK_LaunchB: 0x1008FF4B,\n XF86XK_LaunchC: 0x1008FF4C,\n XF86XK_LaunchD: 0x1008FF4D,\n XF86XK_LaunchE: 0x1008FF4E,\n XF86XK_LaunchF: 0x1008FF4F,\n XF86XK_ApplicationLeft: 0x1008FF50,\n XF86XK_ApplicationRight: 0x1008FF51,\n XF86XK_Book: 0x1008FF52,\n XF86XK_CD: 0x1008FF53,\n XF86XK_Calculater: 0x1008FF54,\n XF86XK_Clear: 0x1008FF55,\n XF86XK_Close: 0x1008FF56,\n XF86XK_Copy: 0x1008FF57,\n XF86XK_Cut: 0x1008FF58,\n XF86XK_Display: 0x1008FF59,\n XF86XK_DOS: 0x1008FF5A,\n XF86XK_Documents: 0x1008FF5B,\n XF86XK_Excel: 0x1008FF5C,\n XF86XK_Explorer: 0x1008FF5D,\n XF86XK_Game: 0x1008FF5E,\n XF86XK_Go: 0x1008FF5F,\n XF86XK_iTouch: 0x1008FF60,\n XF86XK_LogOff: 0x1008FF61,\n XF86XK_Market: 0x1008FF62,\n XF86XK_Meeting: 0x1008FF63,\n XF86XK_MenuKB: 0x1008FF65,\n XF86XK_MenuPB: 0x1008FF66,\n XF86XK_MySites: 0x1008FF67,\n XF86XK_New: 0x1008FF68,\n XF86XK_News: 0x1008FF69,\n XF86XK_OfficeHome: 0x1008FF6A,\n XF86XK_Open: 0x1008FF6B,\n XF86XK_Option: 0x1008FF6C,\n XF86XK_Paste: 0x1008FF6D,\n XF86XK_Phone: 0x1008FF6E,\n XF86XK_Q: 0x1008FF70,\n XF86XK_Reply: 0x1008FF72,\n XF86XK_Reload: 0x1008FF73,\n XF86XK_RotateWindows: 0x1008FF74,\n XF86XK_RotationPB: 0x1008FF75,\n XF86XK_RotationKB: 0x1008FF76,\n XF86XK_Save: 0x1008FF77,\n XF86XK_ScrollUp: 0x1008FF78,\n XF86XK_ScrollDown: 0x1008FF79,\n XF86XK_ScrollClick: 0x1008FF7A,\n XF86XK_Send: 0x1008FF7B,\n XF86XK_Spell: 0x1008FF7C,\n XF86XK_SplitScreen: 0x1008FF7D,\n XF86XK_Support: 0x1008FF7E,\n XF86XK_TaskPane: 0x1008FF7F,\n XF86XK_Terminal: 0x1008FF80,\n XF86XK_Tools: 0x1008FF81,\n XF86XK_Travel: 0x1008FF82,\n XF86XK_UserPB: 0x1008FF84,\n XF86XK_User1KB: 0x1008FF85,\n XF86XK_User2KB: 0x1008FF86,\n XF86XK_Video: 0x1008FF87,\n XF86XK_WheelButton: 0x1008FF88,\n XF86XK_Word: 0x1008FF89,\n XF86XK_Xfer: 0x1008FF8A,\n XF86XK_ZoomIn: 0x1008FF8B,\n XF86XK_ZoomOut: 0x1008FF8C,\n XF86XK_Away: 0x1008FF8D,\n XF86XK_Messenger: 0x1008FF8E,\n XF86XK_WebCam: 0x1008FF8F,\n XF86XK_MailForward: 0x1008FF90,\n XF86XK_Pictures: 0x1008FF91,\n XF86XK_Music: 0x1008FF92,\n XF86XK_Battery: 0x1008FF93,\n XF86XK_Bluetooth: 0x1008FF94,\n XF86XK_WLAN: 0x1008FF95,\n XF86XK_UWB: 0x1008FF96,\n XF86XK_AudioForward: 0x1008FF97,\n XF86XK_AudioRepeat: 0x1008FF98,\n XF86XK_AudioRandomPlay: 0x1008FF99,\n XF86XK_Subtitle: 0x1008FF9A,\n XF86XK_AudioCycleTrack: 0x1008FF9B,\n XF86XK_CycleAngle: 0x1008FF9C,\n XF86XK_FrameBack: 0x1008FF9D,\n XF86XK_FrameForward: 0x1008FF9E,\n XF86XK_Time: 0x1008FF9F,\n XF86XK_Select: 0x1008FFA0,\n XF86XK_View: 0x1008FFA1,\n XF86XK_TopMenu: 0x1008FFA2,\n XF86XK_Red: 0x1008FFA3,\n XF86XK_Green: 0x1008FFA4,\n XF86XK_Yellow: 0x1008FFA5,\n XF86XK_Blue: 0x1008FFA6,\n XF86XK_Suspend: 0x1008FFA7,\n XF86XK_Hibernate: 0x1008FFA8,\n XF86XK_TouchpadToggle: 0x1008FFA9,\n XF86XK_TouchpadOn: 0x1008FFB0,\n XF86XK_TouchpadOff: 0x1008FFB1,\n XF86XK_AudioMicMute: 0x1008FFB2,\n XF86XK_Switch_VT_1: 0x1008FE01,\n XF86XK_Switch_VT_2: 0x1008FE02,\n XF86XK_Switch_VT_3: 0x1008FE03,\n XF86XK_Switch_VT_4: 0x1008FE04,\n XF86XK_Switch_VT_5: 0x1008FE05,\n XF86XK_Switch_VT_6: 0x1008FE06,\n XF86XK_Switch_VT_7: 0x1008FE07,\n XF86XK_Switch_VT_8: 0x1008FE08,\n XF86XK_Switch_VT_9: 0x1008FE09,\n XF86XK_Switch_VT_10: 0x1008FE0A,\n XF86XK_Switch_VT_11: 0x1008FE0B,\n XF86XK_Switch_VT_12: 0x1008FE0C,\n XF86XK_Ungrab: 0x1008FE20,\n XF86XK_ClearGrab: 0x1008FE21,\n XF86XK_Next_VMode: 0x1008FE22,\n XF86XK_Prev_VMode: 0x1008FE23,\n XF86XK_LogWindowTree: 0x1008FE24,\n XF86XK_LogGrabInfo: 0x1008FE25,\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.connected && _vm.disconnected)?_c('div',[_c('main',{staticClass:\"main-layout error\"},[_c('div',{staticClass:\"text-center\"},[_c('BrandImage',{attrs:{\"file-name\":\"error-desert-landscape.svg\",\"width\":\"900\",\"height\":\"300\"}}),_c('h1',[_vm._v(\" \"+_vm._s(_vm.t('generic.notification.title.warning'))+\" \")]),_c('h2',{staticClass:\"text-secondary mt-20\"},[_vm._v(\" \"+_vm._s(_vm.t('vncConsole.error.message'))+\" \")])],1)])]):_vm._e(),_c('div',{ref:\"view\"})])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nexport function toUnsigned32bit(toConvert) {\n return toConvert >>> 0;\n}\n\nexport function toSigned32bit(toConvert) {\n return toConvert | 0;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Logging/debug routines\n */\n\nlet _logLevel = 'warn';\n\nlet Debug = () => {};\nlet Info = () => {};\nlet Warn = () => {};\nlet Error = () => {};\n\nexport function initLogging(level) {\n if (typeof level === 'undefined') {\n level = _logLevel;\n } else {\n _logLevel = level;\n }\n\n Debug = Info = Warn = Error = () => {};\n\n if (typeof window.console !== \"undefined\") {\n /* eslint-disable no-console, no-fallthrough */\n switch (level) {\n case 'debug':\n Debug = console.debug.bind(window.console);\n case 'info':\n Info = console.info.bind(window.console);\n case 'warn':\n Warn = console.warn.bind(window.console);\n case 'error':\n Error = console.error.bind(window.console);\n case 'none':\n break;\n default:\n throw new window.Error(\"invalid logging type '\" + level + \"'\");\n }\n /* eslint-enable no-console, no-fallthrough */\n }\n}\n\nexport function getLogging() {\n return _logLevel;\n}\n\nexport { Debug, Info, Warn, Error };\n\n// Initialize logging level\ninitLogging();\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n// Decode from UTF-8\nexport function decodeUTF8(utf8string, allowLatin1=false) {\n try {\n return decodeURIComponent(escape(utf8string));\n } catch (e) {\n if (e instanceof URIError) {\n if (allowLatin1) {\n // If we allow Latin1 we can ignore any decoding fails\n // and in these cases return the original string\n return utf8string;\n }\n }\n throw e;\n }\n}\n\n// Encode to UTF-8\nexport function encodeUTF8(DOMString) {\n return unescape(encodeURIComponent(DOMString));\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n * Browser feature support detection\n */\n\nimport * as Log from './logging.js';\n\n// Touch detection\nexport let isTouchDevice = ('ontouchstart' in document.documentElement) ||\n // requried for Chrome debugger\n (document.ontouchstart !== undefined) ||\n // required for MS Surface\n (navigator.maxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0);\nwindow.addEventListener('touchstart', function onFirstTouch() {\n isTouchDevice = true;\n window.removeEventListener('touchstart', onFirstTouch, false);\n}, false);\n\n\n// The goal is to find a certain physical width, the devicePixelRatio\n// brings us a bit closer but is not optimal.\nexport let dragThreshold = 10 * (window.devicePixelRatio || 1);\n\nlet _supportsCursorURIs = false;\n\ntry {\n const target = document.createElement('canvas');\n target.style.cursor = 'url(\"data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==\") 2 2, default';\n\n if (target.style.cursor.indexOf(\"url\") === 0) {\n Log.Info(\"Data URI scheme cursor supported\");\n _supportsCursorURIs = true;\n } else {\n Log.Warn(\"Data URI scheme cursor not supported\");\n }\n} catch (exc) {\n Log.Error(\"Data URI scheme cursor test exception: \" + exc);\n}\n\nexport const supportsCursorURIs = _supportsCursorURIs;\n\nlet _hasScrollbarGutter = true;\ntry {\n // Create invisible container\n const container = document.createElement('div');\n container.style.visibility = 'hidden';\n container.style.overflow = 'scroll'; // forcing scrollbars\n document.body.appendChild(container);\n\n // Create a div and place it in the container\n const child = document.createElement('div');\n container.appendChild(child);\n\n // Calculate the difference between the container's full width\n // and the child's width - the difference is the scrollbars\n const scrollbarWidth = (container.offsetWidth - child.offsetWidth);\n\n // Clean up\n container.parentNode.removeChild(container);\n\n _hasScrollbarGutter = scrollbarWidth != 0;\n} catch (exc) {\n Log.Error(\"Scrollbar test exception: \" + exc);\n}\nexport const hasScrollbarGutter = _hasScrollbarGutter;\n\n/*\n * The functions for detection of platforms and browsers below are exported\n * but the use of these should be minimized as much as possible.\n *\n * It's better to use feature detection than platform detection.\n */\n\n/* OS */\n\nexport function isMac() {\n return !!(/mac/i).exec(navigator.platform);\n}\n\nexport function isWindows() {\n return !!(/win/i).exec(navigator.platform);\n}\n\nexport function isIOS() {\n return (!!(/ipad/i).exec(navigator.platform) ||\n !!(/iphone/i).exec(navigator.platform) ||\n !!(/ipod/i).exec(navigator.platform));\n}\n\nexport function isAndroid() {\n /* Android sets navigator.platform to Linux :/ */\n return !!navigator.userAgent.match('Android ');\n}\n\nexport function isChromeOS() {\n /* ChromeOS sets navigator.platform to Linux :/ */\n return !!navigator.userAgent.match(' CrOS ');\n}\n\n/* Browser */\n\nexport function isSafari() {\n return !!navigator.userAgent.match('Safari/...') &&\n !navigator.userAgent.match('Chrome/...') &&\n !navigator.userAgent.match('Chromium/...') &&\n !navigator.userAgent.match('Epiphany/...');\n}\n\nexport function isFirefox() {\n return !!navigator.userAgent.match('Firefox/...') &&\n !navigator.userAgent.match('Seamonkey/...');\n}\n\nexport function isChrome() {\n return !!navigator.userAgent.match('Chrome/...') &&\n !navigator.userAgent.match('Chromium/...') &&\n !navigator.userAgent.match('Edg/...') &&\n !navigator.userAgent.match('OPR/...');\n}\n\nexport function isChromium() {\n return !!navigator.userAgent.match('Chromium/...');\n}\n\nexport function isOpera() {\n return !!navigator.userAgent.match('OPR/...');\n}\n\nexport function isEdge() {\n return !!navigator.userAgent.match('Edg/...');\n}\n\n/* Engine */\n\nexport function isGecko() {\n return !!navigator.userAgent.match('Gecko/...');\n}\n\nexport function isWebKit() {\n return !!navigator.userAgent.match('AppleWebKit/...') &&\n !navigator.userAgent.match('Chrome/...');\n}\n\nexport function isBlink() {\n return !!navigator.userAgent.match('Chrome/...');\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * HTML element utility functions\n */\n\nexport function clientToElement(x, y, elem) {\n const bounds = elem.getBoundingClientRect();\n let pos = { x: 0, y: 0 };\n // Clip to target bounds\n if (x < bounds.left) {\n pos.x = 0;\n } else if (x >= bounds.right) {\n pos.x = bounds.width - 1;\n } else {\n pos.x = x - bounds.left;\n }\n if (y < bounds.top) {\n pos.y = 0;\n } else if (y >= bounds.bottom) {\n pos.y = bounds.height - 1;\n } else {\n pos.y = y - bounds.top;\n }\n return pos;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Cross-browser event and position routines\n */\n\nexport function getPointerEvent(e) {\n return e.changedTouches ? e.changedTouches[0] : e.touches ? e.touches[0] : e;\n}\n\nexport function stopEvent(e) {\n e.stopPropagation();\n e.preventDefault();\n}\n\n// Emulate Element.setCapture() when not supported\nlet _captureRecursion = false;\nlet _elementForUnflushedEvents = null;\ndocument.captureElement = null;\nfunction _captureProxy(e) {\n // Recursion protection as we'll see our own event\n if (_captureRecursion) return;\n\n // Clone the event as we cannot dispatch an already dispatched event\n const newEv = new e.constructor(e.type, e);\n\n _captureRecursion = true;\n if (document.captureElement) {\n document.captureElement.dispatchEvent(newEv);\n } else {\n _elementForUnflushedEvents.dispatchEvent(newEv);\n }\n _captureRecursion = false;\n\n // Avoid double events\n e.stopPropagation();\n\n // Respect the wishes of the redirected event handlers\n if (newEv.defaultPrevented) {\n e.preventDefault();\n }\n\n // Implicitly release the capture on button release\n if (e.type === \"mouseup\") {\n releaseCapture();\n }\n}\n\n// Follow cursor style of target element\nfunction _capturedElemChanged() {\n const proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n proxyElem.style.cursor = window.getComputedStyle(document.captureElement).cursor;\n}\n\nconst _captureObserver = new MutationObserver(_capturedElemChanged);\n\nexport function setCapture(target) {\n if (target.setCapture) {\n\n target.setCapture();\n document.captureElement = target;\n } else {\n // Release any existing capture in case this method is\n // called multiple times without coordination\n releaseCapture();\n\n let proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n\n if (proxyElem === null) {\n proxyElem = document.createElement(\"div\");\n proxyElem.id = \"noVNC_mouse_capture_elem\";\n proxyElem.style.position = \"fixed\";\n proxyElem.style.top = \"0px\";\n proxyElem.style.left = \"0px\";\n proxyElem.style.width = \"100%\";\n proxyElem.style.height = \"100%\";\n proxyElem.style.zIndex = 10000;\n proxyElem.style.display = \"none\";\n document.body.appendChild(proxyElem);\n\n // This is to make sure callers don't get confused by having\n // our blocking element as the target\n proxyElem.addEventListener('contextmenu', _captureProxy);\n\n proxyElem.addEventListener('mousemove', _captureProxy);\n proxyElem.addEventListener('mouseup', _captureProxy);\n }\n\n document.captureElement = target;\n\n // Track cursor and get initial cursor\n _captureObserver.observe(target, {attributes: true});\n _capturedElemChanged();\n\n proxyElem.style.display = \"\";\n\n // We listen to events on window in order to keep tracking if it\n // happens to leave the viewport\n window.addEventListener('mousemove', _captureProxy);\n window.addEventListener('mouseup', _captureProxy);\n }\n}\n\nexport function releaseCapture() {\n if (document.releaseCapture) {\n\n document.releaseCapture();\n document.captureElement = null;\n\n } else {\n if (!document.captureElement) {\n return;\n }\n\n // There might be events already queued. The event proxy needs\n // access to the captured element for these queued events.\n // E.g. contextmenu (right-click) in Microsoft Edge\n //\n // Before removing the capturedElem pointer we save it to a\n // temporary variable that the unflushed events can use.\n _elementForUnflushedEvents = document.captureElement;\n document.captureElement = null;\n\n _captureObserver.disconnect();\n\n const proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n proxyElem.style.display = \"none\";\n\n window.removeEventListener('mousemove', _captureProxy);\n window.removeEventListener('mouseup', _captureProxy);\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nexport default class EventTargetMixin {\n constructor() {\n this._listeners = new Map();\n }\n\n addEventListener(type, callback) {\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Set());\n }\n this._listeners.get(type).add(callback);\n }\n\n removeEventListener(type, callback) {\n if (this._listeners.has(type)) {\n this._listeners.get(type).delete(callback);\n }\n }\n\n dispatchEvent(event) {\n if (!this._listeners.has(event.type)) {\n return true;\n }\n this._listeners.get(event.type)\n .forEach(callback => callback.call(this, event));\n return !event.defaultPrevented;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n// From: http://hg.mozilla.org/mozilla-central/raw-file/ec10630b1a54/js/src/devtools/jint/sunspider/string-base64.js\n\nimport * as Log from './util/logging.js';\n\nexport default {\n /* Convert data (an array of integers) to a Base64 string. */\n toBase64Table: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split(''),\n base64Pad: '=',\n\n encode(data) {\n \"use strict\";\n let result = '';\n const length = data.length;\n const lengthpad = (length % 3);\n // Convert every three bytes to 4 ascii characters.\n\n for (let i = 0; i < (length - 2); i += 3) {\n result += this.toBase64Table[data[i] >> 2];\n result += this.toBase64Table[((data[i] & 0x03) << 4) + (data[i + 1] >> 4)];\n result += this.toBase64Table[((data[i + 1] & 0x0f) << 2) + (data[i + 2] >> 6)];\n result += this.toBase64Table[data[i + 2] & 0x3f];\n }\n\n // Convert the remaining 1 or 2 bytes, pad out to 4 characters.\n const j = length - lengthpad;\n if (lengthpad === 2) {\n result += this.toBase64Table[data[j] >> 2];\n result += this.toBase64Table[((data[j] & 0x03) << 4) + (data[j + 1] >> 4)];\n result += this.toBase64Table[(data[j + 1] & 0x0f) << 2];\n result += this.toBase64Table[64];\n } else if (lengthpad === 1) {\n result += this.toBase64Table[data[j] >> 2];\n result += this.toBase64Table[(data[j] & 0x03) << 4];\n result += this.toBase64Table[64];\n result += this.toBase64Table[64];\n }\n\n return result;\n },\n\n /* Convert Base64 data to a string */\n /* eslint-disable comma-spacing */\n toBinaryTable: [\n -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,\n -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,\n -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,\n 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,\n -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,\n 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,\n -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,\n 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1\n ],\n /* eslint-enable comma-spacing */\n\n decode(data, offset = 0) {\n let dataLength = data.indexOf('=') - offset;\n if (dataLength < 0) { dataLength = data.length - offset; }\n\n /* Every four characters is 3 resulting numbers */\n const resultLength = (dataLength >> 2) * 3 + Math.floor((dataLength % 4) / 1.5);\n const result = new Array(resultLength);\n\n // Convert one by one.\n\n let leftbits = 0; // number of bits decoded, but yet to be appended\n let leftdata = 0; // bits decoded, but yet to be appended\n for (let idx = 0, i = offset; i < data.length; i++) {\n const c = this.toBinaryTable[data.charCodeAt(i) & 0x7f];\n const padding = (data.charAt(i) === this.base64Pad);\n // Skip illegal characters and whitespace\n if (c === -1) {\n Log.Error(\"Illegal character code \" + data.charCodeAt(i) + \" at position \" + i);\n continue;\n }\n\n // Collect data into leftdata, update bitcount\n leftdata = (leftdata << 6) | c;\n leftbits += 6;\n\n // If we have 8 or more bits, append 8 bits to the result\n if (leftbits >= 8) {\n leftbits -= 8;\n // Append if not padding.\n if (!padding) {\n result[idx++] = (leftdata >> leftbits) & 0xff;\n }\n leftdata &= (1 << leftbits) - 1;\n }\n }\n\n // If there are any bits left, the base64 string was corrupted\n if (leftbits) {\n const err = new Error('Corrupted base64 string');\n err.name = 'Base64-Error';\n throw err;\n }\n\n return result;\n }\n}; /* End of Base64 namespace */\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nimport * as Log from './util/logging.js';\nimport Base64 from \"./base64.js\";\nimport { toSigned32bit } from './util/int.js';\n\nexport default class Display {\n constructor(target) {\n this._drawCtx = null;\n\n this._renderQ = []; // queue drawing actions for in-oder rendering\n this._flushing = false;\n\n // the full frame buffer (logical canvas) size\n this._fbWidth = 0;\n this._fbHeight = 0;\n\n this._prevDrawStyle = \"\";\n\n Log.Debug(\">> Display.constructor\");\n\n // The visible canvas\n this._target = target;\n\n if (!this._target) {\n throw new Error(\"Target must be set\");\n }\n\n if (typeof this._target === 'string') {\n throw new Error('target must be a DOM element');\n }\n\n if (!this._target.getContext) {\n throw new Error(\"no getContext method\");\n }\n\n this._targetCtx = this._target.getContext('2d');\n\n // the visible canvas viewport (i.e. what actually gets seen)\n this._viewportLoc = { 'x': 0, 'y': 0, 'w': this._target.width, 'h': this._target.height };\n\n // The hidden canvas, where we do the actual rendering\n this._backbuffer = document.createElement('canvas');\n this._drawCtx = this._backbuffer.getContext('2d');\n\n this._damageBounds = { left: 0, top: 0,\n right: this._backbuffer.width,\n bottom: this._backbuffer.height };\n\n Log.Debug(\"User Agent: \" + navigator.userAgent);\n\n Log.Debug(\"<< Display.constructor\");\n\n // ===== PROPERTIES =====\n\n this._scale = 1.0;\n this._clipViewport = false;\n\n // ===== EVENT HANDLERS =====\n\n this.onflush = () => {}; // A flush request has finished\n }\n\n // ===== PROPERTIES =====\n\n get scale() { return this._scale; }\n set scale(scale) {\n this._rescale(scale);\n }\n\n get clipViewport() { return this._clipViewport; }\n set clipViewport(viewport) {\n this._clipViewport = viewport;\n // May need to readjust the viewport dimensions\n const vp = this._viewportLoc;\n this.viewportChangeSize(vp.w, vp.h);\n this.viewportChangePos(0, 0);\n }\n\n get width() {\n return this._fbWidth;\n }\n\n get height() {\n return this._fbHeight;\n }\n\n // ===== PUBLIC METHODS =====\n\n viewportChangePos(deltaX, deltaY) {\n const vp = this._viewportLoc;\n deltaX = Math.floor(deltaX);\n deltaY = Math.floor(deltaY);\n\n if (!this._clipViewport) {\n deltaX = -vp.w; // clamped later of out of bounds\n deltaY = -vp.h;\n }\n\n const vx2 = vp.x + vp.w - 1;\n const vy2 = vp.y + vp.h - 1;\n\n // Position change\n\n if (deltaX < 0 && vp.x + deltaX < 0) {\n deltaX = -vp.x;\n }\n if (vx2 + deltaX >= this._fbWidth) {\n deltaX -= vx2 + deltaX - this._fbWidth + 1;\n }\n\n if (vp.y + deltaY < 0) {\n deltaY = -vp.y;\n }\n if (vy2 + deltaY >= this._fbHeight) {\n deltaY -= (vy2 + deltaY - this._fbHeight + 1);\n }\n\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n Log.Debug(\"viewportChange deltaX: \" + deltaX + \", deltaY: \" + deltaY);\n\n vp.x += deltaX;\n vp.y += deltaY;\n\n this._damage(vp.x, vp.y, vp.w, vp.h);\n\n this.flip();\n }\n\n viewportChangeSize(width, height) {\n\n if (!this._clipViewport ||\n typeof(width) === \"undefined\" ||\n typeof(height) === \"undefined\") {\n\n Log.Debug(\"Setting viewport to full display region\");\n width = this._fbWidth;\n height = this._fbHeight;\n }\n\n width = Math.floor(width);\n height = Math.floor(height);\n\n if (width > this._fbWidth) {\n width = this._fbWidth;\n }\n if (height > this._fbHeight) {\n height = this._fbHeight;\n }\n\n const vp = this._viewportLoc;\n if (vp.w !== width || vp.h !== height) {\n vp.w = width;\n vp.h = height;\n\n const canvas = this._target;\n canvas.width = width;\n canvas.height = height;\n\n // The position might need to be updated if we've grown\n this.viewportChangePos(0, 0);\n\n this._damage(vp.x, vp.y, vp.w, vp.h);\n this.flip();\n\n // Update the visible size of the target canvas\n this._rescale(this._scale);\n }\n }\n\n absX(x) {\n if (this._scale === 0) {\n return 0;\n }\n return toSigned32bit(x / this._scale + this._viewportLoc.x);\n }\n\n absY(y) {\n if (this._scale === 0) {\n return 0;\n }\n return toSigned32bit(y / this._scale + this._viewportLoc.y);\n }\n\n resize(width, height) {\n this._prevDrawStyle = \"\";\n\n this._fbWidth = width;\n this._fbHeight = height;\n\n const canvas = this._backbuffer;\n if (canvas.width !== width || canvas.height !== height) {\n\n // We have to save the canvas data since changing the size will clear it\n let saveImg = null;\n if (canvas.width > 0 && canvas.height > 0) {\n saveImg = this._drawCtx.getImageData(0, 0, canvas.width, canvas.height);\n }\n\n if (canvas.width !== width) {\n canvas.width = width;\n }\n if (canvas.height !== height) {\n canvas.height = height;\n }\n\n if (saveImg) {\n this._drawCtx.putImageData(saveImg, 0, 0);\n }\n }\n\n // Readjust the viewport as it may be incorrectly sized\n // and positioned\n const vp = this._viewportLoc;\n this.viewportChangeSize(vp.w, vp.h);\n this.viewportChangePos(0, 0);\n }\n\n getImageData() {\n return this._drawCtx.getImageData(0, 0, this.width, this.height);\n }\n\n toDataURL(type, encoderOptions) {\n return this._backbuffer.toDataURL(type, encoderOptions);\n }\n\n toBlob(callback, type, quality) {\n return this._backbuffer.toBlob(callback, type, quality);\n }\n\n // Track what parts of the visible canvas that need updating\n _damage(x, y, w, h) {\n if (x < this._damageBounds.left) {\n this._damageBounds.left = x;\n }\n if (y < this._damageBounds.top) {\n this._damageBounds.top = y;\n }\n if ((x + w) > this._damageBounds.right) {\n this._damageBounds.right = x + w;\n }\n if ((y + h) > this._damageBounds.bottom) {\n this._damageBounds.bottom = y + h;\n }\n }\n\n // Update the visible canvas with the contents of the\n // rendering canvas\n flip(fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n this._renderQPush({\n 'type': 'flip'\n });\n } else {\n let x = this._damageBounds.left;\n let y = this._damageBounds.top;\n let w = this._damageBounds.right - x;\n let h = this._damageBounds.bottom - y;\n\n let vx = x - this._viewportLoc.x;\n let vy = y - this._viewportLoc.y;\n\n if (vx < 0) {\n w += vx;\n x -= vx;\n vx = 0;\n }\n if (vy < 0) {\n h += vy;\n y -= vy;\n vy = 0;\n }\n\n if ((vx + w) > this._viewportLoc.w) {\n w = this._viewportLoc.w - vx;\n }\n if ((vy + h) > this._viewportLoc.h) {\n h = this._viewportLoc.h - vy;\n }\n\n if ((w > 0) && (h > 0)) {\n // FIXME: We may need to disable image smoothing here\n // as well (see copyImage()), but we haven't\n // noticed any problem yet.\n this._targetCtx.drawImage(this._backbuffer,\n x, y, w, h,\n vx, vy, w, h);\n }\n\n this._damageBounds.left = this._damageBounds.top = 65535;\n this._damageBounds.right = this._damageBounds.bottom = 0;\n }\n }\n\n pending() {\n return this._renderQ.length > 0;\n }\n\n flush() {\n if (this._renderQ.length === 0) {\n this.onflush();\n } else {\n this._flushing = true;\n }\n }\n\n fillRect(x, y, width, height, color, fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n this._renderQPush({\n 'type': 'fill',\n 'x': x,\n 'y': y,\n 'width': width,\n 'height': height,\n 'color': color\n });\n } else {\n this._setFillColor(color);\n this._drawCtx.fillRect(x, y, width, height);\n this._damage(x, y, width, height);\n }\n }\n\n copyImage(oldX, oldY, newX, newY, w, h, fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n this._renderQPush({\n 'type': 'copy',\n 'oldX': oldX,\n 'oldY': oldY,\n 'x': newX,\n 'y': newY,\n 'width': w,\n 'height': h,\n });\n } else {\n // Due to this bug among others [1] we need to disable the image-smoothing to\n // avoid getting a blur effect when copying data.\n //\n // 1. https://bugzilla.mozilla.org/show_bug.cgi?id=1194719\n //\n // We need to set these every time since all properties are reset\n // when the the size is changed\n this._drawCtx.mozImageSmoothingEnabled = false;\n this._drawCtx.webkitImageSmoothingEnabled = false;\n this._drawCtx.msImageSmoothingEnabled = false;\n this._drawCtx.imageSmoothingEnabled = false;\n\n this._drawCtx.drawImage(this._backbuffer,\n oldX, oldY, w, h,\n newX, newY, w, h);\n this._damage(newX, newY, w, h);\n }\n }\n\n imageRect(x, y, width, height, mime, arr) {\n /* The internal logic cannot handle empty images, so bail early */\n if ((width === 0) || (height === 0)) {\n return;\n }\n\n const img = new Image();\n img.src = \"data: \" + mime + \";base64,\" + Base64.encode(arr);\n\n this._renderQPush({\n 'type': 'img',\n 'img': img,\n 'x': x,\n 'y': y,\n 'width': width,\n 'height': height\n });\n }\n\n blitImage(x, y, width, height, arr, offset, fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n // NB(directxman12): it's technically more performant here to use preallocated arrays,\n // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue,\n // this probably isn't getting called *nearly* as much\n const newArr = new Uint8Array(width * height * 4);\n newArr.set(new Uint8Array(arr.buffer, 0, newArr.length));\n this._renderQPush({\n 'type': 'blit',\n 'data': newArr,\n 'x': x,\n 'y': y,\n 'width': width,\n 'height': height,\n });\n } else {\n // NB(directxman12): arr must be an Type Array view\n let data = new Uint8ClampedArray(arr.buffer,\n arr.byteOffset + offset,\n width * height * 4);\n let img = new ImageData(data, width, height);\n this._drawCtx.putImageData(img, x, y);\n this._damage(x, y, width, height);\n }\n }\n\n drawImage(img, x, y) {\n this._drawCtx.drawImage(img, x, y);\n this._damage(x, y, img.width, img.height);\n }\n\n autoscale(containerWidth, containerHeight) {\n let scaleRatio;\n\n if (containerWidth === 0 || containerHeight === 0) {\n scaleRatio = 0;\n\n } else {\n\n const vp = this._viewportLoc;\n const targetAspectRatio = containerWidth / containerHeight;\n const fbAspectRatio = vp.w / vp.h;\n\n if (fbAspectRatio >= targetAspectRatio) {\n scaleRatio = containerWidth / vp.w;\n } else {\n scaleRatio = containerHeight / vp.h;\n }\n }\n\n this._rescale(scaleRatio);\n }\n\n // ===== PRIVATE METHODS =====\n\n _rescale(factor) {\n this._scale = factor;\n const vp = this._viewportLoc;\n\n // NB(directxman12): If you set the width directly, or set the\n // style width to a number, the canvas is cleared.\n // However, if you set the style width to a string\n // ('NNNpx'), the canvas is scaled without clearing.\n const width = factor * vp.w + 'px';\n const height = factor * vp.h + 'px';\n\n if ((this._target.style.width !== width) ||\n (this._target.style.height !== height)) {\n this._target.style.width = width;\n this._target.style.height = height;\n }\n }\n\n _setFillColor(color) {\n const newStyle = 'rgb(' + color[0] + ',' + color[1] + ',' + color[2] + ')';\n if (newStyle !== this._prevDrawStyle) {\n this._drawCtx.fillStyle = newStyle;\n this._prevDrawStyle = newStyle;\n }\n }\n\n _renderQPush(action) {\n this._renderQ.push(action);\n if (this._renderQ.length === 1) {\n // If this can be rendered immediately it will be, otherwise\n // the scanner will wait for the relevant event\n this._scanRenderQ();\n }\n }\n\n _resumeRenderQ() {\n // \"this\" is the object that is ready, not the\n // display object\n this.removeEventListener('load', this._noVNCDisplay._resumeRenderQ);\n this._noVNCDisplay._scanRenderQ();\n }\n\n _scanRenderQ() {\n let ready = true;\n while (ready && this._renderQ.length > 0) {\n const a = this._renderQ[0];\n switch (a.type) {\n case 'flip':\n this.flip(true);\n break;\n case 'copy':\n this.copyImage(a.oldX, a.oldY, a.x, a.y, a.width, a.height, true);\n break;\n case 'fill':\n this.fillRect(a.x, a.y, a.width, a.height, a.color, true);\n break;\n case 'blit':\n this.blitImage(a.x, a.y, a.width, a.height, a.data, 0, true);\n break;\n case 'img':\n if (a.img.complete) {\n if (a.img.width !== a.width || a.img.height !== a.height) {\n Log.Error(\"Decoded image has incorrect dimensions. Got \" +\n a.img.width + \"x\" + a.img.height + \". Expected \" +\n a.width + \"x\" + a.height + \".\");\n return;\n }\n this.drawImage(a.img, a.x, a.y);\n } else {\n a.img._noVNCDisplay = this;\n a.img.addEventListener('load', this._resumeRenderQ);\n // We need to wait for this image to 'load'\n // to keep things in-order\n ready = false;\n }\n break;\n }\n\n if (ready) {\n this._renderQ.shift();\n }\n }\n\n if (this._renderQ.length === 0 && this._flushing) {\n this._flushing = false;\n this.onflush();\n }\n }\n}\n","// reduce buffer size, avoiding mem copy\nexport function shrinkBuf (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nexport function arraySet (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n}\n\n// Join array of chunks to single array.\nexport function flattenChunks (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n}\n\nexport var Buf8 = Uint8Array;\nexport var Buf16 = Uint16Array;\nexport var Buf32 = Int32Array;\n","// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It doesn't worth to make additional optimizationa as in original.\n// Small size is preferable.\n\nexport default function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n","// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n\n// Use ordinary array, since untyped makes no boost here\nexport default function makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n","// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nexport default function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","import * as utils from \"../utils/common.js\";\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nexport default function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","import * as utils from \"../utils/common.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport inflate_fast from \"./inffast.js\";\nimport inflate_table from \"./inftrees.js\";\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//export const Z_NO_FLUSH = 0;\n//export const Z_PARTIAL_FLUSH = 1;\n//export const Z_SYNC_FLUSH = 2;\n//export const Z_FULL_FLUSH = 3;\nexport const Z_FINISH = 4;\nexport const Z_BLOCK = 5;\nexport const Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nexport const Z_OK = 0;\nexport const Z_STREAM_END = 1;\nexport const Z_NEED_DICT = 2;\n//export const Z_ERRNO = -1;\nexport const Z_STREAM_ERROR = -2;\nexport const Z_DATA_ERROR = -3;\nexport const Z_MEM_ERROR = -4;\nexport const Z_BUF_ERROR = -5;\n//export const Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nexport const Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more conveniend processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' insdead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexport { inflateReset, inflateReset2, inflateResetKeep, inflateInit, inflateInit2, inflate, inflateEnd, inflateGetHeader, inflateSetDictionary };\nexport var inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","export default function ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nimport { inflateInit, inflate, inflateReset } from \"../vendor/pako/lib/zlib/inflate.js\";\nimport ZStream from \"../vendor/pako/lib/zlib/zstream.js\";\n\nexport default class Inflate {\n constructor() {\n this.strm = new ZStream();\n this.chunkSize = 1024 * 10 * 10;\n this.strm.output = new Uint8Array(this.chunkSize);\n this.windowBits = 5;\n\n inflateInit(this.strm, this.windowBits);\n }\n\n setInput(data) {\n if (!data) {\n //FIXME: flush remaining data.\n /* eslint-disable camelcase */\n this.strm.input = null;\n this.strm.avail_in = 0;\n this.strm.next_in = 0;\n } else {\n this.strm.input = data;\n this.strm.avail_in = this.strm.input.length;\n this.strm.next_in = 0;\n /* eslint-enable camelcase */\n }\n }\n\n inflate(expected) {\n // resize our output buffer if it's too small\n // (we could just use multiple chunks, but that would cause an extra\n // allocation each time to flatten the chunks)\n if (expected > this.chunkSize) {\n this.chunkSize = expected;\n this.strm.output = new Uint8Array(this.chunkSize);\n }\n\n /* eslint-disable camelcase */\n this.strm.next_out = 0;\n this.strm.avail_out = expected;\n /* eslint-enable camelcase */\n\n let ret = inflate(this.strm, 0); // Flush argument not used.\n if (ret < 0) {\n throw new Error(\"zlib inflate failed\");\n }\n\n if (this.strm.next_out != expected) {\n throw new Error(\"Incomplete zlib block\");\n }\n\n return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);\n }\n\n reset() {\n inflateReset(this.strm);\n }\n}\n","import * as utils from \"../utils/common.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [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];\n\nvar extra_dbits = /* extra bits for each distance code */\n [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];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexport { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align };\n","export default {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","import * as utils from \"../utils/common.js\";\nimport * as trees from \"./trees.js\";\nimport adler32 from \"./adler32.js\";\nimport crc32 from \"./crc32.js\";\nimport msg from \"./messages.js\";\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nexport const Z_NO_FLUSH = 0;\nexport const Z_PARTIAL_FLUSH = 1;\n//export const Z_SYNC_FLUSH = 2;\nexport const Z_FULL_FLUSH = 3;\nexport const Z_FINISH = 4;\nexport const Z_BLOCK = 5;\n//export const Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nexport const Z_OK = 0;\nexport const Z_STREAM_END = 1;\n//export const Z_NEED_DICT = 2;\n//export const Z_ERRNO = -1;\nexport const Z_STREAM_ERROR = -2;\nexport const Z_DATA_ERROR = -3;\n//export const Z_MEM_ERROR = -4;\nexport const Z_BUF_ERROR = -5;\n//export const Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//export const Z_NO_COMPRESSION = 0;\n//export const Z_BEST_SPEED = 1;\n//export const Z_BEST_COMPRESSION = 9;\nexport const Z_DEFAULT_COMPRESSION = -1;\n\n\nexport const Z_FILTERED = 1;\nexport const Z_HUFFMAN_ONLY = 2;\nexport const Z_RLE = 3;\nexport const Z_FIXED = 4;\nexport const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//export const Z_BINARY = 0;\n//export const Z_TEXT = 1;\n//export const Z_ASCII = 1; // = Z_TEXT\nexport const Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nexport const Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n // Do nothing\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n // Do nothing\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexport { deflateInit, deflateInit2, deflateReset, deflateResetKeep, deflateSetHeader, deflate, deflateEnd, deflateSetDictionary };\nexport var deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nimport { deflateInit, deflate } from \"../vendor/pako/lib/zlib/deflate.js\";\nimport { Z_FULL_FLUSH } from \"../vendor/pako/lib/zlib/deflate.js\";\nimport ZStream from \"../vendor/pako/lib/zlib/zstream.js\";\n\nexport default class Deflator {\n constructor() {\n this.strm = new ZStream();\n this.chunkSize = 1024 * 10 * 10;\n this.outputBuffer = new Uint8Array(this.chunkSize);\n this.windowBits = 5;\n\n deflateInit(this.strm, this.windowBits);\n }\n\n deflate(inData) {\n /* eslint-disable camelcase */\n this.strm.input = inData;\n this.strm.avail_in = this.strm.input.length;\n this.strm.next_in = 0;\n this.strm.output = this.outputBuffer;\n this.strm.avail_out = this.chunkSize;\n this.strm.next_out = 0;\n /* eslint-enable camelcase */\n\n let lastRet = deflate(this.strm, Z_FULL_FLUSH);\n let outData = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);\n\n if (lastRet < 0) {\n throw new Error(\"zlib deflate failed\");\n }\n\n if (this.strm.avail_in > 0) {\n // Read chunks until done\n\n let chunks = [outData];\n let totalLen = outData.length;\n do {\n /* eslint-disable camelcase */\n this.strm.output = new Uint8Array(this.chunkSize);\n this.strm.next_out = 0;\n this.strm.avail_out = this.chunkSize;\n /* eslint-enable camelcase */\n\n lastRet = deflate(this.strm, Z_FULL_FLUSH);\n\n if (lastRet < 0) {\n throw new Error(\"zlib deflate failed\");\n }\n\n let chunk = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);\n totalLen += chunk.length;\n chunks.push(chunk);\n } while (this.strm.avail_in > 0);\n\n // Combine chunks into a single data\n\n let newData = new Uint8Array(totalLen);\n let offset = 0;\n\n for (let i = 0; i < chunks.length; i++) {\n newData.set(chunks[i], offset);\n offset += chunks[i].length;\n }\n\n outData = newData;\n }\n\n /* eslint-disable camelcase */\n this.strm.input = null;\n this.strm.avail_in = 0;\n this.strm.next_in = 0;\n /* eslint-enable camelcase */\n\n return outData;\n }\n\n}\n","/*\n * Mapping from Unicode codepoints to X11/RFB keysyms\n *\n * This file was automatically generated from keysymdef.h\n * DO NOT EDIT!\n */\n\n/* Functions at the bottom */\n\nconst codepoints = {\n 0x0100: 0x03c0, // XK_Amacron\n 0x0101: 0x03e0, // XK_amacron\n 0x0102: 0x01c3, // XK_Abreve\n 0x0103: 0x01e3, // XK_abreve\n 0x0104: 0x01a1, // XK_Aogonek\n 0x0105: 0x01b1, // XK_aogonek\n 0x0106: 0x01c6, // XK_Cacute\n 0x0107: 0x01e6, // XK_cacute\n 0x0108: 0x02c6, // XK_Ccircumflex\n 0x0109: 0x02e6, // XK_ccircumflex\n 0x010a: 0x02c5, // XK_Cabovedot\n 0x010b: 0x02e5, // XK_cabovedot\n 0x010c: 0x01c8, // XK_Ccaron\n 0x010d: 0x01e8, // XK_ccaron\n 0x010e: 0x01cf, // XK_Dcaron\n 0x010f: 0x01ef, // XK_dcaron\n 0x0110: 0x01d0, // XK_Dstroke\n 0x0111: 0x01f0, // XK_dstroke\n 0x0112: 0x03aa, // XK_Emacron\n 0x0113: 0x03ba, // XK_emacron\n 0x0116: 0x03cc, // XK_Eabovedot\n 0x0117: 0x03ec, // XK_eabovedot\n 0x0118: 0x01ca, // XK_Eogonek\n 0x0119: 0x01ea, // XK_eogonek\n 0x011a: 0x01cc, // XK_Ecaron\n 0x011b: 0x01ec, // XK_ecaron\n 0x011c: 0x02d8, // XK_Gcircumflex\n 0x011d: 0x02f8, // XK_gcircumflex\n 0x011e: 0x02ab, // XK_Gbreve\n 0x011f: 0x02bb, // XK_gbreve\n 0x0120: 0x02d5, // XK_Gabovedot\n 0x0121: 0x02f5, // XK_gabovedot\n 0x0122: 0x03ab, // XK_Gcedilla\n 0x0123: 0x03bb, // XK_gcedilla\n 0x0124: 0x02a6, // XK_Hcircumflex\n 0x0125: 0x02b6, // XK_hcircumflex\n 0x0126: 0x02a1, // XK_Hstroke\n 0x0127: 0x02b1, // XK_hstroke\n 0x0128: 0x03a5, // XK_Itilde\n 0x0129: 0x03b5, // XK_itilde\n 0x012a: 0x03cf, // XK_Imacron\n 0x012b: 0x03ef, // XK_imacron\n 0x012e: 0x03c7, // XK_Iogonek\n 0x012f: 0x03e7, // XK_iogonek\n 0x0130: 0x02a9, // XK_Iabovedot\n 0x0131: 0x02b9, // XK_idotless\n 0x0134: 0x02ac, // XK_Jcircumflex\n 0x0135: 0x02bc, // XK_jcircumflex\n 0x0136: 0x03d3, // XK_Kcedilla\n 0x0137: 0x03f3, // XK_kcedilla\n 0x0138: 0x03a2, // XK_kra\n 0x0139: 0x01c5, // XK_Lacute\n 0x013a: 0x01e5, // XK_lacute\n 0x013b: 0x03a6, // XK_Lcedilla\n 0x013c: 0x03b6, // XK_lcedilla\n 0x013d: 0x01a5, // XK_Lcaron\n 0x013e: 0x01b5, // XK_lcaron\n 0x0141: 0x01a3, // XK_Lstroke\n 0x0142: 0x01b3, // XK_lstroke\n 0x0143: 0x01d1, // XK_Nacute\n 0x0144: 0x01f1, // XK_nacute\n 0x0145: 0x03d1, // XK_Ncedilla\n 0x0146: 0x03f1, // XK_ncedilla\n 0x0147: 0x01d2, // XK_Ncaron\n 0x0148: 0x01f2, // XK_ncaron\n 0x014a: 0x03bd, // XK_ENG\n 0x014b: 0x03bf, // XK_eng\n 0x014c: 0x03d2, // XK_Omacron\n 0x014d: 0x03f2, // XK_omacron\n 0x0150: 0x01d5, // XK_Odoubleacute\n 0x0151: 0x01f5, // XK_odoubleacute\n 0x0152: 0x13bc, // XK_OE\n 0x0153: 0x13bd, // XK_oe\n 0x0154: 0x01c0, // XK_Racute\n 0x0155: 0x01e0, // XK_racute\n 0x0156: 0x03a3, // XK_Rcedilla\n 0x0157: 0x03b3, // XK_rcedilla\n 0x0158: 0x01d8, // XK_Rcaron\n 0x0159: 0x01f8, // XK_rcaron\n 0x015a: 0x01a6, // XK_Sacute\n 0x015b: 0x01b6, // XK_sacute\n 0x015c: 0x02de, // XK_Scircumflex\n 0x015d: 0x02fe, // XK_scircumflex\n 0x015e: 0x01aa, // XK_Scedilla\n 0x015f: 0x01ba, // XK_scedilla\n 0x0160: 0x01a9, // XK_Scaron\n 0x0161: 0x01b9, // XK_scaron\n 0x0162: 0x01de, // XK_Tcedilla\n 0x0163: 0x01fe, // XK_tcedilla\n 0x0164: 0x01ab, // XK_Tcaron\n 0x0165: 0x01bb, // XK_tcaron\n 0x0166: 0x03ac, // XK_Tslash\n 0x0167: 0x03bc, // XK_tslash\n 0x0168: 0x03dd, // XK_Utilde\n 0x0169: 0x03fd, // XK_utilde\n 0x016a: 0x03de, // XK_Umacron\n 0x016b: 0x03fe, // XK_umacron\n 0x016c: 0x02dd, // XK_Ubreve\n 0x016d: 0x02fd, // XK_ubreve\n 0x016e: 0x01d9, // XK_Uring\n 0x016f: 0x01f9, // XK_uring\n 0x0170: 0x01db, // XK_Udoubleacute\n 0x0171: 0x01fb, // XK_udoubleacute\n 0x0172: 0x03d9, // XK_Uogonek\n 0x0173: 0x03f9, // XK_uogonek\n 0x0178: 0x13be, // XK_Ydiaeresis\n 0x0179: 0x01ac, // XK_Zacute\n 0x017a: 0x01bc, // XK_zacute\n 0x017b: 0x01af, // XK_Zabovedot\n 0x017c: 0x01bf, // XK_zabovedot\n 0x017d: 0x01ae, // XK_Zcaron\n 0x017e: 0x01be, // XK_zcaron\n 0x0192: 0x08f6, // XK_function\n 0x01d2: 0x10001d1, // XK_Ocaron\n 0x02c7: 0x01b7, // XK_caron\n 0x02d8: 0x01a2, // XK_breve\n 0x02d9: 0x01ff, // XK_abovedot\n 0x02db: 0x01b2, // XK_ogonek\n 0x02dd: 0x01bd, // XK_doubleacute\n 0x0385: 0x07ae, // XK_Greek_accentdieresis\n 0x0386: 0x07a1, // XK_Greek_ALPHAaccent\n 0x0388: 0x07a2, // XK_Greek_EPSILONaccent\n 0x0389: 0x07a3, // XK_Greek_ETAaccent\n 0x038a: 0x07a4, // XK_Greek_IOTAaccent\n 0x038c: 0x07a7, // XK_Greek_OMICRONaccent\n 0x038e: 0x07a8, // XK_Greek_UPSILONaccent\n 0x038f: 0x07ab, // XK_Greek_OMEGAaccent\n 0x0390: 0x07b6, // XK_Greek_iotaaccentdieresis\n 0x0391: 0x07c1, // XK_Greek_ALPHA\n 0x0392: 0x07c2, // XK_Greek_BETA\n 0x0393: 0x07c3, // XK_Greek_GAMMA\n 0x0394: 0x07c4, // XK_Greek_DELTA\n 0x0395: 0x07c5, // XK_Greek_EPSILON\n 0x0396: 0x07c6, // XK_Greek_ZETA\n 0x0397: 0x07c7, // XK_Greek_ETA\n 0x0398: 0x07c8, // XK_Greek_THETA\n 0x0399: 0x07c9, // XK_Greek_IOTA\n 0x039a: 0x07ca, // XK_Greek_KAPPA\n 0x039b: 0x07cb, // XK_Greek_LAMDA\n 0x039c: 0x07cc, // XK_Greek_MU\n 0x039d: 0x07cd, // XK_Greek_NU\n 0x039e: 0x07ce, // XK_Greek_XI\n 0x039f: 0x07cf, // XK_Greek_OMICRON\n 0x03a0: 0x07d0, // XK_Greek_PI\n 0x03a1: 0x07d1, // XK_Greek_RHO\n 0x03a3: 0x07d2, // XK_Greek_SIGMA\n 0x03a4: 0x07d4, // XK_Greek_TAU\n 0x03a5: 0x07d5, // XK_Greek_UPSILON\n 0x03a6: 0x07d6, // XK_Greek_PHI\n 0x03a7: 0x07d7, // XK_Greek_CHI\n 0x03a8: 0x07d8, // XK_Greek_PSI\n 0x03a9: 0x07d9, // XK_Greek_OMEGA\n 0x03aa: 0x07a5, // XK_Greek_IOTAdieresis\n 0x03ab: 0x07a9, // XK_Greek_UPSILONdieresis\n 0x03ac: 0x07b1, // XK_Greek_alphaaccent\n 0x03ad: 0x07b2, // XK_Greek_epsilonaccent\n 0x03ae: 0x07b3, // XK_Greek_etaaccent\n 0x03af: 0x07b4, // XK_Greek_iotaaccent\n 0x03b0: 0x07ba, // XK_Greek_upsilonaccentdieresis\n 0x03b1: 0x07e1, // XK_Greek_alpha\n 0x03b2: 0x07e2, // XK_Greek_beta\n 0x03b3: 0x07e3, // XK_Greek_gamma\n 0x03b4: 0x07e4, // XK_Greek_delta\n 0x03b5: 0x07e5, // XK_Greek_epsilon\n 0x03b6: 0x07e6, // XK_Greek_zeta\n 0x03b7: 0x07e7, // XK_Greek_eta\n 0x03b8: 0x07e8, // XK_Greek_theta\n 0x03b9: 0x07e9, // XK_Greek_iota\n 0x03ba: 0x07ea, // XK_Greek_kappa\n 0x03bb: 0x07eb, // XK_Greek_lamda\n 0x03bc: 0x07ec, // XK_Greek_mu\n 0x03bd: 0x07ed, // XK_Greek_nu\n 0x03be: 0x07ee, // XK_Greek_xi\n 0x03bf: 0x07ef, // XK_Greek_omicron\n 0x03c0: 0x07f0, // XK_Greek_pi\n 0x03c1: 0x07f1, // XK_Greek_rho\n 0x03c2: 0x07f3, // XK_Greek_finalsmallsigma\n 0x03c3: 0x07f2, // XK_Greek_sigma\n 0x03c4: 0x07f4, // XK_Greek_tau\n 0x03c5: 0x07f5, // XK_Greek_upsilon\n 0x03c6: 0x07f6, // XK_Greek_phi\n 0x03c7: 0x07f7, // XK_Greek_chi\n 0x03c8: 0x07f8, // XK_Greek_psi\n 0x03c9: 0x07f9, // XK_Greek_omega\n 0x03ca: 0x07b5, // XK_Greek_iotadieresis\n 0x03cb: 0x07b9, // XK_Greek_upsilondieresis\n 0x03cc: 0x07b7, // XK_Greek_omicronaccent\n 0x03cd: 0x07b8, // XK_Greek_upsilonaccent\n 0x03ce: 0x07bb, // XK_Greek_omegaaccent\n 0x0401: 0x06b3, // XK_Cyrillic_IO\n 0x0402: 0x06b1, // XK_Serbian_DJE\n 0x0403: 0x06b2, // XK_Macedonia_GJE\n 0x0404: 0x06b4, // XK_Ukrainian_IE\n 0x0405: 0x06b5, // XK_Macedonia_DSE\n 0x0406: 0x06b6, // XK_Ukrainian_I\n 0x0407: 0x06b7, // XK_Ukrainian_YI\n 0x0408: 0x06b8, // XK_Cyrillic_JE\n 0x0409: 0x06b9, // XK_Cyrillic_LJE\n 0x040a: 0x06ba, // XK_Cyrillic_NJE\n 0x040b: 0x06bb, // XK_Serbian_TSHE\n 0x040c: 0x06bc, // XK_Macedonia_KJE\n 0x040e: 0x06be, // XK_Byelorussian_SHORTU\n 0x040f: 0x06bf, // XK_Cyrillic_DZHE\n 0x0410: 0x06e1, // XK_Cyrillic_A\n 0x0411: 0x06e2, // XK_Cyrillic_BE\n 0x0412: 0x06f7, // XK_Cyrillic_VE\n 0x0413: 0x06e7, // XK_Cyrillic_GHE\n 0x0414: 0x06e4, // XK_Cyrillic_DE\n 0x0415: 0x06e5, // XK_Cyrillic_IE\n 0x0416: 0x06f6, // XK_Cyrillic_ZHE\n 0x0417: 0x06fa, // XK_Cyrillic_ZE\n 0x0418: 0x06e9, // XK_Cyrillic_I\n 0x0419: 0x06ea, // XK_Cyrillic_SHORTI\n 0x041a: 0x06eb, // XK_Cyrillic_KA\n 0x041b: 0x06ec, // XK_Cyrillic_EL\n 0x041c: 0x06ed, // XK_Cyrillic_EM\n 0x041d: 0x06ee, // XK_Cyrillic_EN\n 0x041e: 0x06ef, // XK_Cyrillic_O\n 0x041f: 0x06f0, // XK_Cyrillic_PE\n 0x0420: 0x06f2, // XK_Cyrillic_ER\n 0x0421: 0x06f3, // XK_Cyrillic_ES\n 0x0422: 0x06f4, // XK_Cyrillic_TE\n 0x0423: 0x06f5, // XK_Cyrillic_U\n 0x0424: 0x06e6, // XK_Cyrillic_EF\n 0x0425: 0x06e8, // XK_Cyrillic_HA\n 0x0426: 0x06e3, // XK_Cyrillic_TSE\n 0x0427: 0x06fe, // XK_Cyrillic_CHE\n 0x0428: 0x06fb, // XK_Cyrillic_SHA\n 0x0429: 0x06fd, // XK_Cyrillic_SHCHA\n 0x042a: 0x06ff, // XK_Cyrillic_HARDSIGN\n 0x042b: 0x06f9, // XK_Cyrillic_YERU\n 0x042c: 0x06f8, // XK_Cyrillic_SOFTSIGN\n 0x042d: 0x06fc, // XK_Cyrillic_E\n 0x042e: 0x06e0, // XK_Cyrillic_YU\n 0x042f: 0x06f1, // XK_Cyrillic_YA\n 0x0430: 0x06c1, // XK_Cyrillic_a\n 0x0431: 0x06c2, // XK_Cyrillic_be\n 0x0432: 0x06d7, // XK_Cyrillic_ve\n 0x0433: 0x06c7, // XK_Cyrillic_ghe\n 0x0434: 0x06c4, // XK_Cyrillic_de\n 0x0435: 0x06c5, // XK_Cyrillic_ie\n 0x0436: 0x06d6, // XK_Cyrillic_zhe\n 0x0437: 0x06da, // XK_Cyrillic_ze\n 0x0438: 0x06c9, // XK_Cyrillic_i\n 0x0439: 0x06ca, // XK_Cyrillic_shorti\n 0x043a: 0x06cb, // XK_Cyrillic_ka\n 0x043b: 0x06cc, // XK_Cyrillic_el\n 0x043c: 0x06cd, // XK_Cyrillic_em\n 0x043d: 0x06ce, // XK_Cyrillic_en\n 0x043e: 0x06cf, // XK_Cyrillic_o\n 0x043f: 0x06d0, // XK_Cyrillic_pe\n 0x0440: 0x06d2, // XK_Cyrillic_er\n 0x0441: 0x06d3, // XK_Cyrillic_es\n 0x0442: 0x06d4, // XK_Cyrillic_te\n 0x0443: 0x06d5, // XK_Cyrillic_u\n 0x0444: 0x06c6, // XK_Cyrillic_ef\n 0x0445: 0x06c8, // XK_Cyrillic_ha\n 0x0446: 0x06c3, // XK_Cyrillic_tse\n 0x0447: 0x06de, // XK_Cyrillic_che\n 0x0448: 0x06db, // XK_Cyrillic_sha\n 0x0449: 0x06dd, // XK_Cyrillic_shcha\n 0x044a: 0x06df, // XK_Cyrillic_hardsign\n 0x044b: 0x06d9, // XK_Cyrillic_yeru\n 0x044c: 0x06d8, // XK_Cyrillic_softsign\n 0x044d: 0x06dc, // XK_Cyrillic_e\n 0x044e: 0x06c0, // XK_Cyrillic_yu\n 0x044f: 0x06d1, // XK_Cyrillic_ya\n 0x0451: 0x06a3, // XK_Cyrillic_io\n 0x0452: 0x06a1, // XK_Serbian_dje\n 0x0453: 0x06a2, // XK_Macedonia_gje\n 0x0454: 0x06a4, // XK_Ukrainian_ie\n 0x0455: 0x06a5, // XK_Macedonia_dse\n 0x0456: 0x06a6, // XK_Ukrainian_i\n 0x0457: 0x06a7, // XK_Ukrainian_yi\n 0x0458: 0x06a8, // XK_Cyrillic_je\n 0x0459: 0x06a9, // XK_Cyrillic_lje\n 0x045a: 0x06aa, // XK_Cyrillic_nje\n 0x045b: 0x06ab, // XK_Serbian_tshe\n 0x045c: 0x06ac, // XK_Macedonia_kje\n 0x045e: 0x06ae, // XK_Byelorussian_shortu\n 0x045f: 0x06af, // XK_Cyrillic_dzhe\n 0x0490: 0x06bd, // XK_Ukrainian_GHE_WITH_UPTURN\n 0x0491: 0x06ad, // XK_Ukrainian_ghe_with_upturn\n 0x05d0: 0x0ce0, // XK_hebrew_aleph\n 0x05d1: 0x0ce1, // XK_hebrew_bet\n 0x05d2: 0x0ce2, // XK_hebrew_gimel\n 0x05d3: 0x0ce3, // XK_hebrew_dalet\n 0x05d4: 0x0ce4, // XK_hebrew_he\n 0x05d5: 0x0ce5, // XK_hebrew_waw\n 0x05d6: 0x0ce6, // XK_hebrew_zain\n 0x05d7: 0x0ce7, // XK_hebrew_chet\n 0x05d8: 0x0ce8, // XK_hebrew_tet\n 0x05d9: 0x0ce9, // XK_hebrew_yod\n 0x05da: 0x0cea, // XK_hebrew_finalkaph\n 0x05db: 0x0ceb, // XK_hebrew_kaph\n 0x05dc: 0x0cec, // XK_hebrew_lamed\n 0x05dd: 0x0ced, // XK_hebrew_finalmem\n 0x05de: 0x0cee, // XK_hebrew_mem\n 0x05df: 0x0cef, // XK_hebrew_finalnun\n 0x05e0: 0x0cf0, // XK_hebrew_nun\n 0x05e1: 0x0cf1, // XK_hebrew_samech\n 0x05e2: 0x0cf2, // XK_hebrew_ayin\n 0x05e3: 0x0cf3, // XK_hebrew_finalpe\n 0x05e4: 0x0cf4, // XK_hebrew_pe\n 0x05e5: 0x0cf5, // XK_hebrew_finalzade\n 0x05e6: 0x0cf6, // XK_hebrew_zade\n 0x05e7: 0x0cf7, // XK_hebrew_qoph\n 0x05e8: 0x0cf8, // XK_hebrew_resh\n 0x05e9: 0x0cf9, // XK_hebrew_shin\n 0x05ea: 0x0cfa, // XK_hebrew_taw\n 0x060c: 0x05ac, // XK_Arabic_comma\n 0x061b: 0x05bb, // XK_Arabic_semicolon\n 0x061f: 0x05bf, // XK_Arabic_question_mark\n 0x0621: 0x05c1, // XK_Arabic_hamza\n 0x0622: 0x05c2, // XK_Arabic_maddaonalef\n 0x0623: 0x05c3, // XK_Arabic_hamzaonalef\n 0x0624: 0x05c4, // XK_Arabic_hamzaonwaw\n 0x0625: 0x05c5, // XK_Arabic_hamzaunderalef\n 0x0626: 0x05c6, // XK_Arabic_hamzaonyeh\n 0x0627: 0x05c7, // XK_Arabic_alef\n 0x0628: 0x05c8, // XK_Arabic_beh\n 0x0629: 0x05c9, // XK_Arabic_tehmarbuta\n 0x062a: 0x05ca, // XK_Arabic_teh\n 0x062b: 0x05cb, // XK_Arabic_theh\n 0x062c: 0x05cc, // XK_Arabic_jeem\n 0x062d: 0x05cd, // XK_Arabic_hah\n 0x062e: 0x05ce, // XK_Arabic_khah\n 0x062f: 0x05cf, // XK_Arabic_dal\n 0x0630: 0x05d0, // XK_Arabic_thal\n 0x0631: 0x05d1, // XK_Arabic_ra\n 0x0632: 0x05d2, // XK_Arabic_zain\n 0x0633: 0x05d3, // XK_Arabic_seen\n 0x0634: 0x05d4, // XK_Arabic_sheen\n 0x0635: 0x05d5, // XK_Arabic_sad\n 0x0636: 0x05d6, // XK_Arabic_dad\n 0x0637: 0x05d7, // XK_Arabic_tah\n 0x0638: 0x05d8, // XK_Arabic_zah\n 0x0639: 0x05d9, // XK_Arabic_ain\n 0x063a: 0x05da, // XK_Arabic_ghain\n 0x0640: 0x05e0, // XK_Arabic_tatweel\n 0x0641: 0x05e1, // XK_Arabic_feh\n 0x0642: 0x05e2, // XK_Arabic_qaf\n 0x0643: 0x05e3, // XK_Arabic_kaf\n 0x0644: 0x05e4, // XK_Arabic_lam\n 0x0645: 0x05e5, // XK_Arabic_meem\n 0x0646: 0x05e6, // XK_Arabic_noon\n 0x0647: 0x05e7, // XK_Arabic_ha\n 0x0648: 0x05e8, // XK_Arabic_waw\n 0x0649: 0x05e9, // XK_Arabic_alefmaksura\n 0x064a: 0x05ea, // XK_Arabic_yeh\n 0x064b: 0x05eb, // XK_Arabic_fathatan\n 0x064c: 0x05ec, // XK_Arabic_dammatan\n 0x064d: 0x05ed, // XK_Arabic_kasratan\n 0x064e: 0x05ee, // XK_Arabic_fatha\n 0x064f: 0x05ef, // XK_Arabic_damma\n 0x0650: 0x05f0, // XK_Arabic_kasra\n 0x0651: 0x05f1, // XK_Arabic_shadda\n 0x0652: 0x05f2, // XK_Arabic_sukun\n 0x0e01: 0x0da1, // XK_Thai_kokai\n 0x0e02: 0x0da2, // XK_Thai_khokhai\n 0x0e03: 0x0da3, // XK_Thai_khokhuat\n 0x0e04: 0x0da4, // XK_Thai_khokhwai\n 0x0e05: 0x0da5, // XK_Thai_khokhon\n 0x0e06: 0x0da6, // XK_Thai_khorakhang\n 0x0e07: 0x0da7, // XK_Thai_ngongu\n 0x0e08: 0x0da8, // XK_Thai_chochan\n 0x0e09: 0x0da9, // XK_Thai_choching\n 0x0e0a: 0x0daa, // XK_Thai_chochang\n 0x0e0b: 0x0dab, // XK_Thai_soso\n 0x0e0c: 0x0dac, // XK_Thai_chochoe\n 0x0e0d: 0x0dad, // XK_Thai_yoying\n 0x0e0e: 0x0dae, // XK_Thai_dochada\n 0x0e0f: 0x0daf, // XK_Thai_topatak\n 0x0e10: 0x0db0, // XK_Thai_thothan\n 0x0e11: 0x0db1, // XK_Thai_thonangmontho\n 0x0e12: 0x0db2, // XK_Thai_thophuthao\n 0x0e13: 0x0db3, // XK_Thai_nonen\n 0x0e14: 0x0db4, // XK_Thai_dodek\n 0x0e15: 0x0db5, // XK_Thai_totao\n 0x0e16: 0x0db6, // XK_Thai_thothung\n 0x0e17: 0x0db7, // XK_Thai_thothahan\n 0x0e18: 0x0db8, // XK_Thai_thothong\n 0x0e19: 0x0db9, // XK_Thai_nonu\n 0x0e1a: 0x0dba, // XK_Thai_bobaimai\n 0x0e1b: 0x0dbb, // XK_Thai_popla\n 0x0e1c: 0x0dbc, // XK_Thai_phophung\n 0x0e1d: 0x0dbd, // XK_Thai_fofa\n 0x0e1e: 0x0dbe, // XK_Thai_phophan\n 0x0e1f: 0x0dbf, // XK_Thai_fofan\n 0x0e20: 0x0dc0, // XK_Thai_phosamphao\n 0x0e21: 0x0dc1, // XK_Thai_moma\n 0x0e22: 0x0dc2, // XK_Thai_yoyak\n 0x0e23: 0x0dc3, // XK_Thai_rorua\n 0x0e24: 0x0dc4, // XK_Thai_ru\n 0x0e25: 0x0dc5, // XK_Thai_loling\n 0x0e26: 0x0dc6, // XK_Thai_lu\n 0x0e27: 0x0dc7, // XK_Thai_wowaen\n 0x0e28: 0x0dc8, // XK_Thai_sosala\n 0x0e29: 0x0dc9, // XK_Thai_sorusi\n 0x0e2a: 0x0dca, // XK_Thai_sosua\n 0x0e2b: 0x0dcb, // XK_Thai_hohip\n 0x0e2c: 0x0dcc, // XK_Thai_lochula\n 0x0e2d: 0x0dcd, // XK_Thai_oang\n 0x0e2e: 0x0dce, // XK_Thai_honokhuk\n 0x0e2f: 0x0dcf, // XK_Thai_paiyannoi\n 0x0e30: 0x0dd0, // XK_Thai_saraa\n 0x0e31: 0x0dd1, // XK_Thai_maihanakat\n 0x0e32: 0x0dd2, // XK_Thai_saraaa\n 0x0e33: 0x0dd3, // XK_Thai_saraam\n 0x0e34: 0x0dd4, // XK_Thai_sarai\n 0x0e35: 0x0dd5, // XK_Thai_saraii\n 0x0e36: 0x0dd6, // XK_Thai_saraue\n 0x0e37: 0x0dd7, // XK_Thai_sarauee\n 0x0e38: 0x0dd8, // XK_Thai_sarau\n 0x0e39: 0x0dd9, // XK_Thai_sarauu\n 0x0e3a: 0x0dda, // XK_Thai_phinthu\n 0x0e3f: 0x0ddf, // XK_Thai_baht\n 0x0e40: 0x0de0, // XK_Thai_sarae\n 0x0e41: 0x0de1, // XK_Thai_saraae\n 0x0e42: 0x0de2, // XK_Thai_sarao\n 0x0e43: 0x0de3, // XK_Thai_saraaimaimuan\n 0x0e44: 0x0de4, // XK_Thai_saraaimaimalai\n 0x0e45: 0x0de5, // XK_Thai_lakkhangyao\n 0x0e46: 0x0de6, // XK_Thai_maiyamok\n 0x0e47: 0x0de7, // XK_Thai_maitaikhu\n 0x0e48: 0x0de8, // XK_Thai_maiek\n 0x0e49: 0x0de9, // XK_Thai_maitho\n 0x0e4a: 0x0dea, // XK_Thai_maitri\n 0x0e4b: 0x0deb, // XK_Thai_maichattawa\n 0x0e4c: 0x0dec, // XK_Thai_thanthakhat\n 0x0e4d: 0x0ded, // XK_Thai_nikhahit\n 0x0e50: 0x0df0, // XK_Thai_leksun\n 0x0e51: 0x0df1, // XK_Thai_leknung\n 0x0e52: 0x0df2, // XK_Thai_leksong\n 0x0e53: 0x0df3, // XK_Thai_leksam\n 0x0e54: 0x0df4, // XK_Thai_leksi\n 0x0e55: 0x0df5, // XK_Thai_lekha\n 0x0e56: 0x0df6, // XK_Thai_lekhok\n 0x0e57: 0x0df7, // XK_Thai_lekchet\n 0x0e58: 0x0df8, // XK_Thai_lekpaet\n 0x0e59: 0x0df9, // XK_Thai_lekkao\n 0x2002: 0x0aa2, // XK_enspace\n 0x2003: 0x0aa1, // XK_emspace\n 0x2004: 0x0aa3, // XK_em3space\n 0x2005: 0x0aa4, // XK_em4space\n 0x2007: 0x0aa5, // XK_digitspace\n 0x2008: 0x0aa6, // XK_punctspace\n 0x2009: 0x0aa7, // XK_thinspace\n 0x200a: 0x0aa8, // XK_hairspace\n 0x2012: 0x0abb, // XK_figdash\n 0x2013: 0x0aaa, // XK_endash\n 0x2014: 0x0aa9, // XK_emdash\n 0x2015: 0x07af, // XK_Greek_horizbar\n 0x2017: 0x0cdf, // XK_hebrew_doublelowline\n 0x2018: 0x0ad0, // XK_leftsinglequotemark\n 0x2019: 0x0ad1, // XK_rightsinglequotemark\n 0x201a: 0x0afd, // XK_singlelowquotemark\n 0x201c: 0x0ad2, // XK_leftdoublequotemark\n 0x201d: 0x0ad3, // XK_rightdoublequotemark\n 0x201e: 0x0afe, // XK_doublelowquotemark\n 0x2020: 0x0af1, // XK_dagger\n 0x2021: 0x0af2, // XK_doubledagger\n 0x2022: 0x0ae6, // XK_enfilledcircbullet\n 0x2025: 0x0aaf, // XK_doubbaselinedot\n 0x2026: 0x0aae, // XK_ellipsis\n 0x2030: 0x0ad5, // XK_permille\n 0x2032: 0x0ad6, // XK_minutes\n 0x2033: 0x0ad7, // XK_seconds\n 0x2038: 0x0afc, // XK_caret\n 0x203e: 0x047e, // XK_overline\n 0x20a9: 0x0eff, // XK_Korean_Won\n 0x20ac: 0x20ac, // XK_EuroSign\n 0x2105: 0x0ab8, // XK_careof\n 0x2116: 0x06b0, // XK_numerosign\n 0x2117: 0x0afb, // XK_phonographcopyright\n 0x211e: 0x0ad4, // XK_prescription\n 0x2122: 0x0ac9, // XK_trademark\n 0x2153: 0x0ab0, // XK_onethird\n 0x2154: 0x0ab1, // XK_twothirds\n 0x2155: 0x0ab2, // XK_onefifth\n 0x2156: 0x0ab3, // XK_twofifths\n 0x2157: 0x0ab4, // XK_threefifths\n 0x2158: 0x0ab5, // XK_fourfifths\n 0x2159: 0x0ab6, // XK_onesixth\n 0x215a: 0x0ab7, // XK_fivesixths\n 0x215b: 0x0ac3, // XK_oneeighth\n 0x215c: 0x0ac4, // XK_threeeighths\n 0x215d: 0x0ac5, // XK_fiveeighths\n 0x215e: 0x0ac6, // XK_seveneighths\n 0x2190: 0x08fb, // XK_leftarrow\n 0x2191: 0x08fc, // XK_uparrow\n 0x2192: 0x08fd, // XK_rightarrow\n 0x2193: 0x08fe, // XK_downarrow\n 0x21d2: 0x08ce, // XK_implies\n 0x21d4: 0x08cd, // XK_ifonlyif\n 0x2202: 0x08ef, // XK_partialderivative\n 0x2207: 0x08c5, // XK_nabla\n 0x2218: 0x0bca, // XK_jot\n 0x221a: 0x08d6, // XK_radical\n 0x221d: 0x08c1, // XK_variation\n 0x221e: 0x08c2, // XK_infinity\n 0x2227: 0x08de, // XK_logicaland\n 0x2228: 0x08df, // XK_logicalor\n 0x2229: 0x08dc, // XK_intersection\n 0x222a: 0x08dd, // XK_union\n 0x222b: 0x08bf, // XK_integral\n 0x2234: 0x08c0, // XK_therefore\n 0x223c: 0x08c8, // XK_approximate\n 0x2243: 0x08c9, // XK_similarequal\n 0x2245: 0x1002248, // XK_approxeq\n 0x2260: 0x08bd, // XK_notequal\n 0x2261: 0x08cf, // XK_identical\n 0x2264: 0x08bc, // XK_lessthanequal\n 0x2265: 0x08be, // XK_greaterthanequal\n 0x2282: 0x08da, // XK_includedin\n 0x2283: 0x08db, // XK_includes\n 0x22a2: 0x0bfc, // XK_righttack\n 0x22a3: 0x0bdc, // XK_lefttack\n 0x22a4: 0x0bc2, // XK_downtack\n 0x22a5: 0x0bce, // XK_uptack\n 0x2308: 0x0bd3, // XK_upstile\n 0x230a: 0x0bc4, // XK_downstile\n 0x2315: 0x0afa, // XK_telephonerecorder\n 0x2320: 0x08a4, // XK_topintegral\n 0x2321: 0x08a5, // XK_botintegral\n 0x2395: 0x0bcc, // XK_quad\n 0x239b: 0x08ab, // XK_topleftparens\n 0x239d: 0x08ac, // XK_botleftparens\n 0x239e: 0x08ad, // XK_toprightparens\n 0x23a0: 0x08ae, // XK_botrightparens\n 0x23a1: 0x08a7, // XK_topleftsqbracket\n 0x23a3: 0x08a8, // XK_botleftsqbracket\n 0x23a4: 0x08a9, // XK_toprightsqbracket\n 0x23a6: 0x08aa, // XK_botrightsqbracket\n 0x23a8: 0x08af, // XK_leftmiddlecurlybrace\n 0x23ac: 0x08b0, // XK_rightmiddlecurlybrace\n 0x23b7: 0x08a1, // XK_leftradical\n 0x23ba: 0x09ef, // XK_horizlinescan1\n 0x23bb: 0x09f0, // XK_horizlinescan3\n 0x23bc: 0x09f2, // XK_horizlinescan7\n 0x23bd: 0x09f3, // XK_horizlinescan9\n 0x2409: 0x09e2, // XK_ht\n 0x240a: 0x09e5, // XK_lf\n 0x240b: 0x09e9, // XK_vt\n 0x240c: 0x09e3, // XK_ff\n 0x240d: 0x09e4, // XK_cr\n 0x2423: 0x0aac, // XK_signifblank\n 0x2424: 0x09e8, // XK_nl\n 0x2500: 0x08a3, // XK_horizconnector\n 0x2502: 0x08a6, // XK_vertconnector\n 0x250c: 0x08a2, // XK_topleftradical\n 0x2510: 0x09eb, // XK_uprightcorner\n 0x2514: 0x09ed, // XK_lowleftcorner\n 0x2518: 0x09ea, // XK_lowrightcorner\n 0x251c: 0x09f4, // XK_leftt\n 0x2524: 0x09f5, // XK_rightt\n 0x252c: 0x09f7, // XK_topt\n 0x2534: 0x09f6, // XK_bott\n 0x253c: 0x09ee, // XK_crossinglines\n 0x2592: 0x09e1, // XK_checkerboard\n 0x25aa: 0x0ae7, // XK_enfilledsqbullet\n 0x25ab: 0x0ae1, // XK_enopensquarebullet\n 0x25ac: 0x0adb, // XK_filledrectbullet\n 0x25ad: 0x0ae2, // XK_openrectbullet\n 0x25ae: 0x0adf, // XK_emfilledrect\n 0x25af: 0x0acf, // XK_emopenrectangle\n 0x25b2: 0x0ae8, // XK_filledtribulletup\n 0x25b3: 0x0ae3, // XK_opentribulletup\n 0x25b6: 0x0add, // XK_filledrighttribullet\n 0x25b7: 0x0acd, // XK_rightopentriangle\n 0x25bc: 0x0ae9, // XK_filledtribulletdown\n 0x25bd: 0x0ae4, // XK_opentribulletdown\n 0x25c0: 0x0adc, // XK_filledlefttribullet\n 0x25c1: 0x0acc, // XK_leftopentriangle\n 0x25c6: 0x09e0, // XK_soliddiamond\n 0x25cb: 0x0ace, // XK_emopencircle\n 0x25cf: 0x0ade, // XK_emfilledcircle\n 0x25e6: 0x0ae0, // XK_enopencircbullet\n 0x2606: 0x0ae5, // XK_openstar\n 0x260e: 0x0af9, // XK_telephone\n 0x2613: 0x0aca, // XK_signaturemark\n 0x261c: 0x0aea, // XK_leftpointer\n 0x261e: 0x0aeb, // XK_rightpointer\n 0x2640: 0x0af8, // XK_femalesymbol\n 0x2642: 0x0af7, // XK_malesymbol\n 0x2663: 0x0aec, // XK_club\n 0x2665: 0x0aee, // XK_heart\n 0x2666: 0x0aed, // XK_diamond\n 0x266d: 0x0af6, // XK_musicalflat\n 0x266f: 0x0af5, // XK_musicalsharp\n 0x2713: 0x0af3, // XK_checkmark\n 0x2717: 0x0af4, // XK_ballotcross\n 0x271d: 0x0ad9, // XK_latincross\n 0x2720: 0x0af0, // XK_maltesecross\n 0x27e8: 0x0abc, // XK_leftanglebracket\n 0x27e9: 0x0abe, // XK_rightanglebracket\n 0x3001: 0x04a4, // XK_kana_comma\n 0x3002: 0x04a1, // XK_kana_fullstop\n 0x300c: 0x04a2, // XK_kana_openingbracket\n 0x300d: 0x04a3, // XK_kana_closingbracket\n 0x309b: 0x04de, // XK_voicedsound\n 0x309c: 0x04df, // XK_semivoicedsound\n 0x30a1: 0x04a7, // XK_kana_a\n 0x30a2: 0x04b1, // XK_kana_A\n 0x30a3: 0x04a8, // XK_kana_i\n 0x30a4: 0x04b2, // XK_kana_I\n 0x30a5: 0x04a9, // XK_kana_u\n 0x30a6: 0x04b3, // XK_kana_U\n 0x30a7: 0x04aa, // XK_kana_e\n 0x30a8: 0x04b4, // XK_kana_E\n 0x30a9: 0x04ab, // XK_kana_o\n 0x30aa: 0x04b5, // XK_kana_O\n 0x30ab: 0x04b6, // XK_kana_KA\n 0x30ad: 0x04b7, // XK_kana_KI\n 0x30af: 0x04b8, // XK_kana_KU\n 0x30b1: 0x04b9, // XK_kana_KE\n 0x30b3: 0x04ba, // XK_kana_KO\n 0x30b5: 0x04bb, // XK_kana_SA\n 0x30b7: 0x04bc, // XK_kana_SHI\n 0x30b9: 0x04bd, // XK_kana_SU\n 0x30bb: 0x04be, // XK_kana_SE\n 0x30bd: 0x04bf, // XK_kana_SO\n 0x30bf: 0x04c0, // XK_kana_TA\n 0x30c1: 0x04c1, // XK_kana_CHI\n 0x30c3: 0x04af, // XK_kana_tsu\n 0x30c4: 0x04c2, // XK_kana_TSU\n 0x30c6: 0x04c3, // XK_kana_TE\n 0x30c8: 0x04c4, // XK_kana_TO\n 0x30ca: 0x04c5, // XK_kana_NA\n 0x30cb: 0x04c6, // XK_kana_NI\n 0x30cc: 0x04c7, // XK_kana_NU\n 0x30cd: 0x04c8, // XK_kana_NE\n 0x30ce: 0x04c9, // XK_kana_NO\n 0x30cf: 0x04ca, // XK_kana_HA\n 0x30d2: 0x04cb, // XK_kana_HI\n 0x30d5: 0x04cc, // XK_kana_FU\n 0x30d8: 0x04cd, // XK_kana_HE\n 0x30db: 0x04ce, // XK_kana_HO\n 0x30de: 0x04cf, // XK_kana_MA\n 0x30df: 0x04d0, // XK_kana_MI\n 0x30e0: 0x04d1, // XK_kana_MU\n 0x30e1: 0x04d2, // XK_kana_ME\n 0x30e2: 0x04d3, // XK_kana_MO\n 0x30e3: 0x04ac, // XK_kana_ya\n 0x30e4: 0x04d4, // XK_kana_YA\n 0x30e5: 0x04ad, // XK_kana_yu\n 0x30e6: 0x04d5, // XK_kana_YU\n 0x30e7: 0x04ae, // XK_kana_yo\n 0x30e8: 0x04d6, // XK_kana_YO\n 0x30e9: 0x04d7, // XK_kana_RA\n 0x30ea: 0x04d8, // XK_kana_RI\n 0x30eb: 0x04d9, // XK_kana_RU\n 0x30ec: 0x04da, // XK_kana_RE\n 0x30ed: 0x04db, // XK_kana_RO\n 0x30ef: 0x04dc, // XK_kana_WA\n 0x30f2: 0x04a6, // XK_kana_WO\n 0x30f3: 0x04dd, // XK_kana_N\n 0x30fb: 0x04a5, // XK_kana_conjunctive\n 0x30fc: 0x04b0, // XK_prolongedsound\n};\n\nexport default {\n lookup(u) {\n // Latin-1 is one-to-one mapping\n if ((u >= 0x20) && (u <= 0xff)) {\n return u;\n }\n\n // Lookup table (fairly random)\n const keysym = codepoints[u];\n if (keysym !== undefined) {\n return keysym;\n }\n\n // General mapping as final fallback\n return 0x01000000 | u;\n },\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\n/*\n * Mapping between Microsoft® Windows® Virtual-Key codes and\n * HTML key codes.\n */\n\nexport default {\n 0x08: 'Backspace',\n 0x09: 'Tab',\n 0x0a: 'NumpadClear',\n 0x0d: 'Enter',\n 0x10: 'ShiftLeft',\n 0x11: 'ControlLeft',\n 0x12: 'AltLeft',\n 0x13: 'Pause',\n 0x14: 'CapsLock',\n 0x15: 'Lang1',\n 0x19: 'Lang2',\n 0x1b: 'Escape',\n 0x1c: 'Convert',\n 0x1d: 'NonConvert',\n 0x20: 'Space',\n 0x21: 'PageUp',\n 0x22: 'PageDown',\n 0x23: 'End',\n 0x24: 'Home',\n 0x25: 'ArrowLeft',\n 0x26: 'ArrowUp',\n 0x27: 'ArrowRight',\n 0x28: 'ArrowDown',\n 0x29: 'Select',\n 0x2c: 'PrintScreen',\n 0x2d: 'Insert',\n 0x2e: 'Delete',\n 0x2f: 'Help',\n 0x30: 'Digit0',\n 0x31: 'Digit1',\n 0x32: 'Digit2',\n 0x33: 'Digit3',\n 0x34: 'Digit4',\n 0x35: 'Digit5',\n 0x36: 'Digit6',\n 0x37: 'Digit7',\n 0x38: 'Digit8',\n 0x39: 'Digit9',\n 0x5b: 'MetaLeft',\n 0x5c: 'MetaRight',\n 0x5d: 'ContextMenu',\n 0x5f: 'Sleep',\n 0x60: 'Numpad0',\n 0x61: 'Numpad1',\n 0x62: 'Numpad2',\n 0x63: 'Numpad3',\n 0x64: 'Numpad4',\n 0x65: 'Numpad5',\n 0x66: 'Numpad6',\n 0x67: 'Numpad7',\n 0x68: 'Numpad8',\n 0x69: 'Numpad9',\n 0x6a: 'NumpadMultiply',\n 0x6b: 'NumpadAdd',\n 0x6c: 'NumpadDecimal',\n 0x6d: 'NumpadSubtract',\n 0x6e: 'NumpadDecimal', // Duplicate, because buggy on Windows\n 0x6f: 'NumpadDivide',\n 0x70: 'F1',\n 0x71: 'F2',\n 0x72: 'F3',\n 0x73: 'F4',\n 0x74: 'F5',\n 0x75: 'F6',\n 0x76: 'F7',\n 0x77: 'F8',\n 0x78: 'F9',\n 0x79: 'F10',\n 0x7a: 'F11',\n 0x7b: 'F12',\n 0x7c: 'F13',\n 0x7d: 'F14',\n 0x7e: 'F15',\n 0x7f: 'F16',\n 0x80: 'F17',\n 0x81: 'F18',\n 0x82: 'F19',\n 0x83: 'F20',\n 0x84: 'F21',\n 0x85: 'F22',\n 0x86: 'F23',\n 0x87: 'F24',\n 0x90: 'NumLock',\n 0x91: 'ScrollLock',\n 0xa6: 'BrowserBack',\n 0xa7: 'BrowserForward',\n 0xa8: 'BrowserRefresh',\n 0xa9: 'BrowserStop',\n 0xaa: 'BrowserSearch',\n 0xab: 'BrowserFavorites',\n 0xac: 'BrowserHome',\n 0xad: 'AudioVolumeMute',\n 0xae: 'AudioVolumeDown',\n 0xaf: 'AudioVolumeUp',\n 0xb0: 'MediaTrackNext',\n 0xb1: 'MediaTrackPrevious',\n 0xb2: 'MediaStop',\n 0xb3: 'MediaPlayPause',\n 0xb4: 'LaunchMail',\n 0xb5: 'MediaSelect',\n 0xb6: 'LaunchApp1',\n 0xb7: 'LaunchApp2',\n 0xe1: 'AltRight', // Only when it is AltGraph\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\n/*\n * Fallback mapping between HTML key codes (physical keys) and\n * HTML key values. This only works for keys that don't vary\n * between layouts. We also omit those who manage fine by mapping the\n * Unicode representation.\n *\n * See https://www.w3.org/TR/uievents-code/ for possible codes.\n * See https://www.w3.org/TR/uievents-key/ for possible values.\n */\n\n/* eslint-disable key-spacing */\n\nexport default {\n\n// 3.1.1.1. Writing System Keys\n\n 'Backspace': 'Backspace',\n\n// 3.1.1.2. Functional Keys\n\n 'AltLeft': 'Alt',\n 'AltRight': 'Alt', // This could also be 'AltGraph'\n 'CapsLock': 'CapsLock',\n 'ContextMenu': 'ContextMenu',\n 'ControlLeft': 'Control',\n 'ControlRight': 'Control',\n 'Enter': 'Enter',\n 'MetaLeft': 'Meta',\n 'MetaRight': 'Meta',\n 'ShiftLeft': 'Shift',\n 'ShiftRight': 'Shift',\n 'Tab': 'Tab',\n // FIXME: Japanese/Korean keys\n\n// 3.1.2. Control Pad Section\n\n 'Delete': 'Delete',\n 'End': 'End',\n 'Help': 'Help',\n 'Home': 'Home',\n 'Insert': 'Insert',\n 'PageDown': 'PageDown',\n 'PageUp': 'PageUp',\n\n// 3.1.3. Arrow Pad Section\n\n 'ArrowDown': 'ArrowDown',\n 'ArrowLeft': 'ArrowLeft',\n 'ArrowRight': 'ArrowRight',\n 'ArrowUp': 'ArrowUp',\n\n// 3.1.4. Numpad Section\n\n 'NumLock': 'NumLock',\n 'NumpadBackspace': 'Backspace',\n 'NumpadClear': 'Clear',\n\n// 3.1.5. Function Section\n\n 'Escape': 'Escape',\n 'F1': 'F1',\n 'F2': 'F2',\n 'F3': 'F3',\n 'F4': 'F4',\n 'F5': 'F5',\n 'F6': 'F6',\n 'F7': 'F7',\n 'F8': 'F8',\n 'F9': 'F9',\n 'F10': 'F10',\n 'F11': 'F11',\n 'F12': 'F12',\n 'F13': 'F13',\n 'F14': 'F14',\n 'F15': 'F15',\n 'F16': 'F16',\n 'F17': 'F17',\n 'F18': 'F18',\n 'F19': 'F19',\n 'F20': 'F20',\n 'F21': 'F21',\n 'F22': 'F22',\n 'F23': 'F23',\n 'F24': 'F24',\n 'F25': 'F25',\n 'F26': 'F26',\n 'F27': 'F27',\n 'F28': 'F28',\n 'F29': 'F29',\n 'F30': 'F30',\n 'F31': 'F31',\n 'F32': 'F32',\n 'F33': 'F33',\n 'F34': 'F34',\n 'F35': 'F35',\n 'PrintScreen': 'PrintScreen',\n 'ScrollLock': 'ScrollLock',\n 'Pause': 'Pause',\n\n// 3.1.6. Media Keys\n\n 'BrowserBack': 'BrowserBack',\n 'BrowserFavorites': 'BrowserFavorites',\n 'BrowserForward': 'BrowserForward',\n 'BrowserHome': 'BrowserHome',\n 'BrowserRefresh': 'BrowserRefresh',\n 'BrowserSearch': 'BrowserSearch',\n 'BrowserStop': 'BrowserStop',\n 'Eject': 'Eject',\n 'LaunchApp1': 'LaunchMyComputer',\n 'LaunchApp2': 'LaunchCalendar',\n 'LaunchMail': 'LaunchMail',\n 'MediaPlayPause': 'MediaPlay',\n 'MediaStop': 'MediaStop',\n 'MediaTrackNext': 'MediaTrackNext',\n 'MediaTrackPrevious': 'MediaTrackPrevious',\n 'Power': 'Power',\n 'Sleep': 'Sleep',\n 'AudioVolumeDown': 'AudioVolumeDown',\n 'AudioVolumeMute': 'AudioVolumeMute',\n 'AudioVolumeUp': 'AudioVolumeUp',\n 'WakeUp': 'WakeUp',\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\nimport KeyTable from \"./keysym.js\";\n\n/*\n * Mapping between HTML key values and VNC/X11 keysyms for \"special\"\n * keys that cannot be handled via their Unicode codepoint.\n *\n * See https://www.w3.org/TR/uievents-key/ for possible values.\n */\n\nconst DOMKeyTable = {};\n\nfunction addStandard(key, standard) {\n if (standard === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (key in DOMKeyTable) throw new Error(\"Duplicate entry for key \\\"\" + key + \"\\\"\");\n DOMKeyTable[key] = [standard, standard, standard, standard];\n}\n\nfunction addLeftRight(key, left, right) {\n if (left === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (right === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (key in DOMKeyTable) throw new Error(\"Duplicate entry for key \\\"\" + key + \"\\\"\");\n DOMKeyTable[key] = [left, left, right, left];\n}\n\nfunction addNumpad(key, standard, numpad) {\n if (standard === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (numpad === undefined) throw new Error(\"Undefined keysym for key \\\"\" + key + \"\\\"\");\n if (key in DOMKeyTable) throw new Error(\"Duplicate entry for key \\\"\" + key + \"\\\"\");\n DOMKeyTable[key] = [standard, standard, standard, numpad];\n}\n\n// 3.2. Modifier Keys\n\naddLeftRight(\"Alt\", KeyTable.XK_Alt_L, KeyTable.XK_Alt_R);\naddStandard(\"AltGraph\", KeyTable.XK_ISO_Level3_Shift);\naddStandard(\"CapsLock\", KeyTable.XK_Caps_Lock);\naddLeftRight(\"Control\", KeyTable.XK_Control_L, KeyTable.XK_Control_R);\n// - Fn\n// - FnLock\naddLeftRight(\"Meta\", KeyTable.XK_Super_L, KeyTable.XK_Super_R);\naddStandard(\"NumLock\", KeyTable.XK_Num_Lock);\naddStandard(\"ScrollLock\", KeyTable.XK_Scroll_Lock);\naddLeftRight(\"Shift\", KeyTable.XK_Shift_L, KeyTable.XK_Shift_R);\n// - Symbol\n// - SymbolLock\n// - Hyper\n// - Super\n\n// 3.3. Whitespace Keys\n\naddNumpad(\"Enter\", KeyTable.XK_Return, KeyTable.XK_KP_Enter);\naddStandard(\"Tab\", KeyTable.XK_Tab);\naddNumpad(\" \", KeyTable.XK_space, KeyTable.XK_KP_Space);\n\n// 3.4. Navigation Keys\n\naddNumpad(\"ArrowDown\", KeyTable.XK_Down, KeyTable.XK_KP_Down);\naddNumpad(\"ArrowLeft\", KeyTable.XK_Left, KeyTable.XK_KP_Left);\naddNumpad(\"ArrowRight\", KeyTable.XK_Right, KeyTable.XK_KP_Right);\naddNumpad(\"ArrowUp\", KeyTable.XK_Up, KeyTable.XK_KP_Up);\naddNumpad(\"End\", KeyTable.XK_End, KeyTable.XK_KP_End);\naddNumpad(\"Home\", KeyTable.XK_Home, KeyTable.XK_KP_Home);\naddNumpad(\"PageDown\", KeyTable.XK_Next, KeyTable.XK_KP_Next);\naddNumpad(\"PageUp\", KeyTable.XK_Prior, KeyTable.XK_KP_Prior);\n\n// 3.5. Editing Keys\n\naddStandard(\"Backspace\", KeyTable.XK_BackSpace);\n// Browsers send \"Clear\" for the numpad 5 without NumLock because\n// Windows uses VK_Clear for that key. But Unix expects KP_Begin for\n// that scenario.\naddNumpad(\"Clear\", KeyTable.XK_Clear, KeyTable.XK_KP_Begin);\naddStandard(\"Copy\", KeyTable.XF86XK_Copy);\n// - CrSel\naddStandard(\"Cut\", KeyTable.XF86XK_Cut);\naddNumpad(\"Delete\", KeyTable.XK_Delete, KeyTable.XK_KP_Delete);\n// - EraseEof\n// - ExSel\naddNumpad(\"Insert\", KeyTable.XK_Insert, KeyTable.XK_KP_Insert);\naddStandard(\"Paste\", KeyTable.XF86XK_Paste);\naddStandard(\"Redo\", KeyTable.XK_Redo);\naddStandard(\"Undo\", KeyTable.XK_Undo);\n\n// 3.6. UI Keys\n\n// - Accept\n// - Again (could just be XK_Redo)\n// - Attn\naddStandard(\"Cancel\", KeyTable.XK_Cancel);\naddStandard(\"ContextMenu\", KeyTable.XK_Menu);\naddStandard(\"Escape\", KeyTable.XK_Escape);\naddStandard(\"Execute\", KeyTable.XK_Execute);\naddStandard(\"Find\", KeyTable.XK_Find);\naddStandard(\"Help\", KeyTable.XK_Help);\naddStandard(\"Pause\", KeyTable.XK_Pause);\n// - Play\n// - Props\naddStandard(\"Select\", KeyTable.XK_Select);\naddStandard(\"ZoomIn\", KeyTable.XF86XK_ZoomIn);\naddStandard(\"ZoomOut\", KeyTable.XF86XK_ZoomOut);\n\n// 3.7. Device Keys\n\naddStandard(\"BrightnessDown\", KeyTable.XF86XK_MonBrightnessDown);\naddStandard(\"BrightnessUp\", KeyTable.XF86XK_MonBrightnessUp);\naddStandard(\"Eject\", KeyTable.XF86XK_Eject);\naddStandard(\"LogOff\", KeyTable.XF86XK_LogOff);\naddStandard(\"Power\", KeyTable.XF86XK_PowerOff);\naddStandard(\"PowerOff\", KeyTable.XF86XK_PowerDown);\naddStandard(\"PrintScreen\", KeyTable.XK_Print);\naddStandard(\"Hibernate\", KeyTable.XF86XK_Hibernate);\naddStandard(\"Standby\", KeyTable.XF86XK_Standby);\naddStandard(\"WakeUp\", KeyTable.XF86XK_WakeUp);\n\n// 3.8. IME and Composition Keys\n\naddStandard(\"AllCandidates\", KeyTable.XK_MultipleCandidate);\naddStandard(\"Alphanumeric\", KeyTable.XK_Eisu_toggle);\naddStandard(\"CodeInput\", KeyTable.XK_Codeinput);\naddStandard(\"Compose\", KeyTable.XK_Multi_key);\naddStandard(\"Convert\", KeyTable.XK_Henkan);\n// - Dead\n// - FinalMode\naddStandard(\"GroupFirst\", KeyTable.XK_ISO_First_Group);\naddStandard(\"GroupLast\", KeyTable.XK_ISO_Last_Group);\naddStandard(\"GroupNext\", KeyTable.XK_ISO_Next_Group);\naddStandard(\"GroupPrevious\", KeyTable.XK_ISO_Prev_Group);\n// - ModeChange (XK_Mode_switch is often used for AltGr)\n// - NextCandidate\naddStandard(\"NonConvert\", KeyTable.XK_Muhenkan);\naddStandard(\"PreviousCandidate\", KeyTable.XK_PreviousCandidate);\n// - Process\naddStandard(\"SingleCandidate\", KeyTable.XK_SingleCandidate);\naddStandard(\"HangulMode\", KeyTable.XK_Hangul);\naddStandard(\"HanjaMode\", KeyTable.XK_Hangul_Hanja);\naddStandard(\"JunjaMode\", KeyTable.XK_Hangul_Jeonja);\naddStandard(\"Eisu\", KeyTable.XK_Eisu_toggle);\naddStandard(\"Hankaku\", KeyTable.XK_Hankaku);\naddStandard(\"Hiragana\", KeyTable.XK_Hiragana);\naddStandard(\"HiraganaKatakana\", KeyTable.XK_Hiragana_Katakana);\naddStandard(\"KanaMode\", KeyTable.XK_Kana_Shift); // could also be _Kana_Lock\naddStandard(\"KanjiMode\", KeyTable.XK_Kanji);\naddStandard(\"Katakana\", KeyTable.XK_Katakana);\naddStandard(\"Romaji\", KeyTable.XK_Romaji);\naddStandard(\"Zenkaku\", KeyTable.XK_Zenkaku);\naddStandard(\"ZenkakuHankaku\", KeyTable.XK_Zenkaku_Hankaku);\n\n// 3.9. General-Purpose Function Keys\n\naddStandard(\"F1\", KeyTable.XK_F1);\naddStandard(\"F2\", KeyTable.XK_F2);\naddStandard(\"F3\", KeyTable.XK_F3);\naddStandard(\"F4\", KeyTable.XK_F4);\naddStandard(\"F5\", KeyTable.XK_F5);\naddStandard(\"F6\", KeyTable.XK_F6);\naddStandard(\"F7\", KeyTable.XK_F7);\naddStandard(\"F8\", KeyTable.XK_F8);\naddStandard(\"F9\", KeyTable.XK_F9);\naddStandard(\"F10\", KeyTable.XK_F10);\naddStandard(\"F11\", KeyTable.XK_F11);\naddStandard(\"F12\", KeyTable.XK_F12);\naddStandard(\"F13\", KeyTable.XK_F13);\naddStandard(\"F14\", KeyTable.XK_F14);\naddStandard(\"F15\", KeyTable.XK_F15);\naddStandard(\"F16\", KeyTable.XK_F16);\naddStandard(\"F17\", KeyTable.XK_F17);\naddStandard(\"F18\", KeyTable.XK_F18);\naddStandard(\"F19\", KeyTable.XK_F19);\naddStandard(\"F20\", KeyTable.XK_F20);\naddStandard(\"F21\", KeyTable.XK_F21);\naddStandard(\"F22\", KeyTable.XK_F22);\naddStandard(\"F23\", KeyTable.XK_F23);\naddStandard(\"F24\", KeyTable.XK_F24);\naddStandard(\"F25\", KeyTable.XK_F25);\naddStandard(\"F26\", KeyTable.XK_F26);\naddStandard(\"F27\", KeyTable.XK_F27);\naddStandard(\"F28\", KeyTable.XK_F28);\naddStandard(\"F29\", KeyTable.XK_F29);\naddStandard(\"F30\", KeyTable.XK_F30);\naddStandard(\"F31\", KeyTable.XK_F31);\naddStandard(\"F32\", KeyTable.XK_F32);\naddStandard(\"F33\", KeyTable.XK_F33);\naddStandard(\"F34\", KeyTable.XK_F34);\naddStandard(\"F35\", KeyTable.XK_F35);\n// - Soft1...\n\n// 3.10. Multimedia Keys\n\n// - ChannelDown\n// - ChannelUp\naddStandard(\"Close\", KeyTable.XF86XK_Close);\naddStandard(\"MailForward\", KeyTable.XF86XK_MailForward);\naddStandard(\"MailReply\", KeyTable.XF86XK_Reply);\naddStandard(\"MailSend\", KeyTable.XF86XK_Send);\n// - MediaClose\naddStandard(\"MediaFastForward\", KeyTable.XF86XK_AudioForward);\naddStandard(\"MediaPause\", KeyTable.XF86XK_AudioPause);\naddStandard(\"MediaPlay\", KeyTable.XF86XK_AudioPlay);\n// - MediaPlayPause\naddStandard(\"MediaRecord\", KeyTable.XF86XK_AudioRecord);\naddStandard(\"MediaRewind\", KeyTable.XF86XK_AudioRewind);\naddStandard(\"MediaStop\", KeyTable.XF86XK_AudioStop);\naddStandard(\"MediaTrackNext\", KeyTable.XF86XK_AudioNext);\naddStandard(\"MediaTrackPrevious\", KeyTable.XF86XK_AudioPrev);\naddStandard(\"New\", KeyTable.XF86XK_New);\naddStandard(\"Open\", KeyTable.XF86XK_Open);\naddStandard(\"Print\", KeyTable.XK_Print);\naddStandard(\"Save\", KeyTable.XF86XK_Save);\naddStandard(\"SpellCheck\", KeyTable.XF86XK_Spell);\n\n// 3.11. Multimedia Numpad Keys\n\n// - Key11\n// - Key12\n\n// 3.12. Audio Keys\n\n// - AudioBalanceLeft\n// - AudioBalanceRight\n// - AudioBassBoostDown\n// - AudioBassBoostToggle\n// - AudioBassBoostUp\n// - AudioFaderFront\n// - AudioFaderRear\n// - AudioSurroundModeNext\n// - AudioTrebleDown\n// - AudioTrebleUp\naddStandard(\"AudioVolumeDown\", KeyTable.XF86XK_AudioLowerVolume);\naddStandard(\"AudioVolumeUp\", KeyTable.XF86XK_AudioRaiseVolume);\naddStandard(\"AudioVolumeMute\", KeyTable.XF86XK_AudioMute);\n// - MicrophoneToggle\n// - MicrophoneVolumeDown\n// - MicrophoneVolumeUp\naddStandard(\"MicrophoneVolumeMute\", KeyTable.XF86XK_AudioMicMute);\n\n// 3.13. Speech Keys\n\n// - SpeechCorrectionList\n// - SpeechInputToggle\n\n// 3.14. Application Keys\n\naddStandard(\"LaunchApplication1\", KeyTable.XF86XK_MyComputer);\naddStandard(\"LaunchApplication2\", KeyTable.XF86XK_Calculator);\naddStandard(\"LaunchCalendar\", KeyTable.XF86XK_Calendar);\n// - LaunchContacts\naddStandard(\"LaunchMail\", KeyTable.XF86XK_Mail);\naddStandard(\"LaunchMediaPlayer\", KeyTable.XF86XK_AudioMedia);\naddStandard(\"LaunchMusicPlayer\", KeyTable.XF86XK_Music);\naddStandard(\"LaunchPhone\", KeyTable.XF86XK_Phone);\naddStandard(\"LaunchScreenSaver\", KeyTable.XF86XK_ScreenSaver);\naddStandard(\"LaunchSpreadsheet\", KeyTable.XF86XK_Excel);\naddStandard(\"LaunchWebBrowser\", KeyTable.XF86XK_WWW);\naddStandard(\"LaunchWebCam\", KeyTable.XF86XK_WebCam);\naddStandard(\"LaunchWordProcessor\", KeyTable.XF86XK_Word);\n\n// 3.15. Browser Keys\n\naddStandard(\"BrowserBack\", KeyTable.XF86XK_Back);\naddStandard(\"BrowserFavorites\", KeyTable.XF86XK_Favorites);\naddStandard(\"BrowserForward\", KeyTable.XF86XK_Forward);\naddStandard(\"BrowserHome\", KeyTable.XF86XK_HomePage);\naddStandard(\"BrowserRefresh\", KeyTable.XF86XK_Refresh);\naddStandard(\"BrowserSearch\", KeyTable.XF86XK_Search);\naddStandard(\"BrowserStop\", KeyTable.XF86XK_Stop);\n\n// 3.16. Mobile Phone Keys\n\n// - A whole bunch...\n\n// 3.17. TV Keys\n\n// - A whole bunch...\n\n// 3.18. Media Controller Keys\n\n// - A whole bunch...\naddStandard(\"Dimmer\", KeyTable.XF86XK_BrightnessAdjust);\naddStandard(\"MediaAudioTrack\", KeyTable.XF86XK_AudioCycleTrack);\naddStandard(\"RandomToggle\", KeyTable.XF86XK_AudioRandomPlay);\naddStandard(\"SplitScreenToggle\", KeyTable.XF86XK_SplitScreen);\naddStandard(\"Subtitle\", KeyTable.XF86XK_Subtitle);\naddStandard(\"VideoModeNext\", KeyTable.XF86XK_Next_VMode);\n\n// Extra: Numpad\n\naddNumpad(\"=\", KeyTable.XK_equal, KeyTable.XK_KP_Equal);\naddNumpad(\"+\", KeyTable.XK_plus, KeyTable.XK_KP_Add);\naddNumpad(\"-\", KeyTable.XK_minus, KeyTable.XK_KP_Subtract);\naddNumpad(\"*\", KeyTable.XK_asterisk, KeyTable.XK_KP_Multiply);\naddNumpad(\"/\", KeyTable.XK_slash, KeyTable.XK_KP_Divide);\naddNumpad(\".\", KeyTable.XK_period, KeyTable.XK_KP_Decimal);\naddNumpad(\",\", KeyTable.XK_comma, KeyTable.XK_KP_Separator);\naddNumpad(\"0\", KeyTable.XK_0, KeyTable.XK_KP_0);\naddNumpad(\"1\", KeyTable.XK_1, KeyTable.XK_KP_1);\naddNumpad(\"2\", KeyTable.XK_2, KeyTable.XK_KP_2);\naddNumpad(\"3\", KeyTable.XK_3, KeyTable.XK_KP_3);\naddNumpad(\"4\", KeyTable.XK_4, KeyTable.XK_KP_4);\naddNumpad(\"5\", KeyTable.XK_5, KeyTable.XK_KP_5);\naddNumpad(\"6\", KeyTable.XK_6, KeyTable.XK_KP_6);\naddNumpad(\"7\", KeyTable.XK_7, KeyTable.XK_KP_7);\naddNumpad(\"8\", KeyTable.XK_8, KeyTable.XK_KP_8);\naddNumpad(\"9\", KeyTable.XK_9, KeyTable.XK_KP_9);\n\nexport default DOMKeyTable;\n","import KeyTable from \"./keysym.js\";\nimport keysyms from \"./keysymdef.js\";\nimport vkeys from \"./vkeys.js\";\nimport fixedkeys from \"./fixedkeys.js\";\nimport DOMKeyTable from \"./domkeytable.js\";\nimport * as browser from \"../util/browser.js\";\n\n// Get 'KeyboardEvent.code', handling legacy browsers\nexport function getKeycode(evt) {\n // Are we getting proper key identifiers?\n // (unfortunately Firefox and Chrome are crappy here and gives\n // us an empty string on some platforms, rather than leaving it\n // undefined)\n if (evt.code) {\n // Mozilla isn't fully in sync with the spec yet\n switch (evt.code) {\n case 'OSLeft': return 'MetaLeft';\n case 'OSRight': return 'MetaRight';\n }\n\n return evt.code;\n }\n\n // The de-facto standard is to use Windows Virtual-Key codes\n // in the 'keyCode' field for non-printable characters\n if (evt.keyCode in vkeys) {\n let code = vkeys[evt.keyCode];\n\n // macOS has messed up this code for some reason\n if (browser.isMac() && (code === 'ContextMenu')) {\n code = 'MetaRight';\n }\n\n // The keyCode doesn't distinguish between left and right\n // for the standard modifiers\n if (evt.location === 2) {\n switch (code) {\n case 'ShiftLeft': return 'ShiftRight';\n case 'ControlLeft': return 'ControlRight';\n case 'AltLeft': return 'AltRight';\n }\n }\n\n // Nor a bunch of the numpad keys\n if (evt.location === 3) {\n switch (code) {\n case 'Delete': return 'NumpadDecimal';\n case 'Insert': return 'Numpad0';\n case 'End': return 'Numpad1';\n case 'ArrowDown': return 'Numpad2';\n case 'PageDown': return 'Numpad3';\n case 'ArrowLeft': return 'Numpad4';\n case 'ArrowRight': return 'Numpad6';\n case 'Home': return 'Numpad7';\n case 'ArrowUp': return 'Numpad8';\n case 'PageUp': return 'Numpad9';\n case 'Enter': return 'NumpadEnter';\n }\n }\n\n return code;\n }\n\n return 'Unidentified';\n}\n\n// Get 'KeyboardEvent.key', handling legacy browsers\nexport function getKey(evt) {\n // Are we getting a proper key value?\n if (evt.key !== undefined) {\n // Mozilla isn't fully in sync with the spec yet\n switch (evt.key) {\n case 'OS': return 'Meta';\n case 'LaunchMyComputer': return 'LaunchApplication1';\n case 'LaunchCalculator': return 'LaunchApplication2';\n }\n\n // iOS leaks some OS names\n switch (evt.key) {\n case 'UIKeyInputUpArrow': return 'ArrowUp';\n case 'UIKeyInputDownArrow': return 'ArrowDown';\n case 'UIKeyInputLeftArrow': return 'ArrowLeft';\n case 'UIKeyInputRightArrow': return 'ArrowRight';\n case 'UIKeyInputEscape': return 'Escape';\n }\n\n // Broken behaviour in Chrome\n if ((evt.key === '\\x00') && (evt.code === 'NumpadDecimal')) {\n return 'Delete';\n }\n\n return evt.key;\n }\n\n // Try to deduce it based on the physical key\n const code = getKeycode(evt);\n if (code in fixedkeys) {\n return fixedkeys[code];\n }\n\n // If that failed, then see if we have a printable character\n if (evt.charCode) {\n return String.fromCharCode(evt.charCode);\n }\n\n // At this point we have nothing left to go on\n return 'Unidentified';\n}\n\n// Get the most reliable keysym value we can get from a key event\nexport function getKeysym(evt) {\n const key = getKey(evt);\n\n if (key === 'Unidentified') {\n return null;\n }\n\n // First look up special keys\n if (key in DOMKeyTable) {\n let location = evt.location;\n\n // Safari screws up location for the right cmd key\n if ((key === 'Meta') && (location === 0)) {\n location = 2;\n }\n\n // And for Clear\n if ((key === 'Clear') && (location === 3)) {\n let code = getKeycode(evt);\n if (code === 'NumLock') {\n location = 0;\n }\n }\n\n if ((location === undefined) || (location > 3)) {\n location = 0;\n }\n\n // The original Meta key now gets confused with the Windows key\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1020141\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1232918\n if (key === 'Meta') {\n let code = getKeycode(evt);\n if (code === 'AltLeft') {\n return KeyTable.XK_Meta_L;\n } else if (code === 'AltRight') {\n return KeyTable.XK_Meta_R;\n }\n }\n\n // macOS has Clear instead of NumLock, but the remote system is\n // probably not macOS, so lying here is probably best...\n if (key === 'Clear') {\n let code = getKeycode(evt);\n if (code === 'NumLock') {\n return KeyTable.XK_Num_Lock;\n }\n }\n\n // Windows sends alternating symbols for some keys when using a\n // Japanese layout. We have no way of synchronising with the IM\n // running on the remote system, so we send some combined keysym\n // instead and hope for the best.\n if (browser.isWindows()) {\n switch (key) {\n case 'Zenkaku':\n case 'Hankaku':\n return KeyTable.XK_Zenkaku_Hankaku;\n case 'Romaji':\n case 'KanaMode':\n return KeyTable.XK_Romaji;\n }\n }\n\n return DOMKeyTable[key][location];\n }\n\n // Now we need to look at the Unicode symbol instead\n\n // Special key? (FIXME: Should have been caught earlier)\n if (key.length !== 1) {\n return null;\n }\n\n const codepoint = key.charCodeAt();\n if (codepoint) {\n return keysyms.lookup(codepoint);\n }\n\n return null;\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\nimport * as Log from '../util/logging.js';\nimport { stopEvent } from '../util/events.js';\nimport * as KeyboardUtil from \"./util.js\";\nimport KeyTable from \"./keysym.js\";\nimport * as browser from \"../util/browser.js\";\n\n//\n// Keyboard event handler\n//\n\nexport default class Keyboard {\n constructor(target) {\n this._target = target || null;\n\n this._keyDownList = {}; // List of depressed keys\n // (even if they are happy)\n this._altGrArmed = false; // Windows AltGr detection\n\n // keep these here so we can refer to them later\n this._eventHandlers = {\n 'keyup': this._handleKeyUp.bind(this),\n 'keydown': this._handleKeyDown.bind(this),\n 'blur': this._allKeysUp.bind(this),\n };\n\n // ===== EVENT HANDLERS =====\n\n this.onkeyevent = () => {}; // Handler for key press/release\n }\n\n // ===== PRIVATE METHODS =====\n\n _sendKeyEvent(keysym, code, down) {\n if (down) {\n this._keyDownList[code] = keysym;\n } else {\n // Do we really think this key is down?\n if (!(code in this._keyDownList)) {\n return;\n }\n delete this._keyDownList[code];\n }\n\n Log.Debug(\"onkeyevent \" + (down ? \"down\" : \"up\") +\n \", keysym: \" + keysym, \", code: \" + code);\n this.onkeyevent(keysym, code, down);\n }\n\n _getKeyCode(e) {\n const code = KeyboardUtil.getKeycode(e);\n if (code !== 'Unidentified') {\n return code;\n }\n\n // Unstable, but we don't have anything else to go on\n if (e.keyCode) {\n // 229 is used for composition events\n if (e.keyCode !== 229) {\n return 'Platform' + e.keyCode;\n }\n }\n\n // A precursor to the final DOM3 standard. Unfortunately it\n // is not layout independent, so it is as bad as using keyCode\n if (e.keyIdentifier) {\n // Non-character key?\n if (e.keyIdentifier.substr(0, 2) !== 'U+') {\n return e.keyIdentifier;\n }\n\n const codepoint = parseInt(e.keyIdentifier.substr(2), 16);\n const char = String.fromCharCode(codepoint).toUpperCase();\n\n return 'Platform' + char.charCodeAt();\n }\n\n return 'Unidentified';\n }\n\n _handleKeyDown(e) {\n const code = this._getKeyCode(e);\n let keysym = KeyboardUtil.getKeysym(e);\n\n // Windows doesn't have a proper AltGr, but handles it using\n // fake Ctrl+Alt. However the remote end might not be Windows,\n // so we need to merge those in to a single AltGr event. We\n // detect this case by seeing the two key events directly after\n // each other with a very short time between them (<50ms).\n if (this._altGrArmed) {\n this._altGrArmed = false;\n clearTimeout(this._altGrTimeout);\n\n if ((code === \"AltRight\") &&\n ((e.timeStamp - this._altGrCtrlTime) < 50)) {\n // FIXME: We fail to detect this if either Ctrl key is\n // first manually pressed as Windows then no\n // longer sends the fake Ctrl down event. It\n // does however happily send real Ctrl events\n // even when AltGr is already down. Some\n // browsers detect this for us though and set the\n // key to \"AltGraph\".\n keysym = KeyTable.XK_ISO_Level3_Shift;\n } else {\n this._sendKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n }\n }\n\n // We cannot handle keys we cannot track, but we also need\n // to deal with virtual keyboards which omit key info\n if (code === 'Unidentified') {\n if (keysym) {\n // If it's a virtual keyboard then it should be\n // sufficient to just send press and release right\n // after each other\n this._sendKeyEvent(keysym, code, true);\n this._sendKeyEvent(keysym, code, false);\n }\n\n stopEvent(e);\n return;\n }\n\n // Alt behaves more like AltGraph on macOS, so shuffle the\n // keys around a bit to make things more sane for the remote\n // server. This method is used by RealVNC and TigerVNC (and\n // possibly others).\n if (browser.isMac() || browser.isIOS()) {\n switch (keysym) {\n case KeyTable.XK_Super_L:\n keysym = KeyTable.XK_Alt_L;\n break;\n case KeyTable.XK_Super_R:\n keysym = KeyTable.XK_Super_L;\n break;\n case KeyTable.XK_Alt_L:\n keysym = KeyTable.XK_Mode_switch;\n break;\n case KeyTable.XK_Alt_R:\n keysym = KeyTable.XK_ISO_Level3_Shift;\n break;\n }\n }\n\n // Is this key already pressed? If so, then we must use the\n // same keysym or we'll confuse the server\n if (code in this._keyDownList) {\n keysym = this._keyDownList[code];\n }\n\n // macOS doesn't send proper key releases if a key is pressed\n // while meta is held down\n if ((browser.isMac() || browser.isIOS()) &&\n (e.metaKey && code !== 'MetaLeft' && code !== 'MetaRight')) {\n this._sendKeyEvent(keysym, code, true);\n this._sendKeyEvent(keysym, code, false);\n stopEvent(e);\n return;\n }\n\n // macOS doesn't send proper key events for modifiers, only\n // state change events. That gets extra confusing for CapsLock\n // which toggles on each press, but not on release. So pretend\n // it was a quick press and release of the button.\n if ((browser.isMac() || browser.isIOS()) && (code === 'CapsLock')) {\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true);\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false);\n stopEvent(e);\n return;\n }\n\n // Windows doesn't send proper key releases for a bunch of\n // Japanese IM keys so we have to fake the release right away\n const jpBadKeys = [ KeyTable.XK_Zenkaku_Hankaku,\n KeyTable.XK_Eisu_toggle,\n KeyTable.XK_Katakana,\n KeyTable.XK_Hiragana,\n KeyTable.XK_Romaji ];\n if (browser.isWindows() && jpBadKeys.includes(keysym)) {\n this._sendKeyEvent(keysym, code, true);\n this._sendKeyEvent(keysym, code, false);\n stopEvent(e);\n return;\n }\n\n stopEvent(e);\n\n // Possible start of AltGr sequence? (see above)\n if ((code === \"ControlLeft\") && browser.isWindows() &&\n !(\"ControlLeft\" in this._keyDownList)) {\n this._altGrArmed = true;\n this._altGrTimeout = setTimeout(this._handleAltGrTimeout.bind(this), 100);\n this._altGrCtrlTime = e.timeStamp;\n return;\n }\n\n this._sendKeyEvent(keysym, code, true);\n }\n\n _handleKeyUp(e) {\n stopEvent(e);\n\n const code = this._getKeyCode(e);\n\n // We can't get a release in the middle of an AltGr sequence, so\n // abort that detection\n if (this._altGrArmed) {\n this._altGrArmed = false;\n clearTimeout(this._altGrTimeout);\n this._sendKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n }\n\n // See comment in _handleKeyDown()\n if ((browser.isMac() || browser.isIOS()) && (code === 'CapsLock')) {\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true);\n this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false);\n return;\n }\n\n this._sendKeyEvent(this._keyDownList[code], code, false);\n\n // Windows has a rather nasty bug where it won't send key\n // release events for a Shift button if the other Shift is still\n // pressed\n if (browser.isWindows() && ((code === 'ShiftLeft') ||\n (code === 'ShiftRight'))) {\n if ('ShiftRight' in this._keyDownList) {\n this._sendKeyEvent(this._keyDownList['ShiftRight'],\n 'ShiftRight', false);\n }\n if ('ShiftLeft' in this._keyDownList) {\n this._sendKeyEvent(this._keyDownList['ShiftLeft'],\n 'ShiftLeft', false);\n }\n }\n }\n\n _handleAltGrTimeout() {\n this._altGrArmed = false;\n clearTimeout(this._altGrTimeout);\n this._sendKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n }\n\n _allKeysUp() {\n Log.Debug(\">> Keyboard.allKeysUp\");\n for (let code in this._keyDownList) {\n this._sendKeyEvent(this._keyDownList[code], code, false);\n }\n Log.Debug(\"<< Keyboard.allKeysUp\");\n }\n\n // ===== PUBLIC METHODS =====\n\n grab() {\n //Log.Debug(\">> Keyboard.grab\");\n\n this._target.addEventListener('keydown', this._eventHandlers.keydown);\n this._target.addEventListener('keyup', this._eventHandlers.keyup);\n\n // Release (key up) if window loses focus\n window.addEventListener('blur', this._eventHandlers.blur);\n\n //Log.Debug(\"<< Keyboard.grab\");\n }\n\n ungrab() {\n //Log.Debug(\">> Keyboard.ungrab\");\n\n this._target.removeEventListener('keydown', this._eventHandlers.keydown);\n this._target.removeEventListener('keyup', this._eventHandlers.keyup);\n window.removeEventListener('blur', this._eventHandlers.blur);\n\n // Release (key up) all keys that are in a down state\n this._allKeysUp();\n\n //Log.Debug(\">> Keyboard.ungrab\");\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nconst GH_NOGESTURE = 0;\nconst GH_ONETAP = 1;\nconst GH_TWOTAP = 2;\nconst GH_THREETAP = 4;\nconst GH_DRAG = 8;\nconst GH_LONGPRESS = 16;\nconst GH_TWODRAG = 32;\nconst GH_PINCH = 64;\n\nconst GH_INITSTATE = 127;\n\nconst GH_MOVE_THRESHOLD = 50;\nconst GH_ANGLE_THRESHOLD = 90; // Degrees\n\n// Timeout when waiting for gestures (ms)\nconst GH_MULTITOUCH_TIMEOUT = 250;\n\n// Maximum time between press and release for a tap (ms)\nconst GH_TAP_TIMEOUT = 1000;\n\n// Timeout when waiting for longpress (ms)\nconst GH_LONGPRESS_TIMEOUT = 1000;\n\n// Timeout when waiting to decide between PINCH and TWODRAG (ms)\nconst GH_TWOTOUCH_TIMEOUT = 50;\n\nexport default class GestureHandler {\n constructor() {\n this._target = null;\n\n this._state = GH_INITSTATE;\n\n this._tracked = [];\n this._ignored = [];\n\n this._waitingRelease = false;\n this._releaseStart = 0.0;\n\n this._longpressTimeoutId = null;\n this._twoTouchTimeoutId = null;\n\n this._boundEventHandler = this._eventHandler.bind(this);\n }\n\n attach(target) {\n this.detach();\n\n this._target = target;\n this._target.addEventListener('touchstart',\n this._boundEventHandler);\n this._target.addEventListener('touchmove',\n this._boundEventHandler);\n this._target.addEventListener('touchend',\n this._boundEventHandler);\n this._target.addEventListener('touchcancel',\n this._boundEventHandler);\n }\n\n detach() {\n if (!this._target) {\n return;\n }\n\n this._stopLongpressTimeout();\n this._stopTwoTouchTimeout();\n\n this._target.removeEventListener('touchstart',\n this._boundEventHandler);\n this._target.removeEventListener('touchmove',\n this._boundEventHandler);\n this._target.removeEventListener('touchend',\n this._boundEventHandler);\n this._target.removeEventListener('touchcancel',\n this._boundEventHandler);\n this._target = null;\n }\n\n _eventHandler(e) {\n let fn;\n\n e.stopPropagation();\n e.preventDefault();\n\n switch (e.type) {\n case 'touchstart':\n fn = this._touchStart;\n break;\n case 'touchmove':\n fn = this._touchMove;\n break;\n case 'touchend':\n case 'touchcancel':\n fn = this._touchEnd;\n break;\n }\n\n for (let i = 0; i < e.changedTouches.length; i++) {\n let touch = e.changedTouches[i];\n fn.call(this, touch.identifier, touch.clientX, touch.clientY);\n }\n }\n\n _touchStart(id, x, y) {\n // Ignore any new touches if there is already an active gesture,\n // or we're in a cleanup state\n if (this._hasDetectedGesture() || (this._state === GH_NOGESTURE)) {\n this._ignored.push(id);\n return;\n }\n\n // Did it take too long between touches that we should no longer\n // consider this a single gesture?\n if ((this._tracked.length > 0) &&\n ((Date.now() - this._tracked[0].started) > GH_MULTITOUCH_TIMEOUT)) {\n this._state = GH_NOGESTURE;\n this._ignored.push(id);\n return;\n }\n\n // If we're waiting for fingers to release then we should no longer\n // recognize new touches\n if (this._waitingRelease) {\n this._state = GH_NOGESTURE;\n this._ignored.push(id);\n return;\n }\n\n this._tracked.push({\n id: id,\n started: Date.now(),\n active: true,\n firstX: x,\n firstY: y,\n lastX: x,\n lastY: y,\n angle: 0\n });\n\n switch (this._tracked.length) {\n case 1:\n this._startLongpressTimeout();\n break;\n\n case 2:\n this._state &= ~(GH_ONETAP | GH_DRAG | GH_LONGPRESS);\n this._stopLongpressTimeout();\n break;\n\n case 3:\n this._state &= ~(GH_TWOTAP | GH_TWODRAG | GH_PINCH);\n break;\n\n default:\n this._state = GH_NOGESTURE;\n }\n }\n\n _touchMove(id, x, y) {\n let touch = this._tracked.find(t => t.id === id);\n\n // If this is an update for a touch we're not tracking, ignore it\n if (touch === undefined) {\n return;\n }\n\n // Update the touches last position with the event coordinates\n touch.lastX = x;\n touch.lastY = y;\n\n let deltaX = x - touch.firstX;\n let deltaY = y - touch.firstY;\n\n // Update angle when the touch has moved\n if ((touch.firstX !== touch.lastX) ||\n (touch.firstY !== touch.lastY)) {\n touch.angle = Math.atan2(deltaY, deltaX) * 180 / Math.PI;\n }\n\n if (!this._hasDetectedGesture()) {\n // Ignore moves smaller than the minimum threshold\n if (Math.hypot(deltaX, deltaY) < GH_MOVE_THRESHOLD) {\n return;\n }\n\n // Can't be a tap or long press as we've seen movement\n this._state &= ~(GH_ONETAP | GH_TWOTAP | GH_THREETAP | GH_LONGPRESS);\n this._stopLongpressTimeout();\n\n if (this._tracked.length !== 1) {\n this._state &= ~(GH_DRAG);\n }\n if (this._tracked.length !== 2) {\n this._state &= ~(GH_TWODRAG | GH_PINCH);\n }\n\n // We need to figure out which of our different two touch gestures\n // this might be\n if (this._tracked.length === 2) {\n\n // The other touch is the one where the id doesn't match\n let prevTouch = this._tracked.find(t => t.id !== id);\n\n // How far the previous touch point has moved since start\n let prevDeltaMove = Math.hypot(prevTouch.firstX - prevTouch.lastX,\n prevTouch.firstY - prevTouch.lastY);\n\n // We know that the current touch moved far enough,\n // but unless both touches moved further than their\n // threshold we don't want to disqualify any gestures\n if (prevDeltaMove > GH_MOVE_THRESHOLD) {\n\n // The angle difference between the direction of the touch points\n let deltaAngle = Math.abs(touch.angle - prevTouch.angle);\n deltaAngle = Math.abs(((deltaAngle + 180) % 360) - 180);\n\n // PINCH or TWODRAG can be eliminated depending on the angle\n if (deltaAngle > GH_ANGLE_THRESHOLD) {\n this._state &= ~GH_TWODRAG;\n } else {\n this._state &= ~GH_PINCH;\n }\n\n if (this._isTwoTouchTimeoutRunning()) {\n this._stopTwoTouchTimeout();\n }\n } else if (!this._isTwoTouchTimeoutRunning()) {\n // We can't determine the gesture right now, let's\n // wait and see if more events are on their way\n this._startTwoTouchTimeout();\n }\n }\n\n if (!this._hasDetectedGesture()) {\n return;\n }\n\n this._pushEvent('gesturestart');\n }\n\n this._pushEvent('gesturemove');\n }\n\n _touchEnd(id, x, y) {\n // Check if this is an ignored touch\n if (this._ignored.indexOf(id) !== -1) {\n // Remove this touch from ignored\n this._ignored.splice(this._ignored.indexOf(id), 1);\n\n // And reset the state if there are no more touches\n if ((this._ignored.length === 0) &&\n (this._tracked.length === 0)) {\n this._state = GH_INITSTATE;\n this._waitingRelease = false;\n }\n return;\n }\n\n // We got a touchend before the timer triggered,\n // this cannot result in a gesture anymore.\n if (!this._hasDetectedGesture() &&\n this._isTwoTouchTimeoutRunning()) {\n this._stopTwoTouchTimeout();\n this._state = GH_NOGESTURE;\n }\n\n // Some gestures don't trigger until a touch is released\n if (!this._hasDetectedGesture()) {\n // Can't be a gesture that relies on movement\n this._state &= ~(GH_DRAG | GH_TWODRAG | GH_PINCH);\n // Or something that relies on more time\n this._state &= ~GH_LONGPRESS;\n this._stopLongpressTimeout();\n\n if (!this._waitingRelease) {\n this._releaseStart = Date.now();\n this._waitingRelease = true;\n\n // Can't be a tap that requires more touches than we current have\n switch (this._tracked.length) {\n case 1:\n this._state &= ~(GH_TWOTAP | GH_THREETAP);\n break;\n\n case 2:\n this._state &= ~(GH_ONETAP | GH_THREETAP);\n break;\n }\n }\n }\n\n // Waiting for all touches to release? (i.e. some tap)\n if (this._waitingRelease) {\n // Were all touches released at roughly the same time?\n if ((Date.now() - this._releaseStart) > GH_MULTITOUCH_TIMEOUT) {\n this._state = GH_NOGESTURE;\n }\n\n // Did too long time pass between press and release?\n if (this._tracked.some(t => (Date.now() - t.started) > GH_TAP_TIMEOUT)) {\n this._state = GH_NOGESTURE;\n }\n\n let touch = this._tracked.find(t => t.id === id);\n touch.active = false;\n\n // Are we still waiting for more releases?\n if (this._hasDetectedGesture()) {\n this._pushEvent('gesturestart');\n } else {\n // Have we reached a dead end?\n if (this._state !== GH_NOGESTURE) {\n return;\n }\n }\n }\n\n if (this._hasDetectedGesture()) {\n this._pushEvent('gestureend');\n }\n\n // Ignore any remaining touches until they are ended\n for (let i = 0; i < this._tracked.length; i++) {\n if (this._tracked[i].active) {\n this._ignored.push(this._tracked[i].id);\n }\n }\n this._tracked = [];\n\n this._state = GH_NOGESTURE;\n\n // Remove this touch from ignored if it's in there\n if (this._ignored.indexOf(id) !== -1) {\n this._ignored.splice(this._ignored.indexOf(id), 1);\n }\n\n // We reset the state if ignored is empty\n if ((this._ignored.length === 0)) {\n this._state = GH_INITSTATE;\n this._waitingRelease = false;\n }\n }\n\n _hasDetectedGesture() {\n if (this._state === GH_NOGESTURE) {\n return false;\n }\n // Check to see if the bitmask value is a power of 2\n // (i.e. only one bit set). If it is, we have a state.\n if (this._state & (this._state - 1)) {\n return false;\n }\n\n // For taps we also need to have all touches released\n // before we've fully detected the gesture\n if (this._state & (GH_ONETAP | GH_TWOTAP | GH_THREETAP)) {\n if (this._tracked.some(t => t.active)) {\n return false;\n }\n }\n\n return true;\n }\n\n _startLongpressTimeout() {\n this._stopLongpressTimeout();\n this._longpressTimeoutId = setTimeout(() => this._longpressTimeout(),\n GH_LONGPRESS_TIMEOUT);\n }\n\n _stopLongpressTimeout() {\n clearTimeout(this._longpressTimeoutId);\n this._longpressTimeoutId = null;\n }\n\n _longpressTimeout() {\n if (this._hasDetectedGesture()) {\n throw new Error(\"A longpress gesture failed, conflict with a different gesture\");\n }\n\n this._state = GH_LONGPRESS;\n this._pushEvent('gesturestart');\n }\n\n _startTwoTouchTimeout() {\n this._stopTwoTouchTimeout();\n this._twoTouchTimeoutId = setTimeout(() => this._twoTouchTimeout(),\n GH_TWOTOUCH_TIMEOUT);\n }\n\n _stopTwoTouchTimeout() {\n clearTimeout(this._twoTouchTimeoutId);\n this._twoTouchTimeoutId = null;\n }\n\n _isTwoTouchTimeoutRunning() {\n return this._twoTouchTimeoutId !== null;\n }\n\n _twoTouchTimeout() {\n if (this._tracked.length === 0) {\n throw new Error(\"A pinch or two drag gesture failed, no tracked touches\");\n }\n\n // How far each touch point has moved since start\n let avgM = this._getAverageMovement();\n let avgMoveH = Math.abs(avgM.x);\n let avgMoveV = Math.abs(avgM.y);\n\n // The difference in the distance between where\n // the touch points started and where they are now\n let avgD = this._getAverageDistance();\n let deltaTouchDistance = Math.abs(Math.hypot(avgD.first.x, avgD.first.y) -\n Math.hypot(avgD.last.x, avgD.last.y));\n\n if ((avgMoveV < deltaTouchDistance) &&\n (avgMoveH < deltaTouchDistance)) {\n this._state = GH_PINCH;\n } else {\n this._state = GH_TWODRAG;\n }\n\n this._pushEvent('gesturestart');\n this._pushEvent('gesturemove');\n }\n\n _pushEvent(type) {\n let detail = { type: this._stateToGesture(this._state) };\n\n // For most gesture events the current (average) position is the\n // most useful\n let avg = this._getPosition();\n let pos = avg.last;\n\n // However we have a slight distance to detect gestures, so for the\n // first gesture event we want to use the first positions we saw\n if (type === 'gesturestart') {\n pos = avg.first;\n }\n\n // For these gestures, we always want the event coordinates\n // to be where the gesture began, not the current touch location.\n switch (this._state) {\n case GH_TWODRAG:\n case GH_PINCH:\n pos = avg.first;\n break;\n }\n\n detail['clientX'] = pos.x;\n detail['clientY'] = pos.y;\n\n // FIXME: other coordinates?\n\n // Some gestures also have a magnitude\n if (this._state === GH_PINCH) {\n let distance = this._getAverageDistance();\n if (type === 'gesturestart') {\n detail['magnitudeX'] = distance.first.x;\n detail['magnitudeY'] = distance.first.y;\n } else {\n detail['magnitudeX'] = distance.last.x;\n detail['magnitudeY'] = distance.last.y;\n }\n } else if (this._state === GH_TWODRAG) {\n if (type === 'gesturestart') {\n detail['magnitudeX'] = 0.0;\n detail['magnitudeY'] = 0.0;\n } else {\n let movement = this._getAverageMovement();\n detail['magnitudeX'] = movement.x;\n detail['magnitudeY'] = movement.y;\n }\n }\n\n let gev = new CustomEvent(type, { detail: detail });\n this._target.dispatchEvent(gev);\n }\n\n _stateToGesture(state) {\n switch (state) {\n case GH_ONETAP:\n return 'onetap';\n case GH_TWOTAP:\n return 'twotap';\n case GH_THREETAP:\n return 'threetap';\n case GH_DRAG:\n return 'drag';\n case GH_LONGPRESS:\n return 'longpress';\n case GH_TWODRAG:\n return 'twodrag';\n case GH_PINCH:\n return 'pinch';\n }\n\n throw new Error(\"Unknown gesture state: \" + state);\n }\n\n _getPosition() {\n if (this._tracked.length === 0) {\n throw new Error(\"Failed to get gesture position, no tracked touches\");\n }\n\n let size = this._tracked.length;\n let fx = 0, fy = 0, lx = 0, ly = 0;\n\n for (let i = 0; i < this._tracked.length; i++) {\n fx += this._tracked[i].firstX;\n fy += this._tracked[i].firstY;\n lx += this._tracked[i].lastX;\n ly += this._tracked[i].lastY;\n }\n\n return { first: { x: fx / size,\n y: fy / size },\n last: { x: lx / size,\n y: ly / size } };\n }\n\n _getAverageMovement() {\n if (this._tracked.length === 0) {\n throw new Error(\"Failed to get gesture movement, no tracked touches\");\n }\n\n let totalH, totalV;\n totalH = totalV = 0;\n let size = this._tracked.length;\n\n for (let i = 0; i < this._tracked.length; i++) {\n totalH += this._tracked[i].lastX - this._tracked[i].firstX;\n totalV += this._tracked[i].lastY - this._tracked[i].firstY;\n }\n\n return { x: totalH / size,\n y: totalV / size };\n }\n\n _getAverageDistance() {\n if (this._tracked.length === 0) {\n throw new Error(\"Failed to get gesture distance, no tracked touches\");\n }\n\n // Distance between the first and last tracked touches\n\n let first = this._tracked[0];\n let last = this._tracked[this._tracked.length - 1];\n\n let fdx = Math.abs(last.firstX - first.firstX);\n let fdy = Math.abs(last.firstY - first.firstY);\n\n let ldx = Math.abs(last.lastX - first.lastX);\n let ldy = Math.abs(last.lastY - first.lastY);\n\n return { first: { x: fdx, y: fdy },\n last: { x: ldx, y: ldy } };\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 or any later version (see LICENSE.txt)\n */\n\nimport { supportsCursorURIs, isTouchDevice } from './browser.js';\n\nconst useFallback = !supportsCursorURIs || isTouchDevice;\n\nexport default class Cursor {\n constructor() {\n this._target = null;\n\n this._canvas = document.createElement('canvas');\n\n if (useFallback) {\n this._canvas.style.position = 'fixed';\n this._canvas.style.zIndex = '65535';\n this._canvas.style.pointerEvents = 'none';\n // Safari on iOS can select the cursor image\n // https://bugs.webkit.org/show_bug.cgi?id=249223\n this._canvas.style.userSelect = 'none';\n this._canvas.style.WebkitUserSelect = 'none';\n // Can't use \"display\" because of Firefox bug #1445997\n this._canvas.style.visibility = 'hidden';\n }\n\n this._position = { x: 0, y: 0 };\n this._hotSpot = { x: 0, y: 0 };\n\n this._eventHandlers = {\n 'mouseover': this._handleMouseOver.bind(this),\n 'mouseleave': this._handleMouseLeave.bind(this),\n 'mousemove': this._handleMouseMove.bind(this),\n 'mouseup': this._handleMouseUp.bind(this),\n };\n }\n\n attach(target) {\n if (this._target) {\n this.detach();\n }\n\n this._target = target;\n\n if (useFallback) {\n document.body.appendChild(this._canvas);\n\n const options = { capture: true, passive: true };\n this._target.addEventListener('mouseover', this._eventHandlers.mouseover, options);\n this._target.addEventListener('mouseleave', this._eventHandlers.mouseleave, options);\n this._target.addEventListener('mousemove', this._eventHandlers.mousemove, options);\n this._target.addEventListener('mouseup', this._eventHandlers.mouseup, options);\n }\n\n this.clear();\n }\n\n detach() {\n if (!this._target) {\n return;\n }\n\n if (useFallback) {\n const options = { capture: true, passive: true };\n this._target.removeEventListener('mouseover', this._eventHandlers.mouseover, options);\n this._target.removeEventListener('mouseleave', this._eventHandlers.mouseleave, options);\n this._target.removeEventListener('mousemove', this._eventHandlers.mousemove, options);\n this._target.removeEventListener('mouseup', this._eventHandlers.mouseup, options);\n\n document.body.removeChild(this._canvas);\n }\n\n this._target = null;\n }\n\n change(rgba, hotx, hoty, w, h) {\n if ((w === 0) || (h === 0)) {\n this.clear();\n return;\n }\n\n this._position.x = this._position.x + this._hotSpot.x - hotx;\n this._position.y = this._position.y + this._hotSpot.y - hoty;\n this._hotSpot.x = hotx;\n this._hotSpot.y = hoty;\n\n let ctx = this._canvas.getContext('2d');\n\n this._canvas.width = w;\n this._canvas.height = h;\n\n let img = new ImageData(new Uint8ClampedArray(rgba), w, h);\n ctx.clearRect(0, 0, w, h);\n ctx.putImageData(img, 0, 0);\n\n if (useFallback) {\n this._updatePosition();\n } else {\n let url = this._canvas.toDataURL();\n this._target.style.cursor = 'url(' + url + ')' + hotx + ' ' + hoty + ', default';\n }\n }\n\n clear() {\n this._target.style.cursor = 'none';\n this._canvas.width = 0;\n this._canvas.height = 0;\n this._position.x = this._position.x + this._hotSpot.x;\n this._position.y = this._position.y + this._hotSpot.y;\n this._hotSpot.x = 0;\n this._hotSpot.y = 0;\n }\n\n // Mouse events might be emulated, this allows\n // moving the cursor in such cases\n move(clientX, clientY) {\n if (!useFallback) {\n return;\n }\n // clientX/clientY are relative the _visual viewport_,\n // but our position is relative the _layout viewport_,\n // so try to compensate when we can\n if (window.visualViewport) {\n this._position.x = clientX + window.visualViewport.offsetLeft;\n this._position.y = clientY + window.visualViewport.offsetTop;\n } else {\n this._position.x = clientX;\n this._position.y = clientY;\n }\n this._updatePosition();\n let target = document.elementFromPoint(clientX, clientY);\n this._updateVisibility(target);\n }\n\n _handleMouseOver(event) {\n // This event could be because we're entering the target, or\n // moving around amongst its sub elements. Let the move handler\n // sort things out.\n this._handleMouseMove(event);\n }\n\n _handleMouseLeave(event) {\n // Check if we should show the cursor on the element we are leaving to\n this._updateVisibility(event.relatedTarget);\n }\n\n _handleMouseMove(event) {\n this._updateVisibility(event.target);\n\n this._position.x = event.clientX - this._hotSpot.x;\n this._position.y = event.clientY - this._hotSpot.y;\n\n this._updatePosition();\n }\n\n _handleMouseUp(event) {\n // We might get this event because of a drag operation that\n // moved outside of the target. Check what's under the cursor\n // now and adjust visibility based on that.\n let target = document.elementFromPoint(event.clientX, event.clientY);\n this._updateVisibility(target);\n\n // Captures end with a mouseup but we can't know the event order of\n // mouseup vs releaseCapture.\n //\n // In the cases when releaseCapture comes first, the code above is\n // enough.\n //\n // In the cases when the mouseup comes first, we need wait for the\n // browser to flush all events and then check again if the cursor\n // should be visible.\n if (this._captureIsActive()) {\n window.setTimeout(() => {\n // We might have detached at this point\n if (!this._target) {\n return;\n }\n // Refresh the target from elementFromPoint since queued events\n // might have altered the DOM\n target = document.elementFromPoint(event.clientX,\n event.clientY);\n this._updateVisibility(target);\n }, 0);\n }\n }\n\n _showCursor() {\n if (this._canvas.style.visibility === 'hidden') {\n this._canvas.style.visibility = '';\n }\n }\n\n _hideCursor() {\n if (this._canvas.style.visibility !== 'hidden') {\n this._canvas.style.visibility = 'hidden';\n }\n }\n\n // Should we currently display the cursor?\n // (i.e. are we over the target, or a child of the target without a\n // different cursor set)\n _shouldShowCursor(target) {\n if (!target) {\n return false;\n }\n // Easy case\n if (target === this._target) {\n return true;\n }\n // Other part of the DOM?\n if (!this._target.contains(target)) {\n return false;\n }\n // Has the child its own cursor?\n // FIXME: How can we tell that a sub element has an\n // explicit \"cursor: none;\"?\n if (window.getComputedStyle(target).cursor !== 'none') {\n return false;\n }\n return true;\n }\n\n _updateVisibility(target) {\n // When the cursor target has capture we want to show the cursor.\n // So, if a capture is active - look at the captured element instead.\n if (this._captureIsActive()) {\n target = document.captureElement;\n }\n if (this._shouldShowCursor(target)) {\n this._showCursor();\n } else {\n this._hideCursor();\n }\n }\n\n _updatePosition() {\n this._canvas.style.left = this._position.x + \"px\";\n this._canvas.style.top = this._position.y + \"px\";\n }\n\n _captureIsActive() {\n return document.captureElement &&\n document.documentElement.contains(document.captureElement);\n }\n}\n","/*\n * Websock: high-performance buffering wrapper\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * Websock is similar to the standard WebSocket / RTCDataChannel object\n * but with extra buffer handling.\n *\n * Websock has built-in receive queue buffering; the message event\n * does not contain actual data but is simply a notification that\n * there is new data available. Several rQ* methods are available to\n * read binary data off of the receive queue.\n */\n\nimport * as Log from './util/logging.js';\n\n// this has performance issues in some versions Chromium, and\n// doesn't gain a tremendous amount of performance increase in Firefox\n// at the moment. It may be valuable to turn it on in the future.\nconst MAX_RQ_GROW_SIZE = 40 * 1024 * 1024; // 40 MiB\n\n// Constants pulled from RTCDataChannelState enum\n// https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState#RTCDataChannelState_enum\nconst DataChannel = {\n CONNECTING: \"connecting\",\n OPEN: \"open\",\n CLOSING: \"closing\",\n CLOSED: \"closed\"\n};\n\nconst ReadyStates = {\n CONNECTING: [WebSocket.CONNECTING, DataChannel.CONNECTING],\n OPEN: [WebSocket.OPEN, DataChannel.OPEN],\n CLOSING: [WebSocket.CLOSING, DataChannel.CLOSING],\n CLOSED: [WebSocket.CLOSED, DataChannel.CLOSED],\n};\n\n// Properties a raw channel must have, WebSocket and RTCDataChannel are two examples\nconst rawChannelProps = [\n \"send\",\n \"close\",\n \"binaryType\",\n \"onerror\",\n \"onmessage\",\n \"onopen\",\n \"protocol\",\n \"readyState\",\n];\n\nexport default class Websock {\n constructor() {\n this._websocket = null; // WebSocket or RTCDataChannel object\n\n this._rQi = 0; // Receive queue index\n this._rQlen = 0; // Next write position in the receive queue\n this._rQbufferSize = 1024 * 1024 * 4; // Receive queue buffer size (4 MiB)\n // called in init: this._rQ = new Uint8Array(this._rQbufferSize);\n this._rQ = null; // Receive queue\n\n this._sQbufferSize = 1024 * 10; // 10 KiB\n // called in init: this._sQ = new Uint8Array(this._sQbufferSize);\n this._sQlen = 0;\n this._sQ = null; // Send queue\n\n this._eventHandlers = {\n message: () => {},\n open: () => {},\n close: () => {},\n error: () => {}\n };\n }\n\n // Getters and Setters\n\n get readyState() {\n let subState;\n\n if (this._websocket === null) {\n return \"unused\";\n }\n\n subState = this._websocket.readyState;\n\n if (ReadyStates.CONNECTING.includes(subState)) {\n return \"connecting\";\n } else if (ReadyStates.OPEN.includes(subState)) {\n return \"open\";\n } else if (ReadyStates.CLOSING.includes(subState)) {\n return \"closing\";\n } else if (ReadyStates.CLOSED.includes(subState)) {\n return \"closed\";\n }\n\n return \"unknown\";\n }\n\n get sQ() {\n return this._sQ;\n }\n\n get rQ() {\n return this._rQ;\n }\n\n get rQi() {\n return this._rQi;\n }\n\n set rQi(val) {\n this._rQi = val;\n }\n\n // Receive Queue\n get rQlen() {\n return this._rQlen - this._rQi;\n }\n\n rQpeek8() {\n return this._rQ[this._rQi];\n }\n\n rQskipBytes(bytes) {\n this._rQi += bytes;\n }\n\n rQshift8() {\n return this._rQshift(1);\n }\n\n rQshift16() {\n return this._rQshift(2);\n }\n\n rQshift32() {\n return this._rQshift(4);\n }\n\n // TODO(directxman12): test performance with these vs a DataView\n _rQshift(bytes) {\n let res = 0;\n for (let byte = bytes - 1; byte >= 0; byte--) {\n res += this._rQ[this._rQi++] << (byte * 8);\n }\n return res;\n }\n\n rQshiftStr(len) {\n if (typeof(len) === 'undefined') { len = this.rQlen; }\n let str = \"\";\n // Handle large arrays in steps to avoid long strings on the stack\n for (let i = 0; i < len; i += 4096) {\n let part = this.rQshiftBytes(Math.min(4096, len - i));\n str += String.fromCharCode.apply(null, part);\n }\n return str;\n }\n\n rQshiftBytes(len) {\n if (typeof(len) === 'undefined') { len = this.rQlen; }\n this._rQi += len;\n return new Uint8Array(this._rQ.buffer, this._rQi - len, len);\n }\n\n rQshiftTo(target, len) {\n if (len === undefined) { len = this.rQlen; }\n // TODO: make this just use set with views when using a ArrayBuffer to store the rQ\n target.set(new Uint8Array(this._rQ.buffer, this._rQi, len));\n this._rQi += len;\n }\n\n rQslice(start, end = this.rQlen) {\n return new Uint8Array(this._rQ.buffer, this._rQi + start, end - start);\n }\n\n // Check to see if we must wait for 'num' bytes (default to FBU.bytes)\n // to be available in the receive queue. Return true if we need to\n // wait (and possibly print a debug message), otherwise false.\n rQwait(msg, num, goback) {\n if (this.rQlen < num) {\n if (goback) {\n if (this._rQi < goback) {\n throw new Error(\"rQwait cannot backup \" + goback + \" bytes\");\n }\n this._rQi -= goback;\n }\n return true; // true means need more data\n }\n return false;\n }\n\n // Send Queue\n\n flush() {\n if (this._sQlen > 0 && this.readyState === 'open') {\n this._websocket.send(this._encodeMessage());\n this._sQlen = 0;\n }\n }\n\n send(arr) {\n this._sQ.set(arr, this._sQlen);\n this._sQlen += arr.length;\n this.flush();\n }\n\n sendString(str) {\n this.send(str.split('').map(chr => chr.charCodeAt(0)));\n }\n\n // Event Handlers\n off(evt) {\n this._eventHandlers[evt] = () => {};\n }\n\n on(evt, handler) {\n this._eventHandlers[evt] = handler;\n }\n\n _allocateBuffers() {\n this._rQ = new Uint8Array(this._rQbufferSize);\n this._sQ = new Uint8Array(this._sQbufferSize);\n }\n\n init() {\n this._allocateBuffers();\n this._rQi = 0;\n this._websocket = null;\n }\n\n open(uri, protocols) {\n this.attach(new WebSocket(uri, protocols));\n }\n\n attach(rawChannel) {\n this.init();\n\n // Must get object and class methods to be compatible with the tests.\n const channelProps = [...Object.keys(rawChannel), ...Object.getOwnPropertyNames(Object.getPrototypeOf(rawChannel))];\n for (let i = 0; i < rawChannelProps.length; i++) {\n const prop = rawChannelProps[i];\n if (channelProps.indexOf(prop) < 0) {\n throw new Error('Raw channel missing property: ' + prop);\n }\n }\n\n this._websocket = rawChannel;\n this._websocket.binaryType = \"arraybuffer\";\n this._websocket.onmessage = this._recvMessage.bind(this);\n\n this._websocket.onopen = () => {\n Log.Debug('>> WebSock.onopen');\n if (this._websocket.protocol) {\n Log.Info(\"Server choose sub-protocol: \" + this._websocket.protocol);\n }\n\n this._eventHandlers.open();\n Log.Debug(\"<< WebSock.onopen\");\n };\n\n this._websocket.onclose = (e) => {\n Log.Debug(\">> WebSock.onclose\");\n this._eventHandlers.close(e);\n Log.Debug(\"<< WebSock.onclose\");\n };\n\n this._websocket.onerror = (e) => {\n Log.Debug(\">> WebSock.onerror: \" + e);\n this._eventHandlers.error(e);\n Log.Debug(\"<< WebSock.onerror: \" + e);\n };\n }\n\n close() {\n if (this._websocket) {\n if (this.readyState === 'connecting' ||\n this.readyState === 'open') {\n Log.Info(\"Closing WebSocket connection\");\n this._websocket.close();\n }\n\n this._websocket.onmessage = () => {};\n }\n }\n\n // private methods\n _encodeMessage() {\n // Put in a binary arraybuffer\n // according to the spec, you can send ArrayBufferViews with the send method\n return new Uint8Array(this._sQ.buffer, 0, this._sQlen);\n }\n\n // We want to move all the unread data to the start of the queue,\n // e.g. compacting.\n // The function also expands the receive que if needed, and for\n // performance reasons we combine these two actions to avoid\n // unneccessary copying.\n _expandCompactRQ(minFit) {\n // if we're using less than 1/8th of the buffer even with the incoming bytes, compact in place\n // instead of resizing\n const requiredBufferSize = (this._rQlen - this._rQi + minFit) * 8;\n const resizeNeeded = this._rQbufferSize < requiredBufferSize;\n\n if (resizeNeeded) {\n // Make sure we always *at least* double the buffer size, and have at least space for 8x\n // the current amount of data\n this._rQbufferSize = Math.max(this._rQbufferSize * 2, requiredBufferSize);\n }\n\n // we don't want to grow unboundedly\n if (this._rQbufferSize > MAX_RQ_GROW_SIZE) {\n this._rQbufferSize = MAX_RQ_GROW_SIZE;\n if (this._rQbufferSize - this.rQlen < minFit) {\n throw new Error(\"Receive Queue buffer exceeded \" + MAX_RQ_GROW_SIZE + \" bytes, and the new message could not fit\");\n }\n }\n\n if (resizeNeeded) {\n const oldRQbuffer = this._rQ.buffer;\n this._rQ = new Uint8Array(this._rQbufferSize);\n this._rQ.set(new Uint8Array(oldRQbuffer, this._rQi, this._rQlen - this._rQi));\n } else {\n this._rQ.copyWithin(0, this._rQi, this._rQlen);\n }\n\n this._rQlen = this._rQlen - this._rQi;\n this._rQi = 0;\n }\n\n // push arraybuffer values onto the end of the receive que\n _DecodeMessage(data) {\n const u8 = new Uint8Array(data);\n if (u8.length > this._rQbufferSize - this._rQlen) {\n this._expandCompactRQ(u8.length);\n }\n this._rQ.set(u8, this._rQlen);\n this._rQlen += u8.length;\n }\n\n _recvMessage(e) {\n this._DecodeMessage(e.data);\n if (this.rQlen > 0) {\n this._eventHandlers.message();\n if (this._rQlen == this._rQi) {\n // All data has now been processed, this means we\n // can reset the receive queue.\n this._rQlen = 0;\n this._rQi = 0;\n }\n } else {\n Log.Debug(\"Ignoring empty message\");\n }\n }\n}\n","/*\n * Ported from Flashlight VNC ActionScript implementation:\n * http://www.wizhelp.com/flashlight-vnc/\n *\n * Full attribution follows:\n *\n * -------------------------------------------------------------------------\n *\n * This DES class has been extracted from package Acme.Crypto for use in VNC.\n * The unnecessary odd parity code has been removed.\n *\n * These changes are:\n * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n *\n\n * DesCipher - the DES encryption method\n *\n * The meat of this code is by Dave Zimmerman , and is:\n *\n * Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved.\n *\n * Permission to use, copy, modify, and distribute this software\n * and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and\n * without fee is hereby granted, provided that this copyright notice is kept\n * intact.\n *\n * WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY\n * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE\n * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR\n * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.\n *\n * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE\n * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE\n * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT\n * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE\n * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE\n * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE\n * PHYSICAL OR ENVIRONMENTAL DAMAGE (\"HIGH RISK ACTIVITIES\"). WIDGET WORKSHOP\n * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR\n * HIGH RISK ACTIVITIES.\n *\n *\n * The rest is:\n *\n * Copyright (C) 1996 by Jef Poskanzer . All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * Visit the ACME Labs Java page for up-to-date versions of this and other\n * fine Java utilities: http://www.acme.com/java/\n */\n\n/* eslint-disable comma-spacing */\n\n// Tables, permutations, S-boxes, etc.\nconst PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3,\n 25, 7,15, 6,26,19,12, 1,40,51,30,36,46,54,29,39,\n 50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ],\n totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28];\n\nconst z = 0x0;\nlet a,b,c,d,e,f;\na=1<<16; b=1<<24; c=a|b; d=1<<2; e=1<<10; f=d|e;\nconst SP1 = [c|e,z|z,a|z,c|f,c|d,a|f,z|d,a|z,z|e,c|e,c|f,z|e,b|f,c|d,b|z,z|d,\n z|f,b|e,b|e,a|e,a|e,c|z,c|z,b|f,a|d,b|d,b|d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a|b; d=1<<6; e=1<<12; f=d|e;\nconst SP8 = [b|f,z|e,a|z,c|f,b|z,b|f,z|d,b|z,a|d,c|z,c|f,a|e,c|e,a|f,z|e,z|d,\n c|z,b|d,b|e,z|f,a|e,a|d,c|d,c|e,z|f,z|z,z|z,c|d,b|d,b|e,a|f,a|z,\n a|f,a|z,c|e,z|e,z|d,c|d,z|e,a|f,b|e,z|d,b|d,c|z,c|d,b|z,a|z,b|f,\n z|z,c|f,a|d,b|d,c|z,b|e,b|f,z|z,c|f,a|e,a|e,z|f,z|f,a|d,b|z,c|e];\n\n/* eslint-enable comma-spacing */\n\nexport default class DES {\n constructor(password) {\n this.keys = [];\n\n // Set the key.\n const pc1m = [], pcr = [], kn = [];\n\n for (let j = 0, l = 56; j < 56; ++j, l -= 8) {\n l += l < -5 ? 65 : l < -3 ? 31 : l < -1 ? 63 : l === 27 ? 35 : 0; // PC1\n const m = l & 0x7;\n pc1m[j] = ((password[l >>> 3] & (1<>> 10;\n this.keys[KnLi] |= (raw1 & 0x00000fc0) >>> 6;\n ++KnLi;\n this.keys[KnLi] = (raw0 & 0x0003f000) << 12;\n this.keys[KnLi] |= (raw0 & 0x0000003f) << 16;\n this.keys[KnLi] |= (raw1 & 0x0003f000) >>> 4;\n this.keys[KnLi] |= (raw1 & 0x0000003f);\n ++KnLi;\n }\n }\n\n // Encrypt 8 bytes of text\n enc8(text) {\n const b = text.slice();\n let i = 0, l, r, x; // left, right, accumulator\n\n // Squash 8 bytes to 2 ints\n l = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];\n r = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];\n\n x = ((l >>> 4) ^ r) & 0x0f0f0f0f;\n r ^= x;\n l ^= (x << 4);\n x = ((l >>> 16) ^ r) & 0x0000ffff;\n r ^= x;\n l ^= (x << 16);\n x = ((r >>> 2) ^ l) & 0x33333333;\n l ^= x;\n r ^= (x << 2);\n x = ((r >>> 8) ^ l) & 0x00ff00ff;\n l ^= x;\n r ^= (x << 8);\n r = (r << 1) | ((r >>> 31) & 1);\n x = (l ^ r) & 0xaaaaaaaa;\n l ^= x;\n r ^= x;\n l = (l << 1) | ((l >>> 31) & 1);\n\n for (let i = 0, keysi = 0; i < 8; ++i) {\n x = (r << 28) | (r >>> 4);\n x ^= this.keys[keysi++];\n let fval = SP7[x & 0x3f];\n fval |= SP5[(x >>> 8) & 0x3f];\n fval |= SP3[(x >>> 16) & 0x3f];\n fval |= SP1[(x >>> 24) & 0x3f];\n x = r ^ this.keys[keysi++];\n fval |= SP8[x & 0x3f];\n fval |= SP6[(x >>> 8) & 0x3f];\n fval |= SP4[(x >>> 16) & 0x3f];\n fval |= SP2[(x >>> 24) & 0x3f];\n l ^= fval;\n x = (l << 28) | (l >>> 4);\n x ^= this.keys[keysi++];\n fval = SP7[x & 0x3f];\n fval |= SP5[(x >>> 8) & 0x3f];\n fval |= SP3[(x >>> 16) & 0x3f];\n fval |= SP1[(x >>> 24) & 0x3f];\n x = l ^ this.keys[keysi++];\n fval |= SP8[x & 0x0000003f];\n fval |= SP6[(x >>> 8) & 0x3f];\n fval |= SP4[(x >>> 16) & 0x3f];\n fval |= SP2[(x >>> 24) & 0x3f];\n r ^= fval;\n }\n\n r = (r << 31) | (r >>> 1);\n x = (l ^ r) & 0xaaaaaaaa;\n l ^= x;\n r ^= x;\n l = (l << 31) | (l >>> 1);\n x = ((l >>> 8) ^ r) & 0x00ff00ff;\n r ^= x;\n l ^= (x << 8);\n x = ((l >>> 2) ^ r) & 0x33333333;\n r ^= x;\n l ^= (x << 2);\n x = ((r >>> 16) ^ l) & 0x0000ffff;\n l ^= x;\n r ^= (x << 16);\n x = ((r >>> 4) ^ l) & 0x0f0f0f0f;\n l ^= x;\n r ^= (x << 4);\n\n // Spread ints to bytes\n x = [r, l];\n for (i = 0; i < 8; i++) {\n b[i] = (x[i>>>2] >>> (8 * (3 - (i % 4)))) % 256;\n if (b[i] < 0) { b[i] += 256; } // unsigned\n }\n return b;\n }\n\n // Encrypt 16 bytes of text using passwd as key\n encrypt(t) {\n return this.enc8(t.slice(0, 8)).concat(this.enc8(t.slice(8, 16)));\n }\n}\n","/*\n * This file is auto-generated from keymaps.csv\n * Database checksum sha256(76d68c10e97d37fe2ea459e210125ae41796253fb217e900bf2983ade13a7920)\n * To re-generate, run:\n * keymap-gen code-map --lang=js keymaps.csv html atset1\n*/\nexport default {\n \"Again\": 0xe005, /* html:Again (Again) -> linux:129 (KEY_AGAIN) -> atset1:57349 */\n \"AltLeft\": 0x38, /* html:AltLeft (AltLeft) -> linux:56 (KEY_LEFTALT) -> atset1:56 */\n \"AltRight\": 0xe038, /* html:AltRight (AltRight) -> linux:100 (KEY_RIGHTALT) -> atset1:57400 */\n \"ArrowDown\": 0xe050, /* html:ArrowDown (ArrowDown) -> linux:108 (KEY_DOWN) -> atset1:57424 */\n \"ArrowLeft\": 0xe04b, /* html:ArrowLeft (ArrowLeft) -> linux:105 (KEY_LEFT) -> atset1:57419 */\n \"ArrowRight\": 0xe04d, /* html:ArrowRight (ArrowRight) -> linux:106 (KEY_RIGHT) -> atset1:57421 */\n \"ArrowUp\": 0xe048, /* html:ArrowUp (ArrowUp) -> linux:103 (KEY_UP) -> atset1:57416 */\n \"AudioVolumeDown\": 0xe02e, /* html:AudioVolumeDown (AudioVolumeDown) -> linux:114 (KEY_VOLUMEDOWN) -> atset1:57390 */\n \"AudioVolumeMute\": 0xe020, /* html:AudioVolumeMute (AudioVolumeMute) -> linux:113 (KEY_MUTE) -> atset1:57376 */\n \"AudioVolumeUp\": 0xe030, /* html:AudioVolumeUp (AudioVolumeUp) -> linux:115 (KEY_VOLUMEUP) -> atset1:57392 */\n \"Backquote\": 0x29, /* html:Backquote (Backquote) -> linux:41 (KEY_GRAVE) -> atset1:41 */\n \"Backslash\": 0x2b, /* html:Backslash (Backslash) -> linux:43 (KEY_BACKSLASH) -> atset1:43 */\n \"Backspace\": 0xe, /* html:Backspace (Backspace) -> linux:14 (KEY_BACKSPACE) -> atset1:14 */\n \"BracketLeft\": 0x1a, /* html:BracketLeft (BracketLeft) -> linux:26 (KEY_LEFTBRACE) -> atset1:26 */\n \"BracketRight\": 0x1b, /* html:BracketRight (BracketRight) -> linux:27 (KEY_RIGHTBRACE) -> atset1:27 */\n \"BrowserBack\": 0xe06a, /* html:BrowserBack (BrowserBack) -> linux:158 (KEY_BACK) -> atset1:57450 */\n \"BrowserFavorites\": 0xe066, /* html:BrowserFavorites (BrowserFavorites) -> linux:156 (KEY_BOOKMARKS) -> atset1:57446 */\n \"BrowserForward\": 0xe069, /* html:BrowserForward (BrowserForward) -> linux:159 (KEY_FORWARD) -> atset1:57449 */\n \"BrowserHome\": 0xe032, /* html:BrowserHome (BrowserHome) -> linux:172 (KEY_HOMEPAGE) -> atset1:57394 */\n \"BrowserRefresh\": 0xe067, /* html:BrowserRefresh (BrowserRefresh) -> linux:173 (KEY_REFRESH) -> atset1:57447 */\n \"BrowserSearch\": 0xe065, /* html:BrowserSearch (BrowserSearch) -> linux:217 (KEY_SEARCH) -> atset1:57445 */\n \"BrowserStop\": 0xe068, /* html:BrowserStop (BrowserStop) -> linux:128 (KEY_STOP) -> atset1:57448 */\n \"CapsLock\": 0x3a, /* html:CapsLock (CapsLock) -> linux:58 (KEY_CAPSLOCK) -> atset1:58 */\n \"Comma\": 0x33, /* html:Comma (Comma) -> linux:51 (KEY_COMMA) -> atset1:51 */\n \"ContextMenu\": 0xe05d, /* html:ContextMenu (ContextMenu) -> linux:127 (KEY_COMPOSE) -> atset1:57437 */\n \"ControlLeft\": 0x1d, /* html:ControlLeft (ControlLeft) -> linux:29 (KEY_LEFTCTRL) -> atset1:29 */\n \"ControlRight\": 0xe01d, /* html:ControlRight (ControlRight) -> linux:97 (KEY_RIGHTCTRL) -> atset1:57373 */\n \"Convert\": 0x79, /* html:Convert (Convert) -> linux:92 (KEY_HENKAN) -> atset1:121 */\n \"Copy\": 0xe078, /* html:Copy (Copy) -> linux:133 (KEY_COPY) -> atset1:57464 */\n \"Cut\": 0xe03c, /* html:Cut (Cut) -> linux:137 (KEY_CUT) -> atset1:57404 */\n \"Delete\": 0xe053, /* html:Delete (Delete) -> linux:111 (KEY_DELETE) -> atset1:57427 */\n \"Digit0\": 0xb, /* html:Digit0 (Digit0) -> linux:11 (KEY_0) -> atset1:11 */\n \"Digit1\": 0x2, /* html:Digit1 (Digit1) -> linux:2 (KEY_1) -> atset1:2 */\n \"Digit2\": 0x3, /* html:Digit2 (Digit2) -> linux:3 (KEY_2) -> atset1:3 */\n \"Digit3\": 0x4, /* html:Digit3 (Digit3) -> linux:4 (KEY_3) -> atset1:4 */\n \"Digit4\": 0x5, /* html:Digit4 (Digit4) -> linux:5 (KEY_4) -> atset1:5 */\n \"Digit5\": 0x6, /* html:Digit5 (Digit5) -> linux:6 (KEY_5) -> atset1:6 */\n \"Digit6\": 0x7, /* html:Digit6 (Digit6) -> linux:7 (KEY_6) -> atset1:7 */\n \"Digit7\": 0x8, /* html:Digit7 (Digit7) -> linux:8 (KEY_7) -> atset1:8 */\n \"Digit8\": 0x9, /* html:Digit8 (Digit8) -> linux:9 (KEY_8) -> atset1:9 */\n \"Digit9\": 0xa, /* html:Digit9 (Digit9) -> linux:10 (KEY_9) -> atset1:10 */\n \"Eject\": 0xe07d, /* html:Eject (Eject) -> linux:162 (KEY_EJECTCLOSECD) -> atset1:57469 */\n \"End\": 0xe04f, /* html:End (End) -> linux:107 (KEY_END) -> atset1:57423 */\n \"Enter\": 0x1c, /* html:Enter (Enter) -> linux:28 (KEY_ENTER) -> atset1:28 */\n \"Equal\": 0xd, /* html:Equal (Equal) -> linux:13 (KEY_EQUAL) -> atset1:13 */\n \"Escape\": 0x1, /* html:Escape (Escape) -> linux:1 (KEY_ESC) -> atset1:1 */\n \"F1\": 0x3b, /* html:F1 (F1) -> linux:59 (KEY_F1) -> atset1:59 */\n \"F10\": 0x44, /* html:F10 (F10) -> linux:68 (KEY_F10) -> atset1:68 */\n \"F11\": 0x57, /* html:F11 (F11) -> linux:87 (KEY_F11) -> atset1:87 */\n \"F12\": 0x58, /* html:F12 (F12) -> linux:88 (KEY_F12) -> atset1:88 */\n \"F13\": 0x5d, /* html:F13 (F13) -> linux:183 (KEY_F13) -> atset1:93 */\n \"F14\": 0x5e, /* html:F14 (F14) -> linux:184 (KEY_F14) -> atset1:94 */\n \"F15\": 0x5f, /* html:F15 (F15) -> linux:185 (KEY_F15) -> atset1:95 */\n \"F16\": 0x55, /* html:F16 (F16) -> linux:186 (KEY_F16) -> atset1:85 */\n \"F17\": 0xe003, /* html:F17 (F17) -> linux:187 (KEY_F17) -> atset1:57347 */\n \"F18\": 0xe077, /* html:F18 (F18) -> linux:188 (KEY_F18) -> atset1:57463 */\n \"F19\": 0xe004, /* html:F19 (F19) -> linux:189 (KEY_F19) -> atset1:57348 */\n \"F2\": 0x3c, /* html:F2 (F2) -> linux:60 (KEY_F2) -> atset1:60 */\n \"F20\": 0x5a, /* html:F20 (F20) -> linux:190 (KEY_F20) -> atset1:90 */\n \"F21\": 0x74, /* html:F21 (F21) -> linux:191 (KEY_F21) -> atset1:116 */\n \"F22\": 0xe079, /* html:F22 (F22) -> linux:192 (KEY_F22) -> atset1:57465 */\n \"F23\": 0x6d, /* html:F23 (F23) -> linux:193 (KEY_F23) -> atset1:109 */\n \"F24\": 0x6f, /* html:F24 (F24) -> linux:194 (KEY_F24) -> atset1:111 */\n \"F3\": 0x3d, /* html:F3 (F3) -> linux:61 (KEY_F3) -> atset1:61 */\n \"F4\": 0x3e, /* html:F4 (F4) -> linux:62 (KEY_F4) -> atset1:62 */\n \"F5\": 0x3f, /* html:F5 (F5) -> linux:63 (KEY_F5) -> atset1:63 */\n \"F6\": 0x40, /* html:F6 (F6) -> linux:64 (KEY_F6) -> atset1:64 */\n \"F7\": 0x41, /* html:F7 (F7) -> linux:65 (KEY_F7) -> atset1:65 */\n \"F8\": 0x42, /* html:F8 (F8) -> linux:66 (KEY_F8) -> atset1:66 */\n \"F9\": 0x43, /* html:F9 (F9) -> linux:67 (KEY_F9) -> atset1:67 */\n \"Find\": 0xe041, /* html:Find (Find) -> linux:136 (KEY_FIND) -> atset1:57409 */\n \"Help\": 0xe075, /* html:Help (Help) -> linux:138 (KEY_HELP) -> atset1:57461 */\n \"Hiragana\": 0x77, /* html:Hiragana (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */\n \"Home\": 0xe047, /* html:Home (Home) -> linux:102 (KEY_HOME) -> atset1:57415 */\n \"Insert\": 0xe052, /* html:Insert (Insert) -> linux:110 (KEY_INSERT) -> atset1:57426 */\n \"IntlBackslash\": 0x56, /* html:IntlBackslash (IntlBackslash) -> linux:86 (KEY_102ND) -> atset1:86 */\n \"IntlRo\": 0x73, /* html:IntlRo (IntlRo) -> linux:89 (KEY_RO) -> atset1:115 */\n \"IntlYen\": 0x7d, /* html:IntlYen (IntlYen) -> linux:124 (KEY_YEN) -> atset1:125 */\n \"KanaMode\": 0x70, /* html:KanaMode (KanaMode) -> linux:93 (KEY_KATAKANAHIRAGANA) -> atset1:112 */\n \"Katakana\": 0x78, /* html:Katakana (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */\n \"KeyA\": 0x1e, /* html:KeyA (KeyA) -> linux:30 (KEY_A) -> atset1:30 */\n \"KeyB\": 0x30, /* html:KeyB (KeyB) -> linux:48 (KEY_B) -> atset1:48 */\n \"KeyC\": 0x2e, /* html:KeyC (KeyC) -> linux:46 (KEY_C) -> atset1:46 */\n \"KeyD\": 0x20, /* html:KeyD (KeyD) -> linux:32 (KEY_D) -> atset1:32 */\n \"KeyE\": 0x12, /* html:KeyE (KeyE) -> linux:18 (KEY_E) -> atset1:18 */\n \"KeyF\": 0x21, /* html:KeyF (KeyF) -> linux:33 (KEY_F) -> atset1:33 */\n \"KeyG\": 0x22, /* html:KeyG (KeyG) -> linux:34 (KEY_G) -> atset1:34 */\n \"KeyH\": 0x23, /* html:KeyH (KeyH) -> linux:35 (KEY_H) -> atset1:35 */\n \"KeyI\": 0x17, /* html:KeyI (KeyI) -> linux:23 (KEY_I) -> atset1:23 */\n \"KeyJ\": 0x24, /* html:KeyJ (KeyJ) -> linux:36 (KEY_J) -> atset1:36 */\n \"KeyK\": 0x25, /* html:KeyK (KeyK) -> linux:37 (KEY_K) -> atset1:37 */\n \"KeyL\": 0x26, /* html:KeyL (KeyL) -> linux:38 (KEY_L) -> atset1:38 */\n \"KeyM\": 0x32, /* html:KeyM (KeyM) -> linux:50 (KEY_M) -> atset1:50 */\n \"KeyN\": 0x31, /* html:KeyN (KeyN) -> linux:49 (KEY_N) -> atset1:49 */\n \"KeyO\": 0x18, /* html:KeyO (KeyO) -> linux:24 (KEY_O) -> atset1:24 */\n \"KeyP\": 0x19, /* html:KeyP (KeyP) -> linux:25 (KEY_P) -> atset1:25 */\n \"KeyQ\": 0x10, /* html:KeyQ (KeyQ) -> linux:16 (KEY_Q) -> atset1:16 */\n \"KeyR\": 0x13, /* html:KeyR (KeyR) -> linux:19 (KEY_R) -> atset1:19 */\n \"KeyS\": 0x1f, /* html:KeyS (KeyS) -> linux:31 (KEY_S) -> atset1:31 */\n \"KeyT\": 0x14, /* html:KeyT (KeyT) -> linux:20 (KEY_T) -> atset1:20 */\n \"KeyU\": 0x16, /* html:KeyU (KeyU) -> linux:22 (KEY_U) -> atset1:22 */\n \"KeyV\": 0x2f, /* html:KeyV (KeyV) -> linux:47 (KEY_V) -> atset1:47 */\n \"KeyW\": 0x11, /* html:KeyW (KeyW) -> linux:17 (KEY_W) -> atset1:17 */\n \"KeyX\": 0x2d, /* html:KeyX (KeyX) -> linux:45 (KEY_X) -> atset1:45 */\n \"KeyY\": 0x15, /* html:KeyY (KeyY) -> linux:21 (KEY_Y) -> atset1:21 */\n \"KeyZ\": 0x2c, /* html:KeyZ (KeyZ) -> linux:44 (KEY_Z) -> atset1:44 */\n \"Lang1\": 0x72, /* html:Lang1 (Lang1) -> linux:122 (KEY_HANGEUL) -> atset1:114 */\n \"Lang2\": 0x71, /* html:Lang2 (Lang2) -> linux:123 (KEY_HANJA) -> atset1:113 */\n \"Lang3\": 0x78, /* html:Lang3 (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */\n \"Lang4\": 0x77, /* html:Lang4 (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */\n \"Lang5\": 0x76, /* html:Lang5 (Lang5) -> linux:85 (KEY_ZENKAKUHANKAKU) -> atset1:118 */\n \"LaunchApp1\": 0xe06b, /* html:LaunchApp1 (LaunchApp1) -> linux:157 (KEY_COMPUTER) -> atset1:57451 */\n \"LaunchApp2\": 0xe021, /* html:LaunchApp2 (LaunchApp2) -> linux:140 (KEY_CALC) -> atset1:57377 */\n \"LaunchMail\": 0xe06c, /* html:LaunchMail (LaunchMail) -> linux:155 (KEY_MAIL) -> atset1:57452 */\n \"MediaPlayPause\": 0xe022, /* html:MediaPlayPause (MediaPlayPause) -> linux:164 (KEY_PLAYPAUSE) -> atset1:57378 */\n \"MediaSelect\": 0xe06d, /* html:MediaSelect (MediaSelect) -> linux:226 (KEY_MEDIA) -> atset1:57453 */\n \"MediaStop\": 0xe024, /* html:MediaStop (MediaStop) -> linux:166 (KEY_STOPCD) -> atset1:57380 */\n \"MediaTrackNext\": 0xe019, /* html:MediaTrackNext (MediaTrackNext) -> linux:163 (KEY_NEXTSONG) -> atset1:57369 */\n \"MediaTrackPrevious\": 0xe010, /* html:MediaTrackPrevious (MediaTrackPrevious) -> linux:165 (KEY_PREVIOUSSONG) -> atset1:57360 */\n \"MetaLeft\": 0xe05b, /* html:MetaLeft (MetaLeft) -> linux:125 (KEY_LEFTMETA) -> atset1:57435 */\n \"MetaRight\": 0xe05c, /* html:MetaRight (MetaRight) -> linux:126 (KEY_RIGHTMETA) -> atset1:57436 */\n \"Minus\": 0xc, /* html:Minus (Minus) -> linux:12 (KEY_MINUS) -> atset1:12 */\n \"NonConvert\": 0x7b, /* html:NonConvert (NonConvert) -> linux:94 (KEY_MUHENKAN) -> atset1:123 */\n \"NumLock\": 0x45, /* html:NumLock (NumLock) -> linux:69 (KEY_NUMLOCK) -> atset1:69 */\n \"Numpad0\": 0x52, /* html:Numpad0 (Numpad0) -> linux:82 (KEY_KP0) -> atset1:82 */\n \"Numpad1\": 0x4f, /* html:Numpad1 (Numpad1) -> linux:79 (KEY_KP1) -> atset1:79 */\n \"Numpad2\": 0x50, /* html:Numpad2 (Numpad2) -> linux:80 (KEY_KP2) -> atset1:80 */\n \"Numpad3\": 0x51, /* html:Numpad3 (Numpad3) -> linux:81 (KEY_KP3) -> atset1:81 */\n \"Numpad4\": 0x4b, /* html:Numpad4 (Numpad4) -> linux:75 (KEY_KP4) -> atset1:75 */\n \"Numpad5\": 0x4c, /* html:Numpad5 (Numpad5) -> linux:76 (KEY_KP5) -> atset1:76 */\n \"Numpad6\": 0x4d, /* html:Numpad6 (Numpad6) -> linux:77 (KEY_KP6) -> atset1:77 */\n \"Numpad7\": 0x47, /* html:Numpad7 (Numpad7) -> linux:71 (KEY_KP7) -> atset1:71 */\n \"Numpad8\": 0x48, /* html:Numpad8 (Numpad8) -> linux:72 (KEY_KP8) -> atset1:72 */\n \"Numpad9\": 0x49, /* html:Numpad9 (Numpad9) -> linux:73 (KEY_KP9) -> atset1:73 */\n \"NumpadAdd\": 0x4e, /* html:NumpadAdd (NumpadAdd) -> linux:78 (KEY_KPPLUS) -> atset1:78 */\n \"NumpadComma\": 0x7e, /* html:NumpadComma (NumpadComma) -> linux:121 (KEY_KPCOMMA) -> atset1:126 */\n \"NumpadDecimal\": 0x53, /* html:NumpadDecimal (NumpadDecimal) -> linux:83 (KEY_KPDOT) -> atset1:83 */\n \"NumpadDivide\": 0xe035, /* html:NumpadDivide (NumpadDivide) -> linux:98 (KEY_KPSLASH) -> atset1:57397 */\n \"NumpadEnter\": 0xe01c, /* html:NumpadEnter (NumpadEnter) -> linux:96 (KEY_KPENTER) -> atset1:57372 */\n \"NumpadEqual\": 0x59, /* html:NumpadEqual (NumpadEqual) -> linux:117 (KEY_KPEQUAL) -> atset1:89 */\n \"NumpadMultiply\": 0x37, /* html:NumpadMultiply (NumpadMultiply) -> linux:55 (KEY_KPASTERISK) -> atset1:55 */\n \"NumpadParenLeft\": 0xe076, /* html:NumpadParenLeft (NumpadParenLeft) -> linux:179 (KEY_KPLEFTPAREN) -> atset1:57462 */\n \"NumpadParenRight\": 0xe07b, /* html:NumpadParenRight (NumpadParenRight) -> linux:180 (KEY_KPRIGHTPAREN) -> atset1:57467 */\n \"NumpadSubtract\": 0x4a, /* html:NumpadSubtract (NumpadSubtract) -> linux:74 (KEY_KPMINUS) -> atset1:74 */\n \"Open\": 0x64, /* html:Open (Open) -> linux:134 (KEY_OPEN) -> atset1:100 */\n \"PageDown\": 0xe051, /* html:PageDown (PageDown) -> linux:109 (KEY_PAGEDOWN) -> atset1:57425 */\n \"PageUp\": 0xe049, /* html:PageUp (PageUp) -> linux:104 (KEY_PAGEUP) -> atset1:57417 */\n \"Paste\": 0x65, /* html:Paste (Paste) -> linux:135 (KEY_PASTE) -> atset1:101 */\n \"Pause\": 0xe046, /* html:Pause (Pause) -> linux:119 (KEY_PAUSE) -> atset1:57414 */\n \"Period\": 0x34, /* html:Period (Period) -> linux:52 (KEY_DOT) -> atset1:52 */\n \"Power\": 0xe05e, /* html:Power (Power) -> linux:116 (KEY_POWER) -> atset1:57438 */\n \"PrintScreen\": 0x54, /* html:PrintScreen (PrintScreen) -> linux:99 (KEY_SYSRQ) -> atset1:84 */\n \"Props\": 0xe006, /* html:Props (Props) -> linux:130 (KEY_PROPS) -> atset1:57350 */\n \"Quote\": 0x28, /* html:Quote (Quote) -> linux:40 (KEY_APOSTROPHE) -> atset1:40 */\n \"ScrollLock\": 0x46, /* html:ScrollLock (ScrollLock) -> linux:70 (KEY_SCROLLLOCK) -> atset1:70 */\n \"Semicolon\": 0x27, /* html:Semicolon (Semicolon) -> linux:39 (KEY_SEMICOLON) -> atset1:39 */\n \"ShiftLeft\": 0x2a, /* html:ShiftLeft (ShiftLeft) -> linux:42 (KEY_LEFTSHIFT) -> atset1:42 */\n \"ShiftRight\": 0x36, /* html:ShiftRight (ShiftRight) -> linux:54 (KEY_RIGHTSHIFT) -> atset1:54 */\n \"Slash\": 0x35, /* html:Slash (Slash) -> linux:53 (KEY_SLASH) -> atset1:53 */\n \"Sleep\": 0xe05f, /* html:Sleep (Sleep) -> linux:142 (KEY_SLEEP) -> atset1:57439 */\n \"Space\": 0x39, /* html:Space (Space) -> linux:57 (KEY_SPACE) -> atset1:57 */\n \"Suspend\": 0xe025, /* html:Suspend (Suspend) -> linux:205 (KEY_SUSPEND) -> atset1:57381 */\n \"Tab\": 0xf, /* html:Tab (Tab) -> linux:15 (KEY_TAB) -> atset1:15 */\n \"Undo\": 0xe007, /* html:Undo (Undo) -> linux:131 (KEY_UNDO) -> atset1:57351 */\n \"WakeUp\": 0xe063, /* html:WakeUp (WakeUp) -> linux:143 (KEY_WAKEUP) -> atset1:57443 */\n};\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nexport const encodings = {\n encodingRaw: 0,\n encodingCopyRect: 1,\n encodingRRE: 2,\n encodingHextile: 5,\n encodingTight: 7,\n encodingZRLE: 16,\n encodingTightPNG: -260,\n encodingJPEG: 21,\n\n pseudoEncodingQualityLevel9: -23,\n pseudoEncodingQualityLevel0: -32,\n pseudoEncodingDesktopSize: -223,\n pseudoEncodingLastRect: -224,\n pseudoEncodingCursor: -239,\n pseudoEncodingQEMUExtendedKeyEvent: -258,\n pseudoEncodingDesktopName: -307,\n pseudoEncodingExtendedDesktopSize: -308,\n pseudoEncodingXvp: -309,\n pseudoEncodingFence: -312,\n pseudoEncodingContinuousUpdates: -313,\n pseudoEncodingCompressLevel9: -247,\n pseudoEncodingCompressLevel0: -256,\n pseudoEncodingVMwareCursor: 0x574d5664,\n pseudoEncodingExtendedClipboard: 0xc0a1e5ce\n};\n\nexport function encodingName(num) {\n switch (num) {\n case encodings.encodingRaw: return \"Raw\";\n case encodings.encodingCopyRect: return \"CopyRect\";\n case encodings.encodingRRE: return \"RRE\";\n case encodings.encodingHextile: return \"Hextile\";\n case encodings.encodingTight: return \"Tight\";\n case encodings.encodingZRLE: return \"ZRLE\";\n case encodings.encodingTightPNG: return \"TightPNG\";\n case encodings.encodingJPEG: return \"JPEG\";\n default: return \"[unknown encoding \" + num + \"]\";\n }\n}\n","import Base64 from './base64.js';\nimport { encodeUTF8 } from './util/strings.js';\nimport EventTargetMixin from './util/eventtarget.js';\n\nexport class AESEAXCipher {\n constructor() {\n this._rawKey = null;\n this._ctrKey = null;\n this._cbcKey = null;\n this._zeroBlock = new Uint8Array(16);\n this._prefixBlock0 = this._zeroBlock;\n this._prefixBlock1 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);\n this._prefixBlock2 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]);\n }\n\n async _encryptBlock(block) {\n const encrypted = await window.crypto.subtle.encrypt({\n name: \"AES-CBC\",\n iv: this._zeroBlock,\n }, this._cbcKey, block);\n return new Uint8Array(encrypted).slice(0, 16);\n }\n\n async _initCMAC() {\n const k1 = await this._encryptBlock(this._zeroBlock);\n const k2 = new Uint8Array(16);\n const v = k1[0] >>> 6;\n for (let i = 0; i < 15; i++) {\n k2[i] = (k1[i + 1] >> 6) | (k1[i] << 2);\n k1[i] = (k1[i + 1] >> 7) | (k1[i] << 1);\n }\n const lut = [0x0, 0x87, 0x0e, 0x89];\n k2[14] ^= v >>> 1;\n k2[15] = (k1[15] << 2) ^ lut[v];\n k1[15] = (k1[15] << 1) ^ lut[v >> 1];\n this._k1 = k1;\n this._k2 = k2;\n }\n\n async _encryptCTR(data, counter) {\n const encrypted = await window.crypto.subtle.encrypt({\n \"name\": \"AES-CTR\",\n counter: counter,\n length: 128\n }, this._ctrKey, data);\n return new Uint8Array(encrypted);\n }\n\n async _decryptCTR(data, counter) {\n const decrypted = await window.crypto.subtle.decrypt({\n \"name\": \"AES-CTR\",\n counter: counter,\n length: 128\n }, this._ctrKey, data);\n return new Uint8Array(decrypted);\n }\n\n async _computeCMAC(data, prefixBlock) {\n if (prefixBlock.length !== 16) {\n return null;\n }\n const n = Math.floor(data.length / 16);\n const m = Math.ceil(data.length / 16);\n const r = data.length - n * 16;\n const cbcData = new Uint8Array((m + 1) * 16);\n cbcData.set(prefixBlock);\n cbcData.set(data, 16);\n if (r === 0) {\n for (let i = 0; i < 16; i++) {\n cbcData[n * 16 + i] ^= this._k1[i];\n }\n } else {\n cbcData[(n + 1) * 16 + r] = 0x80;\n for (let i = 0; i < 16; i++) {\n cbcData[(n + 1) * 16 + i] ^= this._k2[i];\n }\n }\n let cbcEncrypted = await window.crypto.subtle.encrypt({\n name: \"AES-CBC\",\n iv: this._zeroBlock,\n }, this._cbcKey, cbcData);\n\n cbcEncrypted = new Uint8Array(cbcEncrypted);\n const mac = cbcEncrypted.slice(cbcEncrypted.length - 32, cbcEncrypted.length - 16);\n return mac;\n }\n\n async setKey(key) {\n this._rawKey = key;\n this._ctrKey = await window.crypto.subtle.importKey(\n \"raw\", key, {\"name\": \"AES-CTR\"}, false, [\"encrypt\", \"decrypt\"]);\n this._cbcKey = await window.crypto.subtle.importKey(\n \"raw\", key, {\"name\": \"AES-CBC\"}, false, [\"encrypt\", \"decrypt\"]);\n await this._initCMAC();\n }\n\n async encrypt(message, associatedData, nonce) {\n const nCMAC = await this._computeCMAC(nonce, this._prefixBlock0);\n const encrypted = await this._encryptCTR(message, nCMAC);\n const adCMAC = await this._computeCMAC(associatedData, this._prefixBlock1);\n const mac = await this._computeCMAC(encrypted, this._prefixBlock2);\n for (let i = 0; i < 16; i++) {\n mac[i] ^= nCMAC[i] ^ adCMAC[i];\n }\n const res = new Uint8Array(16 + encrypted.length);\n res.set(encrypted);\n res.set(mac, encrypted.length);\n return res;\n }\n\n async decrypt(encrypted, associatedData, nonce, mac) {\n const nCMAC = await this._computeCMAC(nonce, this._prefixBlock0);\n const adCMAC = await this._computeCMAC(associatedData, this._prefixBlock1);\n const computedMac = await this._computeCMAC(encrypted, this._prefixBlock2);\n for (let i = 0; i < 16; i++) {\n computedMac[i] ^= nCMAC[i] ^ adCMAC[i];\n }\n if (computedMac.length !== mac.length) {\n return null;\n }\n for (let i = 0; i < mac.length; i++) {\n if (computedMac[i] !== mac[i]) {\n return null;\n }\n }\n const res = await this._decryptCTR(encrypted, nCMAC);\n return res;\n }\n}\n\nexport class RA2Cipher {\n constructor() {\n this._cipher = new AESEAXCipher();\n this._counter = new Uint8Array(16);\n }\n\n async setKey(key) {\n await this._cipher.setKey(key);\n }\n\n async makeMessage(message) {\n const ad = new Uint8Array([(message.length & 0xff00) >>> 8, message.length & 0xff]);\n const encrypted = await this._cipher.encrypt(message, ad, this._counter);\n for (let i = 0; i < 16 && this._counter[i]++ === 255; i++);\n const res = new Uint8Array(message.length + 2 + 16);\n res.set(ad);\n res.set(encrypted, 2);\n return res;\n }\n\n async receiveMessage(length, encrypted, mac) {\n const ad = new Uint8Array([(length & 0xff00) >>> 8, length & 0xff]);\n const res = await this._cipher.decrypt(encrypted, ad, this._counter, mac);\n for (let i = 0; i < 16 && this._counter[i]++ === 255; i++);\n return res;\n }\n}\n\nexport class RSACipher {\n constructor(keyLength) {\n this._key = null;\n this._keyLength = keyLength;\n this._keyBytes = Math.ceil(keyLength / 8);\n this._n = null;\n this._e = null;\n this._d = null;\n this._nBigInt = null;\n this._eBigInt = null;\n this._dBigInt = null;\n }\n\n _base64urlDecode(data) {\n data = data.replace(/-/g, \"+\").replace(/_/g, \"/\");\n data = data.padEnd(Math.ceil(data.length / 4) * 4, \"=\");\n return Base64.decode(data);\n }\n\n _u8ArrayToBigInt(arr) {\n let hex = '0x';\n for (let i = 0; i < arr.length; i++) {\n hex += arr[i].toString(16).padStart(2, '0');\n }\n return BigInt(hex);\n }\n\n _padArray(arr, length) {\n const res = new Uint8Array(length);\n res.set(arr, length - arr.length);\n return res;\n }\n\n _bigIntToU8Array(bigint, padLength=0) {\n let hex = bigint.toString(16);\n if (padLength === 0) {\n padLength = Math.ceil(hex.length / 2) * 2;\n }\n hex = hex.padStart(padLength * 2, '0');\n const length = hex.length / 2;\n const arr = new Uint8Array(length);\n for (let i = 0; i < length; i++) {\n arr[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);\n }\n return arr;\n }\n\n _modPow(b, e, m) {\n if (m === 1n) {\n return 0;\n }\n let r = 1n;\n b = b % m;\n while (e > 0) {\n if (e % 2n === 1n) {\n r = (r * b) % m;\n }\n e = e / 2n;\n b = (b * b) % m;\n }\n return r;\n }\n\n async generateKey() {\n this._key = await window.crypto.subtle.generateKey(\n {\n name: \"RSA-OAEP\",\n modulusLength: this._keyLength,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: {name: \"SHA-256\"},\n },\n true, [\"encrypt\", \"decrypt\"]);\n const privateKey = await window.crypto.subtle.exportKey(\"jwk\", this._key.privateKey);\n this._n = this._padArray(this._base64urlDecode(privateKey.n), this._keyBytes);\n this._nBigInt = this._u8ArrayToBigInt(this._n);\n this._e = this._padArray(this._base64urlDecode(privateKey.e), this._keyBytes);\n this._eBigInt = this._u8ArrayToBigInt(this._e);\n this._d = this._padArray(this._base64urlDecode(privateKey.d), this._keyBytes);\n this._dBigInt = this._u8ArrayToBigInt(this._d);\n }\n\n setPublicKey(n, e) {\n if (n.length !== this._keyBytes || e.length !== this._keyBytes) {\n return;\n }\n this._n = new Uint8Array(this._keyBytes);\n this._e = new Uint8Array(this._keyBytes);\n this._n.set(n);\n this._e.set(e);\n this._nBigInt = this._u8ArrayToBigInt(this._n);\n this._eBigInt = this._u8ArrayToBigInt(this._e);\n }\n\n encrypt(message) {\n if (message.length > this._keyBytes - 11) {\n return null;\n }\n const ps = new Uint8Array(this._keyBytes - message.length - 3);\n window.crypto.getRandomValues(ps);\n for (let i = 0; i < ps.length; i++) {\n ps[i] = Math.floor(ps[i] * 254 / 255 + 1);\n }\n const em = new Uint8Array(this._keyBytes);\n em[1] = 0x02;\n em.set(ps, 2);\n em.set(message, ps.length + 3);\n const emBigInt = this._u8ArrayToBigInt(em);\n const c = this._modPow(emBigInt, this._eBigInt, this._nBigInt);\n return this._bigIntToU8Array(c, this._keyBytes);\n }\n\n decrypt(message) {\n if (message.length !== this._keyBytes) {\n return null;\n }\n const msgBigInt = this._u8ArrayToBigInt(message);\n const emBigInt = this._modPow(msgBigInt, this._dBigInt, this._nBigInt);\n const em = this._bigIntToU8Array(emBigInt, this._keyBytes);\n if (em[0] !== 0x00 || em[1] !== 0x02) {\n return null;\n }\n let i = 2;\n for (; i < em.length; i++) {\n if (em[i] === 0x00) {\n break;\n }\n }\n if (i === em.length) {\n return null;\n }\n return em.slice(i + 1, em.length);\n }\n\n get keyLength() {\n return this._keyLength;\n }\n\n get n() {\n return this._n;\n }\n\n get e() {\n return this._e;\n }\n\n get d() {\n return this._d;\n }\n}\n\nexport default class RSAAESAuthenticationState extends EventTargetMixin {\n constructor(sock, getCredentials) {\n super();\n this._hasStarted = false;\n this._checkSock = null;\n this._checkCredentials = null;\n this._approveServerResolve = null;\n this._sockReject = null;\n this._credentialsReject = null;\n this._approveServerReject = null;\n this._sock = sock;\n this._getCredentials = getCredentials;\n }\n\n _waitSockAsync(len) {\n return new Promise((resolve, reject) => {\n const hasData = () => !this._sock.rQwait('RA2', len);\n if (hasData()) {\n resolve();\n } else {\n this._checkSock = () => {\n if (hasData()) {\n resolve();\n this._checkSock = null;\n this._sockReject = null;\n }\n };\n this._sockReject = reject;\n }\n });\n }\n\n _waitApproveKeyAsync() {\n return new Promise((resolve, reject) => {\n this._approveServerResolve = resolve;\n this._approveServerReject = reject;\n });\n }\n\n _waitCredentialsAsync(subtype) {\n const hasCredentials = () => {\n if (subtype === 1 && this._getCredentials().username !== undefined &&\n this._getCredentials().password !== undefined) {\n return true;\n } else if (subtype === 2 && this._getCredentials().password !== undefined) {\n return true;\n }\n return false;\n };\n return new Promise((resolve, reject) => {\n if (hasCredentials()) {\n resolve();\n } else {\n this._checkCredentials = () => {\n if (hasCredentials()) {\n resolve();\n this._checkCredentials = null;\n this._credentialsReject = null;\n }\n };\n this._credentialsReject = reject;\n }\n });\n }\n\n checkInternalEvents() {\n if (this._checkSock !== null) {\n this._checkSock();\n }\n if (this._checkCredentials !== null) {\n this._checkCredentials();\n }\n }\n\n approveServer() {\n if (this._approveServerResolve !== null) {\n this._approveServerResolve();\n this._approveServerResolve = null;\n }\n }\n\n disconnect() {\n if (this._sockReject !== null) {\n this._sockReject(new Error(\"disconnect normally\"));\n this._sockReject = null;\n }\n if (this._credentialsReject !== null) {\n this._credentialsReject(new Error(\"disconnect normally\"));\n this._credentialsReject = null;\n }\n if (this._approveServerReject !== null) {\n this._approveServerReject(new Error(\"disconnect normally\"));\n this._approveServerReject = null;\n }\n }\n\n async negotiateRA2neAuthAsync() {\n this._hasStarted = true;\n // 1: Receive server public key\n await this._waitSockAsync(4);\n const serverKeyLengthBuffer = this._sock.rQslice(0, 4);\n const serverKeyLength = this._sock.rQshift32();\n if (serverKeyLength < 1024) {\n throw new Error(\"RA2: server public key is too short: \" + serverKeyLength);\n } else if (serverKeyLength > 8192) {\n throw new Error(\"RA2: server public key is too long: \" + serverKeyLength);\n }\n const serverKeyBytes = Math.ceil(serverKeyLength / 8);\n await this._waitSockAsync(serverKeyBytes * 2);\n const serverN = this._sock.rQshiftBytes(serverKeyBytes);\n const serverE = this._sock.rQshiftBytes(serverKeyBytes);\n const serverRSACipher = new RSACipher(serverKeyLength);\n serverRSACipher.setPublicKey(serverN, serverE);\n const serverPublickey = new Uint8Array(4 + serverKeyBytes * 2);\n serverPublickey.set(serverKeyLengthBuffer);\n serverPublickey.set(serverN, 4);\n serverPublickey.set(serverE, 4 + serverKeyBytes);\n\n // verify server public key\n this.dispatchEvent(new CustomEvent(\"serververification\", {\n detail: { type: \"RSA\", publickey: serverPublickey }\n }));\n await this._waitApproveKeyAsync();\n\n // 2: Send client public key\n const clientKeyLength = 2048;\n const clientKeyBytes = Math.ceil(clientKeyLength / 8);\n const clientRSACipher = new RSACipher(clientKeyLength);\n await clientRSACipher.generateKey();\n const clientN = clientRSACipher.n;\n const clientE = clientRSACipher.e;\n const clientPublicKey = new Uint8Array(4 + clientKeyBytes * 2);\n clientPublicKey[0] = (clientKeyLength & 0xff000000) >>> 24;\n clientPublicKey[1] = (clientKeyLength & 0xff0000) >>> 16;\n clientPublicKey[2] = (clientKeyLength & 0xff00) >>> 8;\n clientPublicKey[3] = clientKeyLength & 0xff;\n clientPublicKey.set(clientN, 4);\n clientPublicKey.set(clientE, 4 + clientKeyBytes);\n this._sock.send(clientPublicKey);\n\n // 3: Send client random\n const clientRandom = new Uint8Array(16);\n window.crypto.getRandomValues(clientRandom);\n const clientEncryptedRandom = serverRSACipher.encrypt(clientRandom);\n const clientRandomMessage = new Uint8Array(2 + serverKeyBytes);\n clientRandomMessage[0] = (serverKeyBytes & 0xff00) >>> 8;\n clientRandomMessage[1] = serverKeyBytes & 0xff;\n clientRandomMessage.set(clientEncryptedRandom, 2);\n this._sock.send(clientRandomMessage);\n\n // 4: Receive server random\n await this._waitSockAsync(2);\n if (this._sock.rQshift16() !== clientKeyBytes) {\n throw new Error(\"RA2: wrong encrypted message length\");\n }\n const serverEncryptedRandom = this._sock.rQshiftBytes(clientKeyBytes);\n const serverRandom = clientRSACipher.decrypt(serverEncryptedRandom);\n if (serverRandom === null || serverRandom.length !== 16) {\n throw new Error(\"RA2: corrupted server encrypted random\");\n }\n\n // 5: Compute session keys and set ciphers\n let clientSessionKey = new Uint8Array(32);\n let serverSessionKey = new Uint8Array(32);\n clientSessionKey.set(serverRandom);\n clientSessionKey.set(clientRandom, 16);\n serverSessionKey.set(clientRandom);\n serverSessionKey.set(serverRandom, 16);\n clientSessionKey = await window.crypto.subtle.digest(\"SHA-1\", clientSessionKey);\n clientSessionKey = new Uint8Array(clientSessionKey).slice(0, 16);\n serverSessionKey = await window.crypto.subtle.digest(\"SHA-1\", serverSessionKey);\n serverSessionKey = new Uint8Array(serverSessionKey).slice(0, 16);\n const clientCipher = new RA2Cipher();\n await clientCipher.setKey(clientSessionKey);\n const serverCipher = new RA2Cipher();\n await serverCipher.setKey(serverSessionKey);\n\n // 6: Compute and exchange hashes\n let serverHash = new Uint8Array(8 + serverKeyBytes * 2 + clientKeyBytes * 2);\n let clientHash = new Uint8Array(8 + serverKeyBytes * 2 + clientKeyBytes * 2);\n serverHash.set(serverPublickey);\n serverHash.set(clientPublicKey, 4 + serverKeyBytes * 2);\n clientHash.set(clientPublicKey);\n clientHash.set(serverPublickey, 4 + clientKeyBytes * 2);\n serverHash = await window.crypto.subtle.digest(\"SHA-1\", serverHash);\n clientHash = await window.crypto.subtle.digest(\"SHA-1\", clientHash);\n serverHash = new Uint8Array(serverHash);\n clientHash = new Uint8Array(clientHash);\n this._sock.send(await clientCipher.makeMessage(clientHash));\n await this._waitSockAsync(2 + 20 + 16);\n if (this._sock.rQshift16() !== 20) {\n throw new Error(\"RA2: wrong server hash\");\n }\n const serverHashReceived = await serverCipher.receiveMessage(\n 20, this._sock.rQshiftBytes(20), this._sock.rQshiftBytes(16));\n if (serverHashReceived === null) {\n throw new Error(\"RA2: failed to authenticate the message\");\n }\n for (let i = 0; i < 20; i++) {\n if (serverHashReceived[i] !== serverHash[i]) {\n throw new Error(\"RA2: wrong server hash\");\n }\n }\n\n // 7: Receive subtype\n await this._waitSockAsync(2 + 1 + 16);\n if (this._sock.rQshift16() !== 1) {\n throw new Error(\"RA2: wrong subtype\");\n }\n let subtype = (await serverCipher.receiveMessage(\n 1, this._sock.rQshiftBytes(1), this._sock.rQshiftBytes(16)));\n if (subtype === null) {\n throw new Error(\"RA2: failed to authenticate the message\");\n }\n subtype = subtype[0];\n if (subtype === 1) {\n if (this._getCredentials().username === undefined ||\n this._getCredentials().password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n }\n } else if (subtype === 2) {\n if (this._getCredentials().password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"password\"] } }));\n }\n } else {\n throw new Error(\"RA2: wrong subtype\");\n }\n await this._waitCredentialsAsync(subtype);\n let username;\n if (subtype === 1) {\n username = encodeUTF8(this._getCredentials().username).slice(0, 255);\n } else {\n username = \"\";\n }\n const password = encodeUTF8(this._getCredentials().password).slice(0, 255);\n const credentials = new Uint8Array(username.length + password.length + 2);\n credentials[0] = username.length;\n credentials[username.length + 1] = password.length;\n for (let i = 0; i < username.length; i++) {\n credentials[i + 1] = username.charCodeAt(i);\n }\n for (let i = 0; i < password.length; i++) {\n credentials[username.length + 2 + i] = password.charCodeAt(i);\n }\n this._sock.send(await clientCipher.makeMessage(credentials));\n }\n\n get hasStarted() {\n return this._hasStarted;\n }\n\n set hasStarted(s) {\n this._hasStarted = s;\n }\n}","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2021 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Performs MD5 hashing on a string of binary characters, returns an array of bytes\n */\n\nexport function MD5(d) {\n let r = M(V(Y(X(d), 8 * d.length)));\n return r;\n}\n\nfunction M(d) {\n let f = new Uint8Array(d.length);\n for (let i=0;i> 2);\n for (let m = 0; m < r.length; m++) r[m] = 0;\n for (let m = 0; m < 8 * d.length; m += 8) r[m >> 5] |= (255 & d.charCodeAt(m / 8)) << m % 32;\n return r;\n}\n\nfunction V(d) {\n let r = \"\";\n for (let m = 0; m < 32 * d.length; m += 8) r += String.fromCharCode(d[m >> 5] >>> m % 32 & 255);\n return r;\n}\n\nfunction Y(d, g) {\n d[g >> 5] |= 128 << g % 32, d[14 + (g + 64 >>> 9 << 4)] = g;\n let m = 1732584193, f = -271733879, r = -1732584194, i = 271733878;\n for (let n = 0; n < d.length; n += 16) {\n let h = m,\n t = f,\n g = r,\n e = i;\n f = ii(f = ii(f = ii(f = ii(f = hh(f = hh(f = hh(f = hh(f = gg(f = gg(f = gg(f = gg(f = ff(f = ff(f = ff(f = ff(f, r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 0], 7, -680876936), f, r, d[n + 1], 12, -389564586), m, f, d[n + 2], 17, 606105819), i, m, d[n + 3], 22, -1044525330), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 4], 7, -176418897), f, r, d[n + 5], 12, 1200080426), m, f, d[n + 6], 17, -1473231341), i, m, d[n + 7], 22, -45705983), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 8], 7, 1770035416), f, r, d[n + 9], 12, -1958414417), m, f, d[n + 10], 17, -42063), i, m, d[n + 11], 22, -1990404162), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 12], 7, 1804603682), f, r, d[n + 13], 12, -40341101), m, f, d[n + 14], 17, -1502002290), i, m, d[n + 15], 22, 1236535329), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 1], 5, -165796510), f, r, d[n + 6], 9, -1069501632), m, f, d[n + 11], 14, 643717713), i, m, d[n + 0], 20, -373897302), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 5], 5, -701558691), f, r, d[n + 10], 9, 38016083), m, f, d[n + 15], 14, -660478335), i, m, d[n + 4], 20, -405537848), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 9], 5, 568446438), f, r, d[n + 14], 9, -1019803690), m, f, d[n + 3], 14, -187363961), i, m, d[n + 8], 20, 1163531501), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 13], 5, -1444681467), f, r, d[n + 2], 9, -51403784), m, f, d[n + 7], 14, 1735328473), i, m, d[n + 12], 20, -1926607734), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 5], 4, -378558), f, r, d[n + 8], 11, -2022574463), m, f, d[n + 11], 16, 1839030562), i, m, d[n + 14], 23, -35309556), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 1], 4, -1530992060), f, r, d[n + 4], 11, 1272893353), m, f, d[n + 7], 16, -155497632), i, m, d[n + 10], 23, -1094730640), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 13], 4, 681279174), f, r, d[n + 0], 11, -358537222), m, f, d[n + 3], 16, -722521979), i, m, d[n + 6], 23, 76029189), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 9], 4, -640364487), f, r, d[n + 12], 11, -421815835), m, f, d[n + 15], 16, 530742520), i, m, d[n + 2], 23, -995338651), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 0], 6, -198630844), f, r, d[n + 7], 10, 1126891415), m, f, d[n + 14], 15, -1416354905), i, m, d[n + 5], 21, -57434055), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 12], 6, 1700485571), f, r, d[n + 3], 10, -1894986606), m, f, d[n + 10], 15, -1051523), i, m, d[n + 1], 21, -2054922799), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 8], 6, 1873313359), f, r, d[n + 15], 10, -30611744), m, f, d[n + 6], 15, -1560198380), i, m, d[n + 13], 21, 1309151649), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 4], 6, -145523070), f, r, d[n + 11], 10, -1120210379), m, f, d[n + 2], 15, 718787259), i, m, d[n + 9], 21, -343485551), m = add(m, h), f = add(f, t), r = add(r, g), i = add(i, e);\n }\n return Array(m, f, r, i);\n}\n\nfunction cmn(d, g, m, f, r, i) {\n return add(rol(add(add(g, d), add(f, i)), r), m);\n}\n\nfunction ff(d, g, m, f, r, i, n) {\n return cmn(g & m | ~g & f, d, g, r, i, n);\n}\n\nfunction gg(d, g, m, f, r, i, n) {\n return cmn(g & f | m & ~f, d, g, r, i, n);\n}\n\nfunction hh(d, g, m, f, r, i, n) {\n return cmn(g ^ m ^ f, d, g, r, i, n);\n}\n\nfunction ii(d, g, m, f, r, i, n) {\n return cmn(m ^ (g | ~f), d, g, r, i, n);\n}\n\nfunction add(d, g) {\n let m = (65535 & d) + (65535 & g);\n return (d >> 16) + (g >> 16) + (m >> 16) << 16 | 65535 & m;\n}\n\nfunction rol(d, g) {\n return d << g | d >>> 32 - g;\n}","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class RawDecoder {\n constructor() {\n this._lines = 0;\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if ((width === 0) || (height === 0)) {\n return true;\n }\n\n if (this._lines === 0) {\n this._lines = height;\n }\n\n const pixelSize = depth == 8 ? 1 : 4;\n const bytesPerLine = width * pixelSize;\n\n if (sock.rQwait(\"RAW\", bytesPerLine)) {\n return false;\n }\n\n const curY = y + (height - this._lines);\n const currHeight = Math.min(this._lines,\n Math.floor(sock.rQlen / bytesPerLine));\n const pixels = width * currHeight;\n\n let data = sock.rQ;\n let index = sock.rQi;\n\n // Convert data if needed\n if (depth == 8) {\n const newdata = new Uint8Array(pixels * 4);\n for (let i = 0; i < pixels; i++) {\n newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3;\n newdata[i * 4 + 1] = ((data[index + i] >> 2) & 0x3) * 255 / 3;\n newdata[i * 4 + 2] = ((data[index + i] >> 4) & 0x3) * 255 / 3;\n newdata[i * 4 + 3] = 255;\n }\n data = newdata;\n index = 0;\n }\n\n // Max sure the image is fully opaque\n for (let i = 0; i < pixels; i++) {\n data[index + i * 4 + 3] = 255;\n }\n\n display.blitImage(x, curY, width, currHeight, data, index);\n sock.rQskipBytes(currHeight * bytesPerLine);\n this._lines -= currHeight;\n if (this._lines > 0) {\n return false;\n }\n\n return true;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class CopyRectDecoder {\n decodeRect(x, y, width, height, sock, display, depth) {\n if (sock.rQwait(\"COPYRECT\", 4)) {\n return false;\n }\n\n let deltaX = sock.rQshift16();\n let deltaY = sock.rQshift16();\n\n if ((width === 0) || (height === 0)) {\n return true;\n }\n\n display.copyImage(deltaX, deltaY, x, y, width, height);\n\n return true;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class RREDecoder {\n constructor() {\n this._subrects = 0;\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._subrects === 0) {\n if (sock.rQwait(\"RRE\", 4 + 4)) {\n return false;\n }\n\n this._subrects = sock.rQshift32();\n\n let color = sock.rQshiftBytes(4); // Background\n display.fillRect(x, y, width, height, color);\n }\n\n while (this._subrects > 0) {\n if (sock.rQwait(\"RRE\", 4 + 8)) {\n return false;\n }\n\n let color = sock.rQshiftBytes(4);\n let sx = sock.rQshift16();\n let sy = sock.rQshift16();\n let swidth = sock.rQshift16();\n let sheight = sock.rQshift16();\n display.fillRect(x + sx, y + sy, swidth, sheight, color);\n\n this._subrects--;\n }\n\n return true;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport * as Log from '../util/logging.js';\n\nexport default class HextileDecoder {\n constructor() {\n this._tiles = 0;\n this._lastsubencoding = 0;\n this._tileBuffer = new Uint8Array(16 * 16 * 4);\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._tiles === 0) {\n this._tilesX = Math.ceil(width / 16);\n this._tilesY = Math.ceil(height / 16);\n this._totalTiles = this._tilesX * this._tilesY;\n this._tiles = this._totalTiles;\n }\n\n while (this._tiles > 0) {\n let bytes = 1;\n\n if (sock.rQwait(\"HEXTILE\", bytes)) {\n return false;\n }\n\n let rQ = sock.rQ;\n let rQi = sock.rQi;\n\n let subencoding = rQ[rQi]; // Peek\n if (subencoding > 30) { // Raw\n throw new Error(\"Illegal hextile subencoding (subencoding: \" +\n subencoding + \")\");\n }\n\n const currTile = this._totalTiles - this._tiles;\n const tileX = currTile % this._tilesX;\n const tileY = Math.floor(currTile / this._tilesX);\n const tx = x + tileX * 16;\n const ty = y + tileY * 16;\n const tw = Math.min(16, (x + width) - tx);\n const th = Math.min(16, (y + height) - ty);\n\n // Figure out how much we are expecting\n if (subencoding & 0x01) { // Raw\n bytes += tw * th * 4;\n } else {\n if (subencoding & 0x02) { // Background\n bytes += 4;\n }\n if (subencoding & 0x04) { // Foreground\n bytes += 4;\n }\n if (subencoding & 0x08) { // AnySubrects\n bytes++; // Since we aren't shifting it off\n\n if (sock.rQwait(\"HEXTILE\", bytes)) {\n return false;\n }\n\n let subrects = rQ[rQi + bytes - 1]; // Peek\n if (subencoding & 0x10) { // SubrectsColoured\n bytes += subrects * (4 + 2);\n } else {\n bytes += subrects * 2;\n }\n }\n }\n\n if (sock.rQwait(\"HEXTILE\", bytes)) {\n return false;\n }\n\n // We know the encoding and have a whole tile\n rQi++;\n if (subencoding === 0) {\n if (this._lastsubencoding & 0x01) {\n // Weird: ignore blanks are RAW\n Log.Debug(\" Ignoring blank after RAW\");\n } else {\n display.fillRect(tx, ty, tw, th, this._background);\n }\n } else if (subencoding & 0x01) { // Raw\n let pixels = tw * th;\n // Max sure the image is fully opaque\n for (let i = 0;i < pixels;i++) {\n rQ[rQi + i * 4 + 3] = 255;\n }\n display.blitImage(tx, ty, tw, th, rQ, rQi);\n rQi += bytes - 1;\n } else {\n if (subencoding & 0x02) { // Background\n this._background = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];\n rQi += 4;\n }\n if (subencoding & 0x04) { // Foreground\n this._foreground = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];\n rQi += 4;\n }\n\n this._startTile(tx, ty, tw, th, this._background);\n if (subencoding & 0x08) { // AnySubrects\n let subrects = rQ[rQi];\n rQi++;\n\n for (let s = 0; s < subrects; s++) {\n let color;\n if (subencoding & 0x10) { // SubrectsColoured\n color = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];\n rQi += 4;\n } else {\n color = this._foreground;\n }\n const xy = rQ[rQi];\n rQi++;\n const sx = (xy >> 4);\n const sy = (xy & 0x0f);\n\n const wh = rQ[rQi];\n rQi++;\n const sw = (wh >> 4) + 1;\n const sh = (wh & 0x0f) + 1;\n\n this._subTile(sx, sy, sw, sh, color);\n }\n }\n this._finishTile(display);\n }\n sock.rQi = rQi;\n this._lastsubencoding = subencoding;\n this._tiles--;\n }\n\n return true;\n }\n\n // start updating a tile\n _startTile(x, y, width, height, color) {\n this._tileX = x;\n this._tileY = y;\n this._tileW = width;\n this._tileH = height;\n\n const red = color[0];\n const green = color[1];\n const blue = color[2];\n\n const data = this._tileBuffer;\n for (let i = 0; i < width * height * 4; i += 4) {\n data[i] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n data[i + 3] = 255;\n }\n }\n\n // update sub-rectangle of the current tile\n _subTile(x, y, w, h, color) {\n const red = color[0];\n const green = color[1];\n const blue = color[2];\n const xend = x + w;\n const yend = y + h;\n\n const data = this._tileBuffer;\n const width = this._tileW;\n for (let j = y; j < yend; j++) {\n for (let i = x; i < xend; i++) {\n const p = (i + (j * width)) * 4;\n data[p] = red;\n data[p + 1] = green;\n data[p + 2] = blue;\n data[p + 3] = 255;\n }\n }\n }\n\n // draw the current tile to the screen\n _finishTile(display) {\n display.blitImage(this._tileX, this._tileY,\n this._tileW, this._tileH,\n this._tileBuffer, 0);\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * (c) 2012 Michael Tinglof, Joe Balaz, Les Piech (Mercuri.ca)\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport * as Log from '../util/logging.js';\nimport Inflator from \"../inflator.js\";\n\nexport default class TightDecoder {\n constructor() {\n this._ctl = null;\n this._filter = null;\n this._numColors = 0;\n this._palette = new Uint8Array(1024); // 256 * 4 (max palette size * max bytes-per-pixel)\n this._len = 0;\n\n this._zlibs = [];\n for (let i = 0; i < 4; i++) {\n this._zlibs[i] = new Inflator();\n }\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._ctl === null) {\n if (sock.rQwait(\"TIGHT compression-control\", 1)) {\n return false;\n }\n\n this._ctl = sock.rQshift8();\n\n // Reset streams if the server requests it\n for (let i = 0; i < 4; i++) {\n if ((this._ctl >> i) & 1) {\n this._zlibs[i].reset();\n Log.Info(\"Reset zlib stream \" + i);\n }\n }\n\n // Figure out filter\n this._ctl = this._ctl >> 4;\n }\n\n let ret;\n\n if (this._ctl === 0x08) {\n ret = this._fillRect(x, y, width, height,\n sock, display, depth);\n } else if (this._ctl === 0x09) {\n ret = this._jpegRect(x, y, width, height,\n sock, display, depth);\n } else if (this._ctl === 0x0A) {\n ret = this._pngRect(x, y, width, height,\n sock, display, depth);\n } else if ((this._ctl & 0x08) == 0) {\n ret = this._basicRect(this._ctl, x, y, width, height,\n sock, display, depth);\n } else {\n throw new Error(\"Illegal tight compression received (ctl: \" +\n this._ctl + \")\");\n }\n\n if (ret) {\n this._ctl = null;\n }\n\n return ret;\n }\n\n _fillRect(x, y, width, height, sock, display, depth) {\n if (sock.rQwait(\"TIGHT\", 3)) {\n return false;\n }\n\n const rQi = sock.rQi;\n const rQ = sock.rQ;\n\n display.fillRect(x, y, width, height,\n [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2]], false);\n sock.rQskipBytes(3);\n\n return true;\n }\n\n _jpegRect(x, y, width, height, sock, display, depth) {\n let data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n display.imageRect(x, y, width, height, \"image/jpeg\", data);\n\n return true;\n }\n\n _pngRect(x, y, width, height, sock, display, depth) {\n throw new Error(\"PNG received in standard Tight rect\");\n }\n\n _basicRect(ctl, x, y, width, height, sock, display, depth) {\n if (this._filter === null) {\n if (ctl & 0x4) {\n if (sock.rQwait(\"TIGHT\", 1)) {\n return false;\n }\n\n this._filter = sock.rQshift8();\n } else {\n // Implicit CopyFilter\n this._filter = 0;\n }\n }\n\n let streamId = ctl & 0x3;\n\n let ret;\n\n switch (this._filter) {\n case 0: // CopyFilter\n ret = this._copyFilter(streamId, x, y, width, height,\n sock, display, depth);\n break;\n case 1: // PaletteFilter\n ret = this._paletteFilter(streamId, x, y, width, height,\n sock, display, depth);\n break;\n case 2: // GradientFilter\n ret = this._gradientFilter(streamId, x, y, width, height,\n sock, display, depth);\n break;\n default:\n throw new Error(\"Illegal tight filter received (ctl: \" +\n this._filter + \")\");\n }\n\n if (ret) {\n this._filter = null;\n }\n\n return ret;\n }\n\n _copyFilter(streamId, x, y, width, height, sock, display, depth) {\n const uncompressedSize = width * height * 3;\n let data;\n\n if (uncompressedSize === 0) {\n return true;\n }\n\n if (uncompressedSize < 12) {\n if (sock.rQwait(\"TIGHT\", uncompressedSize)) {\n return false;\n }\n\n data = sock.rQshiftBytes(uncompressedSize);\n } else {\n data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n this._zlibs[streamId].setInput(data);\n data = this._zlibs[streamId].inflate(uncompressedSize);\n this._zlibs[streamId].setInput(null);\n }\n\n let rgbx = new Uint8Array(width * height * 4);\n for (let i = 0, j = 0; i < width * height * 4; i += 4, j += 3) {\n rgbx[i] = data[j];\n rgbx[i + 1] = data[j + 1];\n rgbx[i + 2] = data[j + 2];\n rgbx[i + 3] = 255; // Alpha\n }\n\n display.blitImage(x, y, width, height, rgbx, 0, false);\n\n return true;\n }\n\n _paletteFilter(streamId, x, y, width, height, sock, display, depth) {\n if (this._numColors === 0) {\n if (sock.rQwait(\"TIGHT palette\", 1)) {\n return false;\n }\n\n const numColors = sock.rQpeek8() + 1;\n const paletteSize = numColors * 3;\n\n if (sock.rQwait(\"TIGHT palette\", 1 + paletteSize)) {\n return false;\n }\n\n this._numColors = numColors;\n sock.rQskipBytes(1);\n\n sock.rQshiftTo(this._palette, paletteSize);\n }\n\n const bpp = (this._numColors <= 2) ? 1 : 8;\n const rowSize = Math.floor((width * bpp + 7) / 8);\n const uncompressedSize = rowSize * height;\n\n let data;\n\n if (uncompressedSize === 0) {\n return true;\n }\n\n if (uncompressedSize < 12) {\n if (sock.rQwait(\"TIGHT\", uncompressedSize)) {\n return false;\n }\n\n data = sock.rQshiftBytes(uncompressedSize);\n } else {\n data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n this._zlibs[streamId].setInput(data);\n data = this._zlibs[streamId].inflate(uncompressedSize);\n this._zlibs[streamId].setInput(null);\n }\n\n // Convert indexed (palette based) image data to RGB\n if (this._numColors == 2) {\n this._monoRect(x, y, width, height, data, this._palette, display);\n } else {\n this._paletteRect(x, y, width, height, data, this._palette, display);\n }\n\n this._numColors = 0;\n\n return true;\n }\n\n _monoRect(x, y, width, height, data, palette, display) {\n // Convert indexed (palette based) image data to RGB\n // TODO: reduce number of calculations inside loop\n const dest = this._getScratchBuffer(width * height * 4);\n const w = Math.floor((width + 7) / 8);\n const w1 = Math.floor(width / 8);\n\n for (let y = 0; y < height; y++) {\n let dp, sp, x;\n for (x = 0; x < w1; x++) {\n for (let b = 7; b >= 0; b--) {\n dp = (y * width + x * 8 + 7 - b) * 4;\n sp = (data[y * w + x] >> b & 1) * 3;\n dest[dp] = palette[sp];\n dest[dp + 1] = palette[sp + 1];\n dest[dp + 2] = palette[sp + 2];\n dest[dp + 3] = 255;\n }\n }\n\n for (let b = 7; b >= 8 - width % 8; b--) {\n dp = (y * width + x * 8 + 7 - b) * 4;\n sp = (data[y * w + x] >> b & 1) * 3;\n dest[dp] = palette[sp];\n dest[dp + 1] = palette[sp + 1];\n dest[dp + 2] = palette[sp + 2];\n dest[dp + 3] = 255;\n }\n }\n\n display.blitImage(x, y, width, height, dest, 0, false);\n }\n\n _paletteRect(x, y, width, height, data, palette, display) {\n // Convert indexed (palette based) image data to RGB\n const dest = this._getScratchBuffer(width * height * 4);\n const total = width * height * 4;\n for (let i = 0, j = 0; i < total; i += 4, j++) {\n const sp = data[j] * 3;\n dest[i] = palette[sp];\n dest[i + 1] = palette[sp + 1];\n dest[i + 2] = palette[sp + 2];\n dest[i + 3] = 255;\n }\n\n display.blitImage(x, y, width, height, dest, 0, false);\n }\n\n _gradientFilter(streamId, x, y, width, height, sock, display, depth) {\n throw new Error(\"Gradient filter not implemented\");\n }\n\n _readData(sock) {\n if (this._len === 0) {\n if (sock.rQwait(\"TIGHT\", 3)) {\n return null;\n }\n\n let byte;\n\n byte = sock.rQshift8();\n this._len = byte & 0x7f;\n if (byte & 0x80) {\n byte = sock.rQshift8();\n this._len |= (byte & 0x7f) << 7;\n if (byte & 0x80) {\n byte = sock.rQshift8();\n this._len |= byte << 14;\n }\n }\n }\n\n if (sock.rQwait(\"TIGHT\", this._len)) {\n return null;\n }\n\n let data = sock.rQshiftBytes(this._len);\n this._len = 0;\n\n return data;\n }\n\n _getScratchBuffer(size) {\n if (!this._scratchBuffer || (this._scratchBuffer.length < size)) {\n this._scratchBuffer = new Uint8Array(size);\n }\n return this._scratchBuffer;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport TightDecoder from './tight.js';\n\nexport default class TightPNGDecoder extends TightDecoder {\n _pngRect(x, y, width, height, sock, display, depth) {\n let data = this._readData(sock);\n if (data === null) {\n return false;\n }\n\n display.imageRect(x, y, width, height, \"image/png\", data);\n\n return true;\n }\n\n _basicRect(ctl, x, y, width, height, sock, display, depth) {\n throw new Error(\"BasicCompression received in TightPNG rect\");\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2021 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport Inflate from \"../inflator.js\";\n\nconst ZRLE_TILE_WIDTH = 64;\nconst ZRLE_TILE_HEIGHT = 64;\n\nexport default class ZRLEDecoder {\n constructor() {\n this._length = 0;\n this._inflator = new Inflate();\n\n this._pixelBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);\n this._tileBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n if (this._length === 0) {\n if (sock.rQwait(\"ZLib data length\", 4)) {\n return false;\n }\n this._length = sock.rQshift32();\n }\n if (sock.rQwait(\"Zlib data\", this._length)) {\n return false;\n }\n\n const data = sock.rQshiftBytes(this._length);\n\n this._inflator.setInput(data);\n\n for (let ty = y; ty < y + height; ty += ZRLE_TILE_HEIGHT) {\n let th = Math.min(ZRLE_TILE_HEIGHT, y + height - ty);\n\n for (let tx = x; tx < x + width; tx += ZRLE_TILE_WIDTH) {\n let tw = Math.min(ZRLE_TILE_WIDTH, x + width - tx);\n\n const tileSize = tw * th;\n const subencoding = this._inflator.inflate(1)[0];\n if (subencoding === 0) {\n // raw data\n const data = this._readPixels(tileSize);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else if (subencoding === 1) {\n // solid\n const background = this._readPixels(1);\n display.fillRect(tx, ty, tw, th, [background[0], background[1], background[2]]);\n } else if (subencoding >= 2 && subencoding <= 16) {\n const data = this._decodePaletteTile(subencoding, tileSize, tw, th);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else if (subencoding === 128) {\n const data = this._decodeRLETile(tileSize);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else if (subencoding >= 130 && subencoding <= 255) {\n const data = this._decodeRLEPaletteTile(subencoding - 128, tileSize);\n display.blitImage(tx, ty, tw, th, data, 0, false);\n } else {\n throw new Error('Unknown subencoding: ' + subencoding);\n }\n }\n }\n this._length = 0;\n return true;\n }\n\n _getBitsPerPixelInPalette(paletteSize) {\n if (paletteSize <= 2) {\n return 1;\n } else if (paletteSize <= 4) {\n return 2;\n } else if (paletteSize <= 16) {\n return 4;\n }\n }\n\n _readPixels(pixels) {\n let data = this._pixelBuffer;\n const buffer = this._inflator.inflate(3*pixels);\n for (let i = 0, j = 0; i < pixels*4; i += 4, j += 3) {\n data[i] = buffer[j];\n data[i + 1] = buffer[j + 1];\n data[i + 2] = buffer[j + 2];\n data[i + 3] = 255; // Add the Alpha\n }\n return data;\n }\n\n _decodePaletteTile(paletteSize, tileSize, tilew, tileh) {\n const data = this._tileBuffer;\n const palette = this._readPixels(paletteSize);\n const bitsPerPixel = this._getBitsPerPixelInPalette(paletteSize);\n const mask = (1 << bitsPerPixel) - 1;\n\n let offset = 0;\n let encoded = this._inflator.inflate(1)[0];\n\n for (let y=0; y>shift) & mask;\n\n data[offset] = palette[indexInPalette * 4];\n data[offset + 1] = palette[indexInPalette * 4 + 1];\n data[offset + 2] = palette[indexInPalette * 4 + 2];\n data[offset + 3] = palette[indexInPalette * 4 + 3];\n offset += 4;\n shift-=bitsPerPixel;\n }\n if (shift<8-bitsPerPixel && y= 128) {\n indexInPalette -= 128;\n length = this._readRLELength();\n }\n if (indexInPalette > paletteSize) {\n throw new Error('Too big index in palette: ' + indexInPalette + ', palette size: ' + paletteSize);\n }\n if (offset + length > tileSize) {\n throw new Error('Too big rle length in palette mode: ' + length + ', allowed length is: ' + (tileSize - offset));\n }\n\n for (let j = 0; j < length; j++) {\n data[offset * 4] = palette[indexInPalette * 4];\n data[offset * 4 + 1] = palette[indexInPalette * 4 + 1];\n data[offset * 4 + 2] = palette[indexInPalette * 4 + 2];\n data[offset * 4 + 3] = palette[indexInPalette * 4 + 3];\n offset++;\n }\n }\n return data;\n }\n\n _readRLELength() {\n let length = 0;\n let current = 0;\n do {\n current = this._inflator.inflate(1)[0];\n length += current;\n } while (current === 255);\n return length + 1;\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nexport default class JPEGDecoder {\n constructor() {\n // RealVNC will reuse the quantization tables\n // and Huffman tables, so we need to cache them.\n this._quantTables = [];\n this._huffmanTables = [];\n this._cachedQuantTables = [];\n this._cachedHuffmanTables = [];\n\n this._jpegLength = 0;\n this._segments = [];\n }\n\n decodeRect(x, y, width, height, sock, display, depth) {\n // A rect of JPEG encodings is simply a JPEG file\n if (!this._parseJPEG(sock.rQslice(0))) {\n return false;\n }\n const data = sock.rQshiftBytes(this._jpegLength);\n if (this._quantTables.length != 0 && this._huffmanTables.length != 0) {\n // If there are quantization tables and Huffman tables in the JPEG\n // image, we can directly render it.\n display.imageRect(x, y, width, height, \"image/jpeg\", data);\n return true;\n } else {\n // Otherwise we need to insert cached tables.\n const sofIndex = this._segments.findIndex(\n x => x[1] == 0xC0 || x[1] == 0xC2\n );\n if (sofIndex == -1) {\n throw new Error(\"Illegal JPEG image without SOF\");\n }\n let segments = this._segments.slice(0, sofIndex);\n segments = segments.concat(this._quantTables.length ?\n this._quantTables :\n this._cachedQuantTables);\n segments.push(this._segments[sofIndex]);\n segments = segments.concat(this._huffmanTables.length ?\n this._huffmanTables :\n this._cachedHuffmanTables,\n this._segments.slice(sofIndex + 1));\n let length = 0;\n for (let i = 0; i < segments.length; i++) {\n length += segments[i].length;\n }\n const data = new Uint8Array(length);\n length = 0;\n for (let i = 0; i < segments.length; i++) {\n data.set(segments[i], length);\n length += segments[i].length;\n }\n display.imageRect(x, y, width, height, \"image/jpeg\", data);\n return true;\n }\n }\n\n _parseJPEG(buffer) {\n if (this._quantTables.length != 0) {\n this._cachedQuantTables = this._quantTables;\n }\n if (this._huffmanTables.length != 0) {\n this._cachedHuffmanTables = this._huffmanTables;\n }\n this._quantTables = [];\n this._huffmanTables = [];\n this._segments = [];\n let i = 0;\n let bufferLength = buffer.length;\n while (true) {\n let j = i;\n if (j + 2 > bufferLength) {\n return false;\n }\n if (buffer[j] != 0xFF) {\n throw new Error(\"Illegal JPEG marker received (byte: \" +\n buffer[j] + \")\");\n }\n const type = buffer[j+1];\n j += 2;\n if (type == 0xD9) {\n this._jpegLength = j;\n this._segments.push(buffer.slice(i, j));\n return true;\n } else if (type == 0xDA) {\n // start of scan\n let hasFoundEndOfScan = false;\n for (let k = j + 3; k + 1 < bufferLength; k++) {\n if (buffer[k] == 0xFF && buffer[k+1] != 0x00 &&\n !(buffer[k+1] >= 0xD0 && buffer[k+1] <= 0xD7)) {\n j = k;\n hasFoundEndOfScan = true;\n break;\n }\n }\n if (!hasFoundEndOfScan) {\n return false;\n }\n this._segments.push(buffer.slice(i, j));\n i = j;\n continue;\n } else if (type >= 0xD0 && type < 0xD9 || type == 0x01) {\n // No length after marker\n this._segments.push(buffer.slice(i, j));\n i = j;\n continue;\n }\n if (j + 2 > bufferLength) {\n return false;\n }\n const length = (buffer[j] << 8) + buffer[j+1] - 2;\n if (length < 0) {\n throw new Error(\"Illegal JPEG length received (length: \" +\n length + \")\");\n }\n j += 2;\n if (j + length > bufferLength) {\n return false;\n }\n j += length;\n const segment = buffer.slice(i, j);\n if (type == 0xC4) {\n // Huffman tables\n this._huffmanTables.push(segment);\n } else if (type == 0xDB) {\n // Quantization tables\n this._quantTables.push(segment);\n }\n this._segments.push(segment);\n i = j;\n }\n }\n}\n","/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC Authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n */\n\nimport { toUnsigned32bit, toSigned32bit } from './util/int.js';\nimport * as Log from './util/logging.js';\nimport { encodeUTF8, decodeUTF8 } from './util/strings.js';\nimport { dragThreshold } from './util/browser.js';\nimport { clientToElement } from './util/element.js';\nimport { setCapture } from './util/events.js';\nimport EventTargetMixin from './util/eventtarget.js';\nimport Display from \"./display.js\";\nimport Inflator from \"./inflator.js\";\nimport Deflator from \"./deflator.js\";\nimport Keyboard from \"./input/keyboard.js\";\nimport GestureHandler from \"./input/gesturehandler.js\";\nimport Cursor from \"./util/cursor.js\";\nimport Websock from \"./websock.js\";\nimport DES from \"./des.js\";\nimport KeyTable from \"./input/keysym.js\";\nimport XtScancode from \"./input/xtscancodes.js\";\nimport { encodings } from \"./encodings.js\";\nimport RSAAESAuthenticationState from \"./ra2.js\";\nimport { MD5 } from \"./util/md5.js\";\n\nimport RawDecoder from \"./decoders/raw.js\";\nimport CopyRectDecoder from \"./decoders/copyrect.js\";\nimport RREDecoder from \"./decoders/rre.js\";\nimport HextileDecoder from \"./decoders/hextile.js\";\nimport TightDecoder from \"./decoders/tight.js\";\nimport TightPNGDecoder from \"./decoders/tightpng.js\";\nimport ZRLEDecoder from \"./decoders/zrle.js\";\nimport JPEGDecoder from \"./decoders/jpeg.js\";\n\n// How many seconds to wait for a disconnect to finish\nconst DISCONNECT_TIMEOUT = 3;\nconst DEFAULT_BACKGROUND = 'rgb(40, 40, 40)';\n\n// Minimum wait (ms) between two mouse moves\nconst MOUSE_MOVE_DELAY = 17;\n\n// Wheel thresholds\nconst WHEEL_STEP = 50; // Pixels needed for one step\nconst WHEEL_LINE_HEIGHT = 19; // Assumed pixels for one line step\n\n// Gesture thresholds\nconst GESTURE_ZOOMSENS = 75;\nconst GESTURE_SCRLSENS = 50;\nconst DOUBLE_TAP_TIMEOUT = 1000;\nconst DOUBLE_TAP_THRESHOLD = 50;\n\n// Security types\nconst securityTypeNone = 1;\nconst securityTypeVNCAuth = 2;\nconst securityTypeRA2ne = 6;\nconst securityTypeTight = 16;\nconst securityTypeVeNCrypt = 19;\nconst securityTypeXVP = 22;\nconst securityTypeARD = 30;\nconst securityTypeMSLogonII = 113;\n\n// Special Tight security types\nconst securityTypeUnixLogon = 129;\n\n// VeNCrypt security types\nconst securityTypePlain = 256;\n\n// Extended clipboard pseudo-encoding formats\nconst extendedClipboardFormatText = 1;\n/*eslint-disable no-unused-vars */\nconst extendedClipboardFormatRtf = 1 << 1;\nconst extendedClipboardFormatHtml = 1 << 2;\nconst extendedClipboardFormatDib = 1 << 3;\nconst extendedClipboardFormatFiles = 1 << 4;\n/*eslint-enable */\n\n// Extended clipboard pseudo-encoding actions\nconst extendedClipboardActionCaps = 1 << 24;\nconst extendedClipboardActionRequest = 1 << 25;\nconst extendedClipboardActionPeek = 1 << 26;\nconst extendedClipboardActionNotify = 1 << 27;\nconst extendedClipboardActionProvide = 1 << 28;\n\nexport default class RFB extends EventTargetMixin {\n constructor(target, urlOrChannel, options) {\n if (!target) {\n throw new Error(\"Must specify target\");\n }\n if (!urlOrChannel) {\n throw new Error(\"Must specify URL, WebSocket or RTCDataChannel\");\n }\n\n // We rely on modern APIs which might not be available in an\n // insecure context\n if (!window.isSecureContext) {\n Log.Error(\"noVNC requires a secure context (TLS). Expect crashes!\");\n }\n\n super();\n\n this._target = target;\n\n if (typeof urlOrChannel === \"string\") {\n this._url = urlOrChannel;\n } else {\n this._url = null;\n this._rawChannel = urlOrChannel;\n }\n\n // Connection details\n options = options || {};\n this._rfbCredentials = options.credentials || {};\n this._shared = 'shared' in options ? !!options.shared : true;\n this._repeaterID = options.repeaterID || '';\n this._wsProtocols = options.wsProtocols || [];\n\n // Internal state\n this._rfbConnectionState = '';\n this._rfbInitState = '';\n this._rfbAuthScheme = -1;\n this._rfbCleanDisconnect = true;\n this._rfbRSAAESAuthenticationState = null;\n\n // Server capabilities\n this._rfbVersion = 0;\n this._rfbMaxVersion = 3.8;\n this._rfbTightVNC = false;\n this._rfbVeNCryptState = 0;\n this._rfbXvpVer = 0;\n\n this._fbWidth = 0;\n this._fbHeight = 0;\n\n this._fbName = \"\";\n\n this._capabilities = { power: false };\n\n this._supportsFence = false;\n\n this._supportsContinuousUpdates = false;\n this._enabledContinuousUpdates = false;\n\n this._supportsSetDesktopSize = false;\n this._screenID = 0;\n this._screenFlags = 0;\n\n this._qemuExtKeyEventSupported = false;\n\n this._clipboardText = null;\n this._clipboardServerCapabilitiesActions = {};\n this._clipboardServerCapabilitiesFormats = {};\n\n // Internal objects\n this._sock = null; // Websock object\n this._display = null; // Display object\n this._flushing = false; // Display flushing state\n this._keyboard = null; // Keyboard input handler object\n this._gestures = null; // Gesture input handler object\n this._resizeObserver = null; // Resize observer object\n\n // Timers\n this._disconnTimer = null; // disconnection timer\n this._resizeTimeout = null; // resize rate limiting\n this._mouseMoveTimer = null;\n\n // Decoder states\n this._decoders = {};\n\n this._FBU = {\n rects: 0,\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n encoding: null,\n };\n\n // Mouse state\n this._mousePos = {};\n this._mouseButtonMask = 0;\n this._mouseLastMoveTime = 0;\n this._viewportDragging = false;\n this._viewportDragPos = {};\n this._viewportHasMoved = false;\n this._accumulatedWheelDeltaX = 0;\n this._accumulatedWheelDeltaY = 0;\n\n // Gesture state\n this._gestureLastTapTime = null;\n this._gestureFirstDoubleTapEv = null;\n this._gestureLastMagnitudeX = 0;\n this._gestureLastMagnitudeY = 0;\n\n // Bound event handlers\n this._eventHandlers = {\n focusCanvas: this._focusCanvas.bind(this),\n handleResize: this._handleResize.bind(this),\n handleMouse: this._handleMouse.bind(this),\n handleWheel: this._handleWheel.bind(this),\n handleGesture: this._handleGesture.bind(this),\n handleRSAAESCredentialsRequired: this._handleRSAAESCredentialsRequired.bind(this),\n handleRSAAESServerVerification: this._handleRSAAESServerVerification.bind(this),\n };\n\n // main setup\n Log.Debug(\">> RFB.constructor\");\n\n // Create DOM elements\n this._screen = document.createElement('div');\n this._screen.style.display = 'flex';\n this._screen.style.width = '100%';\n this._screen.style.height = '100%';\n this._screen.style.overflow = 'auto';\n this._screen.style.background = DEFAULT_BACKGROUND;\n this._canvas = document.createElement('canvas');\n this._canvas.style.margin = 'auto';\n // Some browsers add an outline on focus\n this._canvas.style.outline = 'none';\n this._canvas.width = 0;\n this._canvas.height = 0;\n this._canvas.tabIndex = -1;\n this._screen.appendChild(this._canvas);\n\n // Cursor\n this._cursor = new Cursor();\n\n // XXX: TightVNC 2.8.11 sends no cursor at all until Windows changes\n // it. Result: no cursor at all until a window border or an edit field\n // is hit blindly. But there are also VNC servers that draw the cursor\n // in the framebuffer and don't send the empty local cursor. There is\n // no way to satisfy both sides.\n //\n // The spec is unclear on this \"initial cursor\" issue. Many other\n // viewers (TigerVNC, RealVNC, Remmina) display an arrow as the\n // initial cursor instead.\n this._cursorImage = RFB.cursors.none;\n\n // populate decoder array with objects\n this._decoders[encodings.encodingRaw] = new RawDecoder();\n this._decoders[encodings.encodingCopyRect] = new CopyRectDecoder();\n this._decoders[encodings.encodingRRE] = new RREDecoder();\n this._decoders[encodings.encodingHextile] = new HextileDecoder();\n this._decoders[encodings.encodingTight] = new TightDecoder();\n this._decoders[encodings.encodingTightPNG] = new TightPNGDecoder();\n this._decoders[encodings.encodingZRLE] = new ZRLEDecoder();\n this._decoders[encodings.encodingJPEG] = new JPEGDecoder();\n\n // NB: nothing that needs explicit teardown should be done\n // before this point, since this can throw an exception\n try {\n this._display = new Display(this._canvas);\n } catch (exc) {\n Log.Error(\"Display exception: \" + exc);\n throw exc;\n }\n this._display.onflush = this._onFlush.bind(this);\n\n this._keyboard = new Keyboard(this._canvas);\n this._keyboard.onkeyevent = this._handleKeyEvent.bind(this);\n\n this._gestures = new GestureHandler();\n\n this._sock = new Websock();\n this._sock.on('open', this._socketOpen.bind(this));\n this._sock.on('close', this._socketClose.bind(this));\n this._sock.on('message', this._handleMessage.bind(this));\n this._sock.on('error', this._socketError.bind(this));\n\n this._expectedClientWidth = null;\n this._expectedClientHeight = null;\n this._resizeObserver = new ResizeObserver(this._eventHandlers.handleResize);\n\n // All prepared, kick off the connection\n this._updateConnectionState('connecting');\n\n Log.Debug(\"<< RFB.constructor\");\n\n // ===== PROPERTIES =====\n\n this.dragViewport = false;\n this.focusOnClick = true;\n\n this._viewOnly = false;\n this._clipViewport = false;\n this._clippingViewport = false;\n this._scaleViewport = false;\n this._resizeSession = false;\n\n this._showDotCursor = false;\n if (options.showDotCursor !== undefined) {\n Log.Warn(\"Specifying showDotCursor as a RFB constructor argument is deprecated\");\n this._showDotCursor = options.showDotCursor;\n }\n\n this._qualityLevel = 6;\n this._compressionLevel = 2;\n }\n\n // ===== PROPERTIES =====\n\n get viewOnly() { return this._viewOnly; }\n set viewOnly(viewOnly) {\n this._viewOnly = viewOnly;\n\n if (this._rfbConnectionState === \"connecting\" ||\n this._rfbConnectionState === \"connected\") {\n if (viewOnly) {\n this._keyboard.ungrab();\n } else {\n this._keyboard.grab();\n }\n }\n }\n\n get capabilities() { return this._capabilities; }\n\n get clippingViewport() { return this._clippingViewport; }\n _setClippingViewport(on) {\n if (on === this._clippingViewport) {\n return;\n }\n this._clippingViewport = on;\n this.dispatchEvent(new CustomEvent(\"clippingviewport\",\n { detail: this._clippingViewport }));\n }\n\n get touchButton() { return 0; }\n set touchButton(button) { Log.Warn(\"Using old API!\"); }\n\n get clipViewport() { return this._clipViewport; }\n set clipViewport(viewport) {\n this._clipViewport = viewport;\n this._updateClip();\n }\n\n get scaleViewport() { return this._scaleViewport; }\n set scaleViewport(scale) {\n this._scaleViewport = scale;\n // Scaling trumps clipping, so we may need to adjust\n // clipping when enabling or disabling scaling\n if (scale && this._clipViewport) {\n this._updateClip();\n }\n this._updateScale();\n if (!scale && this._clipViewport) {\n this._updateClip();\n }\n }\n\n get resizeSession() { return this._resizeSession; }\n set resizeSession(resize) {\n this._resizeSession = resize;\n if (resize) {\n this._requestRemoteResize();\n }\n }\n\n get showDotCursor() { return this._showDotCursor; }\n set showDotCursor(show) {\n this._showDotCursor = show;\n this._refreshCursor();\n }\n\n get background() { return this._screen.style.background; }\n set background(cssValue) { this._screen.style.background = cssValue; }\n\n get qualityLevel() {\n return this._qualityLevel;\n }\n set qualityLevel(qualityLevel) {\n if (!Number.isInteger(qualityLevel) || qualityLevel < 0 || qualityLevel > 9) {\n Log.Error(\"qualityLevel must be an integer between 0 and 9\");\n return;\n }\n\n if (this._qualityLevel === qualityLevel) {\n return;\n }\n\n this._qualityLevel = qualityLevel;\n\n if (this._rfbConnectionState === 'connected') {\n this._sendEncodings();\n }\n }\n\n get compressionLevel() {\n return this._compressionLevel;\n }\n set compressionLevel(compressionLevel) {\n if (!Number.isInteger(compressionLevel) || compressionLevel < 0 || compressionLevel > 9) {\n Log.Error(\"compressionLevel must be an integer between 0 and 9\");\n return;\n }\n\n if (this._compressionLevel === compressionLevel) {\n return;\n }\n\n this._compressionLevel = compressionLevel;\n\n if (this._rfbConnectionState === 'connected') {\n this._sendEncodings();\n }\n }\n\n // ===== PUBLIC METHODS =====\n\n disconnect() {\n this._updateConnectionState('disconnecting');\n this._sock.off('error');\n this._sock.off('message');\n this._sock.off('open');\n if (this._rfbRSAAESAuthenticationState !== null) {\n this._rfbRSAAESAuthenticationState.disconnect();\n }\n }\n\n approveServer() {\n if (this._rfbRSAAESAuthenticationState !== null) {\n this._rfbRSAAESAuthenticationState.approveServer();\n }\n }\n\n sendCredentials(creds) {\n this._rfbCredentials = creds;\n this._resumeAuthentication();\n }\n\n sendCtrlAltDel() {\n if (this._rfbConnectionState !== 'connected' || this._viewOnly) { return; }\n Log.Info(\"Sending Ctrl-Alt-Del\");\n\n this.sendKey(KeyTable.XK_Control_L, \"ControlLeft\", true);\n this.sendKey(KeyTable.XK_Alt_L, \"AltLeft\", true);\n this.sendKey(KeyTable.XK_Delete, \"Delete\", true);\n this.sendKey(KeyTable.XK_Delete, \"Delete\", false);\n this.sendKey(KeyTable.XK_Alt_L, \"AltLeft\", false);\n this.sendKey(KeyTable.XK_Control_L, \"ControlLeft\", false);\n }\n\n machineShutdown() {\n this._xvpOp(1, 2);\n }\n\n machineReboot() {\n this._xvpOp(1, 3);\n }\n\n machineReset() {\n this._xvpOp(1, 4);\n }\n\n // Send a key press. If 'down' is not specified then send a down key\n // followed by an up key.\n sendKey(keysym, code, down) {\n if (this._rfbConnectionState !== 'connected' || this._viewOnly) { return; }\n\n if (down === undefined) {\n this.sendKey(keysym, code, true);\n this.sendKey(keysym, code, false);\n return;\n }\n\n const scancode = XtScancode[code];\n\n if (this._qemuExtKeyEventSupported && scancode) {\n // 0 is NoSymbol\n keysym = keysym || 0;\n\n Log.Info(\"Sending key (\" + (down ? \"down\" : \"up\") + \"): keysym \" + keysym + \", scancode \" + scancode);\n\n RFB.messages.QEMUExtendedKeyEvent(this._sock, keysym, down, scancode);\n } else {\n if (!keysym) {\n return;\n }\n Log.Info(\"Sending keysym (\" + (down ? \"down\" : \"up\") + \"): \" + keysym);\n RFB.messages.keyEvent(this._sock, keysym, down ? 1 : 0);\n }\n }\n\n focus(options) {\n this._canvas.focus(options);\n }\n\n blur() {\n this._canvas.blur();\n }\n\n clipboardPasteFrom(text) {\n if (this._rfbConnectionState !== 'connected' || this._viewOnly) { return; }\n\n if (this._clipboardServerCapabilitiesFormats[extendedClipboardFormatText] &&\n this._clipboardServerCapabilitiesActions[extendedClipboardActionNotify]) {\n\n this._clipboardText = text;\n RFB.messages.extendedClipboardNotify(this._sock, [extendedClipboardFormatText]);\n } else {\n let length, i;\n let data;\n\n length = 0;\n // eslint-disable-next-line no-unused-vars\n for (let codePoint of text) {\n length++;\n }\n\n data = new Uint8Array(length);\n\n i = 0;\n for (let codePoint of text) {\n let code = codePoint.codePointAt(0);\n\n /* Only ISO 8859-1 is supported */\n if (code > 0xff) {\n code = 0x3f; // '?'\n }\n\n data[i++] = code;\n }\n\n RFB.messages.clientCutText(this._sock, data);\n }\n }\n\n getImageData() {\n return this._display.getImageData();\n }\n\n toDataURL(type, encoderOptions) {\n return this._display.toDataURL(type, encoderOptions);\n }\n\n toBlob(callback, type, quality) {\n return this._display.toBlob(callback, type, quality);\n }\n\n // ===== PRIVATE METHODS =====\n\n _connect() {\n Log.Debug(\">> RFB.connect\");\n\n if (this._url) {\n Log.Info(`connecting to ${this._url}`);\n this._sock.open(this._url, this._wsProtocols);\n } else {\n Log.Info(`attaching ${this._rawChannel} to Websock`);\n this._sock.attach(this._rawChannel);\n\n if (this._sock.readyState === 'closed') {\n throw Error(\"Cannot use already closed WebSocket/RTCDataChannel\");\n }\n\n if (this._sock.readyState === 'open') {\n // FIXME: _socketOpen() can in theory call _fail(), which\n // isn't allowed this early, but I'm not sure that can\n // happen without a bug messing up our state variables\n this._socketOpen();\n }\n }\n\n // Make our elements part of the page\n this._target.appendChild(this._screen);\n\n this._gestures.attach(this._canvas);\n\n this._cursor.attach(this._canvas);\n this._refreshCursor();\n\n // Monitor size changes of the screen element\n this._resizeObserver.observe(this._screen);\n\n // Always grab focus on some kind of click event\n this._canvas.addEventListener(\"mousedown\", this._eventHandlers.focusCanvas);\n this._canvas.addEventListener(\"touchstart\", this._eventHandlers.focusCanvas);\n\n // Mouse events\n this._canvas.addEventListener('mousedown', this._eventHandlers.handleMouse);\n this._canvas.addEventListener('mouseup', this._eventHandlers.handleMouse);\n this._canvas.addEventListener('mousemove', this._eventHandlers.handleMouse);\n // Prevent middle-click pasting (see handler for why we bind to document)\n this._canvas.addEventListener('click', this._eventHandlers.handleMouse);\n // preventDefault() on mousedown doesn't stop this event for some\n // reason so we have to explicitly block it\n this._canvas.addEventListener('contextmenu', this._eventHandlers.handleMouse);\n\n // Wheel events\n this._canvas.addEventListener(\"wheel\", this._eventHandlers.handleWheel);\n\n // Gesture events\n this._canvas.addEventListener(\"gesturestart\", this._eventHandlers.handleGesture);\n this._canvas.addEventListener(\"gesturemove\", this._eventHandlers.handleGesture);\n this._canvas.addEventListener(\"gestureend\", this._eventHandlers.handleGesture);\n\n Log.Debug(\"<< RFB.connect\");\n }\n\n _disconnect() {\n Log.Debug(\">> RFB.disconnect\");\n this._cursor.detach();\n this._canvas.removeEventListener(\"gesturestart\", this._eventHandlers.handleGesture);\n this._canvas.removeEventListener(\"gesturemove\", this._eventHandlers.handleGesture);\n this._canvas.removeEventListener(\"gestureend\", this._eventHandlers.handleGesture);\n this._canvas.removeEventListener(\"wheel\", this._eventHandlers.handleWheel);\n this._canvas.removeEventListener('mousedown', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('mouseup', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('mousemove', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('click', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener('contextmenu', this._eventHandlers.handleMouse);\n this._canvas.removeEventListener(\"mousedown\", this._eventHandlers.focusCanvas);\n this._canvas.removeEventListener(\"touchstart\", this._eventHandlers.focusCanvas);\n this._resizeObserver.disconnect();\n this._keyboard.ungrab();\n this._gestures.detach();\n this._sock.close();\n try {\n this._target.removeChild(this._screen);\n } catch (e) {\n if (e.name === 'NotFoundError') {\n // Some cases where the initial connection fails\n // can disconnect before the _screen is created\n } else {\n throw e;\n }\n }\n clearTimeout(this._resizeTimeout);\n clearTimeout(this._mouseMoveTimer);\n Log.Debug(\"<< RFB.disconnect\");\n }\n\n _socketOpen() {\n if ((this._rfbConnectionState === 'connecting') &&\n (this._rfbInitState === '')) {\n this._rfbInitState = 'ProtocolVersion';\n Log.Debug(\"Starting VNC handshake\");\n } else {\n this._fail(\"Unexpected server connection while \" +\n this._rfbConnectionState);\n }\n }\n\n _socketClose(e) {\n Log.Debug(\"WebSocket on-close event\");\n let msg = \"\";\n if (e.code) {\n msg = \"(code: \" + e.code;\n if (e.reason) {\n msg += \", reason: \" + e.reason;\n }\n msg += \")\";\n }\n switch (this._rfbConnectionState) {\n case 'connecting':\n this._fail(\"Connection closed \" + msg);\n break;\n case 'connected':\n // Handle disconnects that were initiated server-side\n this._updateConnectionState('disconnecting');\n this._updateConnectionState('disconnected');\n break;\n case 'disconnecting':\n // Normal disconnection path\n this._updateConnectionState('disconnected');\n break;\n case 'disconnected':\n this._fail(\"Unexpected server disconnect \" +\n \"when already disconnected \" + msg);\n break;\n default:\n this._fail(\"Unexpected server disconnect before connecting \" +\n msg);\n break;\n }\n this._sock.off('close');\n // Delete reference to raw channel to allow cleanup.\n this._rawChannel = null;\n }\n\n _socketError(e) {\n Log.Warn(\"WebSocket on-error event\");\n }\n\n _focusCanvas(event) {\n if (!this.focusOnClick) {\n return;\n }\n\n this.focus({ preventScroll: true });\n }\n\n _setDesktopName(name) {\n this._fbName = name;\n this.dispatchEvent(new CustomEvent(\n \"desktopname\",\n { detail: { name: this._fbName } }));\n }\n\n _saveExpectedClientSize() {\n this._expectedClientWidth = this._screen.clientWidth;\n this._expectedClientHeight = this._screen.clientHeight;\n }\n\n _currentClientSize() {\n return [this._screen.clientWidth, this._screen.clientHeight];\n }\n\n _clientHasExpectedSize() {\n const [currentWidth, currentHeight] = this._currentClientSize();\n return currentWidth == this._expectedClientWidth &&\n currentHeight == this._expectedClientHeight;\n }\n\n _handleResize() {\n // Don't change anything if the client size is already as expected\n if (this._clientHasExpectedSize()) {\n return;\n }\n // If the window resized then our screen element might have\n // as well. Update the viewport dimensions.\n window.requestAnimationFrame(() => {\n this._updateClip();\n this._updateScale();\n });\n\n if (this._resizeSession) {\n // Request changing the resolution of the remote display to\n // the size of the local browser viewport.\n\n // In order to not send multiple requests before the browser-resize\n // is finished we wait 0.5 seconds before sending the request.\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = setTimeout(this._requestRemoteResize.bind(this), 500);\n }\n }\n\n // Update state of clipping in Display object, and make sure the\n // configured viewport matches the current screen size\n _updateClip() {\n const curClip = this._display.clipViewport;\n let newClip = this._clipViewport;\n\n if (this._scaleViewport) {\n // Disable viewport clipping if we are scaling\n newClip = false;\n }\n\n if (curClip !== newClip) {\n this._display.clipViewport = newClip;\n }\n\n if (newClip) {\n // When clipping is enabled, the screen is limited to\n // the size of the container.\n const size = this._screenSize();\n this._display.viewportChangeSize(size.w, size.h);\n this._fixScrollbars();\n this._setClippingViewport(size.w < this._display.width ||\n size.h < this._display.height);\n } else {\n this._setClippingViewport(false);\n }\n\n // When changing clipping we might show or hide scrollbars.\n // This causes the expected client dimensions to change.\n if (curClip !== newClip) {\n this._saveExpectedClientSize();\n }\n }\n\n _updateScale() {\n if (!this._scaleViewport) {\n this._display.scale = 1.0;\n } else {\n const size = this._screenSize();\n this._display.autoscale(size.w, size.h);\n }\n this._fixScrollbars();\n }\n\n // Requests a change of remote desktop size. This message is an extension\n // and may only be sent if we have received an ExtendedDesktopSize message\n _requestRemoteResize() {\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = null;\n\n if (!this._resizeSession || this._viewOnly ||\n !this._supportsSetDesktopSize) {\n return;\n }\n\n const size = this._screenSize();\n\n RFB.messages.setDesktopSize(this._sock,\n Math.floor(size.w), Math.floor(size.h),\n this._screenID, this._screenFlags);\n\n Log.Debug('Requested new desktop size: ' +\n size.w + 'x' + size.h);\n }\n\n // Gets the the size of the available screen\n _screenSize() {\n let r = this._screen.getBoundingClientRect();\n return { w: r.width, h: r.height };\n }\n\n _fixScrollbars() {\n // This is a hack because Safari on macOS screws up the calculation\n // for when scrollbars are needed. We get scrollbars when making the\n // browser smaller, despite remote resize being enabled. So to fix it\n // we temporarily toggle them off and on.\n const orig = this._screen.style.overflow;\n this._screen.style.overflow = 'hidden';\n // Force Safari to recalculate the layout by asking for\n // an element's dimensions\n this._screen.getBoundingClientRect();\n this._screen.style.overflow = orig;\n }\n\n /*\n * Connection states:\n * connecting\n * connected\n * disconnecting\n * disconnected - permanent state\n */\n _updateConnectionState(state) {\n const oldstate = this._rfbConnectionState;\n\n if (state === oldstate) {\n Log.Debug(\"Already in state '\" + state + \"', ignoring\");\n return;\n }\n\n // The 'disconnected' state is permanent for each RFB object\n if (oldstate === 'disconnected') {\n Log.Error(\"Tried changing state of a disconnected RFB object\");\n return;\n }\n\n // Ensure proper transitions before doing anything\n switch (state) {\n case 'connected':\n if (oldstate !== 'connecting') {\n Log.Error(\"Bad transition to connected state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n case 'disconnected':\n if (oldstate !== 'disconnecting') {\n Log.Error(\"Bad transition to disconnected state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n case 'connecting':\n if (oldstate !== '') {\n Log.Error(\"Bad transition to connecting state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n case 'disconnecting':\n if (oldstate !== 'connected' && oldstate !== 'connecting') {\n Log.Error(\"Bad transition to disconnecting state, \" +\n \"previous connection state: \" + oldstate);\n return;\n }\n break;\n\n default:\n Log.Error(\"Unknown connection state: \" + state);\n return;\n }\n\n // State change actions\n\n this._rfbConnectionState = state;\n\n Log.Debug(\"New state '\" + state + \"', was '\" + oldstate + \"'.\");\n\n if (this._disconnTimer && state !== 'disconnecting') {\n Log.Debug(\"Clearing disconnect timer\");\n clearTimeout(this._disconnTimer);\n this._disconnTimer = null;\n\n // make sure we don't get a double event\n this._sock.off('close');\n }\n\n switch (state) {\n case 'connecting':\n this._connect();\n break;\n\n case 'connected':\n this.dispatchEvent(new CustomEvent(\"connect\", { detail: {} }));\n break;\n\n case 'disconnecting':\n this._disconnect();\n\n this._disconnTimer = setTimeout(() => {\n Log.Error(\"Disconnection timed out.\");\n this._updateConnectionState('disconnected');\n }, DISCONNECT_TIMEOUT * 1000);\n break;\n\n case 'disconnected':\n this.dispatchEvent(new CustomEvent(\n \"disconnect\", { detail:\n { clean: this._rfbCleanDisconnect } }));\n break;\n }\n }\n\n /* Print errors and disconnect\n *\n * The parameter 'details' is used for information that\n * should be logged but not sent to the user interface.\n */\n _fail(details) {\n switch (this._rfbConnectionState) {\n case 'disconnecting':\n Log.Error(\"Failed when disconnecting: \" + details);\n break;\n case 'connected':\n Log.Error(\"Failed while connected: \" + details);\n break;\n case 'connecting':\n Log.Error(\"Failed when connecting: \" + details);\n break;\n default:\n Log.Error(\"RFB failure: \" + details);\n break;\n }\n this._rfbCleanDisconnect = false; //This is sent to the UI\n\n // Transition to disconnected without waiting for socket to close\n this._updateConnectionState('disconnecting');\n this._updateConnectionState('disconnected');\n\n return false;\n }\n\n _setCapability(cap, val) {\n this._capabilities[cap] = val;\n this.dispatchEvent(new CustomEvent(\"capabilities\",\n { detail: { capabilities: this._capabilities } }));\n }\n\n _handleMessage() {\n if (this._sock.rQlen === 0) {\n Log.Warn(\"handleMessage called on an empty receive queue\");\n return;\n }\n\n switch (this._rfbConnectionState) {\n case 'disconnected':\n Log.Error(\"Got data while disconnected\");\n break;\n case 'connected':\n while (true) {\n if (this._flushing) {\n break;\n }\n if (!this._normalMsg()) {\n break;\n }\n if (this._sock.rQlen === 0) {\n break;\n }\n }\n break;\n case 'connecting':\n while (this._rfbConnectionState === 'connecting') {\n if (!this._initMsg()) {\n break;\n }\n }\n break;\n default:\n Log.Error(\"Got data while in an invalid state\");\n break;\n }\n }\n\n _handleKeyEvent(keysym, code, down) {\n this.sendKey(keysym, code, down);\n }\n\n _handleMouse(ev) {\n /*\n * We don't check connection status or viewOnly here as the\n * mouse events might be used to control the viewport\n */\n\n if (ev.type === 'click') {\n /*\n * Note: This is only needed for the 'click' event as it fails\n * to fire properly for the target element so we have\n * to listen on the document element instead.\n */\n if (ev.target !== this._canvas) {\n return;\n }\n }\n\n // FIXME: if we're in view-only and not dragging,\n // should we stop events?\n ev.stopPropagation();\n ev.preventDefault();\n\n if ((ev.type === 'click') || (ev.type === 'contextmenu')) {\n return;\n }\n\n let pos = clientToElement(ev.clientX, ev.clientY,\n this._canvas);\n\n switch (ev.type) {\n case 'mousedown':\n setCapture(this._canvas);\n this._handleMouseButton(pos.x, pos.y,\n true, 1 << ev.button);\n break;\n case 'mouseup':\n this._handleMouseButton(pos.x, pos.y,\n false, 1 << ev.button);\n break;\n case 'mousemove':\n this._handleMouseMove(pos.x, pos.y);\n break;\n }\n }\n\n _handleMouseButton(x, y, down, bmask) {\n if (this.dragViewport) {\n if (down && !this._viewportDragging) {\n this._viewportDragging = true;\n this._viewportDragPos = {'x': x, 'y': y};\n this._viewportHasMoved = false;\n\n // Skip sending mouse events\n return;\n } else {\n this._viewportDragging = false;\n\n // If we actually performed a drag then we are done\n // here and should not send any mouse events\n if (this._viewportHasMoved) {\n return;\n }\n\n // Otherwise we treat this as a mouse click event.\n // Send the button down event here, as the button up\n // event is sent at the end of this function.\n this._sendMouse(x, y, bmask);\n }\n }\n\n // Flush waiting move event first\n if (this._mouseMoveTimer !== null) {\n clearTimeout(this._mouseMoveTimer);\n this._mouseMoveTimer = null;\n this._sendMouse(x, y, this._mouseButtonMask);\n }\n\n if (down) {\n this._mouseButtonMask |= bmask;\n } else {\n this._mouseButtonMask &= ~bmask;\n }\n\n this._sendMouse(x, y, this._mouseButtonMask);\n }\n\n _handleMouseMove(x, y) {\n if (this._viewportDragging) {\n const deltaX = this._viewportDragPos.x - x;\n const deltaY = this._viewportDragPos.y - y;\n\n if (this._viewportHasMoved || (Math.abs(deltaX) > dragThreshold ||\n Math.abs(deltaY) > dragThreshold)) {\n this._viewportHasMoved = true;\n\n this._viewportDragPos = {'x': x, 'y': y};\n this._display.viewportChangePos(deltaX, deltaY);\n }\n\n // Skip sending mouse events\n return;\n }\n\n this._mousePos = { 'x': x, 'y': y };\n\n // Limit many mouse move events to one every MOUSE_MOVE_DELAY ms\n if (this._mouseMoveTimer == null) {\n\n const timeSinceLastMove = Date.now() - this._mouseLastMoveTime;\n if (timeSinceLastMove > MOUSE_MOVE_DELAY) {\n this._sendMouse(x, y, this._mouseButtonMask);\n this._mouseLastMoveTime = Date.now();\n } else {\n // Too soon since the latest move, wait the remaining time\n this._mouseMoveTimer = setTimeout(() => {\n this._handleDelayedMouseMove();\n }, MOUSE_MOVE_DELAY - timeSinceLastMove);\n }\n }\n }\n\n _handleDelayedMouseMove() {\n this._mouseMoveTimer = null;\n this._sendMouse(this._mousePos.x, this._mousePos.y,\n this._mouseButtonMask);\n this._mouseLastMoveTime = Date.now();\n }\n\n _sendMouse(x, y, mask) {\n if (this._rfbConnectionState !== 'connected') { return; }\n if (this._viewOnly) { return; } // View only, skip mouse events\n\n RFB.messages.pointerEvent(this._sock, this._display.absX(x),\n this._display.absY(y), mask);\n }\n\n _handleWheel(ev) {\n if (this._rfbConnectionState !== 'connected') { return; }\n if (this._viewOnly) { return; } // View only, skip mouse events\n\n ev.stopPropagation();\n ev.preventDefault();\n\n let pos = clientToElement(ev.clientX, ev.clientY,\n this._canvas);\n\n let dX = ev.deltaX;\n let dY = ev.deltaY;\n\n // Pixel units unless it's non-zero.\n // Note that if deltamode is line or page won't matter since we aren't\n // sending the mouse wheel delta to the server anyway.\n // The difference between pixel and line can be important however since\n // we have a threshold that can be smaller than the line height.\n if (ev.deltaMode !== 0) {\n dX *= WHEEL_LINE_HEIGHT;\n dY *= WHEEL_LINE_HEIGHT;\n }\n\n // Mouse wheel events are sent in steps over VNC. This means that the VNC\n // protocol can't handle a wheel event with specific distance or speed.\n // Therefor, if we get a lot of small mouse wheel events we combine them.\n this._accumulatedWheelDeltaX += dX;\n this._accumulatedWheelDeltaY += dY;\n\n // Generate a mouse wheel step event when the accumulated delta\n // for one of the axes is large enough.\n if (Math.abs(this._accumulatedWheelDeltaX) >= WHEEL_STEP) {\n if (this._accumulatedWheelDeltaX < 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 5);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 5);\n } else if (this._accumulatedWheelDeltaX > 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 6);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 6);\n }\n\n this._accumulatedWheelDeltaX = 0;\n }\n if (Math.abs(this._accumulatedWheelDeltaY) >= WHEEL_STEP) {\n if (this._accumulatedWheelDeltaY < 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 3);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 3);\n } else if (this._accumulatedWheelDeltaY > 0) {\n this._handleMouseButton(pos.x, pos.y, true, 1 << 4);\n this._handleMouseButton(pos.x, pos.y, false, 1 << 4);\n }\n\n this._accumulatedWheelDeltaY = 0;\n }\n }\n\n _fakeMouseMove(ev, elementX, elementY) {\n this._handleMouseMove(elementX, elementY);\n this._cursor.move(ev.detail.clientX, ev.detail.clientY);\n }\n\n _handleTapEvent(ev, bmask) {\n let pos = clientToElement(ev.detail.clientX, ev.detail.clientY,\n this._canvas);\n\n // If the user quickly taps multiple times we assume they meant to\n // hit the same spot, so slightly adjust coordinates\n\n if ((this._gestureLastTapTime !== null) &&\n ((Date.now() - this._gestureLastTapTime) < DOUBLE_TAP_TIMEOUT) &&\n (this._gestureFirstDoubleTapEv.detail.type === ev.detail.type)) {\n let dx = this._gestureFirstDoubleTapEv.detail.clientX - ev.detail.clientX;\n let dy = this._gestureFirstDoubleTapEv.detail.clientY - ev.detail.clientY;\n let distance = Math.hypot(dx, dy);\n\n if (distance < DOUBLE_TAP_THRESHOLD) {\n pos = clientToElement(this._gestureFirstDoubleTapEv.detail.clientX,\n this._gestureFirstDoubleTapEv.detail.clientY,\n this._canvas);\n } else {\n this._gestureFirstDoubleTapEv = ev;\n }\n } else {\n this._gestureFirstDoubleTapEv = ev;\n }\n this._gestureLastTapTime = Date.now();\n\n this._fakeMouseMove(this._gestureFirstDoubleTapEv, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, true, bmask);\n this._handleMouseButton(pos.x, pos.y, false, bmask);\n }\n\n _handleGesture(ev) {\n let magnitude;\n\n let pos = clientToElement(ev.detail.clientX, ev.detail.clientY,\n this._canvas);\n switch (ev.type) {\n case 'gesturestart':\n switch (ev.detail.type) {\n case 'onetap':\n this._handleTapEvent(ev, 0x1);\n break;\n case 'twotap':\n this._handleTapEvent(ev, 0x4);\n break;\n case 'threetap':\n this._handleTapEvent(ev, 0x2);\n break;\n case 'drag':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, true, 0x1);\n break;\n case 'longpress':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, true, 0x4);\n break;\n\n case 'twodrag':\n this._gestureLastMagnitudeX = ev.detail.magnitudeX;\n this._gestureLastMagnitudeY = ev.detail.magnitudeY;\n this._fakeMouseMove(ev, pos.x, pos.y);\n break;\n case 'pinch':\n this._gestureLastMagnitudeX = Math.hypot(ev.detail.magnitudeX,\n ev.detail.magnitudeY);\n this._fakeMouseMove(ev, pos.x, pos.y);\n break;\n }\n break;\n\n case 'gesturemove':\n switch (ev.detail.type) {\n case 'onetap':\n case 'twotap':\n case 'threetap':\n break;\n case 'drag':\n case 'longpress':\n this._fakeMouseMove(ev, pos.x, pos.y);\n break;\n case 'twodrag':\n // Always scroll in the same position.\n // We don't know if the mouse was moved so we need to move it\n // every update.\n this._fakeMouseMove(ev, pos.x, pos.y);\n while ((ev.detail.magnitudeY - this._gestureLastMagnitudeY) > GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x8);\n this._handleMouseButton(pos.x, pos.y, false, 0x8);\n this._gestureLastMagnitudeY += GESTURE_SCRLSENS;\n }\n while ((ev.detail.magnitudeY - this._gestureLastMagnitudeY) < -GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x10);\n this._handleMouseButton(pos.x, pos.y, false, 0x10);\n this._gestureLastMagnitudeY -= GESTURE_SCRLSENS;\n }\n while ((ev.detail.magnitudeX - this._gestureLastMagnitudeX) > GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x20);\n this._handleMouseButton(pos.x, pos.y, false, 0x20);\n this._gestureLastMagnitudeX += GESTURE_SCRLSENS;\n }\n while ((ev.detail.magnitudeX - this._gestureLastMagnitudeX) < -GESTURE_SCRLSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x40);\n this._handleMouseButton(pos.x, pos.y, false, 0x40);\n this._gestureLastMagnitudeX -= GESTURE_SCRLSENS;\n }\n break;\n case 'pinch':\n // Always scroll in the same position.\n // We don't know if the mouse was moved so we need to move it\n // every update.\n this._fakeMouseMove(ev, pos.x, pos.y);\n magnitude = Math.hypot(ev.detail.magnitudeX, ev.detail.magnitudeY);\n if (Math.abs(magnitude - this._gestureLastMagnitudeX) > GESTURE_ZOOMSENS) {\n this._handleKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", true);\n while ((magnitude - this._gestureLastMagnitudeX) > GESTURE_ZOOMSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x8);\n this._handleMouseButton(pos.x, pos.y, false, 0x8);\n this._gestureLastMagnitudeX += GESTURE_ZOOMSENS;\n }\n while ((magnitude - this._gestureLastMagnitudeX) < -GESTURE_ZOOMSENS) {\n this._handleMouseButton(pos.x, pos.y, true, 0x10);\n this._handleMouseButton(pos.x, pos.y, false, 0x10);\n this._gestureLastMagnitudeX -= GESTURE_ZOOMSENS;\n }\n }\n this._handleKeyEvent(KeyTable.XK_Control_L, \"ControlLeft\", false);\n break;\n }\n break;\n\n case 'gestureend':\n switch (ev.detail.type) {\n case 'onetap':\n case 'twotap':\n case 'threetap':\n case 'pinch':\n case 'twodrag':\n break;\n case 'drag':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, false, 0x1);\n break;\n case 'longpress':\n this._fakeMouseMove(ev, pos.x, pos.y);\n this._handleMouseButton(pos.x, pos.y, false, 0x4);\n break;\n }\n break;\n }\n }\n\n // Message Handlers\n\n _negotiateProtocolVersion() {\n if (this._sock.rQwait(\"version\", 12)) {\n return false;\n }\n\n const sversion = this._sock.rQshiftStr(12).substr(4, 7);\n Log.Info(\"Server ProtocolVersion: \" + sversion);\n let isRepeater = 0;\n switch (sversion) {\n case \"000.000\": // UltraVNC repeater\n isRepeater = 1;\n break;\n case \"003.003\":\n case \"003.006\": // UltraVNC\n this._rfbVersion = 3.3;\n break;\n case \"003.007\":\n this._rfbVersion = 3.7;\n break;\n case \"003.008\":\n case \"003.889\": // Apple Remote Desktop\n case \"004.000\": // Intel AMT KVM\n case \"004.001\": // RealVNC 4.6\n case \"005.000\": // RealVNC 5.3\n this._rfbVersion = 3.8;\n break;\n default:\n return this._fail(\"Invalid server version \" + sversion);\n }\n\n if (isRepeater) {\n let repeaterID = \"ID:\" + this._repeaterID;\n while (repeaterID.length < 250) {\n repeaterID += \"\\0\";\n }\n this._sock.sendString(repeaterID);\n return true;\n }\n\n if (this._rfbVersion > this._rfbMaxVersion) {\n this._rfbVersion = this._rfbMaxVersion;\n }\n\n const cversion = \"00\" + parseInt(this._rfbVersion, 10) +\n \".00\" + ((this._rfbVersion * 10) % 10);\n this._sock.sendString(\"RFB \" + cversion + \"\\n\");\n Log.Debug('Sent ProtocolVersion: ' + cversion);\n\n this._rfbInitState = 'Security';\n }\n\n _isSupportedSecurityType(type) {\n const clientTypes = [\n securityTypeNone,\n securityTypeVNCAuth,\n securityTypeRA2ne,\n securityTypeTight,\n securityTypeVeNCrypt,\n securityTypeXVP,\n securityTypeARD,\n securityTypeMSLogonII,\n securityTypePlain,\n ];\n\n return clientTypes.includes(type);\n }\n\n _negotiateSecurity() {\n if (this._rfbVersion >= 3.7) {\n // Server sends supported list, client decides\n const numTypes = this._sock.rQshift8();\n if (this._sock.rQwait(\"security type\", numTypes, 1)) { return false; }\n\n if (numTypes === 0) {\n this._rfbInitState = \"SecurityReason\";\n this._securityContext = \"no security types\";\n this._securityStatus = 1;\n return true;\n }\n\n const types = this._sock.rQshiftBytes(numTypes);\n Log.Debug(\"Server security types: \" + types);\n\n // Look for a matching security type in the order that the\n // server prefers\n this._rfbAuthScheme = -1;\n for (let type of types) {\n if (this._isSupportedSecurityType(type)) {\n this._rfbAuthScheme = type;\n break;\n }\n }\n\n if (this._rfbAuthScheme === -1) {\n return this._fail(\"Unsupported security types (types: \" + types + \")\");\n }\n\n this._sock.send([this._rfbAuthScheme]);\n } else {\n // Server decides\n if (this._sock.rQwait(\"security scheme\", 4)) { return false; }\n this._rfbAuthScheme = this._sock.rQshift32();\n\n if (this._rfbAuthScheme == 0) {\n this._rfbInitState = \"SecurityReason\";\n this._securityContext = \"authentication scheme\";\n this._securityStatus = 1;\n return true;\n }\n }\n\n this._rfbInitState = 'Authentication';\n Log.Debug('Authenticating using scheme: ' + this._rfbAuthScheme);\n\n return true;\n }\n\n _handleSecurityReason() {\n if (this._sock.rQwait(\"reason length\", 4)) {\n return false;\n }\n const strlen = this._sock.rQshift32();\n let reason = \"\";\n\n if (strlen > 0) {\n if (this._sock.rQwait(\"reason\", strlen, 4)) { return false; }\n reason = this._sock.rQshiftStr(strlen);\n }\n\n if (reason !== \"\") {\n this.dispatchEvent(new CustomEvent(\n \"securityfailure\",\n { detail: { status: this._securityStatus,\n reason: reason } }));\n\n return this._fail(\"Security negotiation failed on \" +\n this._securityContext +\n \" (reason: \" + reason + \")\");\n } else {\n this.dispatchEvent(new CustomEvent(\n \"securityfailure\",\n { detail: { status: this._securityStatus } }));\n\n return this._fail(\"Security negotiation failed on \" +\n this._securityContext);\n }\n }\n\n // authentication\n _negotiateXvpAuth() {\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined ||\n this._rfbCredentials.target === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\", \"target\"] } }));\n return false;\n }\n\n const xvpAuthStr = String.fromCharCode(this._rfbCredentials.username.length) +\n String.fromCharCode(this._rfbCredentials.target.length) +\n this._rfbCredentials.username +\n this._rfbCredentials.target;\n this._sock.sendString(xvpAuthStr);\n this._rfbAuthScheme = securityTypeVNCAuth;\n return this._negotiateAuthentication();\n }\n\n // VeNCrypt authentication, currently only supports version 0.2 and only Plain subtype\n _negotiateVeNCryptAuth() {\n\n // waiting for VeNCrypt version\n if (this._rfbVeNCryptState == 0) {\n if (this._sock.rQwait(\"vencrypt version\", 2)) { return false; }\n\n const major = this._sock.rQshift8();\n const minor = this._sock.rQshift8();\n\n if (!(major == 0 && minor == 2)) {\n return this._fail(\"Unsupported VeNCrypt version \" + major + \".\" + minor);\n }\n\n this._sock.send([0, 2]);\n this._rfbVeNCryptState = 1;\n }\n\n // waiting for ACK\n if (this._rfbVeNCryptState == 1) {\n if (this._sock.rQwait(\"vencrypt ack\", 1)) { return false; }\n\n const res = this._sock.rQshift8();\n\n if (res != 0) {\n return this._fail(\"VeNCrypt failure \" + res);\n }\n\n this._rfbVeNCryptState = 2;\n }\n // must fall through here (i.e. no \"else if\"), beacause we may have already received\n // the subtypes length and won't be called again\n\n if (this._rfbVeNCryptState == 2) { // waiting for subtypes length\n if (this._sock.rQwait(\"vencrypt subtypes length\", 1)) { return false; }\n\n const subtypesLength = this._sock.rQshift8();\n if (subtypesLength < 1) {\n return this._fail(\"VeNCrypt subtypes empty\");\n }\n\n this._rfbVeNCryptSubtypesLength = subtypesLength;\n this._rfbVeNCryptState = 3;\n }\n\n // waiting for subtypes list\n if (this._rfbVeNCryptState == 3) {\n if (this._sock.rQwait(\"vencrypt subtypes\", 4 * this._rfbVeNCryptSubtypesLength)) { return false; }\n\n const subtypes = [];\n for (let i = 0; i < this._rfbVeNCryptSubtypesLength; i++) {\n subtypes.push(this._sock.rQshift32());\n }\n\n // Look for a matching security type in the order that the\n // server prefers\n this._rfbAuthScheme = -1;\n for (let type of subtypes) {\n // Avoid getting in to a loop\n if (type === securityTypeVeNCrypt) {\n continue;\n }\n\n if (this._isSupportedSecurityType(type)) {\n this._rfbAuthScheme = type;\n break;\n }\n }\n\n if (this._rfbAuthScheme === -1) {\n return this._fail(\"Unsupported security types (types: \" + subtypes + \")\");\n }\n\n this._sock.send([this._rfbAuthScheme >> 24,\n this._rfbAuthScheme >> 16,\n this._rfbAuthScheme >> 8,\n this._rfbAuthScheme]);\n\n this._rfbVeNCryptState == 4;\n return true;\n }\n }\n\n _negotiatePlainAuth() {\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n return false;\n }\n\n const user = encodeUTF8(this._rfbCredentials.username);\n const pass = encodeUTF8(this._rfbCredentials.password);\n\n this._sock.send([\n (user.length >> 24) & 0xFF,\n (user.length >> 16) & 0xFF,\n (user.length >> 8) & 0xFF,\n user.length & 0xFF\n ]);\n this._sock.send([\n (pass.length >> 24) & 0xFF,\n (pass.length >> 16) & 0xFF,\n (pass.length >> 8) & 0xFF,\n pass.length & 0xFF\n ]);\n this._sock.sendString(user);\n this._sock.sendString(pass);\n\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n _negotiateStdVNCAuth() {\n if (this._sock.rQwait(\"auth challenge\", 16)) { return false; }\n\n if (this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"password\"] } }));\n return false;\n }\n\n // TODO(directxman12): make genDES not require an Array\n const challenge = Array.prototype.slice.call(this._sock.rQshiftBytes(16));\n const response = RFB.genDES(this._rfbCredentials.password, challenge);\n this._sock.send(response);\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n _negotiateARDAuth() {\n\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n return false;\n }\n\n if (this._rfbCredentials.ardPublicKey != undefined &&\n this._rfbCredentials.ardCredentials != undefined) {\n // if the async web crypto is done return the results\n this._sock.send(this._rfbCredentials.ardCredentials);\n this._sock.send(this._rfbCredentials.ardPublicKey);\n this._rfbCredentials.ardCredentials = null;\n this._rfbCredentials.ardPublicKey = null;\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n if (this._sock.rQwait(\"read ard\", 4)) { return false; }\n\n let generator = this._sock.rQshiftBytes(2); // DH base generator value\n\n let keyLength = this._sock.rQshift16();\n\n if (this._sock.rQwait(\"read ard keylength\", keyLength*2, 4)) { return false; }\n\n // read the server values\n let prime = this._sock.rQshiftBytes(keyLength); // predetermined prime modulus\n let serverPublicKey = this._sock.rQshiftBytes(keyLength); // other party's public key\n\n let clientPrivateKey = window.crypto.getRandomValues(new Uint8Array(keyLength));\n let padding = Array.from(window.crypto.getRandomValues(new Uint8Array(64)), byte => String.fromCharCode(65+byte%26)).join('');\n\n this._negotiateARDAuthAsync(generator, keyLength, prime, serverPublicKey, clientPrivateKey, padding);\n\n return false;\n }\n\n _modPow(base, exponent, modulus) {\n\n let baseHex = \"0x\"+Array.from(base, byte => ('0' + (byte & 0xFF).toString(16)).slice(-2)).join('');\n let exponentHex = \"0x\"+Array.from(exponent, byte => ('0' + (byte & 0xFF).toString(16)).slice(-2)).join('');\n let modulusHex = \"0x\"+Array.from(modulus, byte => ('0' + (byte & 0xFF).toString(16)).slice(-2)).join('');\n\n let b = BigInt(baseHex);\n let e = BigInt(exponentHex);\n let m = BigInt(modulusHex);\n let r = 1n;\n b = b % m;\n while (e > 0) {\n if (e % 2n === 1n) {\n r = (r * b) % m;\n }\n e = e / 2n;\n b = (b * b) % m;\n }\n let hexResult = r.toString(16);\n\n while (hexResult.length/2 String.fromCharCode(byte)).join('');\n let aesKey = await window.crypto.subtle.importKey(\"raw\", MD5(keyString), {name: \"AES-CBC\"}, false, [\"encrypt\"]);\n let data = new Uint8Array(string.length);\n for (let i = 0; i < string.length; ++i) {\n data[i] = string.charCodeAt(i);\n }\n let encrypted = new Uint8Array(data.length);\n for (let i=0;i 0 && this._sock.rQwait(\"tunnel capabilities\", 16 * numTunnels, 4)) { return false; }\n\n this._rfbTightVNC = true;\n\n if (numTunnels > 0) {\n this._negotiateTightTunnels(numTunnels);\n return false; // wait until we receive the sub auth to continue\n }\n }\n\n // second pass, do the sub-auth negotiation\n if (this._sock.rQwait(\"sub auth count\", 4)) { return false; }\n const subAuthCount = this._sock.rQshift32();\n if (subAuthCount === 0) { // empty sub-auth list received means 'no auth' subtype selected\n this._rfbInitState = 'SecurityResult';\n return true;\n }\n\n if (this._sock.rQwait(\"sub auth capabilities\", 16 * subAuthCount, 4)) { return false; }\n\n const clientSupportedTypes = {\n 'STDVNOAUTH__': 1,\n 'STDVVNCAUTH_': 2,\n 'TGHTULGNAUTH': 129\n };\n\n const serverSupportedTypes = [];\n\n for (let i = 0; i < subAuthCount; i++) {\n this._sock.rQshift32(); // capNum\n const capabilities = this._sock.rQshiftStr(12);\n serverSupportedTypes.push(capabilities);\n }\n\n Log.Debug(\"Server Tight authentication types: \" + serverSupportedTypes);\n\n for (let authType in clientSupportedTypes) {\n if (serverSupportedTypes.indexOf(authType) != -1) {\n this._sock.send([0, 0, 0, clientSupportedTypes[authType]]);\n Log.Debug(\"Selected authentication type: \" + authType);\n\n switch (authType) {\n case 'STDVNOAUTH__': // no auth\n this._rfbInitState = 'SecurityResult';\n return true;\n case 'STDVVNCAUTH_':\n this._rfbAuthScheme = securityTypeVNCAuth;\n return true;\n case 'TGHTULGNAUTH':\n this._rfbAuthScheme = securityTypeUnixLogon;\n return true;\n default:\n return this._fail(\"Unsupported tiny auth scheme \" +\n \"(scheme: \" + authType + \")\");\n }\n }\n }\n\n return this._fail(\"No supported sub-auth types!\");\n }\n\n _handleRSAAESCredentialsRequired(event) {\n this.dispatchEvent(event);\n }\n\n _handleRSAAESServerVerification(event) {\n this.dispatchEvent(event);\n }\n\n _negotiateRA2neAuth() {\n if (this._rfbRSAAESAuthenticationState === null) {\n this._rfbRSAAESAuthenticationState = new RSAAESAuthenticationState(this._sock, () => this._rfbCredentials);\n this._rfbRSAAESAuthenticationState.addEventListener(\n \"serververification\", this._eventHandlers.handleRSAAESServerVerification);\n this._rfbRSAAESAuthenticationState.addEventListener(\n \"credentialsrequired\", this._eventHandlers.handleRSAAESCredentialsRequired);\n }\n this._rfbRSAAESAuthenticationState.checkInternalEvents();\n if (!this._rfbRSAAESAuthenticationState.hasStarted) {\n this._rfbRSAAESAuthenticationState.negotiateRA2neAuthAsync()\n .catch((e) => {\n if (e.message !== \"disconnect normally\") {\n this._fail(e.message);\n }\n }).then(() => {\n this.dispatchEvent(new CustomEvent('securityresult'));\n this._rfbInitState = \"SecurityResult\";\n return true;\n }).finally(() => {\n this._rfbRSAAESAuthenticationState.removeEventListener(\n \"serververification\", this._eventHandlers.handleRSAAESServerVerification);\n this._rfbRSAAESAuthenticationState.removeEventListener(\n \"credentialsrequired\", this._eventHandlers.handleRSAAESCredentialsRequired);\n this._rfbRSAAESAuthenticationState = null;\n });\n }\n return false;\n }\n\n _negotiateMSLogonIIAuth() {\n if (this._sock.rQwait(\"mslogonii dh param\", 24)) { return false; }\n\n if (this._rfbCredentials.username === undefined ||\n this._rfbCredentials.password === undefined) {\n this.dispatchEvent(new CustomEvent(\n \"credentialsrequired\",\n { detail: { types: [\"username\", \"password\"] } }));\n return false;\n }\n\n const g = this._sock.rQshiftBytes(8);\n const p = this._sock.rQshiftBytes(8);\n const A = this._sock.rQshiftBytes(8);\n const b = window.crypto.getRandomValues(new Uint8Array(8));\n const B = new Uint8Array(this._modPow(g, b, p));\n const secret = new Uint8Array(this._modPow(A, b, p));\n\n const des = new DES(secret);\n const username = encodeUTF8(this._rfbCredentials.username).substring(0, 255);\n const password = encodeUTF8(this._rfbCredentials.password).substring(0, 63);\n const usernameBytes = new Uint8Array(256);\n const passwordBytes = new Uint8Array(64);\n window.crypto.getRandomValues(usernameBytes);\n window.crypto.getRandomValues(passwordBytes);\n for (let i = 0; i < username.length; i++) {\n usernameBytes[i] = username.charCodeAt(i);\n }\n usernameBytes[username.length] = 0;\n for (let i = 0; i < password.length; i++) {\n passwordBytes[i] = password.charCodeAt(i);\n }\n passwordBytes[password.length] = 0;\n let x = new Uint8Array(secret);\n for (let i = 0; i < 32; i++) {\n for (let j = 0; j < 8; j++) {\n x[j] ^= usernameBytes[i * 8 + j];\n }\n x = des.enc8(x);\n usernameBytes.set(x, i * 8);\n }\n x = new Uint8Array(secret);\n for (let i = 0; i < 8; i++) {\n for (let j = 0; j < 8; j++) {\n x[j] ^= passwordBytes[i * 8 + j];\n }\n x = des.enc8(x);\n passwordBytes.set(x, i * 8);\n }\n this._sock.send(B);\n this._sock.send(usernameBytes);\n this._sock.send(passwordBytes);\n this._rfbInitState = \"SecurityResult\";\n return true;\n }\n\n _negotiateAuthentication() {\n switch (this._rfbAuthScheme) {\n case securityTypeNone:\n this._rfbInitState = 'SecurityResult';\n return true;\n\n case securityTypeXVP:\n return this._negotiateXvpAuth();\n\n case securityTypeARD:\n return this._negotiateARDAuth();\n\n case securityTypeVNCAuth:\n return this._negotiateStdVNCAuth();\n\n case securityTypeTight:\n return this._negotiateTightAuth();\n\n case securityTypeVeNCrypt:\n return this._negotiateVeNCryptAuth();\n\n case securityTypePlain:\n return this._negotiatePlainAuth();\n\n case securityTypeUnixLogon:\n return this._negotiateTightUnixAuth();\n\n case securityTypeRA2ne:\n return this._negotiateRA2neAuth();\n\n case securityTypeMSLogonII:\n return this._negotiateMSLogonIIAuth();\n\n default:\n return this._fail(\"Unsupported auth scheme (scheme: \" +\n this._rfbAuthScheme + \")\");\n }\n }\n\n _handleSecurityResult() {\n // There is no security choice, and hence no security result\n // until RFB 3.7\n if (this._rfbVersion < 3.7) {\n this._rfbInitState = 'ClientInitialisation';\n return true;\n }\n\n if (this._sock.rQwait('VNC auth response ', 4)) { return false; }\n\n const status = this._sock.rQshift32();\n\n if (status === 0) { // OK\n this._rfbInitState = 'ClientInitialisation';\n Log.Debug('Authentication OK');\n return true;\n } else {\n if (this._rfbVersion >= 3.8) {\n this._rfbInitState = \"SecurityReason\";\n this._securityContext = \"security result\";\n this._securityStatus = status;\n return true;\n } else {\n this.dispatchEvent(new CustomEvent(\n \"securityfailure\",\n { detail: { status: status } }));\n\n return this._fail(\"Security handshake failed\");\n }\n }\n }\n\n _negotiateServerInit() {\n if (this._sock.rQwait(\"server initialization\", 24)) { return false; }\n\n /* Screen size */\n const width = this._sock.rQshift16();\n const height = this._sock.rQshift16();\n\n /* PIXEL_FORMAT */\n const bpp = this._sock.rQshift8();\n const depth = this._sock.rQshift8();\n const bigEndian = this._sock.rQshift8();\n const trueColor = this._sock.rQshift8();\n\n const redMax = this._sock.rQshift16();\n const greenMax = this._sock.rQshift16();\n const blueMax = this._sock.rQshift16();\n const redShift = this._sock.rQshift8();\n const greenShift = this._sock.rQshift8();\n const blueShift = this._sock.rQshift8();\n this._sock.rQskipBytes(3); // padding\n\n // NB(directxman12): we don't want to call any callbacks or print messages until\n // *after* we're past the point where we could backtrack\n\n /* Connection name/title */\n const nameLength = this._sock.rQshift32();\n if (this._sock.rQwait('server init name', nameLength, 24)) { return false; }\n let name = this._sock.rQshiftStr(nameLength);\n name = decodeUTF8(name, true);\n\n if (this._rfbTightVNC) {\n if (this._sock.rQwait('TightVNC extended server init header', 8, 24 + nameLength)) { return false; }\n // In TightVNC mode, ServerInit message is extended\n const numServerMessages = this._sock.rQshift16();\n const numClientMessages = this._sock.rQshift16();\n const numEncodings = this._sock.rQshift16();\n this._sock.rQskipBytes(2); // padding\n\n const totalMessagesLength = (numServerMessages + numClientMessages + numEncodings) * 16;\n if (this._sock.rQwait('TightVNC extended server init header', totalMessagesLength, 32 + nameLength)) { return false; }\n\n // we don't actually do anything with the capability information that TIGHT sends,\n // so we just skip the all of this.\n\n // TIGHT server message capabilities\n this._sock.rQskipBytes(16 * numServerMessages);\n\n // TIGHT client message capabilities\n this._sock.rQskipBytes(16 * numClientMessages);\n\n // TIGHT encoding capabilities\n this._sock.rQskipBytes(16 * numEncodings);\n }\n\n // NB(directxman12): these are down here so that we don't run them multiple times\n // if we backtrack\n Log.Info(\"Screen: \" + width + \"x\" + height +\n \", bpp: \" + bpp + \", depth: \" + depth +\n \", bigEndian: \" + bigEndian +\n \", trueColor: \" + trueColor +\n \", redMax: \" + redMax +\n \", greenMax: \" + greenMax +\n \", blueMax: \" + blueMax +\n \", redShift: \" + redShift +\n \", greenShift: \" + greenShift +\n \", blueShift: \" + blueShift);\n\n // we're past the point where we could backtrack, so it's safe to call this\n this._setDesktopName(name);\n this._resize(width, height);\n\n if (!this._viewOnly) { this._keyboard.grab(); }\n\n this._fbDepth = 24;\n\n if (this._fbName === \"Intel(r) AMT KVM\") {\n Log.Warn(\"Intel AMT KVM only supports 8/16 bit depths. Using low color mode.\");\n this._fbDepth = 8;\n }\n\n RFB.messages.pixelFormat(this._sock, this._fbDepth, true);\n this._sendEncodings();\n RFB.messages.fbUpdateRequest(this._sock, false, 0, 0, this._fbWidth, this._fbHeight);\n\n this._updateConnectionState('connected');\n return true;\n }\n\n _sendEncodings() {\n const encs = [];\n\n // In preference order\n encs.push(encodings.encodingCopyRect);\n // Only supported with full depth support\n if (this._fbDepth == 24) {\n encs.push(encodings.encodingTight);\n encs.push(encodings.encodingTightPNG);\n encs.push(encodings.encodingZRLE);\n encs.push(encodings.encodingJPEG);\n encs.push(encodings.encodingHextile);\n encs.push(encodings.encodingRRE);\n }\n encs.push(encodings.encodingRaw);\n\n // Psuedo-encoding settings\n encs.push(encodings.pseudoEncodingQualityLevel0 + this._qualityLevel);\n encs.push(encodings.pseudoEncodingCompressLevel0 + this._compressionLevel);\n\n encs.push(encodings.pseudoEncodingDesktopSize);\n encs.push(encodings.pseudoEncodingLastRect);\n encs.push(encodings.pseudoEncodingQEMUExtendedKeyEvent);\n encs.push(encodings.pseudoEncodingExtendedDesktopSize);\n encs.push(encodings.pseudoEncodingXvp);\n encs.push(encodings.pseudoEncodingFence);\n encs.push(encodings.pseudoEncodingContinuousUpdates);\n encs.push(encodings.pseudoEncodingDesktopName);\n encs.push(encodings.pseudoEncodingExtendedClipboard);\n\n if (this._fbDepth == 24) {\n encs.push(encodings.pseudoEncodingVMwareCursor);\n encs.push(encodings.pseudoEncodingCursor);\n }\n\n RFB.messages.clientEncodings(this._sock, encs);\n }\n\n /* RFB protocol initialization states:\n * ProtocolVersion\n * Security\n * Authentication\n * SecurityResult\n * ClientInitialization - not triggered by server message\n * ServerInitialization\n */\n _initMsg() {\n switch (this._rfbInitState) {\n case 'ProtocolVersion':\n return this._negotiateProtocolVersion();\n\n case 'Security':\n return this._negotiateSecurity();\n\n case 'Authentication':\n return this._negotiateAuthentication();\n\n case 'SecurityResult':\n return this._handleSecurityResult();\n\n case 'SecurityReason':\n return this._handleSecurityReason();\n\n case 'ClientInitialisation':\n this._sock.send([this._shared ? 1 : 0]); // ClientInitialisation\n this._rfbInitState = 'ServerInitialisation';\n return true;\n\n case 'ServerInitialisation':\n return this._negotiateServerInit();\n\n default:\n return this._fail(\"Unknown init state (state: \" +\n this._rfbInitState + \")\");\n }\n }\n\n // Resume authentication handshake after it was paused for some\n // reason, e.g. waiting for a password from the user\n _resumeAuthentication() {\n // We use setTimeout() so it's run in its own context, just like\n // it originally did via the WebSocket's event handler\n setTimeout(this._initMsg.bind(this), 0);\n }\n\n _handleSetColourMapMsg() {\n Log.Debug(\"SetColorMapEntries\");\n\n return this._fail(\"Unexpected SetColorMapEntries message\");\n }\n\n _handleServerCutText() {\n Log.Debug(\"ServerCutText\");\n\n if (this._sock.rQwait(\"ServerCutText header\", 7, 1)) { return false; }\n\n this._sock.rQskipBytes(3); // Padding\n\n let length = this._sock.rQshift32();\n length = toSigned32bit(length);\n\n if (this._sock.rQwait(\"ServerCutText content\", Math.abs(length), 8)) { return false; }\n\n if (length >= 0) {\n //Standard msg\n const text = this._sock.rQshiftStr(length);\n if (this._viewOnly) {\n return true;\n }\n\n this.dispatchEvent(new CustomEvent(\n \"clipboard\",\n { detail: { text: text } }));\n\n } else {\n //Extended msg.\n length = Math.abs(length);\n const flags = this._sock.rQshift32();\n let formats = flags & 0x0000FFFF;\n let actions = flags & 0xFF000000;\n\n let isCaps = (!!(actions & extendedClipboardActionCaps));\n if (isCaps) {\n this._clipboardServerCapabilitiesFormats = {};\n this._clipboardServerCapabilitiesActions = {};\n\n // Update our server capabilities for Formats\n for (let i = 0; i <= 15; i++) {\n let index = 1 << i;\n\n // Check if format flag is set.\n if ((formats & index)) {\n this._clipboardServerCapabilitiesFormats[index] = true;\n // We don't send unsolicited clipboard, so we\n // ignore the size\n this._sock.rQshift32();\n }\n }\n\n // Update our server capabilities for Actions\n for (let i = 24; i <= 31; i++) {\n let index = 1 << i;\n this._clipboardServerCapabilitiesActions[index] = !!(actions & index);\n }\n\n /* Caps handling done, send caps with the clients\n capabilities set as a response */\n let clientActions = [\n extendedClipboardActionCaps,\n extendedClipboardActionRequest,\n extendedClipboardActionPeek,\n extendedClipboardActionNotify,\n extendedClipboardActionProvide\n ];\n RFB.messages.extendedClipboardCaps(this._sock, clientActions, {extendedClipboardFormatText: 0});\n\n } else if (actions === extendedClipboardActionRequest) {\n if (this._viewOnly) {\n return true;\n }\n\n // Check if server has told us it can handle Provide and there is clipboard data to send.\n if (this._clipboardText != null &&\n this._clipboardServerCapabilitiesActions[extendedClipboardActionProvide]) {\n\n if (formats & extendedClipboardFormatText) {\n RFB.messages.extendedClipboardProvide(this._sock, [extendedClipboardFormatText], [this._clipboardText]);\n }\n }\n\n } else if (actions === extendedClipboardActionPeek) {\n if (this._viewOnly) {\n return true;\n }\n\n if (this._clipboardServerCapabilitiesActions[extendedClipboardActionNotify]) {\n\n if (this._clipboardText != null) {\n RFB.messages.extendedClipboardNotify(this._sock, [extendedClipboardFormatText]);\n } else {\n RFB.messages.extendedClipboardNotify(this._sock, []);\n }\n }\n\n } else if (actions === extendedClipboardActionNotify) {\n if (this._viewOnly) {\n return true;\n }\n\n if (this._clipboardServerCapabilitiesActions[extendedClipboardActionRequest]) {\n\n if (formats & extendedClipboardFormatText) {\n RFB.messages.extendedClipboardRequest(this._sock, [extendedClipboardFormatText]);\n }\n }\n\n } else if (actions === extendedClipboardActionProvide) {\n if (this._viewOnly) {\n return true;\n }\n\n if (!(formats & extendedClipboardFormatText)) {\n return true;\n }\n // Ignore what we had in our clipboard client side.\n this._clipboardText = null;\n\n // FIXME: Should probably verify that this data was actually requested\n let zlibStream = this._sock.rQshiftBytes(length - 4);\n let streamInflator = new Inflator();\n let textData = null;\n\n streamInflator.setInput(zlibStream);\n for (let i = 0; i <= 15; i++) {\n let format = 1 << i;\n\n if (formats & format) {\n\n let size = 0x00;\n let sizeArray = streamInflator.inflate(4);\n\n size |= (sizeArray[0] << 24);\n size |= (sizeArray[1] << 16);\n size |= (sizeArray[2] << 8);\n size |= (sizeArray[3]);\n let chunk = streamInflator.inflate(size);\n\n if (format === extendedClipboardFormatText) {\n textData = chunk;\n }\n }\n }\n streamInflator.setInput(null);\n\n if (textData !== null) {\n let tmpText = \"\";\n for (let i = 0; i < textData.length; i++) {\n tmpText += String.fromCharCode(textData[i]);\n }\n textData = tmpText;\n\n textData = decodeUTF8(textData);\n if ((textData.length > 0) && \"\\0\" === textData.charAt(textData.length - 1)) {\n textData = textData.slice(0, -1);\n }\n\n textData = textData.replace(\"\\r\\n\", \"\\n\");\n\n this.dispatchEvent(new CustomEvent(\n \"clipboard\",\n { detail: { text: textData } }));\n }\n } else {\n return this._fail(\"Unexpected action in extended clipboard message: \" + actions);\n }\n }\n return true;\n }\n\n _handleServerFenceMsg() {\n if (this._sock.rQwait(\"ServerFence header\", 8, 1)) { return false; }\n this._sock.rQskipBytes(3); // Padding\n let flags = this._sock.rQshift32();\n let length = this._sock.rQshift8();\n\n if (this._sock.rQwait(\"ServerFence payload\", length, 9)) { return false; }\n\n if (length > 64) {\n Log.Warn(\"Bad payload length (\" + length + \") in fence response\");\n length = 64;\n }\n\n const payload = this._sock.rQshiftStr(length);\n\n this._supportsFence = true;\n\n /*\n * Fence flags\n *\n * (1<<0) - BlockBefore\n * (1<<1) - BlockAfter\n * (1<<2) - SyncNext\n * (1<<31) - Request\n */\n\n if (!(flags & (1<<31))) {\n return this._fail(\"Unexpected fence response\");\n }\n\n // Filter out unsupported flags\n // FIXME: support syncNext\n flags &= (1<<0) | (1<<1);\n\n // BlockBefore and BlockAfter are automatically handled by\n // the fact that we process each incoming message\n // synchronuosly.\n RFB.messages.clientFence(this._sock, flags, payload);\n\n return true;\n }\n\n _handleXvpMsg() {\n if (this._sock.rQwait(\"XVP version and message\", 3, 1)) { return false; }\n this._sock.rQskipBytes(1); // Padding\n const xvpVer = this._sock.rQshift8();\n const xvpMsg = this._sock.rQshift8();\n\n switch (xvpMsg) {\n case 0: // XVP_FAIL\n Log.Error(\"XVP Operation Failed\");\n break;\n case 1: // XVP_INIT\n this._rfbXvpVer = xvpVer;\n Log.Info(\"XVP extensions enabled (version \" + this._rfbXvpVer + \")\");\n this._setCapability(\"power\", true);\n break;\n default:\n this._fail(\"Illegal server XVP message (msg: \" + xvpMsg + \")\");\n break;\n }\n\n return true;\n }\n\n _normalMsg() {\n let msgType;\n if (this._FBU.rects > 0) {\n msgType = 0;\n } else {\n msgType = this._sock.rQshift8();\n }\n\n let first, ret;\n switch (msgType) {\n case 0: // FramebufferUpdate\n ret = this._framebufferUpdate();\n if (ret && !this._enabledContinuousUpdates) {\n RFB.messages.fbUpdateRequest(this._sock, true, 0, 0,\n this._fbWidth, this._fbHeight);\n }\n return ret;\n\n case 1: // SetColorMapEntries\n return this._handleSetColourMapMsg();\n\n case 2: // Bell\n Log.Debug(\"Bell\");\n this.dispatchEvent(new CustomEvent(\n \"bell\",\n { detail: {} }));\n return true;\n\n case 3: // ServerCutText\n return this._handleServerCutText();\n\n case 150: // EndOfContinuousUpdates\n first = !this._supportsContinuousUpdates;\n this._supportsContinuousUpdates = true;\n this._enabledContinuousUpdates = false;\n if (first) {\n this._enabledContinuousUpdates = true;\n this._updateContinuousUpdates();\n Log.Info(\"Enabling continuous updates.\");\n } else {\n // FIXME: We need to send a framebufferupdaterequest here\n // if we add support for turning off continuous updates\n }\n return true;\n\n case 248: // ServerFence\n return this._handleServerFenceMsg();\n\n case 250: // XVP\n return this._handleXvpMsg();\n\n default:\n this._fail(\"Unexpected server message (type \" + msgType + \")\");\n Log.Debug(\"sock.rQslice(0, 30): \" + this._sock.rQslice(0, 30));\n return true;\n }\n }\n\n _onFlush() {\n this._flushing = false;\n // Resume processing\n if (this._sock.rQlen > 0) {\n this._handleMessage();\n }\n }\n\n _framebufferUpdate() {\n if (this._FBU.rects === 0) {\n if (this._sock.rQwait(\"FBU header\", 3, 1)) { return false; }\n this._sock.rQskipBytes(1); // Padding\n this._FBU.rects = this._sock.rQshift16();\n\n // Make sure the previous frame is fully rendered first\n // to avoid building up an excessive queue\n if (this._display.pending()) {\n this._flushing = true;\n this._display.flush();\n return false;\n }\n }\n\n while (this._FBU.rects > 0) {\n if (this._FBU.encoding === null) {\n if (this._sock.rQwait(\"rect header\", 12)) { return false; }\n /* New FramebufferUpdate */\n\n const hdr = this._sock.rQshiftBytes(12);\n this._FBU.x = (hdr[0] << 8) + hdr[1];\n this._FBU.y = (hdr[2] << 8) + hdr[3];\n this._FBU.width = (hdr[4] << 8) + hdr[5];\n this._FBU.height = (hdr[6] << 8) + hdr[7];\n this._FBU.encoding = parseInt((hdr[8] << 24) + (hdr[9] << 16) +\n (hdr[10] << 8) + hdr[11], 10);\n }\n\n if (!this._handleRect()) {\n return false;\n }\n\n this._FBU.rects--;\n this._FBU.encoding = null;\n }\n\n this._display.flip();\n\n return true; // We finished this FBU\n }\n\n _handleRect() {\n switch (this._FBU.encoding) {\n case encodings.pseudoEncodingLastRect:\n this._FBU.rects = 1; // Will be decreased when we return\n return true;\n\n case encodings.pseudoEncodingVMwareCursor:\n return this._handleVMwareCursor();\n\n case encodings.pseudoEncodingCursor:\n return this._handleCursor();\n\n case encodings.pseudoEncodingQEMUExtendedKeyEvent:\n this._qemuExtKeyEventSupported = true;\n return true;\n\n case encodings.pseudoEncodingDesktopName:\n return this._handleDesktopName();\n\n case encodings.pseudoEncodingDesktopSize:\n this._resize(this._FBU.width, this._FBU.height);\n return true;\n\n case encodings.pseudoEncodingExtendedDesktopSize:\n return this._handleExtendedDesktopSize();\n\n default:\n return this._handleDataRect();\n }\n }\n\n _handleVMwareCursor() {\n const hotx = this._FBU.x; // hotspot-x\n const hoty = this._FBU.y; // hotspot-y\n const w = this._FBU.width;\n const h = this._FBU.height;\n if (this._sock.rQwait(\"VMware cursor encoding\", 1)) {\n return false;\n }\n\n const cursorType = this._sock.rQshift8();\n\n this._sock.rQshift8(); //Padding\n\n let rgba;\n const bytesPerPixel = 4;\n\n //Classic cursor\n if (cursorType == 0) {\n //Used to filter away unimportant bits.\n //OR is used for correct conversion in js.\n const PIXEL_MASK = 0xffffff00 | 0;\n rgba = new Array(w * h * bytesPerPixel);\n\n if (this._sock.rQwait(\"VMware cursor classic encoding\",\n (w * h * bytesPerPixel) * 2, 2)) {\n return false;\n }\n\n let andMask = new Array(w * h);\n for (let pixel = 0; pixel < (w * h); pixel++) {\n andMask[pixel] = this._sock.rQshift32();\n }\n\n let xorMask = new Array(w * h);\n for (let pixel = 0; pixel < (w * h); pixel++) {\n xorMask[pixel] = this._sock.rQshift32();\n }\n\n for (let pixel = 0; pixel < (w * h); pixel++) {\n if (andMask[pixel] == 0) {\n //Fully opaque pixel\n let bgr = xorMask[pixel];\n let r = bgr >> 8 & 0xff;\n let g = bgr >> 16 & 0xff;\n let b = bgr >> 24 & 0xff;\n\n rgba[(pixel * bytesPerPixel) ] = r; //r\n rgba[(pixel * bytesPerPixel) + 1 ] = g; //g\n rgba[(pixel * bytesPerPixel) + 2 ] = b; //b\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff; //a\n\n } else if ((andMask[pixel] & PIXEL_MASK) ==\n PIXEL_MASK) {\n //Only screen value matters, no mouse colouring\n if (xorMask[pixel] == 0) {\n //Transparent pixel\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0x00;\n\n } else if ((xorMask[pixel] & PIXEL_MASK) ==\n PIXEL_MASK) {\n //Inverted pixel, not supported in browsers.\n //Fully opaque instead.\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff;\n\n } else {\n //Unhandled xorMask\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff;\n }\n\n } else {\n //Unhandled andMask\n rgba[(pixel * bytesPerPixel) ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 1 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 2 ] = 0x00;\n rgba[(pixel * bytesPerPixel) + 3 ] = 0xff;\n }\n }\n\n //Alpha cursor.\n } else if (cursorType == 1) {\n if (this._sock.rQwait(\"VMware cursor alpha encoding\",\n (w * h * 4), 2)) {\n return false;\n }\n\n rgba = new Array(w * h * bytesPerPixel);\n\n for (let pixel = 0; pixel < (w * h); pixel++) {\n let data = this._sock.rQshift32();\n\n rgba[(pixel * 4) ] = data >> 24 & 0xff; //r\n rgba[(pixel * 4) + 1 ] = data >> 16 & 0xff; //g\n rgba[(pixel * 4) + 2 ] = data >> 8 & 0xff; //b\n rgba[(pixel * 4) + 3 ] = data & 0xff; //a\n }\n\n } else {\n Log.Warn(\"The given cursor type is not supported: \"\n + cursorType + \" given.\");\n return false;\n }\n\n this._updateCursor(rgba, hotx, hoty, w, h);\n\n return true;\n }\n\n _handleCursor() {\n const hotx = this._FBU.x; // hotspot-x\n const hoty = this._FBU.y; // hotspot-y\n const w = this._FBU.width;\n const h = this._FBU.height;\n\n const pixelslength = w * h * 4;\n const masklength = Math.ceil(w / 8) * h;\n\n let bytes = pixelslength + masklength;\n if (this._sock.rQwait(\"cursor encoding\", bytes)) {\n return false;\n }\n\n // Decode from BGRX pixels + bit mask to RGBA\n const pixels = this._sock.rQshiftBytes(pixelslength);\n const mask = this._sock.rQshiftBytes(masklength);\n let rgba = new Uint8Array(w * h * 4);\n\n let pixIdx = 0;\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n let maskIdx = y * Math.ceil(w / 8) + Math.floor(x / 8);\n let alpha = (mask[maskIdx] << (x % 8)) & 0x80 ? 255 : 0;\n rgba[pixIdx ] = pixels[pixIdx + 2];\n rgba[pixIdx + 1] = pixels[pixIdx + 1];\n rgba[pixIdx + 2] = pixels[pixIdx];\n rgba[pixIdx + 3] = alpha;\n pixIdx += 4;\n }\n }\n\n this._updateCursor(rgba, hotx, hoty, w, h);\n\n return true;\n }\n\n _handleDesktopName() {\n if (this._sock.rQwait(\"DesktopName\", 4)) {\n return false;\n }\n\n let length = this._sock.rQshift32();\n\n if (this._sock.rQwait(\"DesktopName\", length, 4)) {\n return false;\n }\n\n let name = this._sock.rQshiftStr(length);\n name = decodeUTF8(name, true);\n\n this._setDesktopName(name);\n\n return true;\n }\n\n _handleExtendedDesktopSize() {\n if (this._sock.rQwait(\"ExtendedDesktopSize\", 4)) {\n return false;\n }\n\n const numberOfScreens = this._sock.rQpeek8();\n\n let bytes = 4 + (numberOfScreens * 16);\n if (this._sock.rQwait(\"ExtendedDesktopSize\", bytes)) {\n return false;\n }\n\n const firstUpdate = !this._supportsSetDesktopSize;\n this._supportsSetDesktopSize = true;\n\n // Normally we only apply the current resize mode after a\n // window resize event. However there is no such trigger on the\n // initial connect. And we don't know if the server supports\n // resizing until we've gotten here.\n if (firstUpdate) {\n this._requestRemoteResize();\n }\n\n this._sock.rQskipBytes(1); // number-of-screens\n this._sock.rQskipBytes(3); // padding\n\n for (let i = 0; i < numberOfScreens; i += 1) {\n // Save the id and flags of the first screen\n if (i === 0) {\n this._screenID = this._sock.rQshiftBytes(4); // id\n this._sock.rQskipBytes(2); // x-position\n this._sock.rQskipBytes(2); // y-position\n this._sock.rQskipBytes(2); // width\n this._sock.rQskipBytes(2); // height\n this._screenFlags = this._sock.rQshiftBytes(4); // flags\n } else {\n this._sock.rQskipBytes(16);\n }\n }\n\n /*\n * The x-position indicates the reason for the change:\n *\n * 0 - server resized on its own\n * 1 - this client requested the resize\n * 2 - another client requested the resize\n */\n\n // We need to handle errors when we requested the resize.\n if (this._FBU.x === 1 && this._FBU.y !== 0) {\n let msg = \"\";\n // The y-position indicates the status code from the server\n switch (this._FBU.y) {\n case 1:\n msg = \"Resize is administratively prohibited\";\n break;\n case 2:\n msg = \"Out of resources\";\n break;\n case 3:\n msg = \"Invalid screen layout\";\n break;\n default:\n msg = \"Unknown reason\";\n break;\n }\n Log.Warn(\"Server did not accept the resize request: \"\n + msg);\n } else {\n this._resize(this._FBU.width, this._FBU.height);\n }\n\n return true;\n }\n\n _handleDataRect() {\n let decoder = this._decoders[this._FBU.encoding];\n if (!decoder) {\n this._fail(\"Unsupported encoding (encoding: \" +\n this._FBU.encoding + \")\");\n return false;\n }\n\n try {\n return decoder.decodeRect(this._FBU.x, this._FBU.y,\n this._FBU.width, this._FBU.height,\n this._sock, this._display,\n this._fbDepth);\n } catch (err) {\n this._fail(\"Error decoding rect: \" + err);\n return false;\n }\n }\n\n _updateContinuousUpdates() {\n if (!this._enabledContinuousUpdates) { return; }\n\n RFB.messages.enableContinuousUpdates(this._sock, true, 0, 0,\n this._fbWidth, this._fbHeight);\n }\n\n _resize(width, height) {\n this._fbWidth = width;\n this._fbHeight = height;\n\n this._display.resize(this._fbWidth, this._fbHeight);\n\n // Adjust the visible viewport based on the new dimensions\n this._updateClip();\n this._updateScale();\n\n this._updateContinuousUpdates();\n\n // Keep this size until browser client size changes\n this._saveExpectedClientSize();\n }\n\n _xvpOp(ver, op) {\n if (this._rfbXvpVer < ver) { return; }\n Log.Info(\"Sending XVP operation \" + op + \" (version \" + ver + \")\");\n RFB.messages.xvpOp(this._sock, ver, op);\n }\n\n _updateCursor(rgba, hotx, hoty, w, h) {\n this._cursorImage = {\n rgbaPixels: rgba,\n hotx: hotx, hoty: hoty, w: w, h: h,\n };\n this._refreshCursor();\n }\n\n _shouldShowDotCursor() {\n // Called when this._cursorImage is updated\n if (!this._showDotCursor) {\n // User does not want to see the dot, so...\n return false;\n }\n\n // The dot should not be shown if the cursor is already visible,\n // i.e. contains at least one not-fully-transparent pixel.\n // So iterate through all alpha bytes in rgba and stop at the\n // first non-zero.\n for (let i = 3; i < this._cursorImage.rgbaPixels.length; i += 4) {\n if (this._cursorImage.rgbaPixels[i]) {\n return false;\n }\n }\n\n // At this point, we know that the cursor is fully transparent, and\n // the user wants to see the dot instead of this.\n return true;\n }\n\n _refreshCursor() {\n if (this._rfbConnectionState !== \"connecting\" &&\n this._rfbConnectionState !== \"connected\") {\n return;\n }\n const image = this._shouldShowDotCursor() ? RFB.cursors.dot : this._cursorImage;\n this._cursor.change(image.rgbaPixels,\n image.hotx, image.hoty,\n image.w, image.h\n );\n }\n\n static genDES(password, challenge) {\n const passwordChars = password.split('').map(c => c.charCodeAt(0));\n return (new DES(passwordChars)).encrypt(challenge);\n }\n}\n\n// Class Methods\nRFB.messages = {\n keyEvent(sock, keysym, down) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 4; // msg-type\n buff[offset + 1] = down;\n\n buff[offset + 2] = 0;\n buff[offset + 3] = 0;\n\n buff[offset + 4] = (keysym >> 24);\n buff[offset + 5] = (keysym >> 16);\n buff[offset + 6] = (keysym >> 8);\n buff[offset + 7] = keysym;\n\n sock._sQlen += 8;\n sock.flush();\n },\n\n QEMUExtendedKeyEvent(sock, keysym, down, keycode) {\n function getRFBkeycode(xtScanCode) {\n const upperByte = (keycode >> 8);\n const lowerByte = (keycode & 0x00ff);\n if (upperByte === 0xe0 && lowerByte < 0x7f) {\n return lowerByte | 0x80;\n }\n return xtScanCode;\n }\n\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 255; // msg-type\n buff[offset + 1] = 0; // sub msg-type\n\n buff[offset + 2] = (down >> 8);\n buff[offset + 3] = down;\n\n buff[offset + 4] = (keysym >> 24);\n buff[offset + 5] = (keysym >> 16);\n buff[offset + 6] = (keysym >> 8);\n buff[offset + 7] = keysym;\n\n const RFBkeycode = getRFBkeycode(keycode);\n\n buff[offset + 8] = (RFBkeycode >> 24);\n buff[offset + 9] = (RFBkeycode >> 16);\n buff[offset + 10] = (RFBkeycode >> 8);\n buff[offset + 11] = RFBkeycode;\n\n sock._sQlen += 12;\n sock.flush();\n },\n\n pointerEvent(sock, x, y, mask) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 5; // msg-type\n\n buff[offset + 1] = mask;\n\n buff[offset + 2] = x >> 8;\n buff[offset + 3] = x;\n\n buff[offset + 4] = y >> 8;\n buff[offset + 5] = y;\n\n sock._sQlen += 6;\n sock.flush();\n },\n\n // Used to build Notify and Request data.\n _buildExtendedClipboardFlags(actions, formats) {\n let data = new Uint8Array(4);\n let formatFlag = 0x00000000;\n let actionFlag = 0x00000000;\n\n for (let i = 0; i < actions.length; i++) {\n actionFlag |= actions[i];\n }\n\n for (let i = 0; i < formats.length; i++) {\n formatFlag |= formats[i];\n }\n\n data[0] = actionFlag >> 24; // Actions\n data[1] = 0x00; // Reserved\n data[2] = 0x00; // Reserved\n data[3] = formatFlag; // Formats\n\n return data;\n },\n\n extendedClipboardProvide(sock, formats, inData) {\n // Deflate incomming data and their sizes\n let deflator = new Deflator();\n let dataToDeflate = [];\n\n for (let i = 0; i < formats.length; i++) {\n // We only support the format Text at this time\n if (formats[i] != extendedClipboardFormatText) {\n throw new Error(\"Unsupported extended clipboard format for Provide message.\");\n }\n\n // Change lone \\r or \\n into \\r\\n as defined in rfbproto\n inData[i] = inData[i].replace(/\\r\\n|\\r|\\n/gm, \"\\r\\n\");\n\n // Check if it already has \\0\n let text = encodeUTF8(inData[i] + \"\\0\");\n\n dataToDeflate.push( (text.length >> 24) & 0xFF,\n (text.length >> 16) & 0xFF,\n (text.length >> 8) & 0xFF,\n (text.length & 0xFF));\n\n for (let j = 0; j < text.length; j++) {\n dataToDeflate.push(text.charCodeAt(j));\n }\n }\n\n let deflatedData = deflator.deflate(new Uint8Array(dataToDeflate));\n\n // Build data to send\n let data = new Uint8Array(4 + deflatedData.length);\n data.set(RFB.messages._buildExtendedClipboardFlags([extendedClipboardActionProvide],\n formats));\n data.set(deflatedData, 4);\n\n RFB.messages.clientCutText(sock, data, true);\n },\n\n extendedClipboardNotify(sock, formats) {\n let flags = RFB.messages._buildExtendedClipboardFlags([extendedClipboardActionNotify],\n formats);\n RFB.messages.clientCutText(sock, flags, true);\n },\n\n extendedClipboardRequest(sock, formats) {\n let flags = RFB.messages._buildExtendedClipboardFlags([extendedClipboardActionRequest],\n formats);\n RFB.messages.clientCutText(sock, flags, true);\n },\n\n extendedClipboardCaps(sock, actions, formats) {\n let formatKeys = Object.keys(formats);\n let data = new Uint8Array(4 + (4 * formatKeys.length));\n\n formatKeys.map(x => parseInt(x));\n formatKeys.sort((a, b) => a - b);\n\n data.set(RFB.messages._buildExtendedClipboardFlags(actions, []));\n\n let loopOffset = 4;\n for (let i = 0; i < formatKeys.length; i++) {\n data[loopOffset] = formats[formatKeys[i]] >> 24;\n data[loopOffset + 1] = formats[formatKeys[i]] >> 16;\n data[loopOffset + 2] = formats[formatKeys[i]] >> 8;\n data[loopOffset + 3] = formats[formatKeys[i]] >> 0;\n\n loopOffset += 4;\n data[3] |= (1 << formatKeys[i]); // Update our format flags\n }\n\n RFB.messages.clientCutText(sock, data, true);\n },\n\n clientCutText(sock, data, extended = false) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 6; // msg-type\n\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = 0; // padding\n buff[offset + 3] = 0; // padding\n\n let length;\n if (extended) {\n length = toUnsigned32bit(-data.length);\n } else {\n length = data.length;\n }\n\n buff[offset + 4] = length >> 24;\n buff[offset + 5] = length >> 16;\n buff[offset + 6] = length >> 8;\n buff[offset + 7] = length;\n\n sock._sQlen += 8;\n\n // We have to keep track of from where in the data we begin creating the\n // buffer for the flush in the next iteration.\n let dataOffset = 0;\n\n let remaining = data.length;\n while (remaining > 0) {\n\n let flushSize = Math.min(remaining, (sock._sQbufferSize - sock._sQlen));\n for (let i = 0; i < flushSize; i++) {\n buff[sock._sQlen + i] = data[dataOffset + i];\n }\n\n sock._sQlen += flushSize;\n sock.flush();\n\n remaining -= flushSize;\n dataOffset += flushSize;\n }\n\n },\n\n setDesktopSize(sock, width, height, id, flags) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 251; // msg-type\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = width >> 8; // width\n buff[offset + 3] = width;\n buff[offset + 4] = height >> 8; // height\n buff[offset + 5] = height;\n\n buff[offset + 6] = 1; // number-of-screens\n buff[offset + 7] = 0; // padding\n\n // screen array\n buff[offset + 8] = id >> 24; // id\n buff[offset + 9] = id >> 16;\n buff[offset + 10] = id >> 8;\n buff[offset + 11] = id;\n buff[offset + 12] = 0; // x-position\n buff[offset + 13] = 0;\n buff[offset + 14] = 0; // y-position\n buff[offset + 15] = 0;\n buff[offset + 16] = width >> 8; // width\n buff[offset + 17] = width;\n buff[offset + 18] = height >> 8; // height\n buff[offset + 19] = height;\n buff[offset + 20] = flags >> 24; // flags\n buff[offset + 21] = flags >> 16;\n buff[offset + 22] = flags >> 8;\n buff[offset + 23] = flags;\n\n sock._sQlen += 24;\n sock.flush();\n },\n\n clientFence(sock, flags, payload) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 248; // msg-type\n\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = 0; // padding\n buff[offset + 3] = 0; // padding\n\n buff[offset + 4] = flags >> 24; // flags\n buff[offset + 5] = flags >> 16;\n buff[offset + 6] = flags >> 8;\n buff[offset + 7] = flags;\n\n const n = payload.length;\n\n buff[offset + 8] = n; // length\n\n for (let i = 0; i < n; i++) {\n buff[offset + 9 + i] = payload.charCodeAt(i);\n }\n\n sock._sQlen += 9 + n;\n sock.flush();\n },\n\n enableContinuousUpdates(sock, enable, x, y, width, height) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 150; // msg-type\n buff[offset + 1] = enable; // enable-flag\n\n buff[offset + 2] = x >> 8; // x\n buff[offset + 3] = x;\n buff[offset + 4] = y >> 8; // y\n buff[offset + 5] = y;\n buff[offset + 6] = width >> 8; // width\n buff[offset + 7] = width;\n buff[offset + 8] = height >> 8; // height\n buff[offset + 9] = height;\n\n sock._sQlen += 10;\n sock.flush();\n },\n\n pixelFormat(sock, depth, trueColor) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n let bpp;\n\n if (depth > 16) {\n bpp = 32;\n } else if (depth > 8) {\n bpp = 16;\n } else {\n bpp = 8;\n }\n\n const bits = Math.floor(depth/3);\n\n buff[offset] = 0; // msg-type\n\n buff[offset + 1] = 0; // padding\n buff[offset + 2] = 0; // padding\n buff[offset + 3] = 0; // padding\n\n buff[offset + 4] = bpp; // bits-per-pixel\n buff[offset + 5] = depth; // depth\n buff[offset + 6] = 0; // little-endian\n buff[offset + 7] = trueColor ? 1 : 0; // true-color\n\n buff[offset + 8] = 0; // red-max\n buff[offset + 9] = (1 << bits) - 1; // red-max\n\n buff[offset + 10] = 0; // green-max\n buff[offset + 11] = (1 << bits) - 1; // green-max\n\n buff[offset + 12] = 0; // blue-max\n buff[offset + 13] = (1 << bits) - 1; // blue-max\n\n buff[offset + 14] = bits * 0; // red-shift\n buff[offset + 15] = bits * 1; // green-shift\n buff[offset + 16] = bits * 2; // blue-shift\n\n buff[offset + 17] = 0; // padding\n buff[offset + 18] = 0; // padding\n buff[offset + 19] = 0; // padding\n\n sock._sQlen += 20;\n sock.flush();\n },\n\n clientEncodings(sock, encodings) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 2; // msg-type\n buff[offset + 1] = 0; // padding\n\n buff[offset + 2] = encodings.length >> 8;\n buff[offset + 3] = encodings.length;\n\n let j = offset + 4;\n for (let i = 0; i < encodings.length; i++) {\n const enc = encodings[i];\n buff[j] = enc >> 24;\n buff[j + 1] = enc >> 16;\n buff[j + 2] = enc >> 8;\n buff[j + 3] = enc;\n\n j += 4;\n }\n\n sock._sQlen += j - offset;\n sock.flush();\n },\n\n fbUpdateRequest(sock, incremental, x, y, w, h) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n if (typeof(x) === \"undefined\") { x = 0; }\n if (typeof(y) === \"undefined\") { y = 0; }\n\n buff[offset] = 3; // msg-type\n buff[offset + 1] = incremental ? 1 : 0;\n\n buff[offset + 2] = (x >> 8) & 0xFF;\n buff[offset + 3] = x & 0xFF;\n\n buff[offset + 4] = (y >> 8) & 0xFF;\n buff[offset + 5] = y & 0xFF;\n\n buff[offset + 6] = (w >> 8) & 0xFF;\n buff[offset + 7] = w & 0xFF;\n\n buff[offset + 8] = (h >> 8) & 0xFF;\n buff[offset + 9] = h & 0xFF;\n\n sock._sQlen += 10;\n sock.flush();\n },\n\n xvpOp(sock, ver, op) {\n const buff = sock._sQ;\n const offset = sock._sQlen;\n\n buff[offset] = 250; // msg-type\n buff[offset + 1] = 0; // padding\n\n buff[offset + 2] = ver;\n buff[offset + 3] = op;\n\n sock._sQlen += 4;\n sock.flush();\n }\n};\n\nRFB.cursors = {\n none: {\n rgbaPixels: new Uint8Array(),\n w: 0, h: 0,\n hotx: 0, hoty: 0,\n },\n\n dot: {\n /* eslint-disable indent */\n rgbaPixels: new Uint8Array([\n 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 255, 255,\n 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255,\n 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 255, 255,\n ]),\n /* eslint-enable indent */\n w: 3, h: 3,\n hotx: 1, hoty: 1,\n }\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('img',_vm._b({attrs:{\"src\":_vm.pathToBrandedImage}},'img',_vm.$attrs,false))\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n","import mod from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./BrandImage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../cache-loader/dist/cjs.js??ref--14-0!../../../thread-loader/dist/cjs.js!../../../babel-loader/lib/index.js!../../../cache-loader/dist/cjs.js??ref--2-0!../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./BrandImage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./BrandImage.vue?vue&type=template&id=096aa8de&\"\nimport script from \"./BrandImage.vue?vue&type=script&lang=js&\"\nexport * from \"./BrandImage.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsole.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsole.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./NovncConsole.vue?vue&type=template&id=d269b192&scoped=true&\"\nimport script from \"./NovncConsole.vue?vue&type=script&lang=js&\"\nexport * from \"./NovncConsole.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NovncConsole.vue?vue&type=style&index=0&id=d269b192&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"d269b192\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./NovncConsoleWrapper.vue?vue&type=template&id=c325098a&scoped=true&\"\nimport script from \"./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"\nexport * from \"./NovncConsoleWrapper.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NovncConsoleWrapper.vue?vue&type=style&index=0&id=c325098a&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"c325098a\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./VNCConsolePage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./VNCConsolePage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./VNCConsolePage.vue?vue&type=template&id=bbdc6168&\"\nimport script from \"./VNCConsolePage.vue?vue&type=script&lang=js&\"\nexport * from \"./VNCConsolePage.vue?vue&type=script&lang=js&\"\nimport style0 from \"./VNCConsolePage.vue?vue&type=style&index=0&id=bbdc6168&prod&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import { importTypes } from '@rancher/auto-import';\nimport { ActionLocation, IPlugin } from '@shell/core/types';\nimport { VM_RESOURCE_NAME, PRODUCT_NAME } from './constants';\nimport { startVMAction, stopVMAction } from './actions';\nimport SerialConsolePage from './components/SerialConsolePage.vue';\nimport VNCConsolePage from './components/VNCConsolePage.vue';\n\n// Init the package\nexport default function (plugin: IPlugin) {\n // Auto-import model, detail, edit from the folders\n importTypes(plugin);\n\n // Provide plugin metadata from package.json\n plugin.metadata = require('./package.json');\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n plugin.addProduct(require('./product'));\n plugin.addAction(ActionLocation.TABLE, { resource: [VM_RESOURCE_NAME] }, startVMAction);\n plugin.addAction(ActionLocation.TABLE, { resource: [VM_RESOURCE_NAME] }, stopVMAction);\n plugin.addRoute({\n name: `${PRODUCT_NAME}-c-cluster-vm-serialconsole`,\n path: `/:product/c/:cluster/console/:namespace/:vm/serial`,\n component: SerialConsolePage,\n meta: {\n product: PRODUCT_NAME,\n },\n });\n plugin.addRoute({\n name: `${PRODUCT_NAME}-c-cluster-vm-vncconsole`,\n path: `/:product/c/:cluster/console/:namespace/:vm/vnc`,\n component: VNCConsolePage,\n meta: {\n product: PRODUCT_NAME,\n },\n });\n}\n","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n","import { get } from './object';\nimport { strPad } from './string';\n\n// Based on https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/runtime/lib/type-of.js\n// and https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/runtime/lib/mixins/array.js\n/*\nCopyright (c) 2019 Yehuda Katz, Tom Dale and Ember.js contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n// ........................................\n// TYPING & ARRAY MESSAGING\n//\nconst TYPE_MAP = {\n '[object Boolean]': 'boolean',\n '[object Number]': 'number',\n '[object String]': 'string',\n '[object Function]': 'function',\n '[object Array]': 'array',\n '[object Date]': 'date',\n '[object RegExp]': 'regexp',\n '[object Object]': 'object',\n '[object FileList]': 'filelist',\n};\n\nconst { toString } = Object.prototype;\n\n/**\n Returns a consistent type for the passed object.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive or String object. |\n | 'number' | Number primitive or Number object. |\n | 'boolean' | Boolean primitive or Boolean object. |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'regexp' | An instance of RegExp |\n | 'date' | An instance of Date |\n | 'filelist' | An instance of FileList |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object |\n\n Examples:\n\n import { typeOf } from '@shell/utils/type-of';\n\n typeOf(); // 'undefined'\n typeOf(null); // 'null'\n typeOf(undefined); // 'undefined'\n typeOf('michael'); // 'string'\n typeOf(new String('michael')); // 'string'\n typeOf(101); // 'number'\n typeOf(new Number(101)); // 'number'\n typeOf(true); // 'boolean'\n typeOf(new Boolean(true)); // 'boolean'\n typeOf(A); // 'function'\n typeOf([1, 2, 90]); // 'array'\n typeOf(/abc/); // 'regexp'\n typeOf(new Date()); // 'date'\n typeOf(event.target.files); // 'filelist'\n typeOf(new Error('teamocil')); // 'error'\n\n // 'normal' JavaScript object\n typeOf({ a: 'b' }); // 'object'\n*/\nexport function typeOf(item) {\n if (item === null) {\n return 'null';\n }\n if (item === undefined) {\n return 'undefined';\n }\n let ret = TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'object') {\n if (item instanceof Error) {\n ret = 'error';\n } else if (item instanceof Date) {\n ret = 'date';\n }\n }\n\n return ret;\n}\n\nexport function spaceship(a, b) {\n const diff = a - b;\n\n return (diff > 0) - (diff < 0);\n}\n\nconst TYPE_ORDER = {\n undefined: 0,\n null: 1,\n boolean: 2,\n number: 3,\n string: 4,\n array: 5,\n object: 6,\n instance: 7,\n function: 8,\n class: 9,\n date: 10,\n};\n\nexport function compare(a, b) {\n const typeA = typeOf(a);\n const typeB = typeOf(b);\n\n const res = spaceship(TYPE_ORDER[typeA], TYPE_ORDER[typeB]);\n\n if ( res ) {\n return res;\n }\n\n switch (typeA) {\n case 'boolean':\n case 'number':\n return spaceship(a, b);\n\n case 'string':\n return spaceship(a.localeCompare(b), 0);\n\n case 'array': {\n const aLen = a.length;\n const bLen = b.length;\n const len = Math.min(aLen, bLen);\n\n for (let i = 0; i < len; i++) {\n const r = compare(a[i], b[i]);\n\n if (r !== 0) {\n return r;\n }\n }\n\n // all elements are equal now\n // shorter array should be ordered first\n return spaceship(aLen, bLen);\n }\n case 'date':\n return spaceship(a.getTime(), b.getTime());\n }\n\n return 0;\n}\n\nexport function parseField(str) {\n const parts = str.split(/:/);\n\n if ( parts.length === 2 && parts[1] === 'desc' ) {\n return { field: parts[0], reverse: true };\n } else {\n return { field: str, reverse: false };\n }\n}\n\nexport function sortBy(ary, keys, desc) {\n if ( !Array.isArray(keys) ) {\n keys = [keys];\n }\n\n return (ary || []).slice().sort((objA, objB) => {\n for ( let i = 0 ; i < keys.length ; i++ ) {\n const parsed = parseField(keys[i]);\n const a = get(objA, parsed.field);\n const b = get(objB, parsed.field);\n let res = compare(a, b);\n\n if ( res ) {\n if ( desc ) {\n res *= -1;\n }\n\n if ( parsed.reverse ) {\n res *= -1;\n }\n\n return res;\n }\n }\n\n return 0;\n });\n}\n\n// Turn foo1-bar2 into foo0000000001-bar0000000002 so that the numbers sort numerically\nconst splitRegex = /([^\\d]+)/;\nconst notNumericRegex = /^[0-9]+$/;\n\nexport function sortableNumericSuffix(str) {\n if ( typeof str !== 'string' ) {\n return str;\n }\n\n return str.split(splitRegex).map((x) => x.match(notNumericRegex) ? strPad(x, 10, '0') : x).join('').trim();\n}\n\nexport function isNumeric(num) {\n return !!`${ num }`.match(notNumericRegex);\n}\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cronstrue\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cronstrue\"] = factory();\n\telse\n\t\troot[\"cronstrue\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 4);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar stringUtilities_1 = __webpack_require__(1);\nvar cronParser_1 = __webpack_require__(2);\nvar ExpressionDescriptor = (function () {\n function ExpressionDescriptor(expression, options) {\n this.expression = expression;\n this.options = options;\n this.expressionParts = new Array(5);\n if (ExpressionDescriptor.locales[options.locale]) {\n this.i18n = ExpressionDescriptor.locales[options.locale];\n }\n else {\n console.warn(\"Locale '\" + options.locale + \"' could not be found; falling back to 'en'.\");\n this.i18n = ExpressionDescriptor.locales[\"en\"];\n }\n if (options.use24HourTimeFormat === undefined) {\n options.use24HourTimeFormat = this.i18n.use24HourTimeFormatByDefault();\n }\n }\n ExpressionDescriptor.toString = function (expression, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.throwExceptionOnParseError, throwExceptionOnParseError = _c === void 0 ? true : _c, _d = _b.verbose, verbose = _d === void 0 ? false : _d, _e = _b.dayOfWeekStartIndexZero, dayOfWeekStartIndexZero = _e === void 0 ? true : _e, use24HourTimeFormat = _b.use24HourTimeFormat, _f = _b.locale, locale = _f === void 0 ? \"en\" : _f;\n var options = {\n throwExceptionOnParseError: throwExceptionOnParseError,\n verbose: verbose,\n dayOfWeekStartIndexZero: dayOfWeekStartIndexZero,\n use24HourTimeFormat: use24HourTimeFormat,\n locale: locale\n };\n var descripter = new ExpressionDescriptor(expression, options);\n return descripter.getFullDescription();\n };\n ExpressionDescriptor.initialize = function (localesLoader) {\n ExpressionDescriptor.specialCharacters = [\"/\", \"-\", \",\", \"*\"];\n localesLoader.load(ExpressionDescriptor.locales);\n };\n ExpressionDescriptor.prototype.getFullDescription = function () {\n var description = \"\";\n try {\n var parser = new cronParser_1.CronParser(this.expression, this.options.dayOfWeekStartIndexZero);\n this.expressionParts = parser.parse();\n var timeSegment = this.getTimeOfDayDescription();\n var dayOfMonthDesc = this.getDayOfMonthDescription();\n var monthDesc = this.getMonthDescription();\n var dayOfWeekDesc = this.getDayOfWeekDescription();\n var yearDesc = this.getYearDescription();\n description += timeSegment + dayOfMonthDesc + dayOfWeekDesc + monthDesc + yearDesc;\n description = this.transformVerbosity(description, this.options.verbose);\n description = description.charAt(0).toLocaleUpperCase() + description.substr(1);\n }\n catch (ex) {\n if (!this.options.throwExceptionOnParseError) {\n description = this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();\n }\n else {\n throw \"\" + ex;\n }\n }\n return description;\n };\n ExpressionDescriptor.prototype.getTimeOfDayDescription = function () {\n var secondsExpression = this.expressionParts[0];\n var minuteExpression = this.expressionParts[1];\n var hourExpression = this.expressionParts[2];\n var description = \"\";\n if (!stringUtilities_1.StringUtilities.containsAny(minuteExpression, ExpressionDescriptor.specialCharacters) &&\n !stringUtilities_1.StringUtilities.containsAny(hourExpression, ExpressionDescriptor.specialCharacters) &&\n !stringUtilities_1.StringUtilities.containsAny(secondsExpression, ExpressionDescriptor.specialCharacters)) {\n description += this.i18n.atSpace() + this.formatTime(hourExpression, minuteExpression, secondsExpression);\n }\n else if (!secondsExpression &&\n minuteExpression.indexOf(\"-\") > -1 &&\n !(minuteExpression.indexOf(\",\") > -1) &&\n !(minuteExpression.indexOf(\"/\") > -1) &&\n !stringUtilities_1.StringUtilities.containsAny(hourExpression, ExpressionDescriptor.specialCharacters)) {\n var minuteParts = minuteExpression.split(\"-\");\n description += stringUtilities_1.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(), this.formatTime(hourExpression, minuteParts[0], \"\"), this.formatTime(hourExpression, minuteParts[1], \"\"));\n }\n else if (!secondsExpression &&\n hourExpression.indexOf(\",\") > -1 &&\n hourExpression.indexOf(\"-\") == -1 &&\n hourExpression.indexOf(\"/\") == -1 &&\n !stringUtilities_1.StringUtilities.containsAny(minuteExpression, ExpressionDescriptor.specialCharacters)) {\n var hourParts = hourExpression.split(\",\");\n description += this.i18n.at();\n for (var i = 0; i < hourParts.length; i++) {\n description += \" \";\n description += this.formatTime(hourParts[i], minuteExpression, \"\");\n if (i < hourParts.length - 2) {\n description += \",\";\n }\n if (i == hourParts.length - 2) {\n description += this.i18n.spaceAnd();\n }\n }\n }\n else {\n var secondsDescription = this.getSecondsDescription();\n var minutesDescription = this.getMinutesDescription();\n var hoursDescription = this.getHoursDescription();\n description += secondsDescription;\n if (description.length > 0 && minutesDescription.length > 0) {\n description += \", \";\n }\n description += minutesDescription;\n if (description.length > 0 && hoursDescription.length > 0) {\n description += \", \";\n }\n description += hoursDescription;\n }\n return description;\n };\n ExpressionDescriptor.prototype.getSecondsDescription = function () {\n var _this = this;\n var description = this.getSegmentDescription(this.expressionParts[0], this.i18n.everySecond(), function (s) {\n return s;\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Seconds(), s);\n }, function (s) {\n return _this.i18n.secondsX0ThroughX1PastTheMinute();\n }, function (s) {\n return s == \"0\"\n ? \"\"\n : parseInt(s) < 20\n ? _this.i18n.atX0SecondsPastTheMinute()\n : _this.i18n.atX0SecondsPastTheMinuteGt20() || _this.i18n.atX0SecondsPastTheMinute();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getMinutesDescription = function () {\n var _this = this;\n var secondsExpression = this.expressionParts[0];\n var hourExpression = this.expressionParts[2];\n var description = this.getSegmentDescription(this.expressionParts[1], this.i18n.everyMinute(), function (s) {\n return s;\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Minutes(), s);\n }, function (s) {\n return _this.i18n.minutesX0ThroughX1PastTheHour();\n }, function (s) {\n try {\n return s == \"0\" && hourExpression.indexOf(\"/\") == -1 && secondsExpression == \"\"\n ? _this.i18n.everyHour()\n : parseInt(s) < 20\n ? _this.i18n.atX0MinutesPastTheHour()\n : _this.i18n.atX0MinutesPastTheHourGt20() || _this.i18n.atX0MinutesPastTheHour();\n }\n catch (e) {\n return _this.i18n.atX0MinutesPastTheHour();\n }\n });\n return description;\n };\n ExpressionDescriptor.prototype.getHoursDescription = function () {\n var _this = this;\n var expression = this.expressionParts[2];\n var description = this.getSegmentDescription(expression, this.i18n.everyHour(), function (s) {\n return _this.formatTime(s, \"0\", \"\");\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Hours(), s);\n }, function (s) {\n return _this.i18n.betweenX0AndX1();\n }, function (s) {\n return _this.i18n.atX0();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getDayOfWeekDescription = function () {\n var _this = this;\n var daysOfWeekNames = this.i18n.daysOfTheWeek();\n var description = null;\n if (this.expressionParts[5] == \"*\") {\n description = \"\";\n }\n else {\n description = this.getSegmentDescription(this.expressionParts[5], this.i18n.commaEveryDay(), function (s) {\n var exp = s;\n if (s.indexOf(\"#\") > -1) {\n exp = s.substr(0, s.indexOf(\"#\"));\n }\n else if (s.indexOf(\"L\") > -1) {\n exp = exp.replace(\"L\", \"\");\n }\n return daysOfWeekNames[parseInt(exp)];\n }, function (s) {\n if (parseInt(s) == 1) {\n return \"\";\n }\n else {\n return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0DaysOfTheWeek(), s);\n }\n }, function (s) {\n return _this.i18n.commaX0ThroughX1();\n }, function (s) {\n var format = null;\n if (s.indexOf(\"#\") > -1) {\n var dayOfWeekOfMonthNumber = s.substring(s.indexOf(\"#\") + 1);\n var dayOfWeekOfMonthDescription = null;\n switch (dayOfWeekOfMonthNumber) {\n case \"1\":\n dayOfWeekOfMonthDescription = _this.i18n.first();\n break;\n case \"2\":\n dayOfWeekOfMonthDescription = _this.i18n.second();\n break;\n case \"3\":\n dayOfWeekOfMonthDescription = _this.i18n.third();\n break;\n case \"4\":\n dayOfWeekOfMonthDescription = _this.i18n.fourth();\n break;\n case \"5\":\n dayOfWeekOfMonthDescription = _this.i18n.fifth();\n break;\n }\n format = _this.i18n.commaOnThe() + dayOfWeekOfMonthDescription + _this.i18n.spaceX0OfTheMonth();\n }\n else if (s.indexOf(\"L\") > -1) {\n format = _this.i18n.commaOnTheLastX0OfTheMonth();\n }\n else {\n var domSpecified = _this.expressionParts[3] != \"*\";\n format = domSpecified ? _this.i18n.commaAndOnX0() : _this.i18n.commaOnlyOnX0();\n }\n return format;\n });\n }\n return description;\n };\n ExpressionDescriptor.prototype.getMonthDescription = function () {\n var _this = this;\n var monthNames = this.i18n.monthsOfTheYear();\n var description = this.getSegmentDescription(this.expressionParts[4], \"\", function (s) {\n return monthNames[parseInt(s) - 1];\n }, function (s) {\n if (parseInt(s) == 1) {\n return \"\";\n }\n else {\n return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Months(), s);\n }\n }, function (s) {\n return _this.i18n.commaMonthX0ThroughMonthX1() || _this.i18n.commaX0ThroughX1();\n }, function (s) {\n return _this.i18n.commaOnlyInMonthX0 ? _this.i18n.commaOnlyInMonthX0() : _this.i18n.commaOnlyInX0();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getDayOfMonthDescription = function () {\n var _this = this;\n var description = null;\n var expression = this.expressionParts[3];\n switch (expression) {\n case \"L\":\n description = this.i18n.commaOnTheLastDayOfTheMonth();\n break;\n case \"WL\":\n case \"LW\":\n description = this.i18n.commaOnTheLastWeekdayOfTheMonth();\n break;\n default:\n var weekDayNumberMatches = expression.match(/(\\d{1,2}W)|(W\\d{1,2})/);\n if (weekDayNumberMatches) {\n var dayNumber = parseInt(weekDayNumberMatches[0].replace(\"W\", \"\"));\n var dayString = dayNumber == 1\n ? this.i18n.firstWeekday()\n : stringUtilities_1.StringUtilities.format(this.i18n.weekdayNearestDayX0(), dayNumber.toString());\n description = stringUtilities_1.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(), dayString);\n break;\n }\n else {\n var lastDayOffSetMatches = expression.match(/L-(\\d{1,2})/);\n if (lastDayOffSetMatches) {\n var offSetDays = lastDayOffSetMatches[1];\n description = stringUtilities_1.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(), offSetDays);\n break;\n }\n else if (expression == \"*\" && this.expressionParts[5] != \"*\") {\n return \"\";\n }\n else {\n description = this.getSegmentDescription(expression, this.i18n.commaEveryDay(), function (s) {\n return s == \"L\" ? _this.i18n.lastDay() : ((_this.i18n.dayX0) ? stringUtilities_1.StringUtilities.format(_this.i18n.dayX0(), s) : s);\n }, function (s) {\n return s == \"1\" ? _this.i18n.commaEveryDay() : _this.i18n.commaEveryX0Days();\n }, function (s) {\n return _this.i18n.commaBetweenDayX0AndX1OfTheMonth();\n }, function (s) {\n return _this.i18n.commaOnDayX0OfTheMonth();\n });\n }\n break;\n }\n }\n return description;\n };\n ExpressionDescriptor.prototype.getYearDescription = function () {\n var _this = this;\n var description = this.getSegmentDescription(this.expressionParts[6], \"\", function (s) {\n return /^\\d+$/.test(s) ? new Date(parseInt(s), 1).getFullYear().toString() : s;\n }, function (s) {\n return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Years(), s);\n }, function (s) {\n return _this.i18n.commaYearX0ThroughYearX1() || _this.i18n.commaX0ThroughX1();\n }, function (s) {\n return _this.i18n.commaOnlyInYearX0 ? _this.i18n.commaOnlyInYearX0() : _this.i18n.commaOnlyInX0();\n });\n return description;\n };\n ExpressionDescriptor.prototype.getSegmentDescription = function (expression, allDescription, getSingleItemDescription, getIntervalDescriptionFormat, getBetweenDescriptionFormat, getDescriptionFormat) {\n var _this = this;\n var description = null;\n if (!expression) {\n description = \"\";\n }\n else if (expression === \"*\") {\n description = allDescription;\n }\n else if (!stringUtilities_1.StringUtilities.containsAny(expression, [\"/\", \"-\", \",\"])) {\n description = stringUtilities_1.StringUtilities.format(getDescriptionFormat(expression), getSingleItemDescription(expression));\n }\n else if (expression.indexOf(\"/\") > -1) {\n var segments = expression.split(\"/\");\n description = stringUtilities_1.StringUtilities.format(getIntervalDescriptionFormat(segments[1]), segments[1]);\n if (segments[0].indexOf(\"-\") > -1) {\n var betweenSegmentDescription = this.generateBetweenSegmentDescription(segments[0], getBetweenDescriptionFormat, getSingleItemDescription);\n if (betweenSegmentDescription.indexOf(\", \") != 0) {\n description += \", \";\n }\n description += betweenSegmentDescription;\n }\n else if (!stringUtilities_1.StringUtilities.containsAny(segments[0], [\"*\", \",\"])) {\n var rangeItemDescription = stringUtilities_1.StringUtilities.format(getDescriptionFormat(segments[0]), getSingleItemDescription(segments[0]));\n rangeItemDescription = rangeItemDescription.replace(\", \", \"\");\n description += stringUtilities_1.StringUtilities.format(this.i18n.commaStartingX0(), rangeItemDescription);\n }\n }\n else if (expression.indexOf(\",\") > -1) {\n var segments = expression.split(\",\");\n var descriptionContent = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (i > 0 && segments.length > 2) {\n descriptionContent += \",\";\n if (i < segments.length - 1) {\n descriptionContent += \" \";\n }\n }\n if (i > 0 && segments.length > 1 && (i == segments.length - 1 || segments.length == 2)) {\n descriptionContent += this.i18n.spaceAnd() + \" \";\n }\n if (segments[i].indexOf(\"-\") > -1) {\n var betweenSegmentDescription = this.generateBetweenSegmentDescription(segments[i], function (s) {\n return _this.i18n.commaX0ThroughX1();\n }, getSingleItemDescription);\n betweenSegmentDescription = betweenSegmentDescription.replace(\", \", \"\");\n descriptionContent += betweenSegmentDescription;\n }\n else {\n descriptionContent += getSingleItemDescription(segments[i]);\n }\n }\n description = stringUtilities_1.StringUtilities.format(getDescriptionFormat(expression), descriptionContent);\n }\n else if (expression.indexOf(\"-\") > -1) {\n description = this.generateBetweenSegmentDescription(expression, getBetweenDescriptionFormat, getSingleItemDescription);\n }\n return description;\n };\n ExpressionDescriptor.prototype.generateBetweenSegmentDescription = function (betweenExpression, getBetweenDescriptionFormat, getSingleItemDescription) {\n var description = \"\";\n var betweenSegments = betweenExpression.split(\"-\");\n var betweenSegment1Description = getSingleItemDescription(betweenSegments[0]);\n var betweenSegment2Description = getSingleItemDescription(betweenSegments[1]);\n betweenSegment2Description = betweenSegment2Description.replace(\":00\", \":59\");\n var betweenDescriptionFormat = getBetweenDescriptionFormat(betweenExpression);\n description += stringUtilities_1.StringUtilities.format(betweenDescriptionFormat, betweenSegment1Description, betweenSegment2Description);\n return description;\n };\n ExpressionDescriptor.prototype.formatTime = function (hourExpression, minuteExpression, secondExpression) {\n var hour = parseInt(hourExpression);\n var period = \"\";\n var setPeriodBeforeTime = false;\n if (!this.options.use24HourTimeFormat) {\n setPeriodBeforeTime = this.i18n.setPeriodBeforeTime && this.i18n.setPeriodBeforeTime();\n period = setPeriodBeforeTime ? this.getPeriod(hour) + \" \" : \" \" + this.getPeriod(hour);\n if (hour > 12) {\n hour -= 12;\n }\n if (hour === 0) {\n hour = 12;\n }\n }\n var minute = minuteExpression;\n var second = \"\";\n if (secondExpression) {\n second = \":\" + (\"00\" + secondExpression).substring(secondExpression.length);\n }\n return \"\" + (setPeriodBeforeTime ? period : \"\") + (\"00\" + hour.toString()).substring(hour.toString().length) + \":\" + (\"00\" + minute.toString()).substring(minute.toString().length) + second + (!setPeriodBeforeTime ? period : \"\");\n };\n ExpressionDescriptor.prototype.transformVerbosity = function (description, useVerboseFormat) {\n if (!useVerboseFormat) {\n description = description.replace(new RegExp(\", \" + this.i18n.everyMinute(), \"g\"), \"\");\n description = description.replace(new RegExp(\", \" + this.i18n.everyHour(), \"g\"), \"\");\n description = description.replace(new RegExp(this.i18n.commaEveryDay(), \"g\"), \"\");\n description = description.replace(/\\, ?$/, \"\");\n }\n return description;\n };\n ExpressionDescriptor.prototype.getPeriod = function (hour) {\n return hour >= 12 ? this.i18n.pm && this.i18n.pm() || \"PM\" : this.i18n.am && this.i18n.am() || \"AM\";\n };\n ExpressionDescriptor.locales = {};\n return ExpressionDescriptor;\n}());\nexports.ExpressionDescriptor = ExpressionDescriptor;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StringUtilities = (function () {\n function StringUtilities() {\n }\n StringUtilities.format = function (template) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n return template.replace(/%s/g, function () {\n return values.shift();\n });\n };\n StringUtilities.containsAny = function (text, searchStrings) {\n return searchStrings.some(function (c) {\n return text.indexOf(c) > -1;\n });\n };\n return StringUtilities;\n}());\nexports.StringUtilities = StringUtilities;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CronParser = (function () {\n function CronParser(expression, dayOfWeekStartIndexZero) {\n if (dayOfWeekStartIndexZero === void 0) { dayOfWeekStartIndexZero = true; }\n this.expression = expression;\n this.dayOfWeekStartIndexZero = dayOfWeekStartIndexZero;\n }\n CronParser.prototype.parse = function () {\n var parsed = this.extractParts(this.expression);\n this.normalize(parsed);\n this.validate(parsed);\n return parsed;\n };\n CronParser.prototype.extractParts = function (expression) {\n if (!this.expression) {\n throw new Error(\"Expression is empty\");\n }\n var parsed = expression.trim().split(/[ ]+/);\n if (parsed.length < 5) {\n throw new Error(\"Expression has only \" + parsed.length + \" part\" + (parsed.length == 1 ? \"\" : \"s\") + \". At least 5 parts are required.\");\n }\n else if (parsed.length == 5) {\n parsed.unshift(\"\");\n parsed.push(\"\");\n }\n else if (parsed.length == 6) {\n if (/\\d{4}$/.test(parsed[5])) {\n parsed.unshift(\"\");\n }\n else {\n parsed.push(\"\");\n }\n }\n else if (parsed.length > 7) {\n throw new Error(\"Expression has \" + parsed.length + \" parts; too many!\");\n }\n return parsed;\n };\n CronParser.prototype.normalize = function (expressionParts) {\n var _this = this;\n expressionParts[3] = expressionParts[3].replace(\"?\", \"*\");\n expressionParts[5] = expressionParts[5].replace(\"?\", \"*\");\n expressionParts[2] = expressionParts[2].replace(\"?\", \"*\");\n if (expressionParts[0].indexOf(\"0/\") == 0) {\n expressionParts[0] = expressionParts[0].replace(\"0/\", \"*/\");\n }\n if (expressionParts[1].indexOf(\"0/\") == 0) {\n expressionParts[1] = expressionParts[1].replace(\"0/\", \"*/\");\n }\n if (expressionParts[2].indexOf(\"0/\") == 0) {\n expressionParts[2] = expressionParts[2].replace(\"0/\", \"*/\");\n }\n if (expressionParts[3].indexOf(\"1/\") == 0) {\n expressionParts[3] = expressionParts[3].replace(\"1/\", \"*/\");\n }\n if (expressionParts[4].indexOf(\"1/\") == 0) {\n expressionParts[4] = expressionParts[4].replace(\"1/\", \"*/\");\n }\n if (expressionParts[5].indexOf(\"1/\") == 0) {\n expressionParts[5] = expressionParts[5].replace(\"1/\", \"*/\");\n }\n if (expressionParts[6].indexOf(\"1/\") == 0) {\n expressionParts[6] = expressionParts[6].replace(\"1/\", \"*/\");\n }\n expressionParts[5] = expressionParts[5].replace(/(^\\d)|([^#/\\s]\\d)/g, function (t) {\n var dowDigits = t.replace(/\\D/, \"\");\n var dowDigitsAdjusted = dowDigits;\n if (_this.dayOfWeekStartIndexZero) {\n if (dowDigits == \"7\") {\n dowDigitsAdjusted = \"0\";\n }\n }\n else {\n dowDigitsAdjusted = (parseInt(dowDigits) - 1).toString();\n }\n return t.replace(dowDigits, dowDigitsAdjusted);\n });\n if (expressionParts[5] == \"L\") {\n expressionParts[5] = \"6\";\n }\n if (expressionParts[3] == \"?\") {\n expressionParts[3] = \"*\";\n }\n if (expressionParts[3].indexOf(\"W\") > -1 &&\n (expressionParts[3].indexOf(\",\") > -1 || expressionParts[3].indexOf(\"-\") > -1)) {\n throw new Error(\"The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.\");\n }\n var days = {\n SUN: 0,\n MON: 1,\n TUE: 2,\n WED: 3,\n THU: 4,\n FRI: 5,\n SAT: 6\n };\n for (var day in days) {\n expressionParts[5] = expressionParts[5].replace(new RegExp(day, \"gi\"), days[day].toString());\n }\n var months = {\n JAN: 1,\n FEB: 2,\n MAR: 3,\n APR: 4,\n MAY: 5,\n JUN: 6,\n JUL: 7,\n AUG: 8,\n SEP: 9,\n OCT: 10,\n NOV: 11,\n DEC: 12\n };\n for (var month in months) {\n expressionParts[4] = expressionParts[4].replace(new RegExp(month, \"gi\"), months[month].toString());\n }\n if (expressionParts[0] == \"0\") {\n expressionParts[0] = \"\";\n }\n if (!/\\*|\\-|\\,|\\//.test(expressionParts[2]) &&\n (/\\*|\\//.test(expressionParts[1]) || /\\*|\\//.test(expressionParts[0]))) {\n expressionParts[2] += \"-\" + expressionParts[2];\n }\n for (var i = 0; i < expressionParts.length; i++) {\n if (expressionParts[i] == \"*/1\") {\n expressionParts[i] = \"*\";\n }\n if (expressionParts[i].indexOf(\"/\") > -1 && !/^\\*|\\-|\\,/.test(expressionParts[i])) {\n var stepRangeThrough = null;\n switch (i) {\n case 4:\n stepRangeThrough = \"12\";\n break;\n case 5:\n stepRangeThrough = \"6\";\n break;\n case 6:\n stepRangeThrough = \"9999\";\n break;\n default:\n stepRangeThrough = null;\n break;\n }\n if (stepRangeThrough != null) {\n var parts = expressionParts[i].split(\"/\");\n expressionParts[i] = parts[0] + \"-\" + stepRangeThrough + \"/\" + parts[1];\n }\n }\n }\n };\n CronParser.prototype.validate = function (parsed) {\n this.assertNoInvalidCharacters(\"DOW\", parsed[5]);\n this.assertNoInvalidCharacters(\"DOM\", parsed[3]);\n };\n CronParser.prototype.assertNoInvalidCharacters = function (partDescription, expression) {\n var invalidChars = expression.match(/[A-KM-VX-Z]+/gi);\n if (invalidChars && invalidChars.length) {\n throw new Error(partDescription + \" part contains invalid values: '\" + invalidChars.toString() + \"'\");\n }\n };\n return CronParser;\n}());\nexports.CronParser = CronParser;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar en = (function () {\n function en() {\n }\n en.prototype.atX0SecondsPastTheMinuteGt20 = function () {\n return null;\n };\n en.prototype.atX0MinutesPastTheHourGt20 = function () {\n return null;\n };\n en.prototype.commaMonthX0ThroughMonthX1 = function () {\n return null;\n };\n en.prototype.commaYearX0ThroughYearX1 = function () {\n return null;\n };\n en.prototype.use24HourTimeFormatByDefault = function () {\n return false;\n };\n en.prototype.anErrorOccuredWhenGeneratingTheExpressionD = function () {\n return \"An error occured when generating the expression description. Check the cron expression syntax.\";\n };\n en.prototype.everyMinute = function () {\n return \"every minute\";\n };\n en.prototype.everyHour = function () {\n return \"every hour\";\n };\n en.prototype.atSpace = function () {\n return \"At \";\n };\n en.prototype.everyMinuteBetweenX0AndX1 = function () {\n return \"Every minute between %s and %s\";\n };\n en.prototype.at = function () {\n return \"At\";\n };\n en.prototype.spaceAnd = function () {\n return \" and\";\n };\n en.prototype.everySecond = function () {\n return \"every second\";\n };\n en.prototype.everyX0Seconds = function () {\n return \"every %s seconds\";\n };\n en.prototype.secondsX0ThroughX1PastTheMinute = function () {\n return \"seconds %s through %s past the minute\";\n };\n en.prototype.atX0SecondsPastTheMinute = function () {\n return \"at %s seconds past the minute\";\n };\n en.prototype.everyX0Minutes = function () {\n return \"every %s minutes\";\n };\n en.prototype.minutesX0ThroughX1PastTheHour = function () {\n return \"minutes %s through %s past the hour\";\n };\n en.prototype.atX0MinutesPastTheHour = function () {\n return \"at %s minutes past the hour\";\n };\n en.prototype.everyX0Hours = function () {\n return \"every %s hours\";\n };\n en.prototype.betweenX0AndX1 = function () {\n return \"between %s and %s\";\n };\n en.prototype.atX0 = function () {\n return \"at %s\";\n };\n en.prototype.commaEveryDay = function () {\n return \", every day\";\n };\n en.prototype.commaEveryX0DaysOfTheWeek = function () {\n return \", every %s days of the week\";\n };\n en.prototype.commaX0ThroughX1 = function () {\n return \", %s through %s\";\n };\n en.prototype.first = function () {\n return \"first\";\n };\n en.prototype.second = function () {\n return \"second\";\n };\n en.prototype.third = function () {\n return \"third\";\n };\n en.prototype.fourth = function () {\n return \"fourth\";\n };\n en.prototype.fifth = function () {\n return \"fifth\";\n };\n en.prototype.commaOnThe = function () {\n return \", on the \";\n };\n en.prototype.spaceX0OfTheMonth = function () {\n return \" %s of the month\";\n };\n en.prototype.lastDay = function () {\n return \"the last day\";\n };\n en.prototype.commaOnTheLastX0OfTheMonth = function () {\n return \", on the last %s of the month\";\n };\n en.prototype.commaOnlyOnX0 = function () {\n return \", only on %s\";\n };\n en.prototype.commaAndOnX0 = function () {\n return \", and on %s\";\n };\n en.prototype.commaEveryX0Months = function () {\n return \", every %s months\";\n };\n en.prototype.commaOnlyInX0 = function () {\n return \", only in %s\";\n };\n en.prototype.commaOnTheLastDayOfTheMonth = function () {\n return \", on the last day of the month\";\n };\n en.prototype.commaOnTheLastWeekdayOfTheMonth = function () {\n return \", on the last weekday of the month\";\n };\n en.prototype.commaDaysBeforeTheLastDayOfTheMonth = function () {\n return \", %s days before the last day of the month\";\n };\n en.prototype.firstWeekday = function () {\n return \"first weekday\";\n };\n en.prototype.weekdayNearestDayX0 = function () {\n return \"weekday nearest day %s\";\n };\n en.prototype.commaOnTheX0OfTheMonth = function () {\n return \", on the %s of the month\";\n };\n en.prototype.commaEveryX0Days = function () {\n return \", every %s days\";\n };\n en.prototype.commaBetweenDayX0AndX1OfTheMonth = function () {\n return \", between day %s and %s of the month\";\n };\n en.prototype.commaOnDayX0OfTheMonth = function () {\n return \", on day %s of the month\";\n };\n en.prototype.commaEveryHour = function () {\n return \", every hour\";\n };\n en.prototype.commaEveryX0Years = function () {\n return \", every %s years\";\n };\n en.prototype.commaStartingX0 = function () {\n return \", starting %s\";\n };\n en.prototype.daysOfTheWeek = function () {\n return [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n };\n en.prototype.monthsOfTheYear = function () {\n return [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n };\n return en;\n}());\nexports.en = en;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar expressionDescriptor_ts_1 = __webpack_require__(0);\nvar enLocaleLoader_1 = __webpack_require__(5);\nexpressionDescriptor_ts_1.ExpressionDescriptor.initialize(new enLocaleLoader_1.enLocaleLoader());\nexports.default = expressionDescriptor_ts_1.ExpressionDescriptor;\nvar toString = expressionDescriptor_ts_1.ExpressionDescriptor.toString;\nexports.toString = toString;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar en_1 = __webpack_require__(3);\nvar enLocaleLoader = (function () {\n function enLocaleLoader() {\n }\n enLocaleLoader.prototype.load = function (availableLocales) {\n availableLocales[\"en\"] = new en_1.en();\n };\n return enLocaleLoader;\n}());\nexports.enLocaleLoader = enLocaleLoader;\n\n\n/***/ })\n/******/ ]);\n});","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var map = {\n\t\"./csp/dark/rancher-logo.svg\": \"858f\",\n\t\"./csp/favicon.png\": \"44a5\",\n\t\"./csp/metadata\": \"7f57\",\n\t\"./csp/metadata.json\": \"7f57\",\n\t\"./csp/rancher-logo.svg\": \"b5af\",\n\t\"./federal/dark/rancher-logo.svg\": \"0749\",\n\t\"./federal/metadata\": \"66fa\",\n\t\"./federal/metadata.json\": \"66fa\",\n\t\"./federal/rancher-logo.svg\": \"ad96\",\n\t\"./rgs/dark/rancher-logo.svg\": \"b160\",\n\t\"./rgs/metadata\": \"45d2\",\n\t\"./rgs/metadata.json\": \"45d2\",\n\t\"./rgs/rancher-logo.svg\": \"bd3e\",\n\t\"./suse/dark/rancher-logo.svg\": \"d5dc\",\n\t\"./suse/favicon.png\": \"f595\",\n\t\"./suse/metadata\": \"1d5f\",\n\t\"./suse/metadata.json\": \"1d5f\",\n\t\"./suse/rancher-logo.svg\": \"4816\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"21de\";","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\nfunction negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n}\n\nmodule.exports = negate;\n","module.exports = __webpack_public_path__ + \"img/half-logo.ed04f313.svg\";","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","module.exports = __webpack_public_path__ + \"img/harvester.765f68bd.png\";","export function camelToTitle(str) {\n return dasherize((str || '')).split('-').map((str) => {\n return ucFirst(str);\n }).join(' ');\n}\n\nexport function ucFirst(str) {\n str = str || '';\n\n return str.substr(0, 1).toUpperCase() + str.substr(1);\n}\n\nexport function lcFirst(str) {\n str = str || '';\n\n return str.substr(0, 1).toLowerCase() + str.substr(1);\n}\n\nexport function strPad(str, toLength, padChars = ' ', right = false) {\n str = `${ str }`;\n\n if (str.length >= toLength) {\n return str;\n }\n\n const neededLen = toLength - str.length + 1;\n const padStr = (new Array(neededLen)).join(padChars).substr(0, neededLen);\n\n if (right) {\n return str + padStr;\n } else {\n return padStr + str;\n }\n}\n\n// Turn thing1 into thing00000001 so that the numbers sort numerically\nexport function sortableNumericSuffix(str) {\n str = str || '';\n const match = str.match(/^(.*[^0-9])([0-9]+)$/);\n\n if (match) {\n return match[1] + strPad(match[2], 8, '0');\n }\n\n return str;\n}\n\nconst entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\n\nexport function escapeHtml(html) {\n return String(html).replace(/[&<>\"']/g, (s) => {\n return entityMap[s];\n });\n}\n\n/**\n * Return HTML markup from escaped HTML string, allowing specific tags\n * @param text string\n * @returns string\n */\nexport function decodeHtml(text) {\n const div = document.createElement('div');\n\n div.innerHTML = text;\n\n return div.textContent || div.innerText || '';\n}\n\nexport function escapeRegex(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\nexport function random32(count) {\n count = Math.max(0, count || 1);\n\n const out = [];\n let i;\n\n if (window.crypto && window.crypto.getRandomValues) {\n const tmp = new Uint32Array(count);\n\n window.crypto.getRandomValues(tmp);\n for (i = 0; i < tmp.length; i++) {\n out[i] = tmp[i];\n }\n } else {\n for (i = 0; i < count; i++) {\n out[i] = Math.random() * 4294967296; // Math.pow(2,32);\n }\n }\n\n if (count === 1) {\n return out[0];\n } else {\n return out;\n }\n}\n\nconst alpha = 'abcdefghijklmnopqrstuvwxyz';\nconst num = '0123456789';\nconst sym = '!@#$%^&*()_+-=[]{};:,./<>?|';\n\nexport const CHARSET = {\n NUMERIC: num,\n NO_VOWELS: 'bcdfghjklmnpqrstvwxz2456789',\n ALPHA: alpha + alpha.toUpperCase(),\n ALPHA_NUM: alpha + alpha.toUpperCase() + num,\n ALPHA_LOWER: alpha,\n ALPHA_UPPER: alpha.toUpperCase(),\n HEX: `${ num }ABCDEF`,\n PASSWORD: alpha + alpha.toUpperCase() + num + alpha + alpha.toUpperCase() + num + sym,\n // ^-- includes alpha / ALPHA / num twice to reduce the occurrence of symbols\n};\n\nexport function randomStr(length = 16, chars = CHARSET.ALPHA_NUM) {\n if (!chars || !chars.length) {\n return null;\n }\n\n return random32(length).map((val) => {\n return chars[val % chars.length];\n }).join('');\n}\n\nexport function formatPercent(value, maxPrecision = 2) {\n if (value < 1 && maxPrecision >= 2) {\n return `${ Math.round(value * 100) / 100 }%`;\n } else if (value < 10 && maxPrecision >= 1) {\n return `${ Math.round(value * 10) / 10 }%`;\n } else {\n return `${ Math.round(value) }%`;\n }\n}\n\nexport function pluralize(str) {\n if ( str.match(/.*[^aeiou]y$/i) ) {\n return `${ str.substr(0, str.length - 1) }ies`;\n } else if ( str.endsWith('ics') ) {\n return str;\n } else if ( str.endsWith('s') ) {\n return `${ str }es`;\n } else {\n return `${ str }s`;\n }\n}\n\nexport function resourceNames(names, plusMore, t) {\n return names.reduce((res, name, i) => {\n if (i >= 5) {\n return res;\n }\n res += `${ escapeHtml( name ) }`;\n if (i === names.length - 1) {\n res += plusMore;\n } else {\n res += i === names.length - 2 ? t('generic.and') : t('generic.comma');\n }\n\n return res;\n }, '');\n}\n\nexport function indent(lines, count = 2, token = ' ', afterRegex = null) {\n if (typeof lines === 'string') {\n lines = lines.split(/\\n/);\n } else {\n lines = lines || [];\n }\n\n const padStr = (new Array(count + 1)).join(token);\n\n const out = lines.map((line) => {\n let prefix = '';\n let suffix = line;\n\n if (afterRegex) {\n const match = line.match(afterRegex);\n\n if (match) {\n prefix = match[match.length - 1];\n suffix = line.substr(match[0].length);\n }\n }\n\n return `${ prefix }${ padStr }${ suffix }`;\n });\n\n const str = out.join('\\n');\n\n return str;\n}\n\nconst decamelizeRegex = /([a-z\\d])([A-Z])/g;\n\nexport function decamelize(str) {\n return str.replace(decamelizeRegex, '$1_$2').toLowerCase();\n}\n\nconst dasherizeRegex = /[ _]/g;\n\nexport function dasherize(str) {\n return decamelize(str).replace(dasherizeRegex, '-');\n}\n\nexport function asciiLike(str) {\n str = str || '';\n\n if ( str.match(/[^\\r\\n\\t\\x20-\\x7F]/) ) {\n return false;\n }\n\n return true;\n}\n\nexport function coerceStringTypeToScalarType(val, type) {\n if ( type === 'float' ) {\n // Coerce strings to floats\n val = parseFloat(val) || null; // NaN becomes null\n } else if ( type === 'int' ) {\n // Coerce strings to ints\n val = parseInt(val, 10);\n\n if ( isNaN(val) ) {\n val = null;\n }\n } else if ( type === 'boolean') {\n // Coerce strings to boolean\n if (val.toLowerCase() === 'true') {\n val = true;\n } else if (val.toLowerCase() === 'false') {\n val = false;\n }\n }\n\n return val;\n}\n\nexport function matchesSomeRegex(stringRaw, regexes = []) {\n return regexes.some((regexRaw) => {\n const string = stringRaw || '';\n const regex = ensureRegex(regexRaw);\n\n return string.match(regex);\n });\n}\n\nexport function ensureRegex(strOrRegex, exact = true) {\n if ( typeof strOrRegex === 'string' ) {\n if ( exact ) {\n return new RegExp(`^${ escapeRegex(strOrRegex) }$`, 'i');\n } else {\n return new RegExp(`${ escapeRegex(strOrRegex) }`, 'i');\n }\n }\n\n return strOrRegex;\n}\n\nexport function nlToBr(value) {\n return escapeHtml(value || '').replace(/(\\r\\n|\\r|\\n)/g, '
\\n');\n}\n\nconst quotedMatch = /[^.\"']+|\"([^\"]*)\"|'([^']*)'/g;\n\nexport function splitObjectPath(path) {\n if ( path.includes('\"') || path.includes(\"'\") ) {\n // Path with quoted section\n return path.match(quotedMatch).map((x) => x.replace(/['\"]/g, ''));\n }\n\n // Regular path\n return path.split('.');\n}\n\nexport function joinObjectPath(ary) {\n let out = '';\n\n for ( const p of ary ) {\n if ( p.includes('.') ) {\n out += `.\"${ p }\"`;\n } else {\n out += `.${ p }`;\n }\n }\n\n if ( out.startsWith('.') ) {\n out = out.substr(1);\n }\n\n return out;\n}\n\nexport function shortenedImage(image) {\n return (image || '')\n .replace(/^(index\\.)?docker.io\\/(library\\/)?/, '')\n .replace(/:latest$/, '')\n .replace(/^(.*@sha256:)([0-9a-f]{8})[0-9a-f]+$/i, '$1$2…');\n}\n\nexport function isIpv4(ip) {\n const reg = /^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/;\n\n return reg.test(ip);\n}\n\nexport function sanitizeKey(k) {\n return (k || '').replace(/[^a-z0-9./_-]/ig, '');\n}\n\nexport function sanitizeValue(v) {\n return (v || '').replace(/[^a-z0-9._-]/ig, '');\n}\n\nexport function sanitizeIP(v) {\n return (v || '').replace(/[^a-z0-9.:_-]/ig, '');\n}\n","module.exports = __webpack_public_path__ + \"img/login-landscape.911b980e.svg\";","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","// style-loader: Adds some css to the DOM by adding a