From c8c2306637e347784ba25334365a0d9144d6faf4 Mon Sep 17 00:00:00 2001 From: micuat Date: Thu, 31 Aug 2023 19:01:47 +0200 Subject: [PATCH] remove dist folder from commit --- .gitignore | 1 + dist/assets/index-745a04ef.js | 342 -- dist/css/codemirror.css | 346 -- dist/css/fontawesome.css | 5 - dist/css/modal.css | 270 -- dist/css/normalize.css | 427 --- dist/css/show-hint.css | 36 - dist/css/skeleton.css | 418 --- dist/css/style.css | 108 - dist/css/tomorrow-night-eighties.css | 114 - dist/index.html | 35 - dist/p5.min.js | 2 - dist/webfonts/fa-brands-400.eot | Bin 129648 -> 0 bytes dist/webfonts/fa-brands-400.svg | 3452 -------------------- dist/webfonts/fa-brands-400.ttf | Bin 129344 -> 0 bytes dist/webfonts/fa-brands-400.woff | Bin 87544 -> 0 bytes dist/webfonts/fa-brands-400.woff2 | Bin 74656 -> 0 bytes dist/webfonts/fa-regular-400.eot | Bin 34388 -> 0 bytes dist/webfonts/fa-regular-400.svg | 803 ----- dist/webfonts/fa-regular-400.ttf | Bin 34092 -> 0 bytes dist/webfonts/fa-regular-400.woff | Bin 16804 -> 0 bytes dist/webfonts/fa-regular-400.woff2 | Bin 13584 -> 0 bytes dist/webfonts/fa-solid-900.eot | Bin 186708 -> 0 bytes dist/webfonts/fa-solid-900.svg | 4527 -------------------------- dist/webfonts/fa-solid-900.ttf | Bin 186424 -> 0 bytes dist/webfonts/fa-solid-900.woff | Bin 96256 -> 0 bytes dist/webfonts/fa-solid-900.woff2 | Bin 74328 -> 0 bytes vite.config.js | 3 + 28 files changed, 4 insertions(+), 10885 deletions(-) delete mode 100644 dist/assets/index-745a04ef.js delete mode 100755 dist/css/codemirror.css delete mode 100644 dist/css/fontawesome.css delete mode 100644 dist/css/modal.css delete mode 100755 dist/css/normalize.css delete mode 100755 dist/css/show-hint.css delete mode 100755 dist/css/skeleton.css delete mode 100755 dist/css/style.css delete mode 100755 dist/css/tomorrow-night-eighties.css delete mode 100644 dist/index.html delete mode 100644 dist/p5.min.js delete mode 100644 dist/webfonts/fa-brands-400.eot delete mode 100644 dist/webfonts/fa-brands-400.svg delete mode 100644 dist/webfonts/fa-brands-400.ttf delete mode 100644 dist/webfonts/fa-brands-400.woff delete mode 100644 dist/webfonts/fa-brands-400.woff2 delete mode 100644 dist/webfonts/fa-regular-400.eot delete mode 100644 dist/webfonts/fa-regular-400.svg delete mode 100644 dist/webfonts/fa-regular-400.ttf delete mode 100644 dist/webfonts/fa-regular-400.woff delete mode 100644 dist/webfonts/fa-regular-400.woff2 delete mode 100644 dist/webfonts/fa-solid-900.eot delete mode 100644 dist/webfonts/fa-solid-900.svg delete mode 100644 dist/webfonts/fa-solid-900.ttf delete mode 100644 dist/webfonts/fa-solid-900.woff delete mode 100644 dist/webfonts/fa-solid-900.woff2 diff --git a/.gitignore b/.gitignore index cfde9151..746f324a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules .data *~ backend/certs +dist \ No newline at end of file diff --git a/dist/assets/index-745a04ef.js b/dist/assets/index-745a04ef.js deleted file mode 100644 index 6527c556..00000000 --- a/dist/assets/index-745a04ef.js +++ /dev/null @@ -1,342 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function i(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=i(o);fetch(o.href,a)}})();var gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function nm(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var a=Function.bind.apply(t,o);return new a}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),i}var nh={exports:{}},fs=typeof Reflect=="object"?Reflect:null,_d=fs&&typeof fs.apply=="function"?fs.apply:function(t,i,n){return Function.prototype.apply.call(t,i,n)},wl;fs&&typeof fs.ownKeys=="function"?wl=fs.ownKeys:Object.getOwnPropertySymbols?wl=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:wl=function(t){return Object.getOwnPropertyNames(t)};function Y_(e){console&&console.warn&&console.warn(e)}var sm=Number.isNaN||function(t){return t!==t};function yt(){yt.init.call(this)}nh.exports=yt;nh.exports.once=X_;yt.EventEmitter=yt;yt.prototype._events=void 0;yt.prototype._eventsCount=0;yt.prototype._maxListeners=void 0;var wd=10;function zl(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(yt,"defaultMaxListeners",{enumerable:!0,get:function(){return wd},set:function(e){if(typeof e!="number"||e<0||sm(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");wd=e}});yt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};yt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||sm(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function om(e){return e._maxListeners===void 0?yt.defaultMaxListeners:e._maxListeners}yt.prototype.getMaxListeners=function(){return om(this)};yt.prototype.emit=function(t){for(var i=[],n=1;n0&&(u=i[0]),u instanceof Error)throw u;var h=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw h.context=u,h}var p=a[t];if(p===void 0)return!1;if(typeof p=="function")_d(p,this,i);else for(var m=p.length,_=cm(p,m),n=0;n0&&u.length>o&&!u.warned){u.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=u.length,Y_(h)}return e}yt.prototype.addListener=function(t,i){return am(this,t,i,!1)};yt.prototype.on=yt.prototype.addListener;yt.prototype.prependListener=function(t,i){return am(this,t,i,!0)};function H_(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function lm(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},o=H_.bind(n);return o.listener=i,n.wrapFn=o,o}yt.prototype.once=function(t,i){return zl(i),this.on(t,lm(this,t,i)),this};yt.prototype.prependOnceListener=function(t,i){return zl(i),this.prependListener(t,lm(this,t,i)),this};yt.prototype.removeListener=function(t,i){var n,o,a,u,h;if(zl(i),o=this._events,o===void 0)return this;if(n=o[t],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,n.listener||i));else if(typeof n!="function"){for(a=-1,u=n.length-1;u>=0;u--)if(n[u]===i||n[u].listener===i){h=n[u].listener,a=u;break}if(a<0)return this;a===0?n.shift():$_(n,a),n.length===1&&(o[t]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",t,h||i)}return this};yt.prototype.off=yt.prototype.removeListener;yt.prototype.removeAllListeners=function(t){var i,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var a=Object.keys(n),u;for(o=0;o=0;o--)this.removeListener(t,i[o]);return this};function um(e,t,i){var n=e._events;if(n===void 0)return[];var o=n[t];return o===void 0?[]:typeof o=="function"?i?[o.listener||o]:[o]:i?Z_(o):cm(o,o.length)}yt.prototype.listeners=function(t){return um(this,t,!0)};yt.prototype.rawListeners=function(t){return um(this,t,!1)};yt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):fm.call(e,t)};yt.prototype.listenerCount=fm;function fm(e){var t=this._events;if(t!==void 0){var i=t[e];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}yt.prototype.eventNames=function(){return this._eventsCount>0?wl(this._events):[]};function cm(e,t){for(var i=new Array(t),n=0;n=10||e%1===0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o}var rw=ew,iw=nw;function nw(){Object.defineProperty(window.choo,"storage",{get:e,set:sw});function e(){if(navigator.storage)return navigator.storage.estimate().then(function(i){var n=(i.usage/i.quota).toFixed();rf("Max storage:",bd(i.quota)),rf("Storage used:",bd(i.usage)+" ("+n+"%)"),navigator.storage.persisted().then(function(o){var a=o?"enabled":"disabled";rf("Persistent storage:",a)})}),"Calculating storage quota…";var t=window.location.protocol;return/https/.test(t)?"The Storage API is unavailable in this browser. We're sorry!":"The Storage API is unavailable. Serving this site over HTTPS might help enable it!"}}function rf(e,t){var i="#cc99cc";console.log("%c"+e,"color: "+i,t)}function bd(e){return rw(e).replace(" ","")}function sw(){}gi.notEqual=aw;gi.notOk=lw;gi.equal=ow;gi.ok=gi;var ur=gi;function ow(e,t,i){gi(e==t,i)}function aw(e,t,i){gi(e!=t,i)}function lw(e,t){gi(!e,t)}function gi(e,t){if(!e)throw new Error(t||"AssertionError")}var uw=ur,fw=typeof window<"u";function cw(){var e;return fw?(window._nanoScheduler||(window._nanoScheduler=new Fo(!0)),e=window._nanoScheduler):e=new Fo,e}function Fo(e){this.hasWindow=e,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}Fo.prototype.push=function(e){uw.equal(typeof e,"function","nanoscheduler.push: cb should be type function"),this.queue.push(e),this.schedule()};Fo.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var e=this;this.method(function(t){for(var i;e.queue.length&&t.timeRemaining()>0;)i=e.queue.shift(),i(t);e.scheduled=!1,e.queue.length&&e.schedule()})}};Fo.prototype.setTimeout=function(e){setTimeout(e,0,{timeRemaining:function(){return 1}})};var ra=cw,pm={exports:{}};/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var xd=Object.getOwnPropertySymbols,hw=Object.prototype.hasOwnProperty,pw=Object.prototype.propertyIsEnumerable;function dw(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function gw(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;var n=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(a){o[a]=a}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var yw=gw()?Object.assign:function(e,t){for(var i,n=dw(e),o,a=1;a=we)return Ie;switch(Ie){case"%s":return String(Me[fe++]);case"%d":return Number(Me[fe++]);case"%j":try{return JSON.stringify(Me[fe++])}catch{return"[Circular]"}default:return Ie}}),ke=Me[fe];fe=3&&(fe.depth=arguments[2]),arguments.length>=4&&(fe.colors=arguments[3]),R(X)?fe.showHidden=X:X&&e._extend(fe,X),P(fe.showHidden)&&(fe.showHidden=!1),P(fe.depth)&&(fe.depth=2),P(fe.colors)&&(fe.colors=!1),P(fe.customInspect)&&(fe.customInspect=!0),fe.colors&&(fe.stylize=a),p(fe,K,fe.depth)}e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(K,X){var fe=o.styles[X];return fe?"\x1B["+o.colors[fe][0]+"m"+K+"\x1B["+o.colors[fe][1]+"m":K}function u(K,X){return K}function h(K){var X={};return K.forEach(function(fe,Me){X[fe]=!0}),X}function p(K,X,fe){if(K.customInspect&&X&&A(X.inspect)&&X.inspect!==e.inspect&&!(X.constructor&&X.constructor.prototype===X)){var Me=X.inspect(fe,K);return G(Me)||(Me=p(K,Me,fe)),Me}var we=m(K,X);if(we)return we;var Re=Object.keys(X),ke=h(Re);if(K.showHidden&&(Re=Object.getOwnPropertyNames(X)),ee(X)&&(Re.indexOf("message")>=0||Re.indexOf("description")>=0))return _(X);if(Re.length===0){if(A(X)){var Ie=X.name?": "+X.name:"";return K.stylize("[Function"+Ie+"]","special")}if(F(X))return K.stylize(RegExp.prototype.toString.call(X),"regexp");if(D(X))return K.stylize(Date.prototype.toString.call(X),"date");if(ee(X))return _(X)}var ze="",le=!1,ue=["{","}"];if(U(X)&&(le=!0,ue=["[","]"]),A(X)){var xe=X.name?": "+X.name:"";ze=" [Function"+xe+"]"}if(F(X)&&(ze=" "+RegExp.prototype.toString.call(X)),D(X)&&(ze=" "+Date.prototype.toUTCString.call(X)),ee(X)&&(ze=" "+_(X)),Re.length===0&&(!le||X.length==0))return ue[0]+ze+ue[1];if(fe<0)return F(X)?K.stylize(RegExp.prototype.toString.call(X),"regexp"):K.stylize("[Object]","special");K.seen.push(X);var Le;return le?Le=y(K,X,fe,ke,Re):Le=Re.map(function(De){return v(K,X,fe,ke,De,le)}),K.seen.pop(),x(Le,ze,ue)}function m(K,X){if(P(X))return K.stylize("undefined","undefined");if(G(X)){var fe="'"+JSON.stringify(X).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return K.stylize(fe,"string")}if(L(X))return K.stylize(""+X,"number");if(R(X))return K.stylize(""+X,"boolean");if(S(X))return K.stylize("null","null")}function _(K){return"["+Error.prototype.toString.call(K)+"]"}function y(K,X,fe,Me,we){for(var Re=[],ke=0,Ie=X.length;ke-1&&(Re?Ie=Ie.split(` -`).map(function(le){return" "+le}).join(` -`).substr(2):Ie=` -`+Ie.split(` -`).map(function(le){return" "+le}).join(` -`))):Ie=K.stylize("[Circular]","special")),P(ke)){if(Re&&we.match(/^\d+$/))return Ie;ke=JSON.stringify(""+we),ke.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ke=ke.substr(1,ke.length-2),ke=K.stylize(ke,"name")):(ke=ke.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ke=K.stylize(ke,"string"))}return ke+": "+Ie}function x(K,X,fe){var Me=K.reduce(function(we,Re){return Re.indexOf(` -`)>=0,we+Re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Me>60?fe[0]+(X===""?"":X+` - `)+" "+K.join(`, - `)+" "+fe[1]:fe[0]+X+" "+K.join(", ")+" "+fe[1]}function U(K){return Array.isArray(K)}e.isArray=U;function R(K){return typeof K=="boolean"}e.isBoolean=R;function S(K){return K===null}e.isNull=S;function g(K){return K==null}e.isNullOrUndefined=g;function L(K){return typeof K=="number"}e.isNumber=L;function G(K){return typeof K=="string"}e.isString=G;function O(K){return typeof K=="symbol"}e.isSymbol=O;function P(K){return K===void 0}e.isUndefined=P;function F(K){return V(K)&&Z(K)==="[object RegExp]"}e.isRegExp=F;function V(K){return typeof K=="object"&&K!==null}e.isObject=V;function D(K){return V(K)&&Z(K)==="[object Date]"}e.isDate=D;function ee(K){return V(K)&&(Z(K)==="[object Error]"||K instanceof Error)}e.isError=ee;function A(K){return typeof K=="function"}e.isFunction=A;function q(K){return K===null||typeof K=="boolean"||typeof K=="number"||typeof K=="string"||typeof K=="symbol"||typeof K>"u"}e.isPrimitive=q,e.isBuffer=mw;function Z(K){return Object.prototype.toString.call(K)}function ce(K){return K<10?"0"+K.toString(10):K.toString(10)}var ye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ie(){var K=new Date,X=[ce(K.getHours()),ce(K.getMinutes()),ce(K.getSeconds())].join(":");return[K.getDate(),ye[K.getMonth()],X].join(" ")}e.log=function(){console.log("%s - %s",ie(),e.format.apply(e,arguments))},e.inherits=vw,e._extend=function(K,X){if(!X||!V(X))return K;for(var fe=Object.keys(X),Me=fe.length;Me--;)K[fe[Me]]=X[fe[Me]];return K};function re(K,X){return Object.prototype.hasOwnProperty.call(K,X)}})(dm);var _w=yw;/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */function Sd(e,t){if(e===t)return 0;for(var i=e.length,n=t.length,o=0,a=Math.min(i,n);o=0){var h=o.indexOf(` -`,u+1);o=o.substring(h+1)}this.stack=o}}};Dr.inherits(nt.AssertionError,Error);function Ed(e,t){return typeof e=="string"?e.length=0;m--)if(u[m]!==h[m])return!1;for(m=u.length-1;m>=0;m--)if(p=u[m],!ds(e[p],t[p],i,n))return!1;return!0}nt.notDeepEqual=function(t,i,n){ds(t,i,!1)&&ar(t,i,n,"notDeepEqual",nt.notDeepEqual)};nt.notDeepStrictEqual=vm;function vm(e,t,i){ds(e,t,!0)&&ar(e,t,i,"notDeepStrictEqual",vm)}nt.strictEqual=function(t,i,n){t!==i&&ar(t,i,n,"===",nt.strictEqual)};nt.notStrictEqual=function(t,i,n){t===i&&ar(t,i,n,"!==",nt.notStrictEqual)};function Rd(e,t){if(!e||!t)return!1;if(Object.prototype.toString.call(t)=="[object RegExp]")return t.test(e);try{if(e instanceof t)return!0}catch{}return Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function Mw(e){var t;try{e()}catch(i){t=i}return t}function _m(e,t,i,n){var o;if(typeof t!="function")throw new TypeError('"block" argument must be a function');typeof i=="string"&&(n=i,i=null),o=Mw(t),n=(i&&i.name?" ("+i.name+").":".")+(n?" "+n:"."),e&&!o&&ar(o,i,"Missing expected exception"+n);var a=typeof n=="string",u=!e&&Dr.isError(o),h=!e&&o&&!i;if((u&&a&&Rd(o,i)||h)&&ar(o,i,"Got unwanted exception"+n),e&&o&&i&&!Rd(o,i)||!e&&o)throw o}nt.throws=function(e,t,i){_m(!0,e,t,i)};nt.doesNotThrow=function(e,t,i){_m(!1,e,t,i)};nt.ifError=function(e){if(e)throw e};function wm(e,t){e||ar(e,!0,t,"==",wm)}nt.strict=_w(wm,nt,{equal:nt.strictEqual,deepEqual:nt.deepStrictEqual,notEqual:nt.notStrictEqual,notDeepEqual:nt.notDeepStrictEqual});nt.strict.strict=nt.strict;var Ld=Object.keys||function(e){var t=[];for(var i in e)ww.call(e,i)&&t.push(i);return t},Yl=pm.exports,Cw=Yl,Tw={trace:"🔍",debug:"🐛",info:"✨",warn:"⚠️",error:"🚨",fatal:"💀"},bm={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Ew={foreground:"#d3c0c8",background:"#2d2d2d",black:"#2d2d2d",red:"#f2777a",green:"#99cc99",yellow:"#ffcc66",blue:"#6699cc",magenta:"#cc99cc",cyan:"#66cccc",white:"#d3d0c8",brightBlack:"#747369"},sh=ni;function ni(e,t){if(t=t||{},!(this instanceof ni))return new ni(e,t);Cw.equal(typeof t,"object","nanologger: opts should be type object"),this._name=e||"",this._colors=Object.assign({},Ew,t.colors||{});try{this.logLevel=window.localStorage.getItem("logLevel")||"info"}catch{this.logLevel="info"}this._logLevel=bm[this.logLevel]}ni.prototype.trace=function(){for(var e=["trace"],t=0,i=arguments.length;t2?t.slice(2):t,t[0]=t[0].replace(/^ {4}at /,""),` -`+t.join(` -`)}var Kw=Gw,Vw=sh,zw=Yl,sf="Debugging enabled. To disable run: `choo.debug = false`",Qw="Debugging disabled. We hope it was helpful! 🙌",Yw=Hw;function Hw(e,t,i,n){var o=Vw("choo-devtools"),a=window.localStorage.logLevel==="debug";a&&o.info(sf),e=Kw(e,function(u,h,p){a&&(p=p.split(` -`)[1].replace(/^ +/,""),o.info("state."+u,h,` -`+p))}),i.state=e,Object.defineProperty(window.choo,"debug",{get:function(){return window.localStorage.logLevel="debug",n.emit("debug",!0),a=!0,sf},set:function(u){zw.equal(typeof u,"boolean","choo-devtools.debug: bool should be type boolean"),window.localStorage.logLevel=u?"debug":"info",a=u,n.emit("debug",a),a?o.info(sf):o.info(Qw)}})}var Sm=Do;Do.default=Do;Do.stable=Tm;Do.stableStringify=Tm;var kl="[...]",Mm="[Circular]",Sn=[],wn=[];function Cm(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Do(e,t,i,n){typeof n>"u"&&(n=Cm()),gc(e,"",0,[],void 0,0,n);var o;try{wn.length===0?o=JSON.stringify(e,t,i):o=JSON.stringify(e,Em(t),i)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Sn.length!==0;){var a=Sn.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return o}function cs(e,t,i,n){var o=Object.getOwnPropertyDescriptor(n,i);o.get!==void 0?o.configurable?(Object.defineProperty(n,i,{value:e}),Sn.push([n,i,t,o])):wn.push([t,i,e]):(n[i]=e,Sn.push([n,i,t]))}function gc(e,t,i,n,o,a,u){a+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;hu.depthLimit){cs(kl,e,t,o);return}if(typeof u.edgesLimit<"u"&&i+1>u.edgesLimit){cs(kl,e,t,o);return}if(n.push(e),Array.isArray(e))for(h=0;ht?1:0}function Tm(e,t,i,n){typeof n>"u"&&(n=Cm());var o=yc(e,"",0,[],void 0,0,n)||e,a;try{wn.length===0?a=JSON.stringify(o,t,i):a=JSON.stringify(o,Em(t),i)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Sn.length!==0;){var u=Sn.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function yc(e,t,i,n,o,a,u){a+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;hu.depthLimit){cs(kl,e,t,o);return}if(typeof u.edgesLimit<"u"&&i+1>u.edgesLimit){cs(kl,e,t,o);return}if(n.push(e),Array.isArray(e))for(h=0;h0)for(var n=0;n */var Zw=Xw;function Xw(e){if(navigator.clipboard)return navigator.clipboard.writeText(e).catch(function(a){throw a!==void 0?a:new DOMException("The request is not allowed","NotAllowedError")});var t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);var i=window.getSelection(),n=window.document.createRange();i.removeAllRanges(),n.selectNode(t),i.addRange(n);var o=!1;try{o=window.document.execCommand("copy")}catch(a){console.log("error",a)}return i.removeAllRanges(),window.document.body.removeChild(t),o?Promise.resolve():Promise.reject(new DOMException("The request is not allowed","NotAllowedError"))}var qw=Sm,e1=Zw;function t1(e){try{return JSON.stringify(e)}catch{}}function r1(e){var t=t1(e)||qw(e);e1(t)}var i1=r1,n1=s1;function s1(e,t){return arguments.length>=2?Jd(e)(t):Jd(e)}function Jd(e){if(e=typeof e=="string"?String(e).trim().split("."):e,e.length<2)return e=e[0],i;var t=e.length;return n;function i(o){return o[e]}function n(o){for(var a=0;a"u");a++)o=o[e[a]];return o}}var o1=i1,a1=n1,l1=u1;function u1(e){var t=e&&typeof e=="string",i=t&&arguments.length===1&&e.indexOf("state.")===0;(!e||typeof e=="function")&&(e=window.choo.state),i&&[].push.call(arguments,{state:window.choo.state}),o1(t?a1.apply(this,arguments):e)}var f1=c1;function c1(){Object.defineProperty(window.choo,"help",{get:e,set:h1});function e(){return setTimeout(function(){Hr("copy","Serialize the current state to the clipboard."),Hr("debug","Enable Choo debug mode."),Hr("emit","Emit an event in the Choo emitter."),Hr("help","Print usage information."),Hr("log","Print the last 150 events emitted."),Hr("on","Listen for an event in the Choo emitter."),Hr("once","Listen for an event once in the Choo emitter."),Hr("perf","Print out performance metrics"),Hr("state","Print the Choo state object."),Hr("storage","Print browser storage information.")},0),"Choo command overview"}}function Hr(e,t){var i="#cc99cc";console.log(" %cchoo."+e,"color: "+i,"— "+t)}function h1(){}var p1=xm,d1="█",g1=y1;function y1(e,t,i,n){var o={};window.choo.perf={};var a=new Eo(o,"all");Object.defineProperty(window.choo.perf,"all",{get:a.get.bind(a),set:Ya});var u=new Eo(o,"core",function(m){return/^choo/.test(m)});Object.defineProperty(window.choo.perf,"core",{get:u.get.bind(u),set:Ya});var h=new Eo(o,"components",function(m){return!/^choo/.test(m)&&!/^bankai/.test(m)});Object.defineProperty(window.choo.perf,"components",{get:h.get.bind(h),set:Ya});var p=new Eo(o,"events",function(m){return/^choo\.emit/.test(m)},function(m){return m.replace(/^choo\.emit\('/,"").replace(/'\)$/,"")});Object.defineProperty(window.choo.perf,"events",{get:p.get.bind(p),set:Ya}),p1(function(m){if(m.entryType==="measure"){var _=m.name.replace(/ .*$/,"");o[_]||(o[_]={name:_,count:0,entries:[]});var y=o[_];y.count+=1,y.entries.push(m.duration)}})}function Eo(e,t,i,n){this.stats=e,this.name=t,this.filter=i||function(){return!0},this.rename=n||function(o){return o}}Eo.prototype.get=function(){var e=Object.keys(this.stats).filter(this.filter),t=this,i=0,n=0,o=e.map(function(p){var m=t.stats[p],_=Number(m.entries.reduce(function(x,U){return x+U},0).toFixed(2));_>i&&(i=_);var y=v1(m.entries);y>n&&(n=y);var v=t.rename(m.name);return new m1(v,_,y,m.count)}),a=10;o.forEach(function(p){var m=p["Total Time (ms)"],_=p["Median (ms)"];p[" "]=u(m/i*100/a),p[" "]=u(_/n*100/a)});function u(p){for(var m="",_=0,y=Math.round(p);_=o||i<=0||t<0)){i=t+i>o?o-t:i;var a=o-i;for(n=t;n"u"&&(x=!0),typeof U>"u"&&(U=1/0);function O(P,F){if(P===null)return null;if(F===0)return P;var V,D;if(typeof P!="object")return P;if(i(P,n))V=new n;else if(i(P,o))V=new o;else if(i(P,a))V=new a(function(K,X){P.then(function(fe){K(O(fe,F-1))},function(fe){X(O(fe,F-1))})});else if(u.__isArray(P))V=[];else if(u.__isRegExp(P))V=new RegExp(P.source,y(P)),P.lastIndex&&(V.lastIndex=P.lastIndex);else if(u.__isDate(P))V=new Date(P.getTime());else{if(G&&Buffer.isBuffer(P))return Buffer.allocUnsafe?V=Buffer.allocUnsafe(P.length):V=new Buffer(P.length),P.copy(V),V;i(P,Error)?V=Object.create(P):typeof R>"u"?(D=Object.getPrototypeOf(P),V=Object.create(D)):(V=Object.create(R),D=R)}if(x){var ee=g.indexOf(P);if(ee!=-1)return L[ee];g.push(P),L.push(V)}i(P,n)&&P.forEach(function(K,X){var fe=O(X,F-1),Me=O(K,F-1);V.set(fe,Me)}),i(P,o)&&P.forEach(function(K){var X=O(K,F-1);V.add(X)});for(var A in P){var q;D&&(q=Object.getOwnPropertyDescriptor(D,A)),!(q&&q.set==null)&&(V[A]=O(P[A],F-1))}if(Object.getOwnPropertySymbols)for(var Z=Object.getOwnPropertySymbols(P),A=0;Aaf&&S1(a,0,U-af)})});function p(){setTimeout(function(){console.table(a)},0);var y=u===1?"event":"events",v=u+" "+y+" recorded, showing the last "+af+".";return o===!1?v+=" Enable state capture by calling `choo.debug`.":v+=" Disable state capture by calling `choo.debug = false`.",v}function m(y,v,x){this.name=y,this.data=v===void 0?"":v,this.state=o?_(x):""}function _(y){try{var v=E1(y);return h||(h=!0),v}catch{return h&&(T1.warn("Could not clone your app state. Make sure to have a serializable state so it can be cloned"),h=!1),""}}}function Od(){}var Bd=ur,R1=L1,km=function(e,t){var i=t||"/",n={},o=e.nodes;return Object.keys(o).forEach(function(a){var u=(i==="/"?i:i+"/")+(a==="$$"?":"+e.name:a),h=o[a].cb;if(h!==void 0&&(n[u]=h),Object.keys(o[a].nodes).length!==0){var p=km(o[a],u);Object.keys(p).forEach(function(m){n[m]=p[m]})}}),n};function L1(e){Bd.equal(typeof e,"function","wayfarer.getAllRoutes: router should be an function");var t=e._trie;Bd.equal(typeof t,"object","wayfarer.getAllRoutes: trie should be an object");var i=t.trie;return km(i)}var U1=Ql.EventEmitter,I1=iw,J1=jw,N1=Yw,O1=l1,B1=f1,F1=g1,D1=k1,j1=R1,P1=G1;function G1(e){return e=e||{},t.storeName="choo-devtools",t;function t(i,n,o){var a=new U1;typeof window<"u"&&J1(i,n,e),n.on("DOMContentLoaded",function(){typeof window>"u"||(window.choo={},window.choo.state=i,window.choo.emit=function(){n.emit.apply(n,arguments)},window.choo.on=function(u,h){n.on(u,h)},N1(i,n,o,a),D1(i,n,o,a),F1(),window.choo.copy=O1,o.router&&o.router.router&&(window.choo.routes=Object.keys(j1(o.router.router))),I1(),B1())})}}const W1=gr(P1);var K1=V1;function V1(e,t){if(e)try{var i=document.querySelector(e);i&&i.scrollIntoView(t)}catch{}}var z1=Q1;function Q1(e){if(typeof document>"u")throw new Error("document-ready only runs in the browser");var t=document.readyState;if(t==="complete"||t==="interactive")return setTimeout(e,0);document.addEventListener("DOMContentLoaded",function(){e()})}var Am=ra(),Y1=ur,Fi;Hl.disabled=!0;try{Fi=window.performance,Hl.disabled=window.localStorage.DISABLE_NANOTIMING==="true"||!Fi.mark}catch{}var oh=Hl;function Hl(e){if(Y1.equal(typeof e,"string","nanotiming: name should be type string"),Hl.disabled)return H1;var t=(Fi.now()*1e4).toFixed()%Number.MAX_SAFE_INTEGER,i="start-"+t+"-"+e;Fi.mark(i);function n(o){var a="end-"+t+"-"+e;Fi.mark(a),Am.push(function(){var u=null;try{var h=e+" ["+t+"]";Fi.measure(h,i,a),Fi.clearMarks(i),Fi.clearMarks(a)}catch(p){u=p}o&&o(u,e)})}return n.uuid=t,n}function H1(e){e&&Am.push(function(){e(new Error("nanotiming: performance API unavailable"))})}var Al=ur,$1=ys;function ys(){if(!(this instanceof ys))return new ys;this.trie={nodes:{}}}ys.prototype.create=function(e){Al.equal(typeof e,"string","route should be a string");var t=e.replace(/^\//,"").split("/");function i(n,o){var a=bl(t,n)&&t[n];if(a===!1)return o;var u=null;return/^:|^\*/.test(a)?(bl(o.nodes,"$$")?u=o.nodes.$$:(u={nodes:{}},o.nodes.$$=u),a[0]==="*"&&(o.wildcard=!0),o.name=a.replace(/^:|^\*/,"")):bl(o.nodes,a)?u=o.nodes[a]:(u={nodes:{}},o.nodes[a]=u),i(n+1,u)}return i(0,this.trie)};ys.prototype.match=function(e){Al.equal(typeof e,"string","route should be a string");var t=e.replace(/^\//,"").split("/"),i={};function n(a,u){if(u!==void 0){var h=t[a];if(h===void 0)return u;if(bl(u.nodes,h))return n(a+1,u.nodes[h]);if(u.name){try{i[u.name]=decodeURIComponent(h)}catch{return n(a,void 0)}return n(a+1,u.nodes.$$)}else if(u.wildcard){try{i.wildcard=decodeURIComponent(t.slice(a).join("/"))}catch{return n(a,void 0)}return u.nodes.$$}else return n(a+1)}}var o=n(0,this.trie);if(o)return o=Object.assign({},o),o.params=i,o};ys.prototype.mount=function(e,t){Al.equal(typeof e,"string","route should be a string"),Al.equal(typeof t,"object","trie should be a object");var i=e.replace(/^\//,"").split("/"),n=null,o=null;if(i.length===1)o=i[0],n=this.create(o);else{var a=i.join("/");o=i[0],n=this.create(a)}Object.assign(n.nodes,t.nodes),t.name&&(n.name=t.name),n.nodes[""]&&(Object.keys(n.nodes[""]).forEach(function(u){u!=="nodes"&&(n[u]=n.nodes[""][u])}),Object.assign(n.nodes,n.nodes[""].nodes),delete n.nodes[""].nodes)};function bl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var lf=ur,Z1=$1,X1=mc;function mc(e){if(!(this instanceof mc))return new mc(e);var t=(e||"").replace(/^\//,""),i=Z1();return o._trie=i,o.on=n,o.emit=o,o.match=a,o._wayfarer=!0,o;function n(h,p){if(lf.equal(typeof h,"string"),lf.equal(typeof p,"function"),h=h||"/",p._wayfarer&&p._trie)i.mount(h,p._trie.trie);else{var m=i.create(h);m.cb=p,m.route=h}return o}function o(h){var p=a(h),m=new Array(arguments.length);m[0]=p.params;for(var _=1;_=0;--m)p=n[m],h=p.name,o=p.namespaceURI,a=p.value,o?(h=p.localName||h,u=t.getAttributeNS(o,h),u!==a&&t.setAttributeNS(o,h,a)):t.hasAttribute(h)?(u=t.getAttribute(h),u!==a&&(a==="null"||a==="undefined"?t.removeAttribute(h):t.setAttribute(h,a))):t.setAttribute(h,a);for(var _=i.length-1;_>=0;--_)p=i[_],p.specified!==!1&&(h=p.name,o=p.namespaceURI,o?(h=p.localName||h,e.hasAttributeNS(o,h)||t.removeAttributeNS(o,h)):e.hasAttributeNS(null,h)||t.removeAttribute(h))}function mb(e,t){for(var i=0;i"u","nanoraf: raf should be a function or undefined"),t||(t=window.requestAnimationFrame);var i=!1,n=null;return function(){n===null&&!i&&(i=!0,t(function(){i=!1;for(var u=n.length,h=new Array(u),p=0;p=a||n===0)){n=i+n>a?a-i:n;var u=a-n;for(o=i;o0&&this._emit(this._listeners[e],t),this._starListeners.length>0&&this._emit(this._starListeners,e,t,o.uuid),o(),this};dr.prototype.on=dr.prototype.addListener=function(e,t){return Pr.ok(typeof e=="string"||typeof e=="symbol","nanobus.on: eventName should be type string or symbol"),Pr.equal(typeof t,"function","nanobus.on: listener should be type function"),e==="*"?this._starListeners.push(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)),this};dr.prototype.prependListener=function(e,t){return Pr.ok(typeof e=="string"||typeof e=="symbol","nanobus.prependListener: eventName should be type string or symbol"),Pr.equal(typeof t,"function","nanobus.prependListener: listener should be type function"),e==="*"?this._starListeners.unshift(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].unshift(t)),this};dr.prototype.once=function(e,t){Pr.ok(typeof e=="string"||typeof e=="symbol","nanobus.once: eventName should be type string or symbol"),Pr.equal(typeof t,"function","nanobus.once: listener should be type function");var i=this;this.on(e,n);function n(){t.apply(i,arguments),i.removeListener(e,n)}return this};dr.prototype.prependOnceListener=function(e,t){Pr.ok(typeof e=="string"||typeof e=="symbol","nanobus.prependOnceListener: eventName should be type string or symbol"),Pr.equal(typeof t,"function","nanobus.prependOnceListener: listener should be type function");var i=this;this.prependListener(e,n);function n(){t.apply(i,arguments),i.removeListener(e,n)}return this};dr.prototype.removeListener=function(e,t){if(Pr.ok(typeof e=="string"||typeof e=="symbol","nanobus.removeListener: eventName should be type string or symbol"),Pr.equal(typeof t,"function","nanobus.removeListener: listener should be type function"),e==="*")return this._starListeners=this._starListeners.slice(),i(this._starListeners,t);return typeof this._listeners[e]<"u"&&(this._listeners[e]=this._listeners[e].slice()),i(this._listeners[e],t);function i(n,o){if(n){var a=n.indexOf(o);if(a!==-1)return Nb(n,a,1),!0}}};dr.prototype.removeAllListeners=function(e){return e?e==="*"?this._starListeners=[]:this._listeners[e]=[]:(this._starListeners=[],this._listeners={}),this};dr.prototype.listeners=function(e){var t=e!=="*"?this._listeners[e]:this._starListeners,i=[];if(t)for(var n=t.length,o=0;o"u")&&e.length!==0){i===void 0&&(i=t,t=null),t&&(n!==void 0?i=[t].concat(i,n):i=[t].concat(i));for(var o=e.length,a=0;athis.maxAge?(this.remove(e),!1):!0};Sr.prototype.get=function(e){if(typeof e!="string"&&(e=""+e),!!this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}};Sr.prototype.evict=function(){this.tail&&this.remove(this.tail)};var Io=ur,Pd=Fb,Db=lh;function lh(e,t,i){Io.ok(this instanceof lh,"ChooComponentCache should be created with `new`"),Io.equal(typeof e,"object","ChooComponentCache: state should be type object"),Io.equal(typeof t,"function","ChooComponentCache: emit should be type function"),typeof i=="number"?this.cache=new Pd(i):this.cache=i||new Pd(100),this.state=e,this.emit=t}lh.prototype.render=function(e,t){Io.equal(typeof e,"function","ChooComponentCache.render: Component should be type function"),Io.ok(typeof t=="string"||typeof t=="number","ChooComponentCache.render: id should be type string or type number");var i=this.cache.get(t);if(!i){for(var n=[],o=2,a=arguments.length;o is not the same type as the new node <"+n.nodeName.toLowerCase()+">.");var o=ri("choo.morph");Bm(t._tree,n),o(),i()})),Om(function(){t.emitter.emit(t._events.DOMCONTENTLOADED),t._loaded=!0}),e(),this._tree};Gr.prototype.mount=function(t){var i=ri("choo.mount('"+t+"')");if(typeof window!="object")return kt.ok(typeof t=="string","choo.mount: selector should be type String"),this.selector=t,i(),this;kt.ok(typeof t=="string"||typeof t=="object","choo.mount: selector should be type String or HTMLElement");var n=this;Om(function(){var o=ri("choo.render"),a=n.start();typeof t=="string"?n._tree=document.querySelector(t):n._tree=t,kt.ok(n._tree,"choo.mount: could not query selector: "+t),kt.equal(n._tree.nodeName,a.nodeName,"choo.mount: The target node <"+n._tree.nodeName.toLowerCase()+"> is not the same type as the new node <"+a.nodeName.toLowerCase()+">.");var u=ri("choo.morph");Bm(n._tree,a),u(),o()}),i()};Gr.prototype.toString=function(e,t){t=t||{},t.components=t.components||{},t.events=Object.assign({},t.events,this._events),kt.notEqual(typeof window,"object","choo.mount: window was found. .toString() must be called in Node, use .start() or .mount() if running in the browser"),kt.equal(typeof e,"string","choo.toString: location should be type string"),kt.equal(typeof t,"object","choo.toString: state should be type object"),this._setCache(t),this._matchRoute(t,e),this.emitter.removeAllListeners(),this._stores.forEach(function(n){n(t)});var i=this._prerender(t);return kt.ok(i,"choo.toString: no valid value returned for the route "+e),kt(!Array.isArray(i),"choo.toString: return value was an array for the route "+e),typeof i.outerHTML=="string"?i.outerHTML:i.toString()};Gr.prototype._matchRoute=function(e,t){var i,n;t?(i=t.replace(/\?.+$/,"").replace(/\/$/,""),this._hashEnabled||(i=i.replace(/#.+$/,"")),n=t):(i=window.location.pathname.replace(/\/$/,""),this._hashEnabled&&(i+=window.location.hash.replace(/^#/,"/")),n=window.location.search);var o=this.router.match(i);this._handler=o.cb,e.href=i,e.query=Pb(n),e.route=o.route,e.params=o.params};Gr.prototype._prerender=function(e){var t=ri("choo.prerender('"+e.route+"')"),i=this._handler(e,this.emit);return t(),i};Gr.prototype._setCache=function(e){var t=new Vb(e,this.emitter.emit.bind(this.emitter),this._cache);e.cache=i;function i(n,o){kt.equal(typeof n,"function","choo.state.cache: Component should be type function");for(var a=[],u=0,h=arguments.length;u{ii=e},Sl=(e,t="")=>{console.log("logging",e,t),ii&&(ii.innerHTML=` >> ${e} `)},Hb=()=>{ii&&(ii.style.display="none")},$b=()=>{ii&&(ii.style.display="block")},Zb=()=>{ii.style.display=="none"?ii.style.display="block":ii.style.display="none"},Xb={init:Yb,log:Sl,hide:Hb,show:$b,toggle:Zb},_c={eval:(e,t)=>{var i=`(async() => { - ${e} -})().catch(${o=>Sl(o.message,"log-error")})`,n=!1;try{window.eval(i),Sl("")}catch(o){n=!0,console.log("logging",o),Sl(o.message,"log-error")}t&&t(i,n)}};function qb(e,t){e.showInfo=!1,e.showUI=!0,e.showExtensions=!1;const i="https://api.hydrasynth.xyz";e.serverURL=i,t.on("load and eval code",(o,a=!0)=>{t.emit("editor: load code",o),t.emit("repl: eval",o),a&&t.emit("gallery: save to URL",o)}),t.on("repl: eval",(o="",a)=>{_c.eval(o,a)}),t.on("screencap",()=>{screencap();const a=e.editor.editor.getValue(),u=new Blob([a],{type:"text/plain"}),h=document.createElement("a");h.style.display="none";let p=new Date;h.download=`hydra-${p.getFullYear()}-${p.getMonth()+1}-${p.getDate()}-${p.getHours()}.${p.getMinutes()}.${p.getSeconds()}.js`,h.href=URL.createObjectURL(u),h.click(),setTimeout(()=>{window.URL.revokeObjectURL(h.href)},300)});function n(){const o=e.editor.editor;hush(),speed=1,t.emit("gallery: clear"),o.clear()}t.on("clear all",()=>{n()}),t.on("ui: hide all",function(){e.showUI=!e.showUI,t.emit("render")}),t.on("ui: toggle info",function(o){e.showInfo?t.emit("ui: hide info"):t.emit("ui: show info")}),t.on("ui: show info",()=>{e.showInfo=!0,t.emit("render")}),t.on("ui: hide info",()=>{e.showInfo=!1,e.showExtensions=!1,t.emit("render")}),t.on("ui: show extensions",()=>{e.showExtensions=!0,e.showInfo=!0,t.emit("extensions: select category"),t.emit("render")}),t.on("ui: hide extensions",()=>{e.showExtensions=!1,t.emit("render")})}function jr(e){"@babel/helpers - typeof";return jr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jr(e)}function Wr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ex(e,t){if(jr(e)!=="object"||e===null)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var n=i.call(e,t||"default");if(jr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fm(e){var t=ex(e,"string");return jr(t)==="symbol"?t:String(t)}function Vd(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i1&&arguments[1]!==void 0?arguments[1]:{};Wr(this,e),this.init(t,i)}return Kr(e,[{key:"init",value:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=i||ox,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(i){this.debug=i}},{key:"log",value:function(){for(var i=arguments.length,n=new Array(i),o=0;o1?n-1:0),a=1;a-1?h.replace(/###/g,"."):h}function o(){return!e||typeof e=="string"}for(var a=typeof t!="string"?[].concat(t):t.split(".");a.length>1;){if(o())return{};var u=n(a.shift());!e[u]&&i&&(e[u]=new i),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={}}return o()?{}:{obj:e,k:n(a.shift())}}function $d(e,t,i){var n=uh(e,t,Object),o=n.obj,a=n.k;o[a]=i}function ux(e,t,i,n){var o=uh(e,t,Object),a=o.obj,u=o.k;a[u]=a[u]||[],n&&(a[u]=a[u].concat(i)),n||a[u].push(i)}function Rl(e,t){var i=uh(e,t),n=i.obj,o=i.k;if(n)return n[o]}function Zd(e,t,i){var n=Rl(e,i);return n!==void 0?n:Rl(t,i)}function Dm(e,t,i){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?i&&(e[n]=t[n]):Dm(e[n],t[n],i):e[n]=t[n]);return e}function Zn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var fx={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function cx(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return fx[t]}):e}var Zl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,hx=[" ",",","?","!",";"];function px(e,t,i){t=t||"",i=i||"";var n=hx.filter(function(h){return t.indexOf(h)<0&&i.indexOf(h)<0});if(n.length===0)return!0;var o=new RegExp("(".concat(n.map(function(h){return h==="?"?"\\?":h}).join("|"),")")),a=!o.test(e);if(!a){var u=e.indexOf(i);u>0&&!o.test(e.substring(0,u))&&(a=!0)}return a}function Xd(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function Ha(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jm(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(i),o=e,a=0;aa+u;)u++,h=n.slice(a,a+u).join(i),p=o[h];if(p===void 0)return;if(p===null)return null;if(t.endsWith(h)){if(typeof p=="string")return p;if(h&&typeof p[h]=="string")return p[h]}var m=n.slice(a+u).join(i);return m?jm(p,m,i):void 0}o=o[n[a]]}return o}}var yx=function(e){$l(i,e);var t=dx(i);function i(n){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Wr(this,i),o=t.call(this),Zl&&Yi.call(Qi(o)),o.data=n||{},o.options=a,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return Kr(i,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var a=this.options.ns.indexOf(o);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(o,a,u){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},p=h.keySeparator!==void 0?h.keySeparator:this.options.keySeparator,m=h.ignoreJSONStructure!==void 0?h.ignoreJSONStructure:this.options.ignoreJSONStructure,_=[o,a];u&&typeof u!="string"&&(_=_.concat(u)),u&&typeof u=="string"&&(_=_.concat(p?u.split(p):u)),o.indexOf(".")>-1&&(_=o.split("."));var y=Rl(this.data,_);return y||!m||typeof u!="string"?y:jm(this.data&&this.data[o]&&this.data[o][a],u,p)}},{key:"addResource",value:function(o,a,u,h){var p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},m=this.options.keySeparator;m===void 0&&(m=".");var _=[o,a];u&&(_=_.concat(m?u.split(m):u)),o.indexOf(".")>-1&&(_=o.split("."),h=a,a=_[1]),this.addNamespaces(a),$d(this.data,_,h),p.silent||this.emit("added",o,a,u,h)}},{key:"addResources",value:function(o,a,u){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var p in u)(typeof u[p]=="string"||Object.prototype.toString.apply(u[p])==="[object Array]")&&this.addResource(o,a,p,u[p],{silent:!0});h.silent||this.emit("added",o,a,u)}},{key:"addResourceBundle",value:function(o,a,u,h,p){var m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},_=[o,a];o.indexOf(".")>-1&&(_=o.split("."),h=u,u=a,a=_[1]),this.addNamespaces(a);var y=Rl(this.data,_)||{};h?Dm(y,u,p):y=Ha(Ha({},y),u),$d(this.data,_,y),m.silent||this.emit("added",o,a,u)}},{key:"removeResourceBundle",value:function(o,a){this.hasResourceBundle(o,a)&&delete this.data[o][a],this.removeNamespaces(a),this.emit("removed",o,a)}},{key:"hasResourceBundle",value:function(o,a){return this.getResource(o,a)!==void 0}},{key:"getResourceBundle",value:function(o,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ha(Ha({},{}),this.getResource(o,a)):this.getResource(o,a)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var a=this.getDataByLanguage(o),u=a&&Object.keys(a)||[];return!!u.find(function(h){return a[h]&&Object.keys(a[h]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),i}(Yi),Pm={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,i,n,o,a){var u=this;return t.forEach(function(h){u.processors[h]&&(i=u.processors[h].process(i,n,o,a))}),i}};function qd(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function qt(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var eg={},tg=function(e){$l(i,e);var t=mx(i);function i(n){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Wr(this,i),o=t.call(this),Zl&&Yi.call(Qi(o)),lx(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,Qi(o)),o.options=a,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=ti.create("translator"),o}return Kr(i,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var u=this.resolve(o,a);return u&&u.res!==void 0}},{key:"extractFromKey",value:function(o,a){var u=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");var h=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,p=a.ns||this.options.defaultNS||[],m=u&&o.indexOf(u)>-1,_=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!px(o,u,h);if(m&&!_){var y=o.match(this.interpolator.nestingRegexp);if(y&&y.length>0)return{key:o,namespaces:p};var v=o.split(u);(u!==h||u===h&&this.options.ns.indexOf(v[0])>-1)&&(p=v.shift()),o=v.join(h)}return typeof p=="string"&&(p=[p]),{key:o,namespaces:p}}},{key:"translate",value:function(o,a,u){var h=this;if(jr(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var p=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,m=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,_=this.extractFromKey(o[o.length-1],a),y=_.key,v=_.namespaces,x=v[v.length-1],U=a.lng||this.language,R=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(U&&U.toLowerCase()==="cimode"){if(R){var S=a.nsSeparator||this.options.nsSeparator;return p?(g.res="".concat(x).concat(S).concat(y),g):"".concat(x).concat(S).concat(y)}return p?(g.res=y,g):y}var g=this.resolve(o,a),L=g&&g.res,G=g&&g.usedKey||y,O=g&&g.exactUsedKey||y,P=Object.prototype.toString.apply(L),F=["[object Number]","[object Function]","[object RegExp]"],V=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,ee=typeof L!="string"&&typeof L!="boolean"&&typeof L!="number";if(D&&L&&ee&&F.indexOf(P)<0&&!(typeof V=="string"&&P==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(G,L,qt(qt({},a),{},{ns:v})):"key '".concat(y," (").concat(this.language,")' returned an object instead of string.");return p?(g.res=A,g):A}if(m){var q=P==="[object Array]",Z=q?[]:{},ce=q?O:G;for(var ye in L)if(Object.prototype.hasOwnProperty.call(L,ye)){var ie="".concat(ce).concat(m).concat(ye);Z[ye]=this.translate(ie,qt(qt({},a),{joinArrays:!1,ns:v})),Z[ye]===ie&&(Z[ye]=L[ye])}L=Z}}else if(D&&typeof V=="string"&&P==="[object Array]")L=L.join(V),L&&(L=this.extendTranslation(L,o,a,u));else{var re=!1,K=!1,X=a.count!==void 0&&typeof a.count!="string",fe=i.hasDefaultValue(a),Me=X?this.pluralResolver.getSuffix(U,a.count,a):"",we=a["defaultValue".concat(Me)]||a.defaultValue;!this.isValidLookup(L)&&fe&&(re=!0,L=we),this.isValidLookup(L)||(K=!0,L=y);var Re=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,ke=Re&&K?void 0:L,Ie=fe&&we!==L&&this.options.updateMissing;if(K||re||Ie){if(this.logger.log(Ie?"updateKey":"missingKey",U,x,y,Ie?we:L),m){var ze=this.resolve(y,qt(qt({},a),{},{keySeparator:!1}));ze&&ze.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var le=[],ue=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ue&&ue[0])for(var xe=0;xe1&&arguments[1]!==void 0?arguments[1]:{},h,p,m,_,y;return typeof o=="string"&&(o=[o]),o.forEach(function(v){if(!a.isValidLookup(h)){var x=a.extractFromKey(v,u),U=x.key;p=U;var R=x.namespaces;a.options.fallbackNS&&(R=R.concat(a.options.fallbackNS));var S=u.count!==void 0&&typeof u.count!="string",g=S&&!u.ordinal&&u.count===0&&a.pluralResolver.shouldUseIntlApi(),L=u.context!==void 0&&(typeof u.context=="string"||typeof u.context=="number")&&u.context!=="",G=u.lngs?u.lngs:a.languageUtils.toResolveHierarchy(u.lng||a.language,u.fallbackLng);R.forEach(function(O){a.isValidLookup(h)||(y=O,!eg["".concat(G[0],"-").concat(O)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(y)&&(eg["".concat(G[0],"-").concat(O)]=!0,a.logger.warn('key "'.concat(p,'" for languages "').concat(G.join(", "),`" won't get resolved as namespace "`).concat(y,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),G.forEach(function(P){if(!a.isValidLookup(h)){_=P;var F=[U];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(F,U,P,O,u);else{var V;S&&(V=a.pluralResolver.getSuffix(P,u.count,u));var D="".concat(a.options.pluralSeparator,"zero");if(S&&(F.push(U+V),g&&F.push(U+D)),L){var ee="".concat(U).concat(a.options.contextSeparator).concat(u.context);F.push(ee),S&&(F.push(ee+V),g&&F.push(ee+D))}}for(var A;A=F.pop();)a.isValidLookup(h)||(m=A,h=a.getResource(P,O,A,u))}}))})}}),{res:h,usedKey:p,exactUsedKey:m,usedLng:_,usedNS:y}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,a,u){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,a,u,h):this.resourceStore.getResource(o,a,u,h)}}],[{key:"hasDefaultValue",value:function(o){var a="defaultValue";for(var u in o)if(Object.prototype.hasOwnProperty.call(o,u)&&a===u.substring(0,a.length)&&o[u]!==void 0)return!0;return!1}}]),i}(Yi);function cf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _x=function(){function e(t){Wr(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ti.create("languageUtils")}return Kr(e,[{key:"getScriptPartFromCode",value:function(i){if(!i||i.indexOf("-")<0)return null;var n=i.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(i){if(!i||i.indexOf("-")<0)return i;var n=i.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(i){if(typeof i=="string"&&i.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],o=i.split("-");return this.options.lowerCaseLng?o=o.map(function(a){return a.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=cf(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=cf(o[1].toLowerCase())),n.indexOf(o[2].toLowerCase())>-1&&(o[2]=cf(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}},{key:"isSupportedCode",value:function(i){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(i)>-1}},{key:"getBestMatchFromCodes",value:function(i){var n=this;if(!i)return null;var o;return i.forEach(function(a){if(!o){var u=n.formatLanguageCode(a);(!n.options.supportedLngs||n.isSupportedCode(u))&&(o=u)}}),!o&&this.options.supportedLngs&&i.forEach(function(a){if(!o){var u=n.getLanguagePartFromCode(a);if(n.isSupportedCode(u))return o=u;o=n.options.supportedLngs.find(function(h){if(h.indexOf(u)===0)return h})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(i,n){if(!i)return[];if(typeof i=="function"&&(i=i(n)),typeof i=="string"&&(i=[i]),Object.prototype.toString.apply(i)==="[object Array]")return i;if(!n)return i.default||[];var o=i[n];return o||(o=i[this.getScriptPartFromCode(n)]),o||(o=i[this.formatLanguageCode(n)]),o||(o=i[this.getLanguagePartFromCode(n)]),o||(o=i.default),o||[]}},{key:"toResolveHierarchy",value:function(i,n){var o=this,a=this.getFallbackCodes(n||this.options.fallbackLng||[],i),u=[],h=function(m){m&&(o.isSupportedCode(m)?u.push(m):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(m)))};return typeof i=="string"&&i.indexOf("-")>-1?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(i)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(i)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(i))):typeof i=="string"&&h(this.formatLanguageCode(i)),a.forEach(function(p){u.indexOf(p)<0&&h(o.formatLanguageCode(p))}),u}}]),e}(),wx=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],bx={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},xx=["v1","v2","v3"],rg={zero:0,one:1,two:2,few:3,many:4,other:5};function Sx(){var e={};return wx.forEach(function(t){t.lngs.forEach(function(i){e[i]={numbers:t.nr,plurals:bx[t.fc]}})}),e}var Mx=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Wr(this,e),this.languageUtils=t,this.options=i,this.logger=ti.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Sx()}return Kr(e,[{key:"addRule",value:function(i,n){this.rules[i]=n}},{key:"getRule",value:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(i,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[i]||this.rules[this.languageUtils.getLanguagePartFromCode(i)]}},{key:"needsPlural",value:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(i,n);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(i,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(i,o).map(function(a){return"".concat(n).concat(a)})}},{key:"getSuffixes",value:function(i){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(i,o);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(u,h){return rg[u]-rg[h]}).map(function(u){return"".concat(n.options.prepend).concat(u)}):a.numbers.map(function(u){return n.getSuffix(i,u,o)}):[]}},{key:"getSuffix",value:function(i,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(i,o);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(n)):this.getSuffixRetroCompatible(a,n):(this.logger.warn("no plural rule found for: ".concat(i)),"")}},{key:"getSuffixRetroCompatible",value:function(i,n){var o=this,a=i.noAbs?i.plurals(n):i.plurals(Math.abs(n)),u=i.numbers[a];this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1&&(u===2?u="plural":u===1&&(u=""));var h=function(){return o.options.prepend&&u.toString()?o.options.prepend+u.toString():u.toString()};return this.options.compatibilityJSON==="v1"?u===1?"":typeof u=="number"?"_plural_".concat(u.toString()):h():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1?h():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!xx.includes(this.options.compatibilityJSON)}}]),e}();function ig(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function Ir(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Wr(this,e),this.logger=ti.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(i){return i},this.init(t)}return Kr(e,[{key:"init",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i.interpolation||(i.interpolation={escapeValue:!0});var n=i.interpolation;this.escape=n.escape!==void 0?n.escape:cx,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Zn(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Zn(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Zn(n.nestingPrefix):n.nestingPrefixEscaped||Zn("$t("),this.nestingSuffix=n.nestingSuffix?Zn(n.nestingSuffix):n.nestingSuffixEscaped||Zn(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var i="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(i,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(i,n,o,a){var u=this,h,p,m,_=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function y(S){return S.replace(/\$/g,"$$$$")}var v=function(g){if(g.indexOf(u.formatSeparator)<0){var L=Zd(n,_,g);return u.alwaysFormat?u.format(L,void 0,o,Ir(Ir(Ir({},a),n),{},{interpolationkey:g})):L}var G=g.split(u.formatSeparator),O=G.shift().trim(),P=G.join(u.formatSeparator).trim();return u.format(Zd(n,_,O),P,o,Ir(Ir(Ir({},a),n),{},{interpolationkey:O}))};this.resetRegExp();var x=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,U=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,R=[{regex:this.regexpUnescape,safeValue:function(g){return y(g)}},{regex:this.regexp,safeValue:function(g){return u.escapeValue?y(u.escape(g)):y(g)}}];return R.forEach(function(S){for(m=0;h=S.regex.exec(i);){var g=h[1].trim();if(p=v(g),p===void 0)if(typeof x=="function"){var L=x(i,h,a);p=typeof L=="string"?L:""}else if(a&&a.hasOwnProperty(g))p="";else if(U){p=h[0];continue}else u.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(i)),p="";else typeof p!="string"&&!u.useRawValueToEscape&&(p=Hd(p));var G=S.safeValue(p);if(i=i.replace(h[0],G),U?(S.regex.lastIndex+=p.length,S.regex.lastIndex-=h[0].length):S.regex.lastIndex=0,m++,m>=u.maxReplaces)break}}),i}},{key:"nest",value:function(i,n){var o=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u,h,p=Ir({},a);p.applyPostProcessor=!1,delete p.defaultValue;function m(x,U){var R=this.nestingOptionsSeparator;if(x.indexOf(R)<0)return x;var S=x.split(new RegExp("".concat(R,"[ ]*{"))),g="{".concat(S[1]);x=S[0],g=this.interpolate(g,p);var L=g.match(/'/g),G=g.match(/"/g);(L&&L.length%2===0&&!G||G.length%2!==0)&&(g=g.replace(/'/g,'"'));try{p=JSON.parse(g),U&&(p=Ir(Ir({},U),p))}catch(O){return this.logger.warn("failed parsing options string in nesting for key ".concat(x),O),"".concat(x).concat(R).concat(g)}return delete p.defaultValue,x}for(;u=this.nestingRegexp.exec(i);){var _=[],y=!1;if(u[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(u[1])){var v=u[1].split(this.formatSeparator).map(function(x){return x.trim()});u[1]=v.shift(),_=v,y=!0}if(h=n(m.call(this,u[1].trim(),p),p),h&&u[0]===i&&typeof h!="string")return h;typeof h!="string"&&(h=Hd(h)),h||(this.logger.warn("missed to resolve ".concat(u[1]," for nesting ").concat(i)),h=""),y&&(h=_.reduce(function(x,U){return o.format(x,U,a.lng,Ir(Ir({},a),{},{interpolationkey:u[1].trim()}))},h.trim())),i=i.replace(u[0],h),this.regexp.lastIndex=0}return i}}]),e}();function ng(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function Oi(e){for(var t=1;t-1){var n=e.split("(");t=n[0].toLowerCase().trim();var o=n[1].substring(0,n[1].length-1);if(t==="currency"&&o.indexOf(":")<0)i.currency||(i.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)i.range||(i.range=o.trim());else{var a=o.split(";");a.forEach(function(u){if(u){var h=u.split(":"),p=sx(h),m=p[0],_=p.slice(1),y=_.join(":").trim().replace(/^'+|'+$/g,"");i[m.trim()]||(i[m.trim()]=y),y==="false"&&(i[m.trim()]=!1),y==="true"&&(i[m.trim()]=!0),isNaN(y)||(i[m.trim()]=parseInt(y,10))}})}}return{formatName:t,formatOptions:i}}function Xn(e){var t={};return function(n,o,a){var u=o+JSON.stringify(a),h=t[u];return h||(h=e(o,a),t[u]=h),h(n)}}var Ex=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wr(this,e),this.logger=ti.create("formatter"),this.options=t,this.formats={number:Xn(function(i,n){var o=new Intl.NumberFormat(i,n);return function(a){return o.format(a)}}),currency:Xn(function(i,n){var o=new Intl.NumberFormat(i,Oi(Oi({},n),{},{style:"currency"}));return function(a){return o.format(a)}}),datetime:Xn(function(i,n){var o=new Intl.DateTimeFormat(i,Oi({},n));return function(a){return o.format(a)}}),relativetime:Xn(function(i,n){var o=new Intl.RelativeTimeFormat(i,Oi({},n));return function(a){return o.format(a,n.range||"day")}}),list:Xn(function(i,n){var o=new Intl.ListFormat(i,Oi({},n));return function(a){return o.format(a)}})},this.init(t)}return Kr(e,[{key:"init",value:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=n.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(i,n){this.formats[i.toLowerCase().trim()]=n}},{key:"addCached",value:function(i,n){this.formats[i.toLowerCase().trim()]=Xn(n)}},{key:"format",value:function(i,n,o,a){var u=this,h=n.split(this.formatSeparator),p=h.reduce(function(m,_){var y=Tx(_),v=y.formatName,x=y.formatOptions;if(u.formats[v]){var U=m;try{var R=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},S=R.locale||R.lng||a.locale||a.lng||o;U=u.formats[v](m,S,Oi(Oi(Oi({},x),a),R))}catch(g){u.logger.warn(g)}return U}else u.logger.warn("there was no format function for ".concat(v));return m},i);return p}}]),e}();function sg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function og(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rx(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Lx=function(e){$l(i,e);var t=kx(i);function i(n,o,a){var u,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Wr(this,i),u=t.call(this),Zl&&Yi.call(Qi(u)),u.backend=n,u.store=o,u.services=a,u.languageUtils=a.languageUtils,u.options=h,u.logger=ti.create("backendConnector"),u.waitingReads=[],u.maxParallelReads=h.maxParallelReads||10,u.readingCalls=0,u.maxRetries=h.maxRetries>=0?h.maxRetries:5,u.retryTimeout=h.retryTimeout>=1?h.retryTimeout:350,u.state={},u.queue=[],u.backend&&u.backend.init&&u.backend.init(a,h.backend,h),u}return Kr(i,[{key:"queueLoad",value:function(o,a,u,h){var p=this,m={},_={},y={},v={};return o.forEach(function(x){var U=!0;a.forEach(function(R){var S="".concat(x,"|").concat(R);!u.reload&&p.store.hasResourceBundle(x,R)?p.state[S]=2:p.state[S]<0||(p.state[S]===1?_[S]===void 0&&(_[S]=!0):(p.state[S]=1,U=!1,_[S]===void 0&&(_[S]=!0),m[S]===void 0&&(m[S]=!0),v[R]===void 0&&(v[R]=!0)))}),U||(y[x]=!0)}),(Object.keys(m).length||Object.keys(_).length)&&this.queue.push({pending:_,pendingCount:Object.keys(_).length,loaded:{},errors:[],callback:h}),{toLoad:Object.keys(m),pending:Object.keys(_),toLoadLanguages:Object.keys(y),toLoadNamespaces:Object.keys(v)}}},{key:"loaded",value:function(o,a,u){var h=o.split("|"),p=h[0],m=h[1];a&&this.emit("failedLoading",p,m,a),u&&this.store.addResourceBundle(p,m,u),this.state[o]=a?-1:2;var _={};this.queue.forEach(function(y){ux(y.loaded,[p],m),Rx(y,o),a&&y.errors.push(a),y.pendingCount===0&&!y.done&&(Object.keys(y.loaded).forEach(function(v){_[v]||(_[v]={});var x=y.loaded[v];x.length&&x.forEach(function(U){_[v][U]===void 0&&(_[v][U]=!0)})}),y.done=!0,y.errors.length?y.callback(y.errors):y.callback())}),this.emit("loaded",_),this.queue=this.queue.filter(function(y){return!y.done})}},{key:"read",value:function(o,a,u){var h=this,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,m=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,_=arguments.length>5?arguments[5]:void 0;if(!o.length)return _(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:a,fcName:u,tried:p,wait:m,callback:_});return}return this.readingCalls++,this.backend[u](o,a,function(y,v){if(h.readingCalls--,h.waitingReads.length>0){var x=h.waitingReads.shift();h.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(y&&v&&p2&&arguments[2]!==void 0?arguments[2]:{},p=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),p&&p();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof a=="string"&&(a=[a]);var m=this.queueLoad(o,a,h,p);if(!m.toLoad.length)return m.pending.length||p(),null;m.toLoad.forEach(function(_){u.loadOne(_)})}},{key:"load",value:function(o,a,u){this.prepareLoading(o,a,{},u)}},{key:"reload",value:function(o,a,u){this.prepareLoading(o,a,{reload:!0},u)}},{key:"loadOne",value:function(o){var a=this,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",h=o.split("|"),p=h[0],m=h[1];this.read(p,m,"read",void 0,void 0,function(_,y){_&&a.logger.warn("".concat(u,"loading namespace ").concat(m," for language ").concat(p," failed"),_),!_&&y&&a.logger.log("".concat(u,"loaded namespace ").concat(m," for language ").concat(p),y),a.loaded(o,_,y)})}},{key:"saveMissing",value:function(o,a,u,h,p){var m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(u,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}u==null||u===""||(this.backend&&this.backend.create&&this.backend.create(o,a,u,h,null,og(og({},m),{},{isUpdate:p})),!(!o||!o[0])&&this.store.addResource(o[0],a,u,h))}}]),i}(Yi);function Ux(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var i={};if(jr(t[1])==="object"&&(i=t[1]),typeof t[1]=="string"&&(i.defaultValue=t[1]),typeof t[2]=="string"&&(i.tDescription=t[2]),jr(t[2])==="object"||jr(t[3])==="object"){var n=t[3]||t[2];Object.keys(n).forEach(function(o){i[o]=n[o]})}return i},interpolation:{escapeValue:!0,format:function(t,i,n,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function ag(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function lg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function $r(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $a(){}function Nx(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(i){typeof e[i]=="function"&&(e[i]=e[i].bind(e))})}var Ll=function(e){$l(i,e);var t=Ix(i);function i(){var n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Wr(this,i),n=t.call(this),Zl&&Yi.call(Qi(n)),n.options=ag(o),n.services={},n.logger=ti,n.modules={external:[]},Nx(Qi(n)),a&&!n.isInitialized&&!o.isClone){if(!n.options.initImmediate)return n.init(o,a),ia(n,Qi(n));setTimeout(function(){n.init(o,a)},0)}return n}return Kr(i,[{key:"init",value:function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(u=a,a={}),!a.defaultNS&&a.defaultNS!==!1&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var h=Ux();this.options=$r($r($r({},h),this.options),ag(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=$r($r({},h.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function p(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?ti.init(p(this.modules.logger),this.options):ti.init(null,this.options);var m;this.modules.formatter?m=this.modules.formatter:typeof Intl<"u"&&(m=Ex);var _=new _x(this.options);this.store=new yx(this.options.resources,this.options);var y=this.services;y.logger=ti,y.resourceStore=this.store,y.languageUtils=_,y.pluralResolver=new Mx(_,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),m&&(!this.options.interpolation.format||this.options.interpolation.format===h.interpolation.format)&&(y.formatter=p(m),y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new Cx(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new Lx(p(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",function(g){for(var L=arguments.length,G=new Array(L>1?L-1:0),O=1;O1?L-1:0),O=1;O0&&v[0]!=="dev"&&(this.options.lng=v[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var x=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];x.forEach(function(g){o[g]=function(){var L;return(L=o.store)[g].apply(L,arguments)}});var U=["addResource","addResources","addResourceBundle","removeResourceBundle"];U.forEach(function(g){o[g]=function(){var L;return(L=o.store)[g].apply(L,arguments),o}});var R=_o(),S=function(){var L=function(O,P){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),R.resolve(P),u(O,P)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return L(null,o.t.bind(o));o.changeLanguage(o.options.lng,L)};return this.options.resources||!this.options.initImmediate?S():setTimeout(S,0),R}},{key:"loadResources",value:function(o){var a=this,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$a,h=u,p=typeof o=="string"?o:this.language;if(typeof o=="function"&&(h=o),!this.options.resources||this.options.partialBundledLanguages){if(p&&p.toLowerCase()==="cimode")return h();var m=[],_=function(x){if(x){var U=a.services.languageUtils.toResolveHierarchy(x);U.forEach(function(R){m.indexOf(R)<0&&m.push(R)})}};if(p)_(p);else{var y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.forEach(function(v){return _(v)})}this.options.preload&&this.options.preload.forEach(function(v){return _(v)}),this.services.backendConnector.load(m,this.options.ns,function(v){!v&&!a.resolvedLanguage&&a.language&&a.setResolvedLanguage(a.language),h(v)})}else h(null)}},{key:"reloadResources",value:function(o,a,u){var h=_o();return o||(o=this.languages),a||(a=this.options.ns),u||(u=$a),this.services.backendConnector.reload(o,a,function(p){h.resolve(),u(p)}),h}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&Pm.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var a=0;a-1)&&this.store.hasLanguageSomeTranslations(u)){this.resolvedLanguage=u;break}}}},{key:"changeLanguage",value:function(o,a){var u=this;this.isLanguageChangingTo=o;var h=_o();this.emit("languageChanging",o);var p=function(v){u.language=v,u.languages=u.services.languageUtils.toResolveHierarchy(v),u.resolvedLanguage=void 0,u.setResolvedLanguage(v)},m=function(v,x){x?(p(x),u.translator.changeLanguage(x),u.isLanguageChangingTo=void 0,u.emit("languageChanged",x),u.logger.log("languageChanged",x)):u.isLanguageChangingTo=void 0,h.resolve(function(){return u.t.apply(u,arguments)}),a&&a(v,function(){return u.t.apply(u,arguments)})},_=function(v){!o&&!v&&u.services.languageDetector&&(v=[]);var x=typeof v=="string"?v:u.services.languageUtils.getBestMatchFromCodes(v);x&&(u.language||p(x),u.translator.language||u.translator.changeLanguage(x),u.services.languageDetector&&u.services.languageDetector.cacheUserLanguage(x)),u.loadResources(x,function(U){m(U,x)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?_(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(_):_(o),h}},{key:"getFixedT",value:function(o,a,u){var h=this,p=function m(_,y){var v;if(jr(y)!=="object"){for(var x=arguments.length,U=new Array(x>2?x-2:0),R=2;R1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var h=this.resolvedLanguage||this.languages[0],p=this.options?this.options.fallbackLng:!1,m=this.languages[this.languages.length-1];if(h.toLowerCase()==="cimode")return!0;var _=function(x,U){var R=a.services.backendConnector.state["".concat(x,"|").concat(U)];return R===-1||R===2};if(u.precheck){var y=u.precheck(this,_);if(y!==void 0)return y}return!!(this.hasResourceBundle(h,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||_(h,o)&&(!p||_(m,o)))}},{key:"loadNamespaces",value:function(o,a){var u=this,h=_o();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(p){u.options.ns.indexOf(p)<0&&u.options.ns.push(p)}),this.loadResources(function(p){h.resolve(),a&&a(p)}),h):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(o,a){var u=_o();typeof o=="string"&&(o=[o]);var h=this.options.preload||[],p=o.filter(function(m){return h.indexOf(m)<0});return p.length?(this.options.preload=h.concat(p),this.loadResources(function(m){u.resolve(),a&&a(m)}),u):(a&&a(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$a,h=$r($r($r({},this.options),a),{isClone:!0}),p=new i(h);(a.debug!==void 0||a.prefix!==void 0)&&(p.logger=p.logger.clone(a));var m=["store","services","language"];return m.forEach(function(_){p[_]=o[_]}),p.services=$r({},this.services),p.services.utils={hasLoadedNamespace:p.hasLoadedNamespace.bind(p)},p.translator=new tg(p.services,p.options),p.translator.on("*",function(_){for(var y=arguments.length,v=new Array(y>1?y-1:0),x=1;x0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Ll(e,t)});var Ct=Ll.createInstance();Ct.createInstance=Ll.createInstance;Ct.createInstance;Ct.init;Ct.loadResources;Ct.reloadResources;Ct.use;Ct.changeLanguage;Ct.getFixedT;Ct.t;Ct.exists;Ct.setDefaultNamespace;Ct.hasLoadedNamespace;Ct.loadNamespaces;Ct.loadLanguages;var Gm=[],Ox=Gm.forEach,Bx=Gm.slice;function Fx(e){return Ox.call(Bx.call(arguments,1),function(t){if(t)for(var i in t)e[i]===void 0&&(e[i]=t[i])}),e}var ug=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Dx=function(t,i,n){var o=n||{};o.path=o.path||"/";var a=encodeURIComponent(i),u="".concat(t,"=").concat(a);if(o.maxAge>0){var h=o.maxAge-0;if(Number.isNaN(h))throw new Error("maxAge should be a Number");u+="; Max-Age=".concat(Math.floor(h))}if(o.domain){if(!ug.test(o.domain))throw new TypeError("option domain is invalid");u+="; Domain=".concat(o.domain)}if(o.path){if(!ug.test(o.path))throw new TypeError("option path is invalid");u+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");u+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(u+="; HttpOnly"),o.secure&&(u+="; Secure"),o.sameSite){var p=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(p){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return u},fg={create:function(t,i,n,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),o&&(a.domain=o),document.cookie=Dx(t,encodeURIComponent(i),a)},read:function(t){for(var i="".concat(t,"="),n=document.cookie.split(";"),o=0;o-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=n.substring(1),a=o.split("&"),u=0;u0){var p=a[u].substring(0,h);p===t.lookupQuerystring&&(i=a[u].substring(h+1))}}}return i}},wo=null,cg=function(){if(wo!==null)return wo;try{wo=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{wo=!1}return wo},Gx={name:"localStorage",lookup:function(t){var i;if(t.lookupLocalStorage&&cg()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(i=n)}return i},cacheUserLanguage:function(t,i){i.lookupLocalStorage&&cg()&&window.localStorage.setItem(i.lookupLocalStorage,t)}},bo=null,hg=function(){if(bo!==null)return bo;try{bo=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{bo=!1}return bo},Wx={name:"sessionStorage",lookup:function(t){var i;if(t.lookupSessionStorage&&hg()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(i=n)}return i},cacheUserLanguage:function(t,i){i.lookupSessionStorage&&hg()&&window.sessionStorage.setItem(i.lookupSessionStorage,t)}},Kx={name:"navigator",lookup:function(t){var i=[];if(typeof navigator<"u"){if(navigator.languages)for(var n=0;n0?i:void 0}},Vx={name:"htmlTag",lookup:function(t){var i,n=t.htmlTag||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(i=n.getAttribute("lang")),i}},zx={name:"path",lookup:function(t){var i;if(typeof window<"u"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;i=n[t.lookupFromPathIndex].replace("/","")}else i=n[0].replace("/","")}return i}},Qx={name:"subdomain",lookup:function(t){var i=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[i]}};function Yx(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Wm=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Wr(this,e),this.type="languageDetector",this.detectors={},this.init(t,i)}return Kr(e,[{key:"init",value:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=i,this.options=Fx(n,this.options||{},Yx()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(jx),this.addDetector(Px),this.addDetector(Gx),this.addDetector(Wx),this.addDetector(Kx),this.addDetector(Vx),this.addDetector(zx),this.addDetector(Qx)}},{key:"addDetector",value:function(i){this.detectors[i.name]=i}},{key:"detect",value:function(i){var n=this;i||(i=this.options.order);var o=[];return i.forEach(function(a){if(n.detectors[a]){var u=n.detectors[a].lookup(n.options);u&&typeof u=="string"&&(u=[u]),u&&(o=o.concat(u))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(i,n){var o=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(i)>-1||n.forEach(function(a){o.detectors[a]&&o.detectors[a].cacheUserLanguage(i,o.options)}))}}]),e}();Wm.type="languageDetector";const Km={en:{translation:{"language-name":"english",toolbar:{run:"Run all code (ctrl+shift+enter)",upload:"upload to gallery",clear:"clear all",shuffle:"show random sketch",random:"make random change","load-extension":"load library or extension","show-info":"show info window","hide-info":"hide info window"},info:{title:"hydra",subtitle:"live coding video synth",description:"Hydra is live code-able video synth and coding environment that runs directly in the browser. It is free and open-source and made for beginners and experts alike.","get-started-title":"To get started:","get-started-list":["Close this window","Change some numbers","Type Ctrl + Shift + Enter"],"description-detailed":"Hydra is written in JavaScript and compiles to WebGL under the hood. The syntax is inspired by analog modular synthesis, in which chaining or patching a set of transformations together generates a visual result.",uses:"Hydra can be used:","uses-list":["to mix and add effects to camera feeds, screenshares, live streams, and videos","to create generative and audio-reactive visuals, and share them online with others","in combination with other javascript libraries such as P5.js, Tone.js, THREE.js, or gibber","to add interactive video effects to a website","to experiment with and learn about video feedback, fractals, and pixel operations","to stream video between browsers and live-jam with others online"],author:"Created by olivia.","more-info":"For more information and instructions, see: the interactive documentation, a list of hydra functions, the community database of projects and tutorials, a gallery of user-generated sketches, and the source code on github,","more-info-forums":"There is also an active Discord server and facebook group for hydra users+contributors.",support:"If you enjoy using Hydra, please consider supporting continued development <3 ."},extensions:{"about-extensions":"Show community extensions for hydra-synth.","show-example":"Load and run {{extension-name}} example.","show-library":"Add code for loading {{extension-name}} to the top of the current sketch.","show-docs":"Documentation of usage for {{extension-name}}"}}}},Hx=["ja","es","ar","id","pt-br","ch"],$x=e=>`https://raw.githubusercontent.com/hydra-synth/l10n/main/${e}/editor.json`;Ct.use(Wm).init({debug:!0,fallbackLng:"en",partialBundledLanguages:!0,resources:Km});function Zx(e,t){const i={};let n=new URLSearchParams(window.location.search),o=n.get("l10n-lang"),a=n.get("l10n-url");Hx.forEach(p=>{h(p,$x(p))}),o!==null&&a!==null&&h(o,a),u(),t.on("set language",p=>{Ct.changeLanguage(p,(m,_)=>{e.translation.selectedLanguage=p,t.emit("render")})});function u(){Object.keys(Km).forEach(p=>{const m=p.split("-")[0];i[m]=Ct.getFixedT(m)("language-name")}),e.translation={t:Ct.t,languages:i,selectedLanguage:Ct.language,textDirection:Ct.language==="ar"?"rtl":"ltr"}}function h(p="es",m){const _="color: purple; background: orange; font-size: 14px;padding:10px";console.log(`%cloading translation for ${p} from ${m}`,_),fetch(m).then(y=>y.ok?y.json():y.text().then(v=>{throw new Error(v)})).then(y=>{window.i18n=Ct,console.log("adding language",p,y);const v=p.split("-")[0];Ct.addResourceBundle(v,"translation",y),u(),t.emit("render")})}}const Xx="https://raw.githubusercontent.com/hydra-synth/hydra-extensions/main/";async function qx(e,t){e.extensions={baseURL:Xx,selectedCategoryIndex:0,categories:[{name:"extensions",slug:"extensions",entries:[],hasLoaded:!1},{name:"external libraries",slug:"external-libraries",entries:[],hasLoaded:!1},{name:"examples",slug:"examples",entries:[],hasLoaded:!1}]},t.on("extensions: select category",(i=e.extensions.selectedCategoryIndex)=>{e.extensions.selectedCategoryIndex=i,t.emit("render");const n=e.extensions.categories[i];if(!n.hasLoaded){const o=e.extensions.baseURL+n.slug+".json?laskd";fetch(o).then(a=>a.json()).then(a=>{console.log("loaded d",a),a.forEach(u=>{u.thumbnail=e.extensions.baseURL+"thumbnails/"+u.thumbnail}),n.entries=a,t.emit("render")})}}),t.on("extensions: add to editor",i=>{const{categories:n,selectedCategoryIndex:o}=e.extensions,a=n[o].entries[i].load;t.emit("editor: add code to top",a)}),t.on("extensions: load example",(i,n)=>{const{categories:o,selectedCategoryIndex:a}=e.extensions,u=o[a].entries[i].examples[n],h=new URL(u);console.log(h,e.gallery),e.gallery.setSketchFromURL(h.search,p=>{t.emit("load and eval code",p)})})}function eS(e,t){t.on("editor: randomize",function(i){const n=e.editor.editor;i.shiftKey?n.mutator.doUndo():(n.mutator.mutate({reroll:!1,changeTransform:i.metaKey}),n.formatCode(),t.emit("gallery: save to URL",n.getValue()))}),t.on("editor: add code to top",i=>{e.editor.editor.addCodeToTop(i)}),t.on("editor: format code",()=>{e.editor.editor.formatCode()}),t.on("editor: load code",i=>{e.editor.editor.setValue(i)}),t.on("editor: eval all",function(){const i=e.editor.editor,n=i.getValue();t.emit("repl: eval",n,(o,a)=>{i.flashCode(),a||t.emit("gallery: save to URL",n)})})}var bc={exports:{}},Vm={exports:{}};(function(e){e.exports=t;function t(n){if(n)return i(n)}function i(n){for(var o in t.prototype)n[o]=t.prototype[o];return n}t.prototype.on=t.prototype.addEventListener=function(n,o){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(o),this},t.prototype.once=function(n,o){function a(){this.off(n,a),o.apply(this,arguments)}return a.fn=o,this.on(n,a),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(n,o){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+n];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var u,h=0;h"u"||!Dt?Qe:Dt(Uint8Array),xn={"%AggregateError%":typeof AggregateError>"u"?Qe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Qe:ArrayBuffer,"%ArrayIteratorPrototype%":qn&&Dt?Dt([][Symbol.iterator]()):Qe,"%AsyncFromSyncIteratorPrototype%":Qe,"%AsyncFunction%":as,"%AsyncGenerator%":as,"%AsyncGeneratorFunction%":as,"%AsyncIteratorPrototype%":as,"%Atomics%":typeof Atomics>"u"?Qe:Atomics,"%BigInt%":typeof BigInt>"u"?Qe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Qe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Qe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Qe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Qe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Qe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Qe:FinalizationRegistry,"%Function%":zm,"%GeneratorFunction%":as,"%Int8Array%":typeof Int8Array>"u"?Qe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Qe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Qe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qn&&Dt?Dt(Dt([][Symbol.iterator]())):Qe,"%JSON%":typeof JSON=="object"?JSON:Qe,"%Map%":typeof Map>"u"?Qe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qn||!Dt?Qe:Dt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Qe:Promise,"%Proxy%":typeof Proxy>"u"?Qe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Qe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Qe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qn||!Dt?Qe:Dt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Qe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qn&&Dt?Dt(""[Symbol.iterator]()):Qe,"%Symbol%":qn?Symbol:Qe,"%SyntaxError%":vs,"%ThrowTypeError%":pS,"%TypedArray%":gS,"%TypeError%":hs,"%Uint8Array%":typeof Uint8Array>"u"?Qe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Qe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Qe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Qe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Qe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Qe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Qe:WeakSet};if(Dt)try{null.error}catch(e){var yS=Dt(Dt(e));xn["%Error.prototype%"]=yS}var mS=function e(t){var i;if(t==="%AsyncFunction%")i=pf("async function () {}");else if(t==="%GeneratorFunction%")i=pf("function* () {}");else if(t==="%AsyncGeneratorFunction%")i=pf("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Dt&&(i=Dt(o.prototype))}return xn[t]=i,i},gg={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},na=fh,Ul=hS,vS=na.call(Function.call,Array.prototype.concat),_S=na.call(Function.apply,Array.prototype.splice),yg=na.call(Function.call,String.prototype.replace),Il=na.call(Function.call,String.prototype.slice),wS=na.call(Function.call,RegExp.prototype.exec),bS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xS=/\\(\\)?/g,SS=function(t){var i=Il(t,0,1),n=Il(t,-1);if(i==="%"&&n!=="%")throw new vs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&i!=="%")throw new vs("invalid intrinsic syntax, expected opening `%`");var o=[];return yg(t,bS,function(a,u,h,p){o[o.length]=h?yg(p,xS,"$1"):u||a}),o},MS=function(t,i){var n=t,o;if(Ul(gg,n)&&(o=gg[n],n="%"+o[0]+"%"),Ul(xn,n)){var a=xn[n];if(a===as&&(a=mS(n)),typeof a>"u"&&!i)throw new hs("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new vs("intrinsic "+t+" does not exist!")},ch=function(t,i){if(typeof t!="string"||t.length===0)throw new hs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof i!="boolean")throw new hs('"allowMissing" argument must be a boolean');if(wS(/^%?[^%]*%?$/,t)===null)throw new vs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=SS(t),o=n.length>0?n[0]:"",a=MS("%"+o+"%",i),u=a.name,h=a.value,p=!1,m=a.alias;m&&(o=m[0],_S(n,vS([0,1],m)));for(var _=1,y=!0;_=n.length){var R=bn(h,v);y=!!R,y&&"get"in R&&!("originalValue"in R.get)?h=R.get:h=h[v]}else y=Ul(h,v),h=h[v];y&&!p&&(xn[u]=h)}}return h},Qm={exports:{}};(function(e){var t=fh,i=ch,n=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||t.call(o,n),u=i("%Object.getOwnPropertyDescriptor%",!0),h=i("%Object.defineProperty%",!0),p=i("%Math.max%");if(h)try{h({},"a",{value:1})}catch{h=null}e.exports=function(y){var v=a(t,o,arguments);if(u&&h){var x=u(v,"length");x.configurable&&h(v,"length",{value:1+p(0,y.length-(arguments.length-1))})}return v};var m=function(){return a(t,n,arguments)};h?h(e.exports,"apply",{value:m}):e.exports.apply=m})(Qm);var CS=Qm.exports,Ym=ch,Hm=CS,TS=Hm(Ym("String.prototype.indexOf")),ES=function(t,i){var n=Ym(t,!!i);return typeof n=="function"&&TS(t,".prototype.")>-1?Hm(n):n};const kS={},AS=Object.freeze(Object.defineProperty({__proto__:null,default:kS},Symbol.toStringTag,{value:"Module"})),Ss=nm(AS);var hh=typeof Map=="function"&&Map.prototype,gf=Object.getOwnPropertyDescriptor&&hh?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Jl=hh&&gf&&typeof gf.get=="function"?gf.get:null,mg=hh&&Map.prototype.forEach,ph=typeof Set=="function"&&Set.prototype,yf=Object.getOwnPropertyDescriptor&&ph?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Nl=ph&&yf&&typeof yf.get=="function"?yf.get:null,vg=ph&&Set.prototype.forEach,RS=typeof WeakMap=="function"&&WeakMap.prototype,Jo=RS?WeakMap.prototype.has:null,LS=typeof WeakSet=="function"&&WeakSet.prototype,No=LS?WeakSet.prototype.has:null,US=typeof WeakRef=="function"&&WeakRef.prototype,_g=US?WeakRef.prototype.deref:null,IS=Boolean.prototype.valueOf,JS=Object.prototype.toString,NS=Function.prototype.toString,OS=String.prototype.match,dh=String.prototype.slice,Gi=String.prototype.replace,BS=String.prototype.toUpperCase,wg=String.prototype.toLowerCase,$m=RegExp.prototype.test,bg=Array.prototype.concat,qr=Array.prototype.join,FS=Array.prototype.slice,xg=Math.floor,xc=typeof BigInt=="function"?BigInt.prototype.valueOf:null,mf=Object.getOwnPropertySymbols,Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,_s=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Yt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_s||"symbol")?Symbol.toStringTag:null,Zm=Object.prototype.propertyIsEnumerable,Sg=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Mg(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||$m.call(/e/,t))return t;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-xg(-e):xg(e);if(n!==e){var o=String(n),a=dh.call(t,o.length+1);return Gi.call(o,i,"$&_")+"."+Gi.call(Gi.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Gi.call(t,i,"$&_")}var Mc=Ss,Cg=Mc.custom,Tg=qm(Cg)?Cg:null,DS=function e(t,i,n,o){var a=i||{};if(Di(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Di(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=Di(a,"customInspect")?a.customInspect:!0;if(typeof u!="boolean"&&u!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Di(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Di(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return t0(t,a);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var p=String(t);return h?Mg(t,p):p}if(typeof t=="bigint"){var m=String(t)+"n";return h?Mg(t,m):m}var _=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof t=="object")return Cc(t)?"[Array]":"[Object]";var y=iM(a,n);if(typeof o>"u")o=[];else if(e0(o,t)>=0)return"[Circular]";function v(ce,ye,ie){if(ye&&(o=FS.call(o),o.push(ye)),ie){var re={depth:a.depth};return Di(a,"quoteStyle")&&(re.quoteStyle=a.quoteStyle),e(ce,re,n+1,o)}return e(ce,a,n+1,o)}if(typeof t=="function"&&!Eg(t)){var x=YS(t),U=Za(t,v);return"[Function"+(x?": "+x:" (anonymous)")+"]"+(U.length>0?" { "+qr.call(U,", ")+" }":"")}if(qm(t)){var R=_s?Gi.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Sc.call(t);return typeof t=="object"&&!_s?xo(R):R}if(eM(t)){for(var S="<"+wg.call(String(t.nodeName)),g=t.attributes||[],L=0;L",S}if(Cc(t)){if(t.length===0)return"[]";var G=Za(t,v);return y&&!rM(G)?"["+Tc(G,y)+"]":"[ "+qr.call(G,", ")+" ]"}if(GS(t)){var O=Za(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!Zm.call(t,"cause")?"{ ["+String(t)+"] "+qr.call(bg.call("[cause]: "+v(t.cause),O),", ")+" }":O.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+qr.call(O,", ")+" }"}if(typeof t=="object"&&u){if(Tg&&typeof t[Tg]=="function"&&Mc)return Mc(t,{depth:_-n});if(u!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(HS(t)){var P=[];return mg&&mg.call(t,function(ce,ye){P.push(v(ye,t,!0)+" => "+v(ce,t))}),kg("Map",Jl.call(t),P,y)}if(XS(t)){var F=[];return vg&&vg.call(t,function(ce){F.push(v(ce,t))}),kg("Set",Nl.call(t),F,y)}if($S(t))return vf("WeakMap");if(qS(t))return vf("WeakSet");if(ZS(t))return vf("WeakRef");if(KS(t))return xo(v(Number(t)));if(zS(t))return xo(v(xc.call(t)));if(VS(t))return xo(IS.call(t));if(WS(t))return xo(v(String(t)));if(!PS(t)&&!Eg(t)){var V=Za(t,v),D=Sg?Sg(t)===Object.prototype:t instanceof Object||t.constructor===Object,ee=t instanceof Object?"":"null prototype",A=!D&&Yt&&Object(t)===t&&Yt in t?dh.call(Zi(t),8,-1):ee?"Object":"",q=D||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Z=q+(A||ee?"["+qr.call(bg.call([],A||[],ee||[]),": ")+"] ":"");return V.length===0?Z+"{}":y?Z+"{"+Tc(V,y)+"}":Z+"{ "+qr.call(V,", ")+" }"}return String(t)};function Xm(e,t,i){var n=(i.quoteStyle||t)==="double"?'"':"'";return n+e+n}function jS(e){return Gi.call(String(e),/"/g,""")}function Cc(e){return Zi(e)==="[object Array]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function PS(e){return Zi(e)==="[object Date]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function Eg(e){return Zi(e)==="[object RegExp]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function GS(e){return Zi(e)==="[object Error]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function WS(e){return Zi(e)==="[object String]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function KS(e){return Zi(e)==="[object Number]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function VS(e){return Zi(e)==="[object Boolean]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function qm(e){if(_s)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Sc)return!1;try{return Sc.call(e),!0}catch{}return!1}function zS(e){if(!e||typeof e!="object"||!xc)return!1;try{return xc.call(e),!0}catch{}return!1}var QS=Object.prototype.hasOwnProperty||function(e){return e in this};function Di(e,t){return QS.call(e,t)}function Zi(e){return JS.call(e)}function YS(e){if(e.name)return e.name;var t=OS.call(NS.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function e0(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;it.maxStringLength){var i=e.length-t.maxStringLength,n="... "+i+" more character"+(i>1?"s":"");return t0(dh.call(e,0,t.maxStringLength),t)+n}var o=Gi.call(Gi.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,tM);return Xm(o,"single",t)}function tM(e){var t=e.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return i?"\\"+i:"\\x"+(t<16?"0":"")+BS.call(t.toString(16))}function xo(e){return"Object("+e+")"}function vf(e){return e+" { ? }"}function kg(e,t,i,n){var o=n?Tc(i,n):qr.call(i,", ");return e+" ("+t+") {"+o+"}"}function rM(e){for(var t=0;t=0)return!1;return!0}function iM(e,t){var i;if(e.indent===" ")i=" ";else if(typeof e.indent=="number"&&e.indent>0)i=qr.call(Array(e.indent+1)," ");else return null;return{base:i,prev:qr.call(Array(t+1),i)}}function Tc(e,t){if(e.length===0)return"";var i=` -`+t.prev+t.base;return i+qr.call(e,","+i)+` -`+t.prev}function Za(e,t){var i=Cc(e),n=[];if(i){n.length=e.length;for(var o=0;o1;){var i=t.pop(),n=i.obj[i.prop];if(vn(n)){for(var o=[],a=0;a=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||a===vM.RFC1738&&(m===40||m===41)){h+=u.charAt(p);continue}if(m<128){h=h+Zr[m];continue}if(m<2048){h=h+(Zr[192|m>>6]+Zr[128|m&63]);continue}if(m<55296||m>=57344){h=h+(Zr[224|m>>12]+Zr[128|m>>6&63]+Zr[128|m&63]);continue}p+=1,m=65536+((m&1023)<<10|u.charCodeAt(p)&1023),h+=Zr[240|m>>18]+Zr[128|m>>12&63]+Zr[128|m>>6&63]+Zr[128|m&63]}return h},MM=function(t){for(var i=[{obj:{o:t},prop:"o"}],n=[],o=0;o"u"&&(G=0)}if(typeof p=="function"?g=p(i,g):g instanceof Date?g=y(g):n==="comma"&&di(g)&&(g=Ml.maybeMap(g,function(re){return re instanceof Date?y(re):re})),g===null){if(a)return h&&!U?h(i,zt.encoder,R,"key",v):i;g=""}if(UM(g)||Ml.isBuffer(g)){if(h){var F=U?i:h(i,zt.encoder,R,"key",v);return[x(F)+"="+x(h(g,zt.encoder,R,"value",v))]}return[x(i)+"="+x(String(g))]}var V=[];if(typeof g>"u")return V;var D;if(n==="comma"&&di(g))U&&h&&(g=Ml.maybeMap(g,h)),D=[{value:g.length>0?g.join(",")||null:void 0}];else if(di(p))D=p;else{var ee=Object.keys(g);D=m?ee.sort(m):ee}for(var A=o&&di(g)&&g.length===1?i+"[]":i,q=0;q"u"?zt.allowDots:!!t.allowDots,charset:i,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:zt.charsetSentinel,delimiter:typeof t.delimiter>"u"?zt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:zt.encode,encoder:typeof t.encoder=="function"?t.encoder:zt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:zt.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:zt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:zt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:zt.strictNullHandling}},NM=function(e,t){var i=e,n=JM(t),o,a;typeof n.filter=="function"?(a=n.filter,i=a("",i)):di(n.filter)&&(a=n.filter,o=a);var u=[];if(typeof i!="object"||i===null)return"";var h;t&&t.arrayFormat in Ag?h=t.arrayFormat:t&&"indices"in t?h=t.indices?"indices":"repeat":h="indices";var p=Ag[h];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=p==="comma"&&t&&t.commaRoundTrip;o||(o=Object.keys(i)),n.sort&&o.sort(n.sort);for(var _=n0(),y=0;y0?U+x:""},ws=i0,Ec=Object.prototype.hasOwnProperty,OM=Array.isArray,Ft={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ws.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},BM=function(e){return e.replace(/&#(\d+);/g,function(t,i){return String.fromCharCode(parseInt(i,10))})},a0=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},FM="utf8=%26%2310003%3B",DM="utf8=%E2%9C%93",jM=function(t,i){var n={__proto__:null},o=i.ignoreQueryPrefix?t.replace(/^\?/,""):t,a=i.parameterLimit===1/0?void 0:i.parameterLimit,u=o.split(i.delimiter,a),h=-1,p,m=i.charset;if(i.charsetSentinel)for(p=0;p-1&&(U=OM(U)?[U]:U),Ec.call(n,x)?n[x]=ws.combine(n[x],U):n[x]=U}return n},PM=function(e,t,i,n){for(var o=n?t:a0(t,i),a=e.length-1;a>=0;--a){var u,h=e[a];if(h==="[]"&&i.parseArrays)u=[].concat(o);else{u=i.plainObjects?Object.create(null):{};var p=h.charAt(0)==="["&&h.charAt(h.length-1)==="]"?h.slice(1,-1):h,m=parseInt(p,10);!i.parseArrays&&p===""?u={0:o}:!isNaN(m)&&h!==p&&String(m)===p&&m>=0&&i.parseArrays&&m<=i.arrayLimit?(u=[],u[m]=o):p!=="__proto__"&&(u[p]=o)}o=u}return o},GM=function(t,i,n,o){if(t){var a=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,u=/(\[[^[\]]*])/,h=/(\[[^[\]]*])/g,p=n.depth>0&&u.exec(a),m=p?a.slice(0,p.index):a,_=[];if(m){if(!n.plainObjects&&Ec.call(Object.prototype,m)&&!n.allowPrototypes)return;_.push(m)}for(var y=0;n.depth>0&&(p=h.exec(a))!==null&&y"u"?Ft.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Ft.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Ft.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Ft.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Ft.arrayLimit,charset:i,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ft.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Ft.comma,decoder:typeof t.decoder=="function"?t.decoder:Ft.decoder,delimiter:typeof t.delimiter=="string"||ws.isRegExp(t.delimiter)?t.delimiter:Ft.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Ft.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Ft.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Ft.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Ft.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ft.strictNullHandling}},KM=function(e,t){var i=WM(t);if(e===""||e===null||typeof e>"u")return i.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?jM(e,i):e,o=i.plainObjects?Object.create(null):{},a=Object.keys(n),u=0;u=a.length?{done:!0}:{done:!1,value:a[p++]}},e:function(U){throw U},f:m}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _=!0,y=!1,v;return{s:function(){h=h.call(a)},n:function(){var U=h.next();return _=U.done,U},e:function(U){y=!0,v=U},f:function(){try{!_&&h.return!=null&&h.return()}finally{if(y)throw v}}}}function n(a,u){if(a){if(typeof a=="string")return o(a,u);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return o(a,u)}}function o(a,u){(u==null||u>a.length)&&(u=a.length);for(var h=0,p=new Array(u);h=this._maxRetries)return!1;if(this._retryCallback)try{var i=this._retryCallback(e,t);if(i===!0)return!0;if(i===!1)return!1}catch(n){console.error(n)}return!!(t&&t.status&&ZM.has(t.status)||e&&(e.code&&$M.has(e.code)||e.timeout&&e.code==="ECONNABORTED"||e.crossDomain))};st.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()};st.prototype.then=function(e,t){var i=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(o,a){n.on("abort",function(){if(!(i._maxRetries&&i._maxRetries>i._retries)){if(i.timedout&&i.timedoutError){a(i.timedoutError);return}var u=new Error("Aborted");u.code="ABORTED",u.status=i.status,u.method=i.method,u.url=i.url,a(u)}}),n.end(function(u,h){u?a(u):o(h)})})}return this._fullfilledPromise.then(e,t)};st.prototype.catch=function(e){return this.then(void 0,e)};st.prototype.use=function(e){return e(this),this};st.prototype.ok=function(e){if(typeof e!="function")throw new Error("Callback required");return this._okCallback=e,this};st.prototype._isResponseOK=function(e){return e?this._okCallback?this._okCallback(e):e.status>=200&&e.status<300:!1};st.prototype.get=function(e){return this._header[e.toLowerCase()]};st.prototype.getHeader=st.prototype.get;st.prototype.set=function(e,t){if(Ol(e)){for(var i in e)jo(e,i)&&this.set(i,e[i]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this};st.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this};st.prototype.field=function(e,t,i){if(e==null)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(Ol(e)){for(var n in e)jo(e,n)&&this.field(n,e[n]);return this}if(Array.isArray(t)){for(var o in t)jo(t,o)&&this.field(e,t[o]);return this}if(t==null)throw new Error(".field(name, val) val can not be empty");return typeof t=="boolean"&&(t=String(t)),i?this._getFormData().append(e,t,i):this._getFormData().append(e,t),this};st.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(xf.gte(process.version,"v13.0.0")&&xf.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");xf.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this};st.prototype._auth=function(e,t,i,n){switch(i.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e));break}return this};st.prototype.withCredentials=function(e){return e===void 0&&(e=!0),this._withCredentials=e,this};st.prototype.redirects=function(e){return this._maxRedirects=e,this};st.prototype.maxResponseSize=function(e){if(typeof e!="number")throw new TypeError("Invalid argument");return this._maxResponseSize=e,this};st.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}};st.prototype.send=function(e){var t=Ol(e),i=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&Ol(this._data))for(var n in e)jo(e,n)&&(this._data[n]=e[n]);else typeof e=="string"?(i||this.type("form"),i=this._header["content-type"],i&&(i=i.toLowerCase().trim()),i==="application/x-www-form-urlencoded"?this._data=this._data?"".concat(this._data,"&").concat(e):e:this._data=(this._data||"")+e):this._data=e;return!t||this._isHost(e)?this:(i||this.type("json"),this)};st.prototype.sortQuery=function(e){return this._sort=typeof e>"u"?!0:e,this};st.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var i=this.url.slice(t+1).split("&");typeof this._sort=="function"?i.sort(this._sort):i.sort(),this.url=this.url.slice(0,t)+"?"+i.join("&")}}};st.prototype._appendQueryString=function(){console.warn("Unsupported")};st.prototype._timeoutError=function(e,t,i){if(!this._aborted){var n=new Error("".concat(e+t,"ms exceeded"));n.timeout=t,n.code="ECONNABORTED",n.errno=i,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}};st.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))};var Sf=Xl,XM=ql;function ql(){}ql.prototype.get=function(e){return this.header[e.toLowerCase()]};ql.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=Sf.type(t);var i=Sf.params(t);for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(this[n]=i[n]);this.links={};try{e.link&&(this.links=Sf.parseLinks(e.link))}catch{}};ql.prototype._setStatusProperties=function(e){var t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=t===1,this.ok=t===2,this.redirect=t===3,this.clientError=t===4,this.serverError=t===5,this.error=t===4||t===5?this.toError():!1,this.created=e===201,this.accepted=e===202,this.noContent=e===204,this.badRequest=e===400,this.unauthorized=e===401,this.notAcceptable=e===406,this.forbidden=e===403,this.notFound=e===404,this.unprocessableEntity=e===422};function qM(e){return rC(e)||tC(e)||u0(e)||eC()}function eC(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rC(e){if(Array.isArray(e))return Ac(e)}function iC(e,t){var i=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=u0(e))||t&&e&&typeof e.length=="number"){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(m){throw m},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,u=!1,h;return{s:function(){i=i.call(e)},n:function(){var m=i.next();return a=m.done,m},e:function(m){u=!0,h=m},f:function(){try{!a&&i.return!=null&&i.return()}finally{if(u)throw h}}}}function u0(e,t){if(e){if(typeof e=="string")return Ac(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ac(e,t)}}function Ac(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i=ie.length?{done:!0}:{done:!1,value:ie[X++]}},e:function(Ie){throw Ie},f:fe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Me=!0,we=!1,Re;return{s:function(){K=K.call(ie)},n:function(){var Ie=K.next();return Me=Ie.done,Ie},e:function(Ie){we=!0,Re=Ie},f:function(){try{!Me&&K.return!=null&&K.return()}finally{if(we)throw Re}}}}function o(ie,re){if(ie){if(typeof ie=="string")return a(ie,re);var K=Object.prototype.toString.call(ie).slice(8,-1);if(K==="Object"&&ie.constructor&&(K=ie.constructor.name),K==="Map"||K==="Set")return Array.from(ie);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return a(ie,re)}}function a(ie,re){(re==null||re>ie.length)&&(re=ie.length);for(var K=0,X=new Array(re);K"u"?(console.warn("Using browser-only version of superagent in non-browser environment"),u=void 0):u=self;var h=Tn,p=Sm,m=YM,_=HM,y=Xl,v=y.isObject,x=y.mixin,U=y.hasOwn,R=XM,S=sC;function g(){}e.exports=function(ie,re){return typeof re=="function"?new t.Request("GET",ie).end(re):arguments.length===1?new t.Request("GET",ie):new t.Request(ie,re)},t=e.exports;var L=t;t.Request=A,L.getXHR=function(){if(u.XMLHttpRequest&&(!u.location||u.location.protocol!=="file:"||!u.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch{}throw new Error("Browser-only version of superagent could not find XHR")};var G="".trim?function(ie){return ie.trim()}:function(ie){return ie.replace(/(^\s*|\s*$)/g,"")};function O(ie){if(!v(ie))return ie;var re=[];for(var K in ie)U(ie,K)&&P(re,K,ie[K]);return re.join("&")}function P(ie,re,K){if(K!==void 0){if(K===null){ie.push(encodeURI(re));return}if(Array.isArray(K)){var X=n(K),fe;try{for(X.s();!(fe=X.n()).done;){var Me=fe.value;P(ie,re,Me)}}catch(Re){X.e(Re)}finally{X.f()}}else if(v(K))for(var we in K)U(K,we)&&P(ie,"".concat(re,"[").concat(we,"]"),K[we]);else ie.push(encodeURI(re)+"="+encodeURIComponent(K))}}L.serializeObject=O;function F(ie){for(var re={},K=ie.split("&"),X,fe,Me=0,we=K.length;Me"u"?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var re=this.xhr.status;re===1223&&(re=204),this._setStatusProperties(re),this.headers=V(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),this.text===null&&ie._responseType?this.body=this.xhr.response:this.body=this.req.method==="HEAD"?null:this._parseBody(this.text?this.text:this.xhr.response)}x(ee.prototype,R.prototype),ee.prototype._parseBody=function(ie){var re=L.parse[this.type];return this.req._parser?this.req._parser(this,ie):(!re&&D(this.type)&&(re=L.parse["application/json"]),re&&ie&&(ie.length>0||ie instanceof Object)?re(ie):null)},ee.prototype.toError=function(){var ie=this.req,re=ie.method,K=ie.url,X="cannot ".concat(re," ").concat(K," (").concat(this.status,")"),fe=new Error(X);return fe.status=this.status,fe.method=re,fe.url=K,fe},L.Response=ee;function A(ie,re){var K=this;this._query=this._query||[],this.method=ie,this.url=re,this.header={},this._header={},this.on("end",function(){var X=null,fe=null;try{fe=new ee(K)}catch(we){return X=new Error("Parser is unable to parse the response"),X.parse=!0,X.original=we,K.xhr?(X.rawResponse=typeof K.xhr.responseType>"u"?K.xhr.responseText:K.xhr.response,X.status=K.xhr.status?K.xhr.status:null,X.statusCode=X.status):(X.rawResponse=null,X.status=null),K.callback(X)}K.emit("response",fe);var Me;try{K._isResponseOK(fe)||(Me=new Error(fe.statusText||fe.text||"Unsuccessful HTTP response"))}catch(we){Me=we}Me?(Me.original=X,Me.response=fe,Me.status=fe.status,K.callback(Me,fe)):K.callback(null,fe)})}h(A.prototype),x(A.prototype,_.prototype),A.prototype.type=function(ie){return this.set("Content-Type",L.types[ie]||ie),this},A.prototype.accept=function(ie){return this.set("Accept",L.types[ie]||ie),this},A.prototype.auth=function(ie,re,K){arguments.length===1&&(re=""),i(re)==="object"&&re!==null&&(K=re,re=""),K||(K={type:typeof btoa=="function"?"basic":"auto"});var X=K.encoder?K.encoder:function(fe){if(typeof btoa=="function")return btoa(fe);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(ie,re,K,X)},A.prototype.query=function(ie){return typeof ie!="string"&&(ie=O(ie)),ie&&this._query.push(ie),this},A.prototype.attach=function(ie,re,K){if(re){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(ie,re,K||re.name)}return this},A.prototype._getFormData=function(){return this._formData||(this._formData=new u.FormData),this._formData},A.prototype.callback=function(ie,re){if(this._shouldRetry(ie,re))return this._retry();var K=this._callback;this.clearTimeout(),ie&&(this._maxRetries&&(ie.retries=this._retries-1),this.emit("error",ie)),K(ie,re)},A.prototype.crossDomainError=function(){var ie=new Error(`Request has been terminated -Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.`);ie.crossDomain=!0,ie.status=this.status,ie.method=this.method,ie.url=this.url,this.callback(ie)},A.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},A.prototype.ca=A.prototype.agent,A.prototype.buffer=A.prototype.ca,A.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},A.prototype.pipe=A.prototype.write,A.prototype._isHost=function(ie){return ie&&i(ie)==="object"&&!Array.isArray(ie)&&Object.prototype.toString.call(ie)!=="[object Object]"},A.prototype.end=function(ie){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=ie||g,this._finalizeQueryString(),this._end()},A.prototype._setUploadTimeout=function(){var ie=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(function(){ie._timeoutError("Upload timeout of ",ie._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},A.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var ie=this;this.xhr=L.getXHR();var re=this.xhr,K=this._formData||this._data;this._setTimeouts(),re.addEventListener("readystatechange",function(){var Re=re.readyState;if(Re>=2&&ie._responseTimeoutTimer&&clearTimeout(ie._responseTimeoutTimer),Re===4){var ke;try{ke=re.status}catch{ke=0}if(!ke)return ie.timedout||ie._aborted?void 0:ie.crossDomainError();ie.emit("end")}});var X=function(ke,Ie){Ie.total>0&&(Ie.percent=Ie.loaded/Ie.total*100,Ie.percent===100&&clearTimeout(ie._uploadTimeoutTimer)),Ie.direction=ke,ie.emit("progress",Ie)};if(this.hasListeners("progress"))try{re.addEventListener("progress",X.bind(null,"download")),re.upload&&re.upload.addEventListener("progress",X.bind(null,"upload"))}catch{}re.upload&&this._setUploadTimeout();try{this.username&&this.password?re.open(this.method,this.url,!0,this.username,this.password):re.open(this.method,this.url,!0)}catch(Re){return this.callback(Re)}if(this._withCredentials&&(re.withCredentials=!0),!this._formData&&this.method!=="GET"&&this.method!=="HEAD"&&typeof K!="string"&&!this._isHost(K)){var fe=this._header["content-type"],Me=this._serializer||L.serialize[fe?fe.split(";")[0]:""];!Me&&D(fe)&&(Me=L.serialize["application/json"]),Me&&(K=Me(K))}for(var we in this.header)this.header[we]!==null&&U(this.header,we)&&re.setRequestHeader(we,this.header[we]);this._responseType&&(re.responseType=this._responseType),this.emit("request",this),re.send(typeof K>"u"?null:K)},L.agent=function(){return new S};for(var q=function(){var re=ce[Z];S.prototype[re.toLowerCase()]=function(K,X){var fe=new L.Request(re,K);return this._setDefaults(fe),X&&fe.end(X),fe}},Z=0,ce=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];Z{this.setSketchFromURL(window.location.search,t)}),this.setRandomSketch=this.setRandomSketch.bind(this)}clear(){this.current=null,this.code=null;let t=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:t},"",t),this.url=t}setSketchFromURL(t=window.location.search,i){hush(),render(o0);let n=new URLSearchParams(t);this.searchParams=n;let o=n.get("code"),a=n.get("sketch_id"),u=n.get("showCode");if(console.log("code is",o),this.foundSketch=!1,a){var h=this.getExampleById(a);h?(this.setSketch(h),i(this.code,!1)):Mf.get(`${this.state.serverURL}/sketchById`).query({sketch_id:a}).end((p,m)=>{p?(console.log("err getting sketches",p),this.setSketchFromCode(o,i)):(this.sketches=JSON.parse(m.text),this.sketches.length>0?(this.setSketch(this.sketches[0]),this.foundSketch=!0,i(this.code,this.foundSketch)):this.setSketchFromCode(o,i))})}else this.setSketchFromCode(o,i);u==="false"&&(this.emitter.emit("ui: hide all"),this.emitter.emit("hide info"))}setSketchFromCode(t,i){t?(this.code=this.decodeBase64(t),this.foundSketch=!0):this.setRandomSketch(),i(this.code,this.foundSketch)}saveImage(){}setToURL(t){this.searchParams.delete("sketch_id"),this.searchParams.delete("code"),t.sketch_id?(`${t.sketch_id}`,this.searchParams.append("sketch_id",t.sketch_id)):(`${t.sketch_id}${t.code}`,this.searchParams.append("sketch_id",t.sketch_id),this.searchParams.append("code",t.code));let i=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+this.searchParams.toString();window.history.replaceState({path:i},"",i),this.url=i}encodeBase64(t){return btoa(encodeURIComponent(t))}decodeBase64(t){return decodeURIComponent(atob(t))}setSketch(t){let i=this.decodeBase64(t.code);i.indexOf(Lg)<0&&(i=`${Lg} -${i} -`),this.code=i,this.current=t,this.setToURL(t)}setRandomSketch(){if(this.examples.length>0){let i;for(i=Math.floor(Math.random()*this.examples.length);i===this.exampleIndex;)i=Math.floor(Math.random()*this.examples.length);this.exampleIndex=i,this.setSketch(this.examples[i])}else{var t="osc(2"+Math.floor(Math.pow(10,Math.random()*2))+")";t+=".color("+Math.random().toFixed(2)+","+Math.random().toFixed(2)+","+Math.random().toFixed(2)+")",t+=".rotate("+Math.random().toFixed(2)+")",t+=".out(o0)",this.code=t}}shareSketch(t,i,n){this.saveSketch(t,()=>{console.log("URL is",this.url,"sketch is",this.current),i.getScreenImage(o=>{Mf.post(`${this.state.serverURL}/image`).attach("previewImage",o).query({url:this.url,sketch_id:this.current.sketch_id,name:n}).end((a,u)=>{a?console.log("error postingimage",a):console.log("image response",u.text)})})})}saveSketch(t,i){let n=this,o=this.encodeBase64(t),a={code:o,parent:this.current?this.current.sketch_id:null};console.log("saving in gallery",a),Mf.post(`${this.state.serverURL}/sketch`).query(a).end((u,h)=>{u?(console.log("error posting sketch",u),i&&i(u)):(console.log("response",h.text),n.setSketch({sketch_id:h.text,code:o}),i&&i(null))})}saveLocally(t){let i=this.encodeBase64(t);this.searchParams.delete("sketch_id"),this.searchParams.delete("code"),this.searchParams.append("code",i);var n=this.searchParams.toString();let o=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+n;window.history.pushState({path:o},"",o),this.url=o}getExampleById(t){var i=this.examples.filter(n=>n.sketch_id===t);return i.length<=0&&(i=this.sketches.filter(n=>n.sketch_id===t)),i[0]}}let Bi;function uC(e,t){t.on("DOMContentLoaded",function(){Bi=new lC((i,n)=>{t.emit("load and eval code",i,!1),n?t.emit("ui: hide info"):t.emit("ui: show info"),t.emit("render")},e,t),e.gallery=Bi}),t.on("gallery: save to URL",function(i){Bi.saveLocally(i)}),t.on("gallery: clear",()=>{Bi.clear()}),t.on("gallery:shareSketch",function(){const n=e.editor.editor.getValue();t.emit("repl: eval",n,(o,a)=>{a?console.warn(a):fC(u=>{Bi.shareSketch(n,e.hydra.hydra,u)},()=>{})})}),t.on("gallery:showExample",()=>{const i=e.editor.editor;t.emit("clear all"),Bi.setRandomSketch(),t.emit("repl: eval",Bi.code),i.setValue(Bi.code)})}function fC(e,t){var i=prompt(`Pressing OK will share this sketch to -https://twitter.com/hydra_patterns. - -Include your name or twitter handle (optional):`);i!==null?e(i):t()}var cC=hC,Ug={class:"className",for:"htmlFor","http-equiv":"httpEquiv"};function hC(e){return function(t,i,n){for(var o in i)o in Ug&&(i[Ug[o]]=i[o],delete i[o]);return e(t,i,n)}}var pC=cC,es=0,Xr=1,sr=2,el=3,Jr=4,Mt=5,Cf=6,yn=7,Bt=8,ls=9,us=10,So=11,mn=12,ts=13,dC=function(e,t){t||(t={});var i=t.concat||function(o,a){return String(o)+String(a)};return t.attrToProp!==!1&&(e=pC(e)),function(o){for(var a=Xr,u="",h=arguments.length,p=[],m=0;m1&&(U.pop(),U[U.length-1][0][2][g]=e(R[0],R[1],R[2].length?R[2]:void 0))}else if(S===sr){var L=[y[1],{},[]];R[2].push(L),U.push([L,R[2].length-1])}else if(S===Mt||S===es&&y[1]===Mt){for(var G="",O;m1&&/^\s*$/.test(x[2][0])&&x[2].shift(),x[2].length>2||x[2].length===2&&/\S/.test(x[2][1])){if(t.createFragment)return t.createFragment(x[2]);throw new Error("multiple root elements must be wrapped in an enclosing tag")}return Array.isArray(x[2][0])&&typeof x[2][0][0]=="string"&&Array.isArray(x[2][0][2])&&(x[2][0]=e(x[2][0][0],x[2][0][1],x[2][0][2])),x[2][0];function F(V){var D=[];a===yn&&(a=Jr);for(var ee=0;ee"&&!gC(a)&&a!==ts?(a===sr&&u.length?D.push([sr,u]):a===Mt?D.push([Mt,u]):a===Bt&&u.length&&D.push([Bt,u]),D.push([el]),u="",a=Xr):a===ts&&/-$/.test(u)&&A==="-"?(t.comments&&D.push([Bt,u.substr(0,u.length-1)]),u="",a=Xr):a===sr&&/^!--$/.test(u)?(t.comments&&D.push([sr,u],[Mt,"comment"],[So]),u=A,a=ts):a===Xr||a===ts?u+=A:a===sr&&A==="/"&&u.length||(a===sr&&/\s/.test(A)?(u.length&&D.push([sr,u]),u="",a=Jr):a===sr?u+=A:a===Jr&&/[^\s"'=/]/.test(A)?(a=Mt,u=A):a===Jr&&/\s/.test(A)?(u.length&&D.push([Mt,u]),D.push([mn])):a===Mt&&/\s/.test(A)?(D.push([Mt,u]),u="",a=Cf):a===Mt&&A==="="?(D.push([Mt,u],[So]),u="",a=yn):a===Mt?u+=A:(a===Cf||a===Jr)&&A==="="?(D.push([So]),a=yn):(a===Cf||a===Jr)&&!/\s/.test(A)?(D.push([mn]),/[\w-]/.test(A)?(u+=A,a=Mt):a=Jr):a===yn&&A==='"'?a=us:a===yn&&A==="'"?a=ls:a===us&&A==='"'?(D.push([Bt,u],[mn]),u="",a=Jr):a===ls&&A==="'"?(D.push([Bt,u],[mn]),u="",a=Jr):a===yn&&!/\s/.test(A)?(a=Bt,ee--):a===Bt&&/\s/.test(A)?(D.push([Bt,u],[mn]),u="",a=Jr):(a===Bt||a===ls||a===us)&&(u+=A))}return a===Xr&&u.length?(D.push([Xr,u]),u=""):a===Bt&&u.length?(D.push([Bt,u]),u=""):a===us&&u.length?(D.push([Bt,u]),u=""):a===ls&&u.length?(D.push([Bt,u]),u=""):a===Mt&&(D.push([Mt,u]),u=""),D}};function n(o){return typeof o=="function"||typeof o=="string"||o&&typeof o=="object"||o==null?o:i("",o)}};function gC(e){return e===ls||e===us}var yC=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-￿_:-]+)*$");function mC(e){return yC.test(e)}var tl=/\n[\s]+$/,rl=/^\n[\s]+/,Ig=/[\s]+$/,Jg=/^[\s]+/,il=/[\n\s]+/g,Ng=["a","abbr","b","bdi","bdo","br","cite","data","dfn","em","i","kbd","mark","q","rp","rt","rtc","ruby","s","amp","small","span","strong","sub","sup","time","u","var","wbr"],nl=["code","pre","textarea"],vC=function e(t,i){if(Array.isArray(i))for(var n=t.nodeName.toLowerCase(),o=!1,a,u,h=0,p=i.length;hm=>t(p,m),a=(p,m,_,y)=>It` - `,u=e.showInfo?a("close","fa-times",n("toolbar.hide-info"),"ui: toggle info"):a("close","fa-question-circle",n("toolbar.show-info"),"ui: toggle info"),h=e.showExtensions?a("close","fa-question-circle",n("toolbar.show-info"),"ui: hide extensions"):a("add","fa-solid fa-puzzle-piece",n("toolbar.load-extension"),"ui: show extensions");return It`
- ${a("run",`fa-play-circle ${i}`,n("toolbar.run"),"editor: eval all")} - ${a("clear",`fa fa-trash ${i}`,n("toolbar.clear"),"clear all")} - ${h} - ${a("shuffle","fa-random",n("toolbar.shuffle"),"gallery:showExample")} - ${a("mutator",`fa-dice ${i}`,n("toolbar.random"),"editor: randomize")} - ${e.serverURL===null?"":a("share",`fa-upload ${i}`,n("toolbar.upload"),"gallery:shareSketch")} - ${u} -
`}const FC=({content:e,header:t},i,n)=>{i.translation;const o=i.translation.selectedLanguage==="ar"&&i.showInfo===!0?"rtl":"ltr";return It` -
- -
-`},DC=(e,t,i)=>()=>i(e,t),Og=(e,t,i,n)=>It` -`,jC=(e,t,i,n)=>It`
- - -
-
{i("extensions: load example",t,0)}} style="cursor:pointer">${e.name} - ${e.author}
-
${e.description}
-
-
-
- ${Og("add-extension","fa-solid fa-plus",n("extensions.show-library",{"extension-name":e.name}),DC("extensions: add to editor",t,i))} - ${Og("show-documentation","fa-book-open",n("extensions.show-docs",{"extension-name":e.name}),()=>{window.open(e.documentation,"_blank")})} -
-
- ${e.examples.map((o,a)=>It`
{i("extensions: load example",t,a)}}>${a+1}
`)} -
-
`,PC=(e,t)=>{const{categories:i,selectedCategoryIndex:n}=e.extensions,o=i[n].entries,{t:a}=e.translation,u=It` -`,h=It`
- ${i.map((p,m)=>It`
t("extensions: select category",m)} - >${p.name}
`)} -
`;return{content:u,header:h}},Nr=e=>`href=${e} target=_blank`,GC=e=>It``;function WC(e,t){const{t:i,languages:n}=e.translation,o=Object.entries(n),a=e.showInfo&&o.length>1?It`
${o.map(([h,p])=>It` -
t("set language",h)}>${p}
-`)}
`:It`
`,u=e.showExtensions?PC(e,t):{content:GC(i),header:a};return FC(u,e,t)}var Bg=typeof gt<"u"?gt:typeof window<"u"?window:{},KC=Ss,Ao;typeof document<"u"?Ao=document:(Ao=Bg["__GLOBAL_DOCUMENT_CACHE@4"],Ao||(Ao=Bg["__GLOBAL_DOCUMENT_CACHE@4"]=KC));var c0=Ao,eu={exports:{}},Ro;typeof window<"u"?Ro=window:typeof gt<"u"?Ro=gt:typeof self<"u"?Ro=self:Ro={};var VC=Ro,Tf=c0,Fg=VC,jt=Object.create(null),h0="onloadid"+Math.random().toString(36).slice(2),Mn="data-"+h0,Ef=0;if(Fg&&Fg.MutationObserver){var zC=new MutationObserver(function(e){if(!(Object.keys(jt).length<1))for(var t=0;t0&&Lc(e[n].childNodes,t)}}var HC=eu.exports,$C=d0;class p0 extends Error{}p0.prototype.name="AssertionError";function d0(e,t){if(!e){var i=new p0(t);throw Error.captureStackTrace&&Error.captureStackTrace(i,d0),i}}const g0=c0,Lo=oh,ZC=Im,_h=HC,Uc=$C,XC=_h.KEY_ID,qC=_h.KEY_ATTR;var eT=lr;function tT(){return"ncid-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)}lr.makeID=tT;function lr(e){this._hasWindow=typeof window<"u",this._id=null,this._ncID=null,this._olID=null,this._proxy=null,this._loaded=!1,this._rootNodeName=null,this._name=e||"nanocomponent",this._rerender=!1,this._handleLoad=this._handleLoad.bind(this),this._handleUnload=this._handleUnload.bind(this),this._arguments=[];const t=this;Object.defineProperty(this,"element",{get:function(){const i=g0.getElementById(t._id);if(i)return i.dataset.nanocomponent===t._ncID?i:void 0}})}lr.prototype.render=function(){const e=Lo(this._name+".render"),t=this,i=new Array(arguments.length);let n;for(let o=0;o{o.setup=()=>{o.createCanvas(t,i,o[n])},o.draw=()=>{}},"hydra-ui"),this.width=t,this.height=i,this.mode=n,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvas.style.zIndex=-1}show(){this.canvas.style.visibility="visible"}hide(){this.canvas.style.visibility="hidden"}clear(){this.drawingContext.clearRect(0,0,this.canvas.width,this.canvas.height)}}var Ic={exports:{}},nT=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,sT=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],m0=function(t){var i=t,n=t.indexOf("["),o=t.indexOf("]");n!=-1&&o!=-1&&(t=t.substring(0,n)+t.substring(n,o).replace(/:/g,";")+t.substring(o,t.length));for(var a=nT.exec(t||""),u={},h=14;h--;)u[sT[h]]=a[h]||"";return n!=-1&&o!=-1&&(u.source=i,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=oT(u,u.path),u.queryKey=aT(u,u.query),u};function oT(e,t){var i=/\/{2,9}/g,n=t.replace(i,"/").split("/");return(t.substr(0,1)=="/"||t.length===0)&&n.splice(0,1),t.substr(t.length-1,1)=="/"&&n.splice(n.length-1,1),n}function aT(e,t){var i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,a){o&&(i[o]=a)}),i}var Jc={exports:{}},Nc={exports:{}},Po=1e3,Go=Po*60,Wo=Go*60,Ko=Wo*24,lT=Ko*365.25,uT=function(e,t){t=t||{};var i=typeof e;if(i==="string"&&e.length>0)return fT(e);if(i==="number"&&isNaN(e)===!1)return t.long?hT(e):cT(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function fT(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return i*lT;case"days":case"day":case"d":return i*Ko;case"hours":case"hour":case"hrs":case"hr":case"h":return i*Wo;case"minutes":case"minute":case"mins":case"min":case"m":return i*Go;case"seconds":case"second":case"secs":case"sec":case"s":return i*Po;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function cT(e){return e>=Ko?Math.round(e/Ko)+"d":e>=Wo?Math.round(e/Wo)+"h":e>=Go?Math.round(e/Go)+"m":e>=Po?Math.round(e/Po)+"s":e+"ms"}function hT(e){return sl(e,Ko,"day")||sl(e,Wo,"hour")||sl(e,Go,"minute")||sl(e,Po,"second")||e+" ms"}function sl(e,t,i){if(!(e=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(p){try{return JSON.stringify(p)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}};function n(p){var m=this.useColors;if(p[0]=(m?"%c":"")+this.namespace+(m?" %c":" ")+p[0]+(m?"%c ":" ")+"+"+t.humanize(this.diff),!!m){var _="color: "+this.color;p.splice(1,0,_,"color: inherit");var y=0,v=0;p[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(v=y))}),p.splice(v,0,_)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(p){try{p==null?t.storage.removeItem("debug"):t.storage.debug=p}catch{}}function u(){var p;try{p=t.storage.debug}catch{}return!p&&typeof process<"u"&&"env"in process&&(p={}.DEBUG),p}t.enable(u());function h(){try{return window.localStorage}catch{}}})(Jc,Jc.exports);var tu=Jc.exports,dT=m0,Pg=tu("socket.io-client:url"),gT=yT;function yT(e,t){var i=e;t=t||typeof location<"u"&&location,e==null&&(e=t.protocol+"//"+t.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=t.protocol+e:e=t.host+e),/^(https?|wss?):\/\//.test(e)||(Pg("protocol-less url %s",e),typeof t<"u"?e=t.protocol+"//"+e:e="https://"+e),Pg("parse %s",e),i=dT(e)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";var n=i.host.indexOf(":")!==-1,o=n?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+o+":"+i.port,i.href=i.protocol+"://"+o+(t&&t.port===i.port?"":":"+i.port),i}var ru={},Oc={exports:{}},Bc={exports:{}},Vo=1e3,zo=Vo*60,Qo=zo*60,Yo=Qo*24,mT=Yo*365.25,vT=function(e,t){t=t||{};var i=typeof e;if(i==="string"&&e.length>0)return _T(e);if(i==="number"&&isNaN(e)===!1)return t.long?bT(e):wT(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function _T(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return i*mT;case"days":case"day":case"d":return i*Yo;case"hours":case"hour":case"hrs":case"hr":case"h":return i*Qo;case"minutes":case"minute":case"mins":case"min":case"m":return i*zo;case"seconds":case"second":case"secs":case"sec":case"s":return i*Vo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function wT(e){return e>=Yo?Math.round(e/Yo)+"d":e>=Qo?Math.round(e/Qo)+"h":e>=zo?Math.round(e/zo)+"m":e>=Vo?Math.round(e/Vo)+"s":e+"ms"}function bT(e){return ol(e,Yo,"day")||ol(e,Qo,"hour")||ol(e,zo,"minute")||ol(e,Vo,"second")||e+" ms"}function ol(e,t,i){if(!(e=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(p){try{return JSON.stringify(p)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}};function n(p){var m=this.useColors;if(p[0]=(m?"%c":"")+this.namespace+(m?" %c":" ")+p[0]+(m?"%c ":" ")+"+"+t.humanize(this.diff),!!m){var _="color: "+this.color;p.splice(1,0,_,"color: inherit");var y=0,v=0;p[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(v=y))}),p.splice(v,0,_)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(p){try{p==null?t.storage.removeItem("debug"):t.storage.debug=p}catch{}}function u(){var p;try{p=t.storage.debug}catch{}return!p&&typeof process<"u"&&"env"in process&&(p={}.DEBUG),p}t.enable(u());function h(){try{return window.localStorage}catch{}}})(Oc,Oc.exports);var ST=Oc.exports,iu={},MT={}.toString,v0=Array.isArray||function(e){return MT.call(e)=="[object Array]"},_0=kT,CT=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",TT=typeof ArrayBuffer=="function",ET=function(e){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer};function kT(e){return CT&&Buffer.isBuffer(e)||TT&&(e instanceof ArrayBuffer||ET(e))}var wh=v0,w0=_0,b0=Object.prototype.toString,AT=typeof Blob=="function"||typeof Blob<"u"&&b0.call(Blob)==="[object BlobConstructor]",RT=typeof File=="function"||typeof File<"u"&&b0.call(File)==="[object FileConstructor]";iu.deconstructPacket=function(e){var t=[],i=e.data,n=e;return n.data=Fc(i,t),n.attachments=t.length,{packet:n,buffers:t}};function Fc(e,t){if(!e)return e;if(w0(e)){var i={_placeholder:!0,num:t.length};return t.push(e),i}else if(wh(e)){for(var n=new Array(e.length),o=0;o=0&&e.numn&&(i=n),t>=n||t>=i||n===0)return new ArrayBuffer(0);for(var o=new Uint8Array(e),a=new Uint8Array(i-t),u=t,h=0;u=55296&&o<=56319&&i65535&&(n-=65536,o+=Pi(n>>>10&1023|55296),n=56320|n&1023),o+=Pi(n);return o}function C0(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function kf(e,t){return Pi(e>>t&63|128)}function VT(e,t){if(!(e&4294967168))return Pi(e);var i="";return e&4294965248?e&4294901760?e&4292870144||(i=Pi(e>>18&7|240),i+=kf(e,12),i+=kf(e,6)):(C0(e,t)||(e=65533),i=Pi(e>>12&15|224),i+=kf(e,6)):i=Pi(e>>6&31|192),i+=Pi(e&63|128),i}function zT(e,t){t=t||{};for(var i=t.strict!==!1,n=M0(e),o=n.length,a=-1,u,h="";++a=Fl)throw Error("Invalid byte index");var e=Bl[Wi]&255;if(Wi++,(e&192)==128)return e&63;throw Error("Invalid continuation byte")}function QT(e){var t,i,n,o,a;if(Wi>Fl)throw Error("Invalid byte index");if(Wi==Fl)return!1;if(t=Bl[Wi]&255,Wi++,!(t&128))return t;if((t&224)==192){if(i=rs(),a=(t&31)<<6|i,a>=128)return a;throw Error("Invalid continuation byte")}if((t&240)==224){if(i=rs(),n=rs(),a=(t&15)<<12|i<<6|n,a>=2048)return C0(a,e)?a:65533;throw Error("Invalid continuation byte")}if((t&248)==240&&(i=rs(),n=rs(),o=rs(),a=(t&7)<<18|i<<12|n<<6|o,a>=65536&&a<=1114111))return a;throw Error("Invalid UTF-8 detected")}var Bl,Fl,Wi;function YT(e,t){t=t||{};var i=t.strict!==!1;Bl=M0(e),Fl=Bl.length,Wi=0;for(var n=[],o;(o=QT(i))!==!1;)n.push(o);return KT(n)}var HT={version:"2.1.2",encode:zT,decode:YT},al={},Gg;function $T(){return Gg||(Gg=1,function(e){al.encode=function(t){var i=new Uint8Array(t),n,o=i.length,a="";for(n=0;n>2],a+=e[(i[n]&3)<<4|i[n+1]>>4],a+=e[(i[n+1]&15)<<2|i[n+2]>>6],a+=e[i[n+2]&63];return o%3===2?a=a.substring(0,a.length-1)+"=":o%3===1&&(a=a.substring(0,a.length-2)+"=="),a},al.decode=function(t){var i=t.length*.75,n=t.length,o,a=0,u,h,p,m;t[t.length-1]==="="&&(i--,t[t.length-2]==="="&&i--);var _=new ArrayBuffer(i),y=new Uint8Array(_);for(o=0;o>4,y[a++]=(h&15)<<4|p>>2,y[a++]=(p&3)<<6|m&63;return _}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")),al}var Af,Wg;function ZT(){if(Wg)return Af;Wg=1;var e=typeof e<"u"?e:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:!1,t=function(){try{var h=new Blob(["hi"]);return h.size===2}catch{return!1}}(),i=t&&function(){try{var h=new Blob([new Uint8Array([1,2])]);return h.size===2}catch{return!1}}(),n=e&&e.prototype.append&&e.prototype.getBlob;function o(h){return h.map(function(p){if(p.buffer instanceof ArrayBuffer){var m=p.buffer;if(p.byteLength!==m.byteLength){var _=new Uint8Array(p.byteLength);_.set(new Uint8Array(m,p.byteOffset,p.byteLength)),m=_.buffer}return m}return p})}function a(h,p){p=p||{};var m=new e;return o(h).forEach(function(_){m.append(_)}),p.type?m.getBlob(p.type):m.getBlob()}function u(h,p){return new Blob(o(h),p||{})}return typeof Blob<"u"&&(a.prototype=Blob.prototype,u.prototype=Blob.prototype),Af=function(){return t?i?Blob:u:n?a:void 0}(),Af}(function(e){var t=JT,i=S0,n=jT,o=PT,a=HT,u;typeof ArrayBuffer<"u"&&(u=$T());var h=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),p=typeof navigator<"u"&&/PhantomJS/i.test(navigator.userAgent),m=h||p;e.protocol=3;var _=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},y=t(_),v={type:"error",data:"parser error"},x=ZT();e.encodePacket=function(O,P,F,V){typeof P=="function"&&(V=P,P=!1),typeof F=="function"&&(V=F,F=null);var D=O.data===void 0?void 0:O.data.buffer||O.data;if(typeof ArrayBuffer<"u"&&D instanceof ArrayBuffer)return R(O,P,V);if(typeof x<"u"&&D instanceof x)return g(O,P,V);if(D&&D.base64)return U(O,V);var ee=_[O.type];return O.data!==void 0&&(ee+=F?a.encode(String(O.data),{strict:!1}):String(O.data)),V(""+ee)};function U(O,P){var F="b"+e.packets[O.type]+O.data.data;return P(F)}function R(O,P,F){if(!P)return e.encodeBase64Packet(O,F);var V=O.data,D=new Uint8Array(V),ee=new Uint8Array(1+V.byteLength);ee[0]=_[O.type];for(var A=0;A1?{type:y[D],data:O.substring(1)}:{type:y[D]}}var V=new Uint8Array(O),D=V[0],ee=n(O,1);return x&&P==="blob"&&(ee=new x([ee])),{type:y[D],data:ee}};function L(O){try{O=a.decode(O,{strict:!1})}catch{return!1}return O}e.decodeBase64Packet=function(O,P){var F=y[O.charAt(0)];if(!u)return{type:F,data:{base64:!0,data:O.substr(1)}};var V=u.decode(O.substr(1));return P==="blob"&&x&&(V=new x([V])),{type:F,data:V}},e.encodePayload=function(O,P,F){typeof P=="function"&&(F=P,P=null);var V=i(O);if(P&&V)return x&&!m?e.encodePayloadAsBlob(O,F):e.encodePayloadAsArrayBuffer(O,F);if(!O.length)return F("0:");function D(A){return A.length+":"+A}function ee(A,q){e.encodePacket(A,V?P:!1,!1,function(Z){q(null,D(Z))})}G(O,ee,function(A,q){return F(q.join(""))})};function G(O,P,F){for(var V=new Array(O.length),D=o(O.length,F),ee=function(q,Z,ce){P(Z,function(ye,ie){V[q]=ie,ce(ye,V)})},A=0;A0;){for(var ee=new Uint8Array(V),A=ee[0]===0,q="",Z=1;ee[Z]!==255;Z++){if(q.length>310)return F(v,0,1);q+=ee[Z]}V=n(V,2+q.length),q=parseInt(q);var ce=n(V,0,q);if(A)try{ce=String.fromCharCode.apply(null,new Uint8Array(ce))}catch{var ye=new Uint8Array(ce);ce="";for(var Z=0;Z0);return t}function XT(e){var t=0;for(Ki=0;Ki0)return tE(e);if(i==="number"&&isNaN(e)===!1)return t.long?iE(e):rE(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function tE(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return i*qT;case"days":case"day":case"d":return i*Xo;case"hours":case"hour":case"hrs":case"hr":case"h":return i*Zo;case"minutes":case"minute":case"mins":case"min":case"m":return i*$o;case"seconds":case"second":case"secs":case"sec":case"s":return i*Ho;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function rE(e){return e>=Xo?Math.round(e/Xo)+"d":e>=Zo?Math.round(e/Zo)+"h":e>=$o?Math.round(e/$o)+"m":e>=Ho?Math.round(e/Ho)+"s":e+"ms"}function iE(e){return ll(e,Xo,"day")||ll(e,Zo,"hour")||ll(e,$o,"minute")||ll(e,Ho,"second")||e+" ms"}function ll(e,t,i){if(!(e=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(p){try{return JSON.stringify(p)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}};function n(p){var m=this.useColors;if(p[0]=(m?"%c":"")+this.namespace+(m?" %c":" ")+p[0]+(m?"%c ":" ")+"+"+t.humanize(this.diff),!!m){var _="color: "+this.color;p.splice(1,0,_,"color: inherit");var y=0,v=0;p[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(v=y))}),p.splice(v,0,_)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(p){try{p==null?t.storage.removeItem("debug"):t.storage.debug=p}catch{}}function u(){var p;try{p=t.storage.debug}catch{}return!p&&typeof process<"u"&&"env"in process&&(p={}.DEBUG),p}t.enable(u());function h(){try{return window.localStorage}catch{}}})(Gc,Gc.exports);var ou=Gc.exports,A0=Ch(),sE=Cs,R0=En,oE=su,aE=k0,Fr=ou("engine.io-client:polling"),L0=oi,lE=function(){var e=Sh,t=new e({xdomain:!1});return t.responseType!=null}();function oi(e){var t=e&&e.forceBase64;(!lE||t)&&(this.supportsBinary=!1),A0.call(this,e)}oE(oi,A0);oi.prototype.name="polling";oi.prototype.doOpen=function(){this.poll()};oi.prototype.pause=function(e){var t=this;this.readyState="pausing";function i(){Fr("paused"),t.readyState="paused",e()}if(this.polling||!this.writable){var n=0;this.polling&&(Fr("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){Fr("pre-pause polling complete"),--n||i()})),this.writable||(Fr("we are currently writing - waiting to pause"),n++,this.once("drain",function(){Fr("pre-pause writing complete"),--n||i()}))}else i()};oi.prototype.poll=function(){Fr("polling"),this.polling=!0,this.doPoll(),this.emit("poll")};oi.prototype.onData=function(e){var t=this;Fr("polling got data %s",e);var i=function(n,o,a){if(t.readyState==="opening"&&n.type==="open"&&t.onOpen(),n.type==="close")return t.onClose(),!1;t.onPacket(n)};R0.decodePayload(e,this.socket.binaryType,i),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():Fr('ignoring poll - transport state "%s"',this.readyState))};oi.prototype.doClose=function(){var e=this;function t(){Fr("writing close packet"),e.write([{type:"close"}])}this.readyState==="open"?(Fr("transport open - closing"),t()):(Fr("transport not open - deferring close"),this.once("open",t))};oi.prototype.write=function(e){var t=this;this.writable=!1;var i=function(){t.writable=!0,t.emit("drain")};R0.encodePayload(e,this.supportsBinary,function(n){t.doWrite(n,i)})};oi.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",i="";this.timestampRequests!==!1&&(e[this.timestampParam]=aE()),!this.supportsBinary&&!e.sid&&(e.b64=1),e=sE.encode(e),this.port&&(t==="https"&&Number(this.port)!==443||t==="http"&&Number(this.port)!==80)&&(i=":"+this.port),e.length&&(e="?"+e);var n=this.hostname.indexOf(":")!==-1;return t+"://"+(n?"["+this.hostname+"]":this.hostname)+i+this.path+e};var uE=Sh,U0=L0,fE=Tn,cE=su,Kc=ou("engine.io-client:polling-xhr"),hE=xh;Mh.exports=Ts;Mh.exports.Request=Jt;function Qg(){}function Ts(e){if(U0.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,typeof location<"u"){var t=location.protocol==="https:",i=location.port;i||(i=t?443:80),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port,this.xs=e.secure!==t}}cE(Ts,U0);Ts.prototype.supportsBinary=!0;Ts.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.withCredentials=this.withCredentials,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new Jt(e)};Ts.prototype.doWrite=function(e,t){var i=typeof e!="string"&&e!==void 0,n=this.request({method:"POST",data:e,isBinary:i}),o=this;n.on("success",t),n.on("error",function(a){o.onError("xhr post error",a)}),this.sendXhr=n};Ts.prototype.doPoll=function(){Kc("xhr poll");var e=this.request(),t=this;e.on("data",function(i){t.onData(i)}),e.on("error",function(i){t.onError("xhr poll error",i)}),this.pollXhr=e};function Jt(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=e.async!==!1,this.data=e.data!==void 0?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}fE(Jt.prototype);Jt.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new uE(e),i=this;try{Kc("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(var n in this.extraHeaders)this.extraHeaders.hasOwnProperty(n)&&t.setRequestHeader(n,this.extraHeaders[n])}}catch{}if(this.method==="POST")try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in t&&(t.withCredentials=this.withCredentials),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){i.onLoad()},t.onerror=function(){i.onError(t.responseText)}):t.onreadystatechange=function(){if(t.readyState===2)try{var o=t.getResponseHeader("Content-Type");(i.supportsBinary&&o==="application/octet-stream"||o==="application/octet-stream; charset=UTF-8")&&(t.responseType="arraybuffer")}catch{}t.readyState===4&&(t.status===200||t.status===1223?i.onLoad():setTimeout(function(){i.onError(typeof t.status=="number"?t.status:0)},0))},Kc("xhr data %s",this.data),t.send(this.data)}catch(o){setTimeout(function(){i.onError(o)},0);return}typeof document<"u"&&(this.index=Jt.requestsCount++,Jt.requests[this.index]=this)};Jt.prototype.onSuccess=function(){this.emit("success"),this.cleanup()};Jt.prototype.onData=function(e){this.emit("data",e),this.onSuccess()};Jt.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)};Jt.prototype.cleanup=function(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Qg:this.xhr.onreadystatechange=Qg,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Jt.requests[this.index],this.xhr=null}};Jt.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch{}t==="application/octet-stream"||t==="application/octet-stream; charset=UTF-8"?e=this.xhr.response||this.xhr.responseText:e=this.xhr.responseText}catch(i){this.onError(i)}e!=null&&this.onData(e)};Jt.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR};Jt.prototype.abort=function(){this.cleanup()};Jt.requestsCount=0;Jt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Yg);else if(typeof addEventListener=="function"){var pE="onpagehide"in hE?"pagehide":"unload";addEventListener(pE,Yg,!1)}}function Yg(){for(var e in Jt.requests)Jt.requests.hasOwnProperty(e)&&Jt.requests[e].abort()}var dE=Mh.exports,Eh=L0,gE=su,Hg=xh,yE=Es,mE=/\n/g,vE=/\\n/g,ul;function _E(){}function Es(e){Eh.call(this,e),this.query=this.query||{},ul||(ul=Hg.___eio=Hg.___eio||[]),this.index=ul.length;var t=this;ul.push(function(i){t.onData(i)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){t.script&&(t.script.onerror=_E)},!1)}gE(Es,Eh);Es.prototype.supportsBinary=!1;Es.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Eh.prototype.doClose.call(this)};Es.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(o){e.onError("jsonp poll error",o)};var i=document.getElementsByTagName("script")[0];i?i.parentNode.insertBefore(t,i):(document.head||document.body).appendChild(t),this.script=t;var n=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);n&&setTimeout(function(){var o=document.createElement("iframe");document.body.appendChild(o),document.body.removeChild(o)},100)};Es.prototype.doWrite=function(e,t){var i=this;if(!this.form){var n=document.createElement("form"),o=document.createElement("textarea"),a=this.iframeId="eio_iframe_"+this.index,u;n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=a,n.method="POST",n.setAttribute("accept-charset","utf-8"),o.name="d",n.appendChild(o),document.body.appendChild(n),this.form=n,this.area=o}this.form.action=this.uri();function h(){p(),t()}function p(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(_){i.onError("jsonp polling iframe removal error",_)}try{var m='