cct-lce
Version:
CCT Latency Check Engine
1 lines • 95.7 kB
JavaScript
(()=>{var e={8599:e=>{"use strict";const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},1227:(e,t,n)=>{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 n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))})),t.splice(s,0,n)},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){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$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=n(2447)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,n)=>{e.exports=function(e){function t(e){let n,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";i++;const o=t.formatters[s];if("function"==typeof o){const t=e[i];n=o.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n<s;n++)r[n]&&("-"===(e=r[n].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 n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(7824),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((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},7187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function s(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),n([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,s)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var s,o,i,u;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),void 0===i)i=o[t]=n,++e._eventsCount;else if("function"==typeof i?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(s=c(e))>0&&i.length>s&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=i.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=l.bind(r);return s.listener=n,r.wrapFn=s,s}function d(e,t,n){var r=e._events;if(void 0===r)return[];var s=r[t];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(s):p(s,s.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(o){r.once&&e.removeEventListener(t,s),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s="error"===e,o=this._events;if(void 0!==o)s=s&&void 0===o.error;else if(!s)return!1;if(s){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var u=c.length,l=p(c,u);for(n=0;n<u;++n)r(l[n],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,s,o,i;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){i=n[o].listener,s=o;break}if(s<0)return this;0===s?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,s),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,i||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var s,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(s=o[r])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7824:e=>{var t=1e3,n=60*t,r=60*n,s=24*r;function o(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}e.exports=function(e,i){i=i||{};var a,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\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(o){var i=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"weeks":case"week":case"w":return 6048e5*i;case"days":case"day":case"d":return i*s;case"hours":case"hour":case"hrs":case"hr":case"h":return i*r;case"minutes":case"minute":case"mins":case"min":case"m":return i*n;case"seconds":case"second":case"secs":case"sec":case"s":return i*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(e);if("number"===u&&isFinite(e))return i.long?(a=e,(c=Math.abs(a))>=s?o(a,c,s,"day"):c>=r?o(a,c,r,"hour"):c>=n?o(a,c,n,"minute"):c>=t?o(a,c,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=s?Math.round(e/s)+"d":o>=r?Math.round(e/r)+"h":o>=n?Math.round(e/n)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},3300:(e,t)=>{"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();e.exports=t=n.fetch,n.fetch&&(t.default=n.fetch.bind(n)),t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response},6898:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Speed=void 0,(n=t.Speed||(t.Speed={})).good="GOOD",n.ok="OK",n.bad="BAD",n.nothing="NOTHING"},14:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.BandwidthMode=void 0,(n=t.BandwidthMode||(t.BandwidthMode={})).big="big",n.small="small"},9623:function(e,t,n){"use strict";var r,s=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},o.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(s=2&o[0]?r.return:o[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;switch(r=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(6===o[0]&&i.label<s[1]){i.label=s[1],s=o;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(o);break}s[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],r=0}finally{n=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CCT=void 0;var c=n(7429),u=n(3300),l=n(7187),h=n(7046),d=n(8599),f=n(6898),p=n(5940),y=n(8944),g={reconnection:!1,timeout:5e3},m=function(e){function t(){var t=e.call(this)||this;return t.allDatacenters=[],t.datacenters=[],t.runningLatency=!1,t.runningBandwidth=!1,t.idsToExclude=[],t.compatibleDCsWithSockets=[],t.lce=new p.LCE,t.abortControllers=[],t.sockets={latency:null,bandwidth:null},t.measurementConfigs={latency:{type:"latency",socketStartEvent:"latency:start",socketEndEvent:"latency:end",socketIterationEvent:"latency:iteration",socketTickEvent:"latency",iterationEvent:"latency:iteration",tickEvent:"latency",endEvent:"latency:end",getMeasurementResult:function(e){return t.lce.getLatencyFor(e)}},bandwidth:{type:"bandwidth",socketStartEvent:"bandwidth:start",socketEndEvent:"bandwidth:end",socketIterationEvent:"bandwidth:iteration",socketTickEvent:"bandwidth",iterationEvent:"bandwidth:iteration",tickEvent:"bandwidth",endEvent:"bandwidth:end",getMeasurementResult:function(e,n){return t.lce.getBandwidthFor(e,n.bandwidthMode)}}},t}return s(t,e),t.prototype.fetchDatacenterInformation=function(e){return void 0===e&&(e="https://cct.demo-education.cloud.sap/datacenters?isActive=true"),i(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,(0,u.default)(e)];case 1:return[4,n.sent().json()];case 2:return t=n.sent(),this.allDatacenters=t,this.datacenters=t,this.clean(),[3,4];case 3:return n.sent(),this.allDatacenters=[],this.datacenters=[],[3,4];case 4:return[2]}}))}))},t.prototype.fetchCompatibleDCsWithSockets=function(){return i(this,void 0,void 0,(function(){var e,t=this;return a(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.datacenters.map((function(e){return i(t,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t={dc:e},[4,this.lce.checkIfCompatibleWithSockets(e.ip)];case 1:return[2,(t.isCompatible=n.sent(),t)]}}))}))})))];case 1:return e=n.sent(),this.compatibleDCsWithSockets=e.filter((function(e){return e.isCompatible})).map((function(e){return e.dc})),[2,this.compatibleDCsWithSockets]}}))}))},t.prototype.setFilters=function(e){var t=this;this.datacenters=e?this.allDatacenters.filter((function(n){return!t.idsToExclude.includes(n.id)&&Object.keys(e).every((function(t){return"tags"===t?e[t].some((function(e){return n[t].toLowerCase().includes(e.toLowerCase())})):e[t].map((function(e){return e.toLowerCase()})).includes(n[t].toLowerCase())}))})):this.allDatacenters.filter((function(e){return!t.idsToExclude.includes(e.id)})),this.filters=e},t.prototype.stopMeasurements=function(){this.runningLatency=!1,this.runningBandwidth=!1,this.abortControllers.forEach((function(e){e.abort()})),this.abortControllers=[],this.lce.terminate(),this.emit("latency:end"),this.emit("bandwidth:end")},t.prototype.startLatencyChecks=function(e){return void 0===e&&(e={}),i(this,void 0,void 0,(function(){var t,n,r,s;return a(this,(function(i){switch(i.label){case 0:return this.compatibleDCsWithSockets.some((function(t){return t.id===e.from}))||void 0===e.from?(e.from!==this.lastLatencyFrom&&(this.cleanLatencyData(),this.lastLatencyFrom=e.from),t=e.iterations,n=void 0===t?16:t,r=e.save,s=void 0===r||r,[4,this.startMeasurements("latency",o(o({},e),{iterations:n,save:s}),new d.default)]):[2];case 1:return i.sent(),[2]}}))}))},t.prototype.startBandwidthChecks=function(e){return void 0===e&&(e={}),i(this,void 0,void 0,(function(){var t,n,r,s;return a(this,(function(i){switch(i.label){case 0:return this.compatibleDCsWithSockets.some((function(t){return t.id===e.from}))||void 0===e.from?(e.from!==this.lastBandwidthFrom&&(this.cleanBandwidthData(),this.lastBandwidthFrom=e.from),t=e.iterations,n=void 0===t?4:t,r=e.save,s=void 0===r||r,[4,this.startMeasurements("bandwidth",o(o({},e),{iterations:n,save:s}),new d.default)]):[2];case 1:return i.sent(),[2]}}))}))},t.prototype.startMeasurements=function(e,t,n){return i(this,void 0,void 0,(function(){var r,s,o;return a(this,(function(i){switch(i.label){case 0:return r=this.measurementConfigs[e],this[s="latency"===e?"runningLatency":"runningBandwidth"]=!0,this.abortControllers.push(n),(o=t.from&&this.compatibleDCsWithSockets.find((function(e){return e.id===t.from})))?[4,this.startCloudMeasurements(r,t,o,n)]:[3,2];case 1:return i.sent(),[3,4];case 2:return 0===this.datacenters.length?[3,4]:[4,this.startLocalMeasurements(r,t,n)];case 3:i.sent(),i.label=4;case 4:return n.signal.aborted||(this[s]=!1,this.emit(r.endEvent)),[2]}}))}))},t.prototype.setIdToExclude=function(e){this.idsToExclude=e||[],this.setFilters(this.filters)},t.prototype.clearSocket=function(e){var t=this.sockets[e];t&&(t.emit("stop"),t.removeAllListeners(),this.sockets[e]=null)},t.prototype.startCloudMeasurements=function(e,t,n,r){return i(this,void 0,void 0,(function(){var s=this;return a(this,(function(i){return[2,new Promise((function(i){var a=function(){s.clearSocket(e.type),i()};r.signal.addEventListener("abort",a);var c=(0,h.io)("https://".concat(n.ip),o(o({},g),{query:{id:n.id}}));s.sockets[e.type]=c,[e.socketEndEvent,"disconnect","connect_error"].forEach((function(e){return c.on(e,a)})),c.on("connect",(function(){c.emit(e.socketStartEvent,o(o({},t),{id:n.id,filters:s.filters}))})),c.on(e.socketIterationEvent,(function(t){s.emit(e.iterationEvent,t)})),c.on(e.socketTickEvent,(function(n){s.handleEventData(n,t.save,e.type),s.emit(e.tickEvent,n)}))}))]}))}))},t.prototype.startLocalMeasurements=function(e,t,n){return i(this,void 0,void 0,(function(){var r,s,o=this;return a(this,(function(i){switch(i.label){case 0:r=t.iterations,i.label=1;case 1:return r-- >0?n.signal.aborted?[2]:[4,Promise.all(this.datacenters.map((function(r){return o.startMeasurementFor(e,r,t,n)})))]:[3,5];case 2:return s=i.sent().filter((function(e){return null!==e})),n.signal.aborted?[2]:(this.emit(e.iterationEvent,s),t.interval?[4,y.Util.sleep(t.interval,n)]:[3,4]);case 3:i.sent(),i.label=4;case 4:return[3,1];case 5:return[2]}}))}))},t.prototype.startMeasurementFor=function(e,t,n,r){return i(this,void 0,void 0,(function(){var s,o;return a(this,(function(i){switch(i.label){case 0:return[4,e.getMeasurementResult(t,n)];case 1:return s=i.sent(),r.signal.aborted||null===s?[2,null]:(o={id:t.id,data:s},this.handleEventData(o,n.save,e.type),this.emit(e.tickEvent,o),[2,o])}}))}))},t.prototype.handleEventData=function(e,t,n){var r=e.id,s=e.data;if(t){var o=this.datacenters.findIndex((function(e){return e.id===r}));if(!(o<0)){var i=this.datacenters[o];if("latency"===n){i.latencies=i.latencies||[],i.latencies.push(s);var a=y.Util.getAverageLatency(i.latencies);i.averageLatency=a,i.latencyJudgement=y.Util.judgeLatency(a)}else if("bandwidth"===n){i.bandwidths=i.bandwidths||[],i.bandwidths.push(s);var c=y.Util.getAverageBandwidth(i.bandwidths);i.averageBandwidth=c,i.bandwidthJudgement=y.Util.judgeBandwidth(c)}}}},t.prototype.getCurrentDatacentersSorted=function(){return y.Util.sortDatacenters(this.datacenters),this.datacenters},t.prototype.getAddress=function(){return i(this,void 0,void 0,(function(){var e,t=this;return a(this,(function(n){return e={address:"",latitude:0,longitude:0},[2,new Promise((function(n){navigator&&(null===navigator||void 0===navigator?void 0:navigator.geolocation)?navigator.geolocation.getCurrentPosition((function(r){return i(t,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return e.latitude=r.coords.latitude,e.longitude=r.coords.longitude,[4,(new google.maps.Geocoder).geocode({location:new google.maps.LatLng(e.latitude,e.longitude)},(function(t,r){"OK"===r?(e.address=t[0].formatted_address,n(e)):(e.address="",e.latitude=0,e.longitude=0,n(e))}))];case 1:return t.sent(),[2]}}))}))}),(function(){n(null)})):n(null)}))]}))}))},t.prototype.store=function(e,t){return void 0===t&&(t="https://cct.demo-education.cloud.sap/measurement"),i(this,void 0,void 0,(function(){var n,r,s,i=this;return a(this,(function(a){switch(a.label){case 0:if(!e)return[2,!1];if(n=[],this.datacenters.forEach((function(e,t){if(e.latencies.length-(e.storedLatencyCount||0)>=16){var r=y.Util.getAverageLatency(e.latencies,e.storedLatencyCount),s=i.lastBandwidthFrom===i.lastLatencyFrom&&e.bandwidths.length-(e.storedBandwidthCount||0)>=4,o=s?y.Util.getAverageBandwidth(e.bandwidths,e.storedBandwidthCount):null;n.push({id:e.id,latency:r.toFixed(2),averageBandwidth:o&&o.megaBitsPerSecond.toFixed(2)}),i.datacenters[t].storedLatencyCount=e.latencies.length,i.datacenters[t].storedBandwidthCount=s?e.bandwidths.length:i.datacenters[t].storedBandwidthCount}})),0===n.length)return[2,!1];r=o(o({uid:(0,c.v4)(),source_id:this.lastLatencyFrom},e),{data:n}),s=JSON.stringify(r,null,4),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,(0,u.default)(t,{method:"post",body:s,headers:{"Content-Type":"application/json"}})];case 2:return[4,a.sent().json()];case 3:return[2,"OK"===a.sent().status];case 4:return a.sent(),[2,!1];case 5:return[2]}}))}))},t.prototype.clean=function(){this.cleanBandwidthData(),this.cleanLatencyData()},t.prototype.cleanLatencyData=function(){this.datacenters.forEach((function(e){e.position=0,e.averageLatency=0,e.latencies=[],e.latencyJudgement=f.Speed.nothing,e.storedLatencyCount=0}))},t.prototype.cleanBandwidthData=function(){this.datacenters.forEach((function(e){e.averageBandwidth={bitsPerSecond:0,kiloBitsPerSecond:0,megaBitsPerSecond:0},e.bandwidths=[],e.bandwidthJudgement=f.Speed.nothing,e.storedBandwidthCount=0}))},t.prototype.getClosestDatacenters=function(e){var t=e.latitude,n=e.longitude,r=e.top,s=void 0===r?1:r,o=e.url,c=void 0===o?"https://cct.demo-education.cloud.sap/datacenters?isActive=true":o;return i(this,void 0,void 0,(function(){var e,r;return a(this,(function(o){switch(o.label){case 0:return this.allDatacenters&&this.allDatacenters.length?[3,2]:[4,this.fetchDatacenterInformation(c)];case 1:o.sent(),o.label=2;case 2:return(e=this.allDatacenters.map((function(e){return{datacenter:e,distance:y.Util.calculateDistance(t,n,+e.latitude,+e.longitude)}}))).sort((function(e,t){return e.distance-t.distance})),r=Math.min(s,this.allDatacenters.length),[2,e.slice(0,r).map((function(e){return e.datacenter}))]}}))}))},t}(l.EventEmitter);t.CCT=m},5940:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(s=2&o[0]?r.return:o[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;switch(r=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(6===o[0]&&i.label<s[1]){i.label=s[1],s=o;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(o);break}s[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],r=0}finally{n=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.LCE=void 0;var o=n(3300),i=n(8599),a=n(14),c=function(){function e(){this.cancelableLatencyRequests=[],this.cancelableBandwidthRequests=[]}return e.prototype.checkIfCompatibleWithSockets=function(e){return r(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.latencyFetch("https://".concat(e,"/drone/index.html"))];case 1:return t=r.sent(),(n=null==t?void 0:t.headers.get("drone-version"))?[2,this.isSemverVersionHigher(n)]:[2,!1]}}))}))},e.prototype.getLatencyFor=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return t=Date.now(),[4,this.latencyFetch("https://".concat(e.ip,"/drone/index.html"))];case 1:return n.sent(),[2,{value:Date.now()-t,timestamp:Date.now()}]}}))}))},e.prototype.getBandwidthFor=function(e,t){return void 0===t&&(t=a.BandwidthMode.big),r(this,void 0,void 0,(function(){var n,r,o,i,a;return s(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.bandwidthFetch("https://".concat(e.ip,"/drone/").concat(t))];case 1:if(r=s.sent(),o=Date.now(),null===r)return[3,6];i=void 0,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,r.text()];case 3:return i=s.sent(),[3,5];case 4:return a=s.sent(),console.log(a),[2,null];case 5:return[2,{value:this.calcBandwidth(i.length,o-n),timestamp:Date.now()}];case 6:return[2,null]}}))}))},e.prototype.bandwidthFetch=function(e){var t=new i.default;return this.cancelableBandwidthRequests.push(t),this.abortableFetch(e,t)},e.prototype.latencyFetch=function(e){var t=new i.default;return this.cancelableLatencyRequests.push(t),this.abortableFetch(e,t)},e.prototype.abortableFetch=function(e,t,n){return void 0===n&&(n=3e3),r(this,void 0,void 0,(function(){var r,i,a,c;return s(this,(function(s){switch(s.label){case 0:r=setTimeout((function(){return t.abort()}),n),s.label=1;case 1:return s.trys.push([1,3,,4]),i=new URLSearchParams({t:"".concat(Date.now())}).toString(),[4,(0,o.default)("".concat(e,"?").concat(i),{signal:t.signal})];case 2:return a=s.sent(),clearTimeout(r),[2,a];case 3:return c=s.sent(),console.log(c),clearTimeout(r),[2,null];case 4:return[2]}}))}))},e.prototype.compare=function(e,t){return e.latency<t.latency?-1:e.latency>t.latency?1:0},e.prototype.terminate=function(){this.cancelableLatencyRequests.forEach((function(e){e.abort()})),this.cancelableBandwidthRequests.forEach((function(e){e.abort()})),this.cancelableLatencyRequests=[],this.cancelableBandwidthRequests=[]},e.prototype.calcBandwidth=function(e,t){var n=8*e/(t/1e3),r=n/1e3;return{bitsPerSecond:n,kiloBitsPerSecond:r,megaBitsPerSecond:r/1e3}},e.prototype.isSemverVersionHigher=function(e,t){void 0===t&&(t="3.0.0");for(var n=e.split(".").map(Number),r=t.split(".").map(Number),s=Math.max(n.length,r.length),o=0;o<s;o++){var i=n[o]||0,a=r[o]||0;if(i>a)return!0;if(i<a)return!1}return e===t},e}();t.LCE=c},8944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;var r=n(6898),s=function(){function e(){}return e.getAverageLatency=function(e,t){if(void 0===t&&(t=0),!e||0===e.length||t>=e.length)return-1;var n=e.slice(t);return n.reduce((function(e,t){return e+t.value}),0)/n.length},e.getAverageBandwidth=function(e,t){if(void 0===t&&(t=0),!e||0===e.length||t>=e.length)return{bitsPerSecond:-1,kiloBitsPerSecond:-1,megaBitsPerSecond:-1};var n=e.slice(t),r=n.reduce((function(e,t){return{bitsPerSecond:e.bitsPerSecond+t.value.bitsPerSecond,kiloBitsPerSecond:e.kiloBitsPerSecond+t.value.kiloBitsPerSecond,megaBitsPerSecond:e.megaBitsPerSecond+t.value.megaBitsPerSecond}}),{bitsPerSecond:0,kiloBitsPerSecond:0,megaBitsPerSecond:0}),s=n.length;return{bitsPerSecond:r.bitsPerSecond/s,kiloBitsPerSecond:r.kiloBitsPerSecond/s,megaBitsPerSecond:r.megaBitsPerSecond/s}},e.sortDatacenters=function(e){return e.sort((function(e,t){return e.averageLatency-t.averageLatency})),e.forEach((function(e,t){e.position=t+1})),e},e.getTop3=function(t){return e.sortDatacenters(t).slice(0,3)},e.calculateDistance=function(e,t,n,r){var s=function(e){return e*Math.PI/180},o=s(e),i=s(n),a=s(n-e),c=s(r-t),u=Math.sin(a/2)*Math.sin(a/2)+Math.cos(o)*Math.cos(i)*Math.sin(c/2)*Math.sin(c/2),l=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))*6371e3;return Math.floor(l/1e3)},e.sleep=function(e,t){var n=t.signal;return new Promise((function(t,r){var s=setTimeout((function(){t()}),e);n.addEventListener("abort",(function(){clearTimeout(s),t()}))}))},e.judgeLatency=function(e){return e<170?r.Speed.good:e>=170&&e<280?r.Speed.ok:r.Speed.bad},e.judgeBandwidth=function(e){return e.megaBitsPerSecond>1?r.Speed.good:e.megaBitsPerSecond<=1&&e.megaBitsPerSecond>.3?r.Speed.ok:r.Speed.bad},e}();t.Util=s},7429:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var r=d(n(3990)),s=d(n(8237)),o=d(n(5355)),i=d(n(3764)),a=d(n(6314)),c=d(n(8464)),u=d(n(6435)),l=d(n(4008)),h=d(n(8222));function d(e){return e&&e.__esModule?e:{default:e}}},4163:(e,t)=>{"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function s(e,t,n,s,o,i){return r((a=r(r(t,e),r(s,i)))<<(c=o)|a>>>32-c,n);var a,c}function o(e,t,n,r,o,i,a){return s(t&n|~t&r,e,t,o,i,a)}function i(e,t,n,r,o,i,a){return s(t&r|n&~r,e,t,o,i,a)}function a(e,t,n,r,o,i,a){return s(t^n^r,e,t,o,i,a)}function c(e,t,n,r,o,i,a){return s(n^(t|~r),e,t,o,i,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let s=0;s<n;s+=8){const n=e[s>>5]>>>s%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let s=1732584193,u=-271733879,l=-1732584194,h=271733878;for(let t=0;t<e.length;t+=16){const n=s,d=u,f=l,p=h;s=o(s,u,l,h,e[t],7,-680876936),h=o(h,s,u,l,e[t+1],12,-389564586),l=o(l,h,s,u,e[t+2],17,606105819),u=o(u,l,h,s,e[t+3],22,-1044525330),s=o(s,u,l,h,e[t+4],7,-176418897),h=o(h,s,u,l,e[t+5],12,1200080426),l=o(l,h,s,u,e[t+6],17,-1473231341),u=o(u,l,h,s,e[t+7],22,-45705983),s=o(s,u,l,h,e[t+8],7,1770035416),h=o(h,s,u,l,e[t+9],12,-1958414417),l=o(l,h,s,u,e[t+10],17,-42063),u=o(u,l,h,s,e[t+11],22,-1990404162),s=o(s,u,l,h,e[t+12],7,1804603682),h=o(h,s,u,l,e[t+13],12,-40341101),l=o(l,h,s,u,e[t+14],17,-1502002290),u=o(u,l,h,s,e[t+15],22,1236535329),s=i(s,u,l,h,e[t+1],5,-165796510),h=i(h,s,u,l,e[t+6],9,-1069501632),l=i(l,h,s,u,e[t+11],14,643717713),u=i(u,l,h,s,e[t],20,-373897302),s=i(s,u,l,h,e[t+5],5,-701558691),h=i(h,s,u,l,e[t+10],9,38016083),l=i(l,h,s,u,e[t+15],14,-660478335),u=i(u,l,h,s,e[t+4],20,-405537848),s=i(s,u,l,h,e[t+9],5,568446438),h=i(h,s,u,l,e[t+14],9,-1019803690),l=i(l,h,s,u,e[t+3],14,-187363961),u=i(u,l,h,s,e[t+8],20,1163531501),s=i(s,u,l,h,e[t+13],5,-1444681467),h=i(h,s,u,l,e[t+2],9,-51403784),l=i(l,h,s,u,e[t+7],14,1735328473),u=i(u,l,h,s,e[t+12],20,-1926607734),s=a(s,u,l,h,e[t+5],4,-378558),h=a(h,s,u,l,e[t+8],11,-2022574463),l=a(l,h,s,u,e[t+11],16,1839030562),u=a(u,l,h,s,e[t+14],23,-35309556),s=a(s,u,l,h,e[t+1],4,-1530992060),h=a(h,s,u,l,e[t+4],11,1272893353),l=a(l,h,s,u,e[t+7],16,-155497632),u=a(u,l,h,s,e[t+10],23,-1094730640),s=a(s,u,l,h,e[t+13],4,681279174),h=a(h,s,u,l,e[t],11,-358537222),l=a(l,h,s,u,e[t+3],16,-722521979),u=a(u,l,h,s,e[t+6],23,76029189),s=a(s,u,l,h,e[t+9],4,-640364487),h=a(h,s,u,l,e[t+12],11,-421815835),l=a(l,h,s,u,e[t+15],16,530742520),u=a(u,l,h,s,e[t+2],23,-995338651),s=c(s,u,l,h,e[t],6,-198630844),h=c(h,s,u,l,e[t+7],10,1126891415),l=c(l,h,s,u,e[t+14],15,-1416354905),u=c(u,l,h,s,e[t+5],21,-57434055),s=c(s,u,l,h,e[t+12],6,1700485571),h=c(h,s,u,l,e[t+3],10,-1894986606),l=c(l,h,s,u,e[t+10],15,-1051523),u=c(u,l,h,s,e[t+1],21,-2054922799),s=c(s,u,l,h,e[t+8],6,1873313359),h=c(h,s,u,l,e[t+15],10,-30611744),l=c(l,h,s,u,e[t+6],15,-1560198380),u=c(u,l,h,s,e[t+13],21,1309151649),s=c(s,u,l,h,e[t+4],6,-145523070),h=c(h,s,u,l,e[t+11],10,-1120210379),l=c(l,h,s,u,e[t+2],15,718787259),u=c(u,l,h,s,e[t+9],21,-343485551),s=r(s,n),u=r(u,d),l=r(l,f),h=r(h,p)}return[s,u,l,h]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},4790:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},6314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},8222:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,s=(r=n(6435))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,s.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},58:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},3319:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},3757:(e,t)=>{"use strict";function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],s=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,i=Math.ceil(o/16),a=new Array(i);for(let t=0;t<i;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];a[t]=n}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<i;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=a[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let i=s[0],c=s[1],u=s[2],l=s[3],h=s[4];for(let e=0;e<80;++e){const s=Math.floor(e/20),a=r(i,5)+n(s,c,u,l)+h+t[s]+o[e]>>>0;h=l,l=u,u=r(c,30)>>>0,c=i,i=a}s[0]=s[0]+i>>>0,s[1]=s[1]+c>>>0,s[2]=s[2]+u>>>0,s[3]=s[3]+l>>>0,s[4]=s[4]+h>>>0}return[s[0]>>24&255,s[0]>>16&255,s[0]>>8&255,255&s[0],s[1]>>24&255,s[1]>>16&255,s[1]>>8&255,255&s[1],s[2]>>24&255,s[2]>>16&255,s[2]>>8&255,255&s[2],s[3]>>24&255,s[3]>>16&255,s[3]>>8&255,255&s[3],s[4]>>24&255,s[4]>>16&255,s[4]>>8&255,255&s[4]]}},4008:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=i;var r,s=(r=n(6435))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function i(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e,t=0){const n=i(e,t);if(!(0,s.default)(n))throw TypeError("Stringified UUID is invalid");return n}},3990:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,s=(r=n(3319))&&r.__esModule?r:{default:r},o=n(4008);let i,a,c=0,u=0;t.default=function(e,t,n){let r=t&&n||0;const l=t||new Array(16);let h=(e=e||{}).node||i,d=void 0!==e.clockseq?e.clockseq:a;if(null==h||null==d){const t=e.random||(e.rng||s.default)();null==h&&(h=i=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==d&&(d=a=16383&(t[6]<<8|t[7]))}let f=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:u+1;const y=f-c+(p-u)/1e4;if(y<0&&void 0===e.clockseq&&(d=d+1&16383),(y<0||f>c)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,u=p,a=d,f+=122192928e5;const g=(1e4*(268435455&f)+p)%4294967296;l[r++]=g>>>24&255,l[r++]=g>>>16&255,l[r++]=g>>>8&255,l[r++]=255&g;const m=f/4294967296*1e4&268435455;l[r++]=m>>>8&255,l[r++]=255&m,l[r++]=m>>>24&15|16,l[r++]=m>>>16&255,l[r++]=d>>>8|128,l[r++]=255&d;for(let e=0;e<6;++e)l[r+e]=h[e];return t||(0,o.unsafeStringify)(l)}},8237:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(7925)),s=o(n(4163));function o(e){return e&&e.__esModule?e:{default:e}}var i=(0,r.default)("v3",48,s.default);t.default=i},7925:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,i,a){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(c=r)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(r),u.set(e,r.length),u=n(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,i){a=a||0;for(let e=0;e<16;++e)i[a+e]=u[e];return i}return(0,s.unsafeStringify)(u)}try{r.name=e}catch(e){}return r.DNS=i,r.URL=a,r};var r,s=n(4008),o=(r=n(8222))&&r.__esModule?r:{default:r};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=i;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=a},5355:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(4790)),s=i(n(3319)),o=n(4008);function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const i=(e=e||{}).random||(e.rng||s.default)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=i[e];return t}return(0,o.unsafeStringify)(i)}},3764:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(7925)),s=o(n(3757));function o(e){return e&&e.__esModule?e:{default:e}}var i=(0,r.default)("v5",80,s.default);t.default=i},6435:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,s=(r=n(58))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&s.default.test(e)}},8464:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,s=(r=n(6435))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,s.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},8419:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let n=!1;try{n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=n},5754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0,t.encode=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}},5222:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const n=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parse=function(e){if(e.length>2e3)throw"URI too long";const t=e,s=e.indexOf("["),o=e.indexOf("]");-1!=s&&-1!=o&&(e=e.substring(0,s)+e.substring(s,o).replace(/:/g,";")+e.substring(o,e.length));let i=n.exec(e||""),a={},c=14;for(;c--;)a[r[c]]=i[c]||"";return-1!=s&&-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),a.pathNames=function(e,t){const n=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||n.splice(0,1),"/"==t.slice(-1)&&n.splice(n.length-1,1),n}(0,a.path),a.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,a.query),a}},8726:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.yeast=t.decode=t.encode=void 0;const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r={};let s,o=0,i=0;function a(e){let t="";do{t=n[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}for(t.encode=a,t.decode=function(e){let t=0;for(i=0;i<e.length;i++)t=64*t+r[e.charAt(i)];return t},t.yeast=function(){const e=a(+new Date);return e!==s?(o=0,s=e):e+"."+a(o++)};i<64;i++)r[n[i]]=i},6242:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalThisShim=void 0,t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},4679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.TransportError=t.Transport=t.protocol=t.Socket=void 0;const r=n(3481);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return r.Socket}}),t.protocol=r.Socket.protocol;var s=n(9870);Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return s.Transport}}),Object.defineProperty(t,"TransportError",{enumerable:!0,get:function(){return s.TransportError}});var o=n(7385);Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return o.transports}});var i=n(9622);Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var a=n(5222);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}});var c=n(5552);Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return c.nextTick}})},3481:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const s=n(7385),o=n(9622),i=n(5754),a=n(5222),c=r(n(1227)),u=n(5260),l=n(1373),h=n(5552),d=(0,c.default)("engine.io-client:socket");class f extends u.Emitter{constructor(e,t={}){super(),this.binaryType=h.defaultBinaryType,this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=(0,a.parse)(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):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=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,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,i.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){d('creating transport "%s"',e);const t=Object.assign({},this.opts.query);t.EIO=l.protocol,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return d("options: %j",n),new s.transports[e](n)}open(){let e;if(this.opts.rememberUpgrade&&f.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return d("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){d("setting transport %s",e.name),this.transport&&(d("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)))}probe(e){d('probing transport "%s"',e);let t=this.createTransport(e),n=!1;f.priorWebsocketSuccess=!1;const r=()=>{n||(d('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(r=>{if(!n)if("pong"===r.type&&"probe"===r.data){if(d('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;f.priorWebsocketSuccess="websocket"===t.name,d('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{n||"closed"!==this.readyState&&(d("changing transport and sending upgrade packet"),u(),this.setTransport(t),t.send([{type:"upgrade"