| 1 |
- $wnd.web3d.runAsyncCallback11('function mkk(){}\nfunction nkk(){nkk=dGc;lkk=new mkk}\nvar lkk;cGc(7851,1,iZn,mkk);_.Mi=function(){return \'multiplayer\'};_.Ni=function(){var a;a=new cwd;a.g+=\'/*! For license information please see multiplayer.js.LICENSE.txt */\\n(()=>{var e={"../node_modules/debug/src/browser.js":(e,t,s)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const s="color: "+this.color;t.splice(1,0,s,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,s)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\\\/(\\\\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\\\\/(\\\\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\\\/(\\\\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=s("../node_modules/debug/src/common.js")(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},"../node_modules/debug/src/common.js":(e,t,s)=>{e.exports=function(e){function t(e){let s,i,o,r=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(s||i);n.diff=o,n.prev=s,n.curr=i,s=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((s,i)=>{if("%%"===s)return"%";r++;const o=t.formatters[i];if("function"==typeof o){const t=e[r];s=o.call(n,t),e.splice(r,1),r--}return s})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{r=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,s){const n=t(this.namespace+(void 0===s?":":s)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\\\\.\\\\*\\\\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let s;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\\\\s,]+/),i=n.length;for(s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/\\\\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let s,n;for(s=0,n=t.skips.length;s<n;s++)if(t.skips[s].test(e))return!1;for(s=0,n=t.names.length;s<n;s++)if(t.names[s].test(e))return!0;return!1},t.humanize=s("../node_modules/ms/index.js"),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((s=>{t[s]=e[s]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let s=0;for(let t=0;t<e.length;t++)s=(s<<5)-s+e.charCodeAt(t),s|=0;return t.colors[Math.abs(s)%t.colors.length]},t.enable(t.load()),t}},"../node_modules/ms/index.js":e=>{var t=1e3,s=60*t,n=60*s,i=24*n,o=7*i,r=365.25*i;function a(e,t,s,n){var i=t>=1.5*s;return Math.round(e/s)+" "+n+(i?"s":"")}e.exports=function(e,c){c=c||{};var d=typeof e;if("string"===d&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\\\\d+)?\\\\.?\\\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*r;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*s;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===d&&isFinite(e))return c.long?function(e){var o=Math.abs(e);if(o>=i)return a(e,o,i,"day");if(o>=n)return a(e,o,n,"hour");if(o>=s)return a(e,o,s,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=i)return Math.round(e/i)+"d";if(o>=n)return Math.round(e/n)+"h";if(o>=s)return Math.round(e/s)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},"./console-logger.ts":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=new class{constructor(){this.enabled=!1}debug(...e){this.enabled&&console.log(...e)}error(...e){this.enabled&&console.error(...e)}enable(){this.enabled=!0}}},"./event-bus.ts":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkEventBus=void 0;const i=n(s("./console-logger.ts"));t.WorkEventBus=class{constructor(e,t,s){this.expectedAcknowledgements=new Set,this.blockOutgoingEvents=!1,this.batchProcessing=!1,this.pasting=!1,this.parent=e,this.api=t,this.embedLabel=s,this.activePage=t.getActivePage()}setupOutgoingEventBus(){const e=this.api;let t=null;const s=[],n=t=>{const s=this.getValue(t);this.send({eventType:"obj_change",label:t,property:s?"value":"style",content:s||e.getXML(t)})},o=()=>{s.forEach(n),s.splice(0,s.length),t=null};e.registerUpdateListener(this.updateListener=n=>{this.blockOutgoingEvents||this.pasting||!e.hasUnlabeledPredecessors(n)&&!e.isMoveable(n)||this.api.isAnimating(n)||(t||(t=window.setTimeout(o,300)),s.includes(n)||s.push(n))}),e.registerRenameListener(this.renameListener=(e,t)=>{this.blockOutgoingEvents||this.pasting||this.send({eventType:"rename",label:e,newLabel:t})}),this.addListener=e=>{this.blockOutgoingEvents||this.batchProcessing||this.pasting||(this.transmitImageData(e),this.send({eventType:"obj_create",labels:[e],content:this.getProps(e)}))},e.registerAddListener(this.addListener),e.registerRemoveListener(this.removeListener=e=>{this.blockOutgoingEvents||(this.deleteEmbedEventBus(e),this.send({eventType:"obj_delete",label:e}))}),e.registerClientListener(this.clientListener=t=>{var s,o;if("embedLoaded"==t.type&&t.api)this.parent.initEventBus(t.target,t.api,!!t.loadedWithFile);else{if("loadPage"==t.type){const e=[];for(const t of(null===(s=this.parent.storedState)||void 0===s?void 0:s.events)||[])t.page==this.activePage?this.checkAndHandleChangeEvent(t,!1):e.push(t);return this.parent.storedState&&(this.parent.storedState.events=e),void(this.blockOutgoingEvents=!1)}if("selectPage"==t.type)return this.activePage=t.argument,i.default.debug("Active page "+this.activePage),void(this.blockOutgoingEvents=!0);if(!this.blockOutgoingEvents&&"viewChanged2D"!=t.type)switch(t.type){case"updateStyle":this.pasting||this.send({eventType:"obj_change",label:t.target,property:"style",content:e.getStyleXML(t.target)});break;case"redefine":n(t.target);break;case"startAnimation":this.send({eventType:"setting_change",properties:{animating:!0}});break;case"stopAnimation":this.send({eventType:"setting_change",properties:{animating:!1}});break;case"select":this.send({eventType:"obj_change",label:t.target,property:"selection"});break;case"deselect":this.send({eventType:"obj_change",property:"selection"});break;case"switchCalculator":this.send({eventType:"setting_change",properties:{calculator:t.argument}});break;case"pasteElms":this.pasting=!0;break;case"pasteElmsComplete":this.pasting=!1,t.targets&&this.send({eventType:"obj_create",labels:t.targets,content:t.targets.map((e=>this.getProps(e))).join("")});break;case"batchAddStarted":this.batchProcessing=!0;break;case"batchAddComplete":this.batchProcessing=!1,this.pasting||this.send({eventType:"obj_create",labels:e.getSiblingObjectNames(t.target),content:this.getProps(t.target)});break;case"groupObjects":case"ungroupObjects":this.send({eventType:"group",labels:t.targets||[],grouped:"groupObjects"==t.type});break;case"viewPropertiesChanged":{const s=Number.parseInt(t.argument),n=e.getGraphicsOptions(s);this.send({eventType:"graphics_change",viewId:s,graphicsOptions:n});break}case"orderingChange":this.send({eventType:"order_change",order:t.argument});break;case"addPage":this.activePage=t.argument,this.send({eventType:"add_page",page:t.argument});break;case"pastePage":this.activePage=t.argument,this.blockOutgoingEvents=!0;const s=t.ggbFile?JSON.parse(t.ggbFile):null,i=t.ggbFile?null===(o=s.archive.find((e=>"geogebra.xml"==e.fileName)))||void 0===o?void 0:o.fileContent:"";this.send({eventType:"paste_page",page:t.argument,xml:i||"",to:t.to||-1,labels:t.targets||[]});break;case"removePage":this.send({eventType:"remove_page",page:t.argument});break;case"movePage":this.send({eventType:"move_page",page:t.argument,to:t.to||-1});break;case"clearPage":this.send({eventType:"clear_page",page:t.argument});break;case"renamePage":this.send({eventType:"rename_page",page:t.argument,title:t.title||""})}}})}deleteEmbedEventBus(e){const t=this.parent.eventBuses.findIndex((t=>t.embedLabel==e));(this.api.getEmbeddedCalculators(!1)||{})[e]&&t>-1&&this.parent.eventBuses.splice(t,1)}getProps(e){return this.api.getAlgorithmXML(e)||this.api.getXML(e)}getValue(e){const t=this.api.getCommandString(e,!1);if(t){if(this.api.isMoveable(e)&&"point"==this.api.getObjectType(e)){return`SetValue(${this.api.getValueString(e,!1).replace("=",",")})`}return e+":"+t}const s=this.api.getValueString(e,!1);if(s&&s!=e)return s}transmitImageData(e){const t=this.api.getImageFileName(e);if(t){const e=this.api.getFileJSON(!1).archive.find((e=>e.fileName.includes(t)));e&&this.send({eventType:"image_add",fileName:t,fileContent:e.fileContent})}}checkAndHandleChangeEvent(e,t=!0){return this.parent.globalEventCounter+1!=e.globalEventCounter&&i.default.error(`Event order inconsistency detected, local counter: ${this.parent.globalEventCounter}, event counter: ${e.globalEventCounter}`,e),this.parent.globalEventCounter=e.globalEventCounter,!(e.embedLabel!=this.embedLabel||e.page!=this.activePage&&!e.eventType.includes("page"))&&(i.default.debug("Change event received:",e),this.blockOutgoingEvents=!0,this.api.setErrorDialogsActive(!1),this.handleChangeEvent(this.api,e,t),this.api.setErrorDialogsActive(!0),this.blockOutgoingEvents=!1,!0)}handleChangeEvent(e,t,s){var n,o,r,a;if("content_change"==t.eventType&&e.setXML(t.xml),"obj_create"==t.eventType&&t.labels&&(t.labels.filter((e=>this.api.exists(e))).forEach((t=>{const s=t.split("_")[0];let n,i=0;do{n=s+"_{"+i+++"}"}while(e.exists(n));e.renameObject(t,n),this.send({eventType:"obj_create",labels:[n],content:this.getProps(n)})})),t.content&&(e.evalXML(t.content),s))){const{name:s,color:n}=t.client.user;e.removeMultiuserSelections(t.client.id),e.addMultiuserSelection(t.client.id,s,n,t.labels[0],!0)}if("obj_change"==t.eventType){let r=!1;if(this.expectedAcknowledgements.forEach((e=>{r=r||!(t.eventType==e.eventType&&e.label==t.label&&t.property==e.property)})),r)return void i.default.debug(`Acknowledgement pending for property ${t.property} of ${t.label}, event rejected`);const{name:a,color:c}=t.client.user;if("selection"==t.property)t.label?e.addMultiuserSelection(t.client.id,a,c,t.label,!1):e.removeMultiuserSelections(t.client.id);else{let i;if(null===(n=t.content)||void 0===n?void 0:n.startsWith("<"))e.evalXML(t.content);else if(i=null===(o=t.content)||void 0===o?void 0:o.match(/([\\\\w{}]+):PenStroke\\\\[([\\\\w.,-]+)\\\\]/)){const t=i[2].split(",").map((e=>parseFloat(e)));e.setCoords(i[1],...t)}else t.content&&e.evalCommand(t.content);s&&t.label&&e.addMultiuserSelection(t.client.id,a,c,t.label,!0),e.updateConstruction()}}if("rename"==t.eventType&&this.api.renameObject(t.label,t.newLabel),"setting_change"==t.eventType&&(t.properties.calculator&&e.switchCalculator(t.properties.calculator),!1===t.properties.animating?e.stopAnimation():t.properties.animating&&e.startAnimation()),"group"==t.eventType&&(t.grouped?e.groupObjects(t.labels):e.ungroupObjects(t.labels)),"obj_delete"==t.eventType&&t.label&&(this.deleteEmbedEventBus(t.label),e.deleteObject(t.label)),"graphics_change"==t.eventType){let s=!1;if(this.expectedAcknowledgements.forEach((e=>{s=s||!("graphics_change"==e.eventType)})),s)return void i.default.debug("Acknowledgement pending for graphics property, event rejected");e.setGraphicsOptions(t.viewId,t.graphicsOptions)}"image_add"==t.eventType&&(e.addImage(t.fileName,t.fileContent),e.updateConstruction()),"order_change"==t.eventType&&e.updateOrdering(t.order),"remove_page"!=t.eventType&&"clear_page"!=t.eventType||(e.handlePageAction(t.eventType.replace("_p","P"),t.page),(null===(r=this.parent.storedState)||void 0===r?void 0:r.events)&&(this.parent.storedState.events=this.parent.storedState.events.filter((e=>e.page!=t.page))),(null===(a=this.parent.storedState)||void 0===a?void 0:a.states)&&(this.parent.storedState.states=this.parent.storedState.states.filter((e=>e.page!=t.page)))),"move_page"==t.eventType&&e.handlePageAction("movePage",t.page,t),"rename_page"==t.eventType&&e.handlePageAction("renamePage",t.page,t),"add_page"==t.eventType&&e.handlePageAction("addPage",t.page),"paste_page"==t.eventType&&e.handlePageAction("pastePage",t.page,t)}send(e){this.expectedAcknowledgements.add(e);const t=Object.assign(Object.assign({page:this.activePage},e),{embedLabel:this.embedLabel});this.parent.socket.emit("work",t,(t=>{this.expectedAcknowledgements.delete(e),t.ack?(i.default.debug("Event acknowledged",e),this.parent.globalEventCounter++):t.ack||i.default.debug("Event rejected"+(t.reason?` because ${t.reason}`:""),e),this.parent.resolvePendingSnapshotRequest()}))}getSnapshot(e){for(const t of this.api.getPages()){const s=this.api.getPageContent(t);e.push(Object.assign(Object.assign({},s),{embedLabel:this.embedLabel,page:t}))}}stop(){this.addListener&&this.api.unregisterAddListener(this.addListener),this.updateListener&&this.api.unregisterUpdateListener(this.updateListener),this.renameListener&&this.api.unregisterRenameListener(this.renameListener),this.removeListener&&this.api.unregisterRemoveListener(this.removeListener),this.clientListener&&this.api.unregisterClientListener(this.clientListener)}}},"./multiplayer.ts":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GGBMultiplayer=void 0;const i=s("./event-bus.ts"),o=n(s("./console-logger.ts")),r=s("../node_modules/socket.io-client/build/cjs/inde\';a.g+=\'x.js");class a{constructor(e,t,s,n){this.globalEventCounter=0,this.snapshotRequested=!1,this.eventBuses=[];const i=Object.assign({collabUrl:"ws://localhost:3001"},s),a={query:{teamId:t}};void 0!==n&&(a.auth={token:`Bearer ${n}`}),i.showLogging&&o.default.enable(),this.api=e,this.socket=(0,r.io)(i.collabUrl,a),this.userChangeListeners=[],this.connectionChangeListeners=[],this.teamId=t}start(e){return new Promise(((t,s)=>{var n;const i={userName:e,teamId:this.teamId,pages:(null===(n=this.api)||void 0===n?void 0:n.getPages())||[]};this.socket.on("disconnect",((e,t)=>{const s=!1,n=t&&"context"in t&&t.context;n instanceof XMLHttpRequest&&413===n.status?(this.socket.io.reconnectionAttempts(0),this.emitConnectionChange({connected:s,reason:"payload too large",tryReconnect:!1})):this.emitConnectionChange({connected:s,reason:e,tryReconnect:!0})})),this.socket.io.on("reconnect",(()=>{this.socket.emit("join",i,(e=>{if(!e.success)throw new Error(`Failed to join during reconnect: ${e.error}`);for(const e of this.eventBuses)e.stop(),e.blockOutgoingEvents=!0;this.eventBuses=[],this.handleJoin(e.data)}))})),this.socket.on("node_change",(e=>{o.default.debug("Connected to pod",e)})),this.setupSnapshotEventBus(),this.setupUserEventBus(),this.setupIncomingWorkEventBus(),this.socket.emit("join",i,(e=>{e.success?(this.handleJoin(e.data),t()):s(new Error(`Failed to join: ${e.error}`))}))}))}terminate(){const e={teamId:this.teamId};this.socket.emit("terminate",e,(e=>{e&&(this.disconnect(),o.default.debug("Terminated"))}))}handleJoin(e){var t;o.default.debug("Joined. Current state of the session:",e),null===(t=this.api)||void 0===t||t.setLabelSuffixForMultiuser(e.labelPrefixIndex),this.globalEventCounter=e.eventCounter,this.storedState=e,this.api&&this.initEventBus(void 0,this.api,!1),this.emitUserChange(e.users),this.emitConnectionChange({connected:!0})}initEventBus(e,t,s){if(!this.storedState||this.eventBuses.some((t=>t.embedLabel==e)))return;const n=new i.WorkEventBus(this,t,e);n.setupOutgoingEventBus(),this.eventBuses.push(n);for(const s of this.storedState.images)s.embedLabel==e&&t.addImage(s.fileName,s.fileContent);if(this.storedState.states.find((t=>t.embedLabel==e))){n.blockOutgoingEvents=!0,this.storedState.states.sort(((e,t)=>e.order-t.order)),this.storedState.states.forEach((s=>{s.embedLabel==e&&t.setPageContent(s.page,s)}));for(const e of t.getPages())this.storedState.states.find((t=>t.page==e))||t.handlePageAction("removePage",e);n.blockOutgoingEvents=!0,t.selectPage(t.getPages()[0]),n.activePage=t.getPages()[0];for(const e of this.storedState.events)n.checkAndHandleChangeEvent(e,!1);this.storedState.events=this.storedState.events.filter((t=>t.embedLabel!=e)),this.storedState.states=this.storedState.states.filter((t=>t.embedLabel!=e)),n.blockOutgoingEvents=!1}else if(s){for(const e of t.getAllObjectNames())n.transmitImageData(e);n.send({eventType:"content_change",xml:t.getXML()})}}setupIncomingWorkEventBus(){this.socket.on("work",(e=>{for(const t of this.eventBuses){if(t.checkAndHandleChangeEvent(e.event))return}o.default.debug("Unhandled event, saving for later",e.event),this.storedState&&this.storedState.events.push(e.event)}))}setupSnapshotEventBus(){this.socket.on("snapshot_req",(()=>{o.default.debug("Snapshot requested"),this.snapshotRequested=!0,this.resolvePendingSnapshotRequest()}))}setupUserEventBus(){this.socket.on("user_change",(e=>{this.emitUserChange(e.users)}))}resolvePendingSnapshotRequest(){if(this.snapshotRequested&&this.areAllEventsAcknowledged()){const e=[];this.eventBuses.forEach((t=>t.getSnapshot(e)));const t={eventCounter:this.globalEventCounter,states:e};this.socket.emit("snapshot",t,(e=>{o.default.debug(e.ack?"Snapshot accepted":`Snapshot rejected by server: ${e.reason}`)})),this.snapshotRequested=!1}}areAllEventsAcknowledged(){return this.eventBuses.every((e=>!e.expectedAcknowledgements.size))}addUserChangeListener(e){this.userChangeListeners.push(e)}addConnectionChangeListener(e){this.connectionChangeListeners.push(e)}disconnect(){var e;for(const e of this.eventBuses)e.stop();this.socket.disconnect(),null===(e=this.api)||void 0===e||e.setLabelSuffixForMultiuser(-1)}emitUserChange(e){this.userChangeListeners.forEach((t=>t(e)))}emitConnectionChange(e){this.connectionChangeListeners.forEach((t=>t(e)))}}t.GGBMultiplayer=a,window.GGBMultiplayer=function(e,t,s,n){return new a(e,t,s,n)}},"../node_modules/engine.io-client/build/cjs/contrib/has-cors.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let s=!1;try{s="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=s},"../node_modules/engine.io-client/build/cjs/contrib/parseqs.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function(e){let t="";for(let s in e)e.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(e[s]));return t},t.decode=function(e){let t={},s=e.split("&");for(let e=0,n=s.length;e<n;e++){let n=s[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}},"../node_modules/engine.io-client/build/cjs/contrib/parseuri.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e){if(e.length>8e3)throw"URI too long";const t=e,i=e.indexOf("["),o=e.indexOf("]");-1!=i&&-1!=o&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));let r=s.exec(e||""),a={},c=14;for(;c--;)a[n[c]]=r[c]||"";-1!=i&&-1!=o&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0);return a.pathNames=function(e,t){const s=t.replace(/\\\\/{2,9}/g,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||s.splice(0,1);"/"==t.slice(-1)&&s.splice(s.length-1,1);return s}(0,a.path),a.queryKey=function(e,t){const s={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,n){t&&(s[t]=n)})),s}(0,a.query),a};const s=/^(?:(?![^:@\\\\/?#]+:[^:@\\\\/]*@)(http|https|ws|wss):\\\\/\\\\/)?((?:(([^:@\\\\/?#]*)(?::([^:@\\\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\\\/?#]*)(?::(\\\\d*))?)(((\\\\/(?:[^?#](?![^?#\\\\/]*\\\\.[^?#\\\\/.]+(?:[?#]|$)))*\\\\/?)?([^?#\\\\/]*))(?:\\\\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"]},"../node_modules/engine.io-client/build/cjs/globals.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBinaryType=t.globalThisShim=t.nextTick=void 0,t.createCookieJar=function(){},t.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")(),t.defaultBinaryType="arraybuffer"},"../node_modules/engine.io-client/build/cjs/index.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebTransport=t.WebSocket=t.NodeWebSocket=t.XHR=t.NodeXHR=t.Fetch=t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.TransportError=t.Transport=t.protocol=t.SocketWithUpgrade=t.SocketWithoutUpgrade=t.Socket=void 0;const n=s("../node_modules/engine.io-client/build/cjs/socket.js");Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return n.Socket}});var i=s("../node_modules/engine.io-client/build/cjs/socket.js");Object.defineProperty(t,"SocketWithoutUpgrade",{enumerable:!0,get:function(){return i.SocketWithoutUpgrade}}),Object.defineProperty(t,"SocketWithUpgrade",{enumerable:!0,get:function(){return i.SocketWithUpgrade}}),t.protocol=n.Socket.protocol;var o=s("../node_modules/engine.io-client/build/cjs/transport.js");Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return o.Transport}}),Object.defineProperty(t,"TransportError",{enumerable:!0,get:function(){return o.TransportError}});var r=s("../node_modules/engine.io-client/build/cjs/transports/index.js");Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return r.transports}});var a=s("../node_modules/engine.io-client/build/cjs/util.js");Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return a.installTimerFunctions}});var c=s("../node_modules/engine.io-client/build/cjs/contrib/parseuri.js");Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return c.parse}});var d=s("../node_modules/engine.io-client/build/cjs/globals.js");Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return d.nextTick}});var l=s("../node_modules/engine.io-client/build/cjs/transports/polling-fetch.js");Object.defineProperty(t,"Fetch",{enumerable:!0,get:function(){return l.Fetch}});var u=s("../node_modules/engine.io-client/build/cjs/transports/polling-xhr.js");Object.defineProperty(t,"NodeXHR",{enumerable:!0,get:function(){return u.XHR}});var h=s("../node_modules/engine.io-client/build/cjs/transports/polling-xhr.js");Object.defineProperty(t,"XHR",{enumerable:!0,get:function(){return h.XHR}});var p=s("../node_modules/engine.io-client/build/cjs/transports/websocket.js");Object.defineProperty(t,"NodeWebSocket",{enumerable:!0,get:function(){return p.WS}});var f=s("../node_modules/engine.io-client/build/cjs/transports/websocket.js");Object.defineProperty(t,"WebSocket",{enumerable:!0,get:function(){return f.WS}});var g=s("../node_modules/engine.io-client/build/cjs/transports/webtransport.js");Object.defineProperty(t,"WebTransport",{enumerable:!0,get:function(){return g.WT}})},"../node_modules/engine.io-client/build/cjs/socket.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=t.SocketWithUpgrade=t.SocketWithoutUpgrade=void 0;const i=s("../node_modules/engine.io-client/build/cjs/transports/index.js"),o=s("../node_modules/engine.io-client/build/cjs/util.js"),r=s("../node_modules/engine.io-client/build/cjs/contrib/parseqs.js"),a=s("../node_modules/engine.io-client/build/cjs/contrib/parseuri.js"),c=s("../node_modules/@socket.io/component-emitter/lib/esm/index.js"),d=s("../node_modules/engine.io-parser/build/cjs/index.js"),l=s("../node_modules/engine.io-client/build/cjs/globals.js"),u=(0,n(s("../node_modules/debug/src/browser.js")).default)("engine.io-client:socket"),h="function"==typeof addEventListener&&"function"==typeof removeEventListener,p=[];h&&addEventListener("offline",(()=>{u("closing %d connection(s) because the network was lost",p.length),p.forEach((e=>e()))}),!1);class f extends c.Emitter{constructor(e,t){if(super(),this.binaryType=l.defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const s=(0,a.parse)(e);t.hostname=s.host,t.secure="https"===s.protocol||"wss"===s.protocol,t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=(0,a.parse)(t.host).host);(0,o.installTimerFunctions)(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach((e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e})),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\\\\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=(0,r.decode)(this.opts.query)),h&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(u("adding listener for the \\\'offline\\\' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},p.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=(0,l.createCookieJar)()),this._open()}createTransport(e){u(\\\'creating transport "%s"\\\',e);const t=Object.assign({},this.opts.query);t.EIO=d.protocol,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return u("options: %j",s),new this._transportsByName[e](s)}_open(){if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);const e=this.opts.rememberUpgrade&&f.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){u("setting transport %s",e.name),this.transport&&(u("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",(e=>this._onClose("transport close",e)))}onOpen(){u("socket open"),this.readyState="open",f.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(u(\\\'socket receive: type "%s", data "%s"\\\',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}else u(\\\'packet received with socket readyState "%s"\\\',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn((()=>{this._onClose("ping timeout")}),e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();u("flushing %d packets in socket",e.length),this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const s=this.writeBuffer[t].data;if(s&&(e+=(0,o.byteLength)(s)),t>0&&e>this._maxPayload)return u("only send %d out of %d packets",t,this.writeBuffer.length),this.writeBuffer.slice(0,t);e+=2}return u("payload size is %d (max: %d)",e,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(u("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,(0,l.nextTick)((()=>{this._onClose("ping timeout")}),this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof s&&(n=s,s=null),"closing"===this.readyState||"closed"===this.readyState)return;(s=s||{}).compress=!1!==s.compress;const i={type:e,data:t,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){const e=()=>{this._\';a.g+=\'onClose("forced close"),u("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?s():e()})):this.upgrading?s():e()),this}_onError(e){if(u("socket error %j",e),f.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return u("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(u(\\\'socket close with reason: "%s"\\\',e),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),h&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=p.indexOf(this._offlineEventListener);-1!==e&&(u("removing listener for the \\\'offline\\\' event"),p.splice(e,1))}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}t.SocketWithoutUpgrade=f,f.protocol=d.protocol;class g extends f{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade){u("starting upgrade probes");for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}}_probe(e){u(\\\'probing transport "%s"\\\',e);let t=this.createTransport(e),s=!1;f.priorWebsocketSuccess=!1;const n=()=>{s||(u(\\\'probe transport "%s" opened\\\',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(n=>{if(!s)if("pong"===n.type&&"probe"===n.data){if(u(\\\'probe transport "%s" pong\\\',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;f.priorWebsocketSuccess="websocket"===t.name,u(\\\'pausing current transport "%s"\\\',this.transport.name),this.transport.pause((()=>{s||"closed"!==this.readyState&&(u("changing transport and sending upgrade packet"),d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{u(\\\'probe transport "%s" failed\\\',e);const s=new Error("probe error");s.transport=t.name,this.emitReserved("upgradeError",s)}})))};function i(){s||(s=!0,d(),t.close(),t=null)}const o=s=>{const n=new Error("probe error: "+s);n.transport=t.name,i(),u(\\\'probe transport "%s" failed because of error: %s\\\',e,s),this.emitReserved("upgradeError",n)};function r(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&(u(\\\'"%s" works - aborting "%s"\\\',e.name,t.name),i())}const d=()=>{t.removeListener("open",n),t.removeListener("error",o),t.removeListener("close",r),this.off("close",a),this.off("upgrading",c)};t.once("open",n),t.once("error",o),t.once("close",r),this.once("close",a),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn((()=>{s||t.open()}),200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}t.SocketWithUpgrade=g;t.Socket=class extends g{constructor(e,t={}){const s="object"==typeof e?e:t;(!s.transports||s.transports&&"string"==typeof s.transports[0])&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map((e=>i.transports[e])).filter((e=>!!e))),super(e,s)}}},"../node_modules/engine.io-client/build/cjs/transport.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=t.TransportError=void 0;const i=s("../node_modules/engine.io-parser/build/cjs/index.js"),o=s("../node_modules/@socket.io/component-emitter/lib/esm/index.js"),r=s("../node_modules/engine.io-client/build/cjs/util.js"),a=s("../node_modules/engine.io-client/build/cjs/contrib/parseqs.js"),c=(0,n(s("../node_modules/debug/src/browser.js")).default)("engine.io-client:transport");class d extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}t.TransportError=d;class l extends o.Emitter{constructor(e){super(),this.writable=!1,(0,r.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new d(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):c("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=(0,i.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=(0,a.encode)(e);return t.length?"?"+t:""}}t.Transport=l},"../node_modules/engine.io-client/build/cjs/transports/index.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transports=void 0;const n=s("../node_modules/engine.io-client/build/cjs/transports/polling-xhr.js"),i=s("../node_modules/engine.io-client/build/cjs/transports/websocket.js"),o=s("../node_modules/engine.io-client/build/cjs/transports/webtransport.js");t.transports={websocket:i.WS,webtransport:o.WT,polling:n.XHR}},"../node_modules/engine.io-client/build/cjs/transports/polling-fetch.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Fetch=void 0;const n=s("../node_modules/engine.io-client/build/cjs/transports/polling.js");class i extends n.Polling{doPoll(){this._fetch().then((e=>{if(!e.ok)return this.onError("fetch read error",e.status,e);e.text().then((e=>this.onData(e)))})).catch((e=>{this.onError("fetch read error",e)}))}doWrite(e,t){this._fetch(e).then((e=>{if(!e.ok)return this.onError("fetch write error",e.status,e);t()})).catch((e=>{this.onError("fetch write error",e)}))}_fetch(e){var t;const s=void 0!==e,n=new Headers(this.opts.extraHeaders);return s&&n.set("content-type","text/plain;charset=UTF-8"),null===(t=this.socket._cookieJar)||void 0===t||t.appendCookies(n),fetch(this.uri(),{method:s?"POST":"GET",body:s?e:null,headers:n,credentials:this.opts.withCredentials?"include":"omit"}).then((e=>{var t;return null===(t=this.socket._cookieJar)||void 0===t||t.parseCookies(e.headers.getSetCookie()),e}))}}t.Fetch=i},"../node_modules/engine.io-client/build/cjs/transports/polling-xhr.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.XHR=t.Request=t.BaseXHR=void 0;const i=s("../node_modules/engine.io-client/build/cjs/transports/polling.js"),o=s("../node_modules/@socket.io/component-emitter/lib/esm/index.js"),r=s("../node_modules/engine.io-client/build/cjs/util.js"),a=s("../node_modules/engine.io-client/build/cjs/globals.js"),c=s("../node_modules/engine.io-client/build/cjs/contrib/has-cors.js"),d=(0,n(s("../node_modules/debug/src/browser.js")).default)("engine.io-client:polling");function l(){}class u extends i.Polling{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let s=location.port;s||(s=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){d("xhr poll");const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}t.BaseXHR=u;class h extends o.Emitter{constructor(e,t,s){super(),this.createRequest=e,(0,r.installTimerFunctions)(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=void 0!==s.data?s.data:null,this._create()}_create(){var e;const t=(0,r.pick)(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{d("xhr open %s: %s",this._method,this._uri),s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&s.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(e){}if("POST"===this._method)try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{s.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var e;3===s.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(s.getResponseHeader("set-cookie"))),4===s.readyState&&(200===s.status||1223===s.status?this._onLoad():this.setTimeoutFn((()=>{this._onError("number"==typeof s.status?s.status:0)}),0))},d("xhr data %s",this._data),s.send(this._data)}catch(e){return void this.setTimeoutFn((()=>{this._onError(e)}),0)}"undefined"!=typeof document&&(this._index=h.requestsCount++,h.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=l,e)try{this._xhr.abort()}catch(e){}"undefined"!=typeof document&&delete h.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(t.Request=h,h.requestsCount=0,h.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",p);else if("function"==typeof addEventListener){const e="onpagehide"in a.globalThisShim?"pagehide":"unload";addEventListener(e,p,!1)}function p(){for(let e in h.requests)h.requests.hasOwnProperty(e)&&h.requests[e].abort()}const f=function(){const e=g({xdomain:!1});return e&&null!==e.responseType}();function g(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||c.hasCORS))return new XMLHttpRequest}catch(e){}if(!t)try{return new(a.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}t.XHR=class extends u{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=f&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new h(g,this.uri(),e)}}},"../node_modules/engine.io-client/build/cjs/transports/polling.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Polling=void 0;const i=s("../node_modules/engine.io-client/build/cjs/transport.js"),o=s("../node_modules/engine.io-client/build/cjs/util.js"),r=s("../node_modules/engine.io-parser/build/cjs/index.js"),a=(0,n(s("../node_modules/debug/src/browser.js")).default)("engine.io-client:polling");class c extends i.Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{a("paused"),this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(a("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){a("pre-pause polling complete"),--e||t()}))),this.writable||(a("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){a("pre-pause writing complete"),--e||t()})))}else t()}_poll(){a("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){a("polling got data %s",e);(0,r.decodePayload)(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this._poll():a(\\\'ignoring poll - transport state "%s"\\\',this.readyState))}doClose(){const e=()=>{a("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(a("transport open - closing"),e()):(a("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,r.encodePayload)(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,o.randomString)()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}t.Polling=c},"../node_modules/engine.io-client/build/cjs/transports/websocket.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WS=t.BaseWS=void 0;const i=s("../node_modules/engine.io-client/build/cjs/transport.js"),o=s("../node_modules/engine.io-client/build/cjs/util.js"),r=s("../node_modules/engine.io-parser/build/cjs/index.js"),a=s("../node_modules/engine.io-client/build/cjs/globals.js"),c=(0,n(s("../node_modules/debug/src/browser.js")).default)("engine.io-client:websocket"),d="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class l extends i.Transport{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=d?{}:(0,o.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],n=t===e.length-1;(0,r.encodePacket)(s,this.supportsBinary,(e=>{try{this.doWrite(s,e)}catch(e){c("websocket closed before onclose event")}n&&(0,a.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,o.randomString)()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}t.BaseWS=l;const u=a.globalThisShim.WebSocket||a.globalThisShim.MozWebSocket;t.WS=class extends l{createSocket(e,t,s){return d?new u(e,t,s):t?new u(e,t):new u(e)}doWrite(e,t){this.ws.send(t)}}},"../node_modules/engine.io-client/build/cjs/transports/webtransport.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WT=void 0;const i=s("../node_modules/engine.io-client/build/cjs/transport.js"),o=s("../node_modules/engine.io-client/build/cjs/globals.js"),r=s("../node_modules/engine.io-parser/build/cjs/index.js"),a=(0,n(s("../node_modules/debug/src/browser.js")).default)("engine.io-client:webtransport");class c extends i.Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.cl\';a.g+=\'osed.then((()=>{a("transport closed gracefully"),this.onClose()})).catch((e=>{a("transport closed due to %s",e),this.onError("webtransport error",e)})),this._transport.ready.then((()=>{this._transport.createBidirectionalStream().then((e=>{const t=(0,r.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),n=(0,r.createPacketEncoderStream)();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();const i=()=>{s.read().then((({done:e,value:t})=>{e?a("session is closed"):(a("received chunk: %o",t),this.onPacket(t),i())})).catch((e=>{a("an error occurred while reading: %s",e)}))};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then((()=>this.onOpen()))}))}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],n=t===e.length-1;this._writer.write(s).then((()=>{n&&(0,o.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}}t.WT=c},"../node_modules/engine.io-client/build/cjs/util.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pick=function(e,...t){return t.reduce(((t,s)=>(e.hasOwnProperty(s)&&(t[s]=e[s]),t)),{})},t.installTimerFunctions=function(e,t){t.useNativeTimers?(e.setTimeoutFn=i.bind(n.globalThisShim),e.clearTimeoutFn=o.bind(n.globalThisShim)):(e.setTimeoutFn=n.globalThisShim.setTimeout.bind(n.globalThisShim),e.clearTimeoutFn=n.globalThisShim.clearTimeout.bind(n.globalThisShim))},t.byteLength=function(e){if("string"==typeof e)return function(e){let t=0,s=0;for(let n=0,i=e.length;n<i;n++)t=e.charCodeAt(n),t<128?s+=1:t<2048?s+=2:t<55296||t>=57344?s+=3:(n++,s+=4);return s}(e);return Math.ceil((e.byteLength||e.size)*r)},t.randomString=function(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)};const n=s("../node_modules/engine.io-client/build/cjs/globals.js");const i=n.globalThisShim.setTimeout,o=n.globalThisShim.clearTimeout;const r=1.33},"../node_modules/engine.io-parser/build/cjs/commons.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_PACKET=t.PACKET_TYPES_REVERSE=t.PACKET_TYPES=void 0;const s=Object.create(null);t.PACKET_TYPES=s,s.open="0",s.close="1",s.ping="2",s.pong="3",s.message="4",s.upgrade="5",s.noop="6";const n=Object.create(null);t.PACKET_TYPES_REVERSE=n,Object.keys(s).forEach((e=>{n[s[e]]=e}));t.ERROR_PACKET={type:"error",data:"parser error"}},"../node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)n[s.charCodeAt(e)]=e;t.encode=e=>{let t,n=new Uint8Array(e),i=n.length,o="";for(t=0;t<i;t+=3)o+=s[n[t]>>2],o+=s[(3&n[t])<<4|n[t+1]>>4],o+=s[(15&n[t+1])<<2|n[t+2]>>6],o+=s[63&n[t+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o};t.decode=e=>{let t,s,i,o,r,a=.75*e.length,c=e.length,d=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const l=new ArrayBuffer(a),u=new Uint8Array(l);for(t=0;t<c;t+=4)s=n[e.charCodeAt(t)],i=n[e.charCodeAt(t+1)],o=n[e.charCodeAt(t+2)],r=n[e.charCodeAt(t+3)],u[d++]=s<<2|i>>4,u[d++]=(15&i)<<4|o>>2,u[d++]=(3&o)<<6|63&r;return l}},"../node_modules/engine.io-parser/build/cjs/decodePacket.browser.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePacket=void 0;const n=s("../node_modules/engine.io-parser/build/cjs/commons.js"),i=s("../node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js"),o="function"==typeof ArrayBuffer;t.decodePacket=(e,t)=>{if("string"!=typeof e)return{type:"message",data:a(e,t)};const s=e.charAt(0);if("b"===s)return{type:"message",data:r(e.substring(1),t)};return n.PACKET_TYPES_REVERSE[s]?e.length>1?{type:n.PACKET_TYPES_REVERSE[s],data:e.substring(1)}:{type:n.PACKET_TYPES_REVERSE[s]}:n.ERROR_PACKET};const r=(e,t)=>{if(o){const s=(0,i.decode)(e);return a(s,t)}return{base64:!0,data:e}},a=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer},"../node_modules/engine.io-parser/build/cjs/encodePacket.browser.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodePacket=void 0,t.encodePacketToBinary=function(e,t){if(i&&e.data instanceof Blob)return e.data.arrayBuffer().then(d).then(t);if(o&&(e.data instanceof ArrayBuffer||r(e.data)))return t(d(e.data));a(e,!1,(e=>{l||(l=new TextEncoder),t(l.encode(e))}))};const n=s("../node_modules/engine.io-parser/build/cjs/commons.js"),i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),o="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,a=({type:e,data:t},s,a)=>i&&t instanceof Blob?s?a(t):c(t,a):o&&(t instanceof ArrayBuffer||r(t))?s?a(t):c(new Blob([t]),a):a(n.PACKET_TYPES[e]+(t||""));t.encodePacket=a;const c=(e,t)=>{const s=new FileReader;return s.onload=function(){const e=s.result.split(",")[1];t("b"+(e||""))},s.readAsDataURL(e)};function d(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let l},"../node_modules/engine.io-parser/build/cjs/index.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePayload=t.decodePacket=t.encodePayload=t.encodePacket=t.protocol=void 0,t.createPacketEncoderStream=function(){return new TransformStream({transform(e,t){(0,n.encodePacketToBinary)(e,(s=>{const n=s.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,n)}else{i=new Uint8Array(9);const e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(n))}e.data&&"string"!=typeof e.data&&(i[0]|=128),t.enqueue(i),t.enqueue(s)}))}})},t.createPacketDecoderStream=function(e,t){a||(a=new TextDecoder);const s=[];let n=0,r=-1,l=!1;return new TransformStream({transform(u,h){for(s.push(u);;){if(0===n){if(c(s)<1)break;const e=d(s,1);l=!(128&~e[0]),r=127&e[0],n=r<126?3:126===r?1:2}else if(1===n){if(c(s)<2)break;const e=d(s,2);r=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),n=3}else if(2===n){if(c(s)<8)break;const e=d(s,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){h.enqueue(o.ERROR_PACKET);break}r=i*Math.pow(2,32)+t.getUint32(4),n=3}else{if(c(s)<r)break;const e=d(s,r);h.enqueue((0,i.decodePacket)(l?e:a.decode(e),t)),n=0}if(0===r||r>e){h.enqueue(o.ERROR_PACKET);break}}}})};const n=s("../node_modules/engine.io-parser/build/cjs/encodePacket.browser.js");Object.defineProperty(t,"encodePacket",{enumerable:!0,get:function(){return n.encodePacket}});const i=s("../node_modules/engine.io-parser/build/cjs/decodePacket.browser.js");Object.defineProperty(t,"decodePacket",{enumerable:!0,get:function(){return i.decodePacket}});const o=s("../node_modules/engine.io-parser/build/cjs/commons.js"),r=String.fromCharCode(30);t.encodePayload=(e,t)=>{const s=e.length,i=new Array(s);let o=0;e.forEach(((e,a)=>{(0,n.encodePacket)(e,!1,(e=>{i[a]=e,++o===s&&t(i.join(r))}))}))};let a;function c(e){return e.reduce(((e,t)=>e+t.length),0)}function d(e,t){if(e[0].length===t)return e.shift();const s=new Uint8Array(t);let n=0;for(let i=0;i<t;i++)s[i]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),s}t.decodePayload=(e,t)=>{const s=e.split(r),n=[];for(let e=0;e<s.length;e++){const o=(0,i.decodePacket)(s[e],t);if(n.push(o),"error"===o.type)break}return n},t.protocol=4},"../node_modules/socket.io-client/build/cjs/contrib/backo2.js":(e,t)=>{"use strict";function s(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Object.defineProperty(t,"__esModule",{value:!0}),t.Backoff=s,s.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+s:e-s}return 0|Math.min(e,this.max)},s.prototype.reset=function(){this.attempts=0},s.prototype.setMin=function(e){this.ms=e},s.prototype.setMax=function(e){this.max=e},s.prototype.setJitter=function(e){this.jitter=e}},"../node_modules/socket.io-client/build/cjs/index.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebTransport=t.WebSocket=t.NodeWebSocket=t.XHR=t.NodeXHR=t.Fetch=t.Socket=t.Manager=t.protocol=void 0,t.io=d,t.connect=d,t.default=d;const i=s("../node_modules/socket.io-client/build/cjs/url.js"),o=s("../node_modules/socket.io-client/build/cjs/manager.js");Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return o.Manager}});const r=s("../node_modules/socket.io-client/build/cjs/socket.js");Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return r.Socket}});const a=(0,n(s("../node_modules/debug/src/browser.js")).default)("socket.io-client"),c={};function d(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};const s=(0,i.url)(e,t.path||"/socket.io"),n=s.source,r=s.id,d=s.path,l=c[r]&&d in c[r].nsps;let u;return t.forceNew||t["force new connection"]||!1===t.multiplex||l?(a("ignoring socket cache for %s",n),u=new o.Manager(n,t)):(c[r]||(a("new io instance for %s",n),c[r]=new o.Manager(n,t)),u=c[r]),s.query&&!t.query&&(t.query=s.queryKey),u.socket(s.path,t)}Object.assign(d,{Manager:o.Manager,Socket:r.Socket,io:d,connect:d});var l=s("../node_modules/socket.io-parser/build/cjs/index.js");Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return l.protocol}});var u=s("../node_modules/engine.io-client/build/cjs/index.js");Object.defineProperty(t,"Fetch",{enumerable:!0,get:function(){return u.Fetch}}),Object.defineProperty(t,"NodeXHR",{enumerable:!0,get:function(){return u.NodeXHR}}),Object.defineProperty(t,"XHR",{enumerable:!0,get:function(){return u.XHR}}),Object.defineProperty(t,"NodeWebSocket",{enumerable:!0,get:function(){return u.NodeWebSocket}}),Object.defineProperty(t,"WebSocket",{enumerable:!0,get:function(){return u.WebSocket}}),Object.defineProperty(t,"WebTransport",{enumerable:!0,get:function(){return u.WebTransport}}),e.exports=d},"../node_modules/socket.io-client/build/cjs/manager.js":function(e,t,s){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){void 0===n&&(n=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,i)}:function(e,t,s,n){void 0===n&&(n=s),e[n]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&n(t,e,s);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;const a=s("../node_modules/engine.io-client/build/cjs/index.js"),c=s("../node_modules/socket.io-client/build/cjs/socket.js"),d=o(s("../node_modules/socket.io-parser/build/cjs/index.js")),l=s("../node_modules/socket.io-client/build/cjs/on.js"),u=s("../node_modules/socket.io-client/build/cjs/contrib/backo2.js"),h=s("../node_modules/@socket.io/component-emitter/lib/esm/index.js"),p=(0,r(s("../node_modules/debug/src/browser.js")).default)("socket.io-client:manager");class f extends h.Emitter{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,(0,a.installTimerFunctions)(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(s=t.randomizationFactor)&&void 0!==s?s:.5),this.backoff=new u.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||d;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(p("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;p("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const n=(0,l.on)(t,"open",(function(){s.onopen(),e&&e()})),i=t=>{p("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=(0,l.on)(t,"error",i);if(!1!==this._timeout){const e=this._timeout;p("connect attempt will timeout after %d",e);const s=this.setTimeoutFn((()=>{p("connect attempt timed out after %d",e),n(),i(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&s.unref(),this.subs.push((()=>{this.clearTimeoutFn(s)}))}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){p("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push((0,l.on)(e,"ping",this.onping.bind(this)),(0,l.on)(e,"data",this.ondata.bind(this)),(0,l.on)(e,"error",this.onerror.bind(this)),(0,l.on)(e,"close",this.onclose.bind(this)),(0,l.on)(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){(0,a.nextTick)((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){p("error",e),this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new c.Socket(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return void p("socket %s is still active, skipping close",e)}this._close()}_packet(e){p("writing packet %j",e);const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){p("cleanup"),this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){p("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;p("closed due to %s",e),this.cleanup(),null===(s=this.engine)||void 0===s||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();p("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const s=this.setTimeoutFn((()=>{e.skipReconnect||(p("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.sk\';a.g+=\'ipReconnect||e.open((t=>{t?(p("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(p("reconnect success"),e.onreconnect())})))}),t);this.opts.autoUnref&&s.unref(),this.subs.push((()=>{this.clearTimeoutFn(s)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}t.Manager=f},"../node_modules/socket.io-client/build/cjs/on.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=function(e,t,s){return e.on(t,s),function(){e.off(t,s)}}},"../node_modules/socket.io-client/build/cjs/socket.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const i=s("../node_modules/socket.io-parser/build/cjs/index.js"),o=s("../node_modules/socket.io-client/build/cjs/on.js"),r=s("../node_modules/@socket.io/component-emitter/lib/esm/index.js"),a=(0,n(s("../node_modules/debug/src/browser.js")).default)("socket.io-client:socket"),c=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class d extends r.Emitter{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[(0,o.on)(e,"open",this.onopen.bind(this)),(0,o.on)(e,"packet",this.onpacket.bind(this)),(0,o.on)(e,"error",this.onerror.bind(this)),(0,o.on)(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,n,o;if(c.hasOwnProperty(e))throw new Error(\\\'"\\\'+e.toString()+\\\'" is a reserved event name\\\');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const r={type:i.PacketType.EVENT,data:t,options:{}};if(r.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++;a("emitting packet with ack id %d",e);const s=t.pop();this._registerAckCallback(e,s),r.id=e}const d=null===(n=null===(s=this.io.engine)||void 0===s?void 0:s.transport)||void 0===n?void 0:n.writable,l=this.connected&&!(null===(o=this.io.engine)||void 0===o?void 0:o._hasPingExpired());return this.flags.volatile&&!d?a("discard packet as the transport is not currently writable"):l?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(e,t){var s;const n=null!==(s=this.flags.timeout)&&void 0!==s?s:this._opts.ackTimeout;if(void 0===n)return void(this.acks[e]=t);const i=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&(a("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(t,1));a("event with ack id %d has timed out after %d ms",e,n),t.call(this,new Error("operation has timed out"))}),n),o=(...e)=>{this.io.clearTimeoutFn(i),t.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise(((s,n)=>{const i=(e,t)=>e?n(e):s(t);i.withError=!0,t.push(i),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...n)=>{if(s!==this._queue[0])return;return null!==e?s.tryCount>this._opts.retries&&(a("packet [%d] is discarded after %d tries",s.id,s.tryCount),this._queue.shift(),t&&t(e)):(a("packet [%d] was successfully sent",s.id),this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue()})),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(a("draining queue"),!this.connected||0===this._queue.length)return;const t=this._queue[0];!t.pending||e?(t.pending=!0,t.tryCount++,a("sending packet [%d] (try n\\xB0%d)",t.id,t.tryCount),this.flags=t.flags,this.emit.apply(this,t.args)):a("packet [%d] has already been sent and is waiting for an ack",t.id)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:i.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){a("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach((e=>{if(!this.sendBuffer.some((t=>String(t.id)===e))){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}}))}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case i.PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case i.PacketType.EVENT:case i.PacketType.BINARY_EVENT:this.onevent(e);break;case i.PacketType.ACK:case i.PacketType.BINARY_ACK:this.onack(e);break;case i.PacketType.DISCONNECT:this.ondisconnect();break;case i.PacketType.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...n){s||(s=!0,a("sending ack %j",n),t.packet({type:i.PacketType.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];"function"==typeof t?(delete this.acks[e.id],a("calling ack %s with %j",e.id,e.data),t.withError&&e.data.unshift(null),t.apply(this,e.data)):a("bad ack %s",e.id)}onconnect(e,t){a("socket connected with id %s",e),this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:i.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}t.Socket=d},"../node_modules/socket.io-client/build/cjs/url.js":function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.url=function(e,t="",s){let n=e;s=s||"undefined"!=typeof location&&location,null==e&&(e=s.protocol+"//"+s.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?s.protocol+e:s.host+e),/^(https?|wss?):\\\\/\\\\//.test(e)||(o("protocol-less url %s",e),e=void 0!==s?s.protocol+"//"+e:"https://"+e),o("parse %s",e),n=(0,i.parse)(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";const r=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port+t,n.href=n.protocol+"://"+r+(s&&s.port===n.port?"":":"+n.port),n};const i=s("../node_modules/engine.io-client/build/cjs/index.js"),o=(0,n(s("../node_modules/debug/src/browser.js")).default)("socket.io-client:url")},"../node_modules/socket.io-parser/build/cjs/binary.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const n=s("../node_modules/socket.io-parser/build/cjs/is-binary.js");function i(e,t){if(!e)return e;if((0,n.isBinary)(e)){const s={_placeholder:!0,num:t.length};return t.push(e),s}if(Array.isArray(e)){const s=new Array(e.length);for(let n=0;n<e.length;n++)s[n]=i(e[n],t);return s}if("object"==typeof e&&!(e instanceof Date)){const s={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(s[n]=i(e[n],t));return s}return e}function o(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let s=0;s<e.length;s++)e[s]=o(e[s],t);else if("object"==typeof e)for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(e[s]=o(e[s],t));return e}t.deconstructPacket=function(e){const t=[],s=e.data,n=e;return n.data=i(s,t),n.attachments=t.length,{packet:n,buffers:t}},t.reconstructPacket=function(e,t){return e.data=o(e.data,t),delete e.attachments,e}},"../node_modules/socket.io-parser/build/cjs/index.js":(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const n=s("../node_modules/@socket.io/component-emitter/lib/esm/index.js"),i=s("../node_modules/socket.io-parser/build/cjs/binary.js"),o=s("../node_modules/socket.io-parser/build/cjs/is-binary.js"),r=(0,s("../node_modules/debug/src/browser.js").default)("socket.io-parser"),a=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var c;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(c=t.PacketType||(t.PacketType={}));function d(e){return"[object Object]"===Object.prototype.toString.call(e)}t.Encoder=class{constructor(e){this.replacer=e}encode(e){return r("encoding packet %j",e),e.type!==c.EVENT&&e.type!==c.ACK||!(0,o.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==c.BINARY_EVENT&&e.type!==c.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),r("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,i.deconstructPacket)(e),s=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(s),n}};class l extends n.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===c.BINARY_EVENT;s||t.type===c.BINARY_ACK?(t.type=s?c.EVENT:c.ACK,this.reconstructor=new u(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,o.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(void 0===c[s.type])throw new Error("unknown packet type "+s.type);if(s.type===c.BINARY_EVENT||s.type===c.BINARY_ACK){const n=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const i=e.substring(n,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");s.attachments=Number(i)}if("/"===e.charAt(t+1)){const n=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}s.nsp=e.substring(n,t)}else s.nsp="/";const n=e.charAt(t+1);if(""!==n&&Number(n)==n){const n=t+1;for(;++t;){const s=e.charAt(t);if(null==s||Number(s)!=s){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){const n=this.tryParse(e.substr(t));if(!l.isPayloadValid(s.type,n))throw new Error("invalid payload");s.data=n}return r("decoded %s as %j",e,s),s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return d(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||d(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===a.indexOf(t[0]));case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=l;class u{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,i.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},"../node_modules/socket.io-parser/build/cjs/is-binary.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const s="function"==typeof ArrayBuffer,n=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===n.call(Blob),o="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===n.call(File);function r(e){return s&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||i&&e instanceof Blob||o&&e instanceof File}t.isBinary=r,t.hasBinary=function e(t,s){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let s=0,n=t.length;s<n;s++)if(e(t[s]))return!0;return!1}if(r(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return!0;return!1}},"../node_modules/@socket.io/component-emitter/lib/esm/index.js":(e,t,s)=>{"use strict";function n(e){if(e)return function(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}(e)}s.r(t),s.d(t,{Emitter:()=>n}),n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function s(){this.off(e,s),t.apply(this,arguments)}return s.fn=t,this.on(e,s),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,n=this._\';a.g+=\'callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<n.length;i++)if((s=n[i])===t||s.fn===t){n.splice(i,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),s=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(s){n=0;for(var i=(s=s.slice(0)).length;n<i;++n)s[n].apply(this,t)}return this},n.prototype.emitReserved=n.prototype.emit,n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}}},t={};function s(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,s),o.exports}s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};s("./multiplayer.ts")})();\\n//# sourceMappingURL=multiplayer.js.map\';return a.g};var HOb=vtd(7851);cGc(5623,1,Lwo);_.Se=function(){var a,b,c,d,e;d=Q5m(this.g.i.db);kck((nkk(),lkk),false,false);a=fLd(\'collabUrl\',d);b=(lrd(),ird).hostname;e=mvd(b,\'\\\\W\',\'\')+\'_\'+this.n;c=new $wnd.GGBMultiplayer(this.i,e,a,this.k.n);this.j.Li(c)};aFn(Qc)(11);\n//# sourceURL=web3d-11.js\n')
|