zeed 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ var Ot=Object.defineProperty;var r=(e,t)=>Ot(e,"name",{value:t,configurable:!0});function $t(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}r($t,"_global");function Y(){let e=$t();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}r(Y,"getGlobalContext");function oe(e={}){let{level:t=void 0,filter:n=void 0}=e,o=V(n),i=re(t);return s=>{if(!i(s.level)||!o(s.name))return;let u=s.name?`[${s.name}]`:"";switch(s.level){case 1:console.info(`I|* ${u}`,...s.messages);break;case 2:console.warn(`W|** ${u}`,...s.messages);break;case 3:console.error(`E|*** ${u}`,...s.messages);break;default:console.debug(`D| ${u}`,...s.messages);break}}}r(oe,"LoggerConsoleHandler");var Q=(a=>(a[a.all=-1]="all",a[a.debug=0]="debug",a[a.info=1]="info",a[a.warn=2]="warn",a[a.error=3]="error",a[a.fatal=4]="fatal",a[a.off=1/0]="off",a))(Q||{}),Ne={"*":-1,a:-1,all:-1,d:0,dbg:0,debug:0,i:1,inf:1,info:1,w:2,warn:2,warning:2,e:3,err:3,error:3,fatal:4,off:1/0,"-":1/0};function Ge(e=""){let t=[oe()],n=r(c=>!0,"logCheckNamespace"),o=!1,i=u,s=!1;function u(c="",l){let f=ye(l??-1);function d(m,g){return f<=m?g:()=>{}}r(d,"defineForLogLevel");let h=d(0,(...m)=>{x({name:c,messages:m,level:0})});h.label=c,h.extend=function(m){return i(c?`${c}:${m}`:m)};let x=r(m=>{if(n(c))for(let g of t)g&&g(m)},"emit");return h.debug=d(0,(...m)=>{x({name:c,messages:m,level:0})}),h.info=d(1,(...m)=>{x({name:c,messages:m,level:1})}),h.warn=d(2,(...m)=>{x({name:c,messages:m,level:2})}),h.error=d(3,(...m)=>{x({name:c,messages:m,level:3})}),h.fatal=d(4,(...m)=>{throw x({name:c,messages:m,level:4}),new Error(`${m.map(String).join(" ")}`)}),h.assert=d(4,(m,...g)=>{m||h.fatal(...g)}),h}r(u,"LoggerBaseFactory");function a(c="",l){let f=i(c,l);return s&&f.debug(`+++ init of logger "${c}" on level "${Q[f.level]}".`),f}return r(a,"Logger"),a.registerHandler=function(c){t.push(c)},a.setFilter=function(c){n=V(c)},a.setLock=(c=!0)=>o=c,a.setDebug=(c=!0)=>s=c,a.setHandlers=function(c=[]){i!==u&&(i=u),!o&&(t=[...c].filter(l=>typeof l=="function"))},a.level=-1,a.setLogLevel=function(c=-1){o||(a.level=c)},a.setFactory=function(c){o||(i=c)},a}r(Ge,"LoggerContext");function Bt(e){return e===!0||e==="true"||e==="1"||typeof e=="number"&&e!==0?e="*":e===!1||e==="false"||e===0||e==="0"||e==null||e==="null"||e==="undefined"?e="":e=String(e),e}r(Bt,"getNamespaceFilterString");var _t=Bt(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*");function V(e=_t){let t,n=[],o=[];if(!e)t=r(function(i){return!1},"fn");else if(e==="*")t=r(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),u=s.length;for(i=0;i<u;i++){if(!s[i])continue;let a=s[i].replace(/\*/g,".*?");a[0]==="-"?n.push(new RegExp(`^${a.substr(1)}$`)):o.push(new RegExp(`^${a}$`))}t=r(function(a){if(n.length===0&&o.length===0)return!0;let c,l;for(c=0,l=n.length;c<l;c++)if(n[c].test(a))return!1;for(c=0,l=o.length;c<l;c++)if(o[c].test(a))return!0;return!1},"fn")}return t.accept=o,t.reject=n,t.filter=e,t}r(V,"useNamespaceFilter");var jt=typeof process<"u"?process.env.ZEED_LEVEL??process.env.LEVEL??process.env.DEBUG_LEVEL:typeof localStorage<"u"?localStorage.zeed_level??localStorage.level??localStorage.debug_level:void 0;function ye(e){if(e===!1)return 1/0;if(typeof e=="number")return e;if(typeof e=="string"){let t=Ne[e.toLocaleLowerCase().trim()];if(t!=null)return t}return-1}r(ye,"parseLogLevel");function re(e=jt){let t=ye(e);return n=>n>=t}r(re,"useLevelFilter");var _;function he(){let e=Ge();return e.setHandlers([oe()]),e}r(he,"getLoggerContext");function Ht(){if(_==null)try{let e=Y();e!=null?e?.logger==null?(_=he(),e.logger=_):_=e.logger:_=he()}catch{_=he()}return _}r(Ht,"getGlobalLogger");var v=Ht();var Ve=r((e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,o)=>(n[o]=t[o],n),{}):t,"_sortedReplacer");function wr(e,t=void 0){return JSON.stringify(e,Ve,t)}r(wr,"jsonStringifySorted");function zt(e,t){let n=[],o=[];return t==null&&(t=r(function(i,s){return n[0]===s?"[Circular ~]":`[Circular ~.${o.slice(0,n.indexOf(s)).join(".")}]`},"cycleReplacer")),function(i,s){if(n.length>0){let u=n.indexOf(this);~u?n.splice(u+1):n.push(this),~u?o.splice(u,1/0,i):o.push(i),~n.indexOf(s)&&(s=t?.call(this,i,s))}else n.push(s);s=Ve(i,s);try{return e==null?s:e.call(this,i,s)}catch{}return String(s)}}r(zt,"serializer");function R(e,t,n,o){return JSON.stringify(e,zt(t,o),n)}r(R,"jsonStringifySafe");var Lr=R;var qe=v("zeed:bin","error");function Nt(e){let t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.codePointAt(i)||0;return o}r(Nt,"_encodeUtf8Polyfill");function Gt(e){let t=e.length,n="",o=0;for(;t>0;){let i=t<1e4?t:1e4,s=e.subarray(o,o+i);o+=i,n+=String.fromCodePoint.apply(null,s),t-=i}return decodeURIComponent(escape(n))}r(Gt,"_decodeUtf8Polyfill");var ie;function Je(e){if(ie==null&&(ie=Nt,typeof TextEncoder<"u")){let t=new TextEncoder;ie=r(n=>t.encode(n),"_textEncoder")}return ie(e.normalize("NFC"))}r(Je,"stringToUInt8Array");var se;function Ze(e){if(se==null&&(se=Gt,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});se=r(n=>t.decode(n),"_textDecoder")}return se(e).normalize("NFC")}r(Ze,"Uint8ArrayToString");function U(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Je(e):e.length?new Uint8Array(e):e}r(U,"toUint8Array");function Ur(...e){let t=0,n=e.flat(1).map(s=>{let u=U(s);return t+=u.length,u}),o=new Uint8Array(t),i=0;for(let s of n)o.set(s,i),i+=s.length;return o}r(Ur,"joinToUint8Array");function We(e){if(typeof Buffer<"u")return Buffer.from(U(e)).toString("hex");let t="0123456789abcdef",n="";for(let o of[...U(e)])n+=t[o>>4]+t[o&15];return n}r(We,"toHex");function Ke(e){return Uint8Array.from(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}r(Ke,"fromHex");function Ye(e,t=!1){let n=U(e),o="";if(typeof Buffer<"u")o=Buffer.from(n).toString("base64");else{let i="";for(let s=0;s<n.byteLength;s++)i+=String.fromCharCode(n[s]);o=btoa(i)}return t?o.replaceAll("=",""):o}r(Ye,"toBase64");function Er(e){let t=U(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64url").replaceAll("=","");let n="";for(let o=0;o<t.byteLength;o++)n+=String.fromCharCode(t[o]);return btoa(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}r(Er,"toBase64Url");function Vt(e){if(e=e.replaceAll("-","+").replaceAll("_","/"),typeof Buffer<"u"){let o=Buffer.from(e,"base64");return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}r(Vt,"fromBase64");function Mr(e){return Ze(Vt(e))}r(Mr,"fromBase64String");function Qe(e,t){if(e.byteLength!==t.byteLength)return!1;let n=U(e),o=U(t);for(let i=0;i<n.length;i++)if(n[i]!==o[i])return!1;return!0}r(Qe,"equalBinary");function xe(e){try{return Je(R(e))}catch(t){throw qe.warn("jsonToUint8Array",e),t}}r(xe,"jsonToUint8Array");function be(e){try{return JSON.parse(Ze(e))}catch(t){throw qe.warn("Uint8ArrayToJson",e),t}}r(be,"Uint8ArrayToJson");function Xe(e,t){if(typeof e!="string")if(e instanceof ArrayBuffer&&e.byteLength!==void 0)e=String.fromCharCode.apply(String,[].slice.call(new Uint8Array(e)));else if(Array.isArray(e))e=String.fromCharCode.apply(String,e);else if(e.constructor===Uint8Array)e=String.fromCharCode.apply(String,[].slice.call(e));else return!1;t=t||16;let n=[],o="0123456789ABCDEF";for(let i=0;i<e.length;i+=t){let s=e.slice(i,Math.min(i+t,e.length)),u=`0000${i.toString(16)}`.slice(-4),a=s.split("").map(l=>{let f=l.charCodeAt(0);return` ${o[(240&f)>>4]}${o[15&f]}`}).join("");a+=" ".repeat(t-s.length);let c=s.replace(/[\x00-\x1F\x20]/g,".");c+=" ".repeat(t-s.length),n.push(`${u} ${a} ${c}`)}return n.join(`
2
+ `)}r(Xe,"Uint8ArrayToHexDump");function q(e=16){let t=new Uint8Array(e);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256);return t}r(q,"randomUint8Array");var tt="SHA-256",Te="AES-GCM",et="PBKDF2",qt=1e5;async function Fr(e,t=tt){return U(await crypto.subtle.digest(t,U(e)))}r(Fr,"digest");async function kr(e,t={}){let n=U(e),o=await crypto.subtle.importKey("raw",n,et,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:et,salt:t.salt?U(t.salt):new Uint8Array(0),iterations:t.iterations??qt,hash:tt},o,{name:Te,length:256},!0,["encrypt","decrypt"])}r(kr,"deriveKeyPbkdf2");var ae=new Uint8Array([1,1]);async function nt(e,t){let n=q(12),o=await crypto.subtle.encrypt({name:Te,iv:n},t,e),i=new Uint8Array(o),s=ae.length+n.length+i.length,u=new Uint8Array(s),a=0;return u.set(ae,a),a+=ae.length,u.set(n,a),a+=n.length,u.set(i,a),u}r(nt,"encrypt");async function rt(e,t){let n=e.subarray(0,2);if(!Qe(n,ae))return Promise.reject(new Error(`Unknown magic ${n}`));let o=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:Te,iv:o},t,i);return new Uint8Array(s)}r(rt,"decrypt");function Jt(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}r(Jt,"getSecureRandom");function D(){return typeof crypto<"u"?Jt():Math.random()}r(D,"getSecureRandomIfPossible");function $r(e=.25){return D()<e}r($r,"randomBoolean");function Br(e=100,t=0){return t+Math.floor(D()*(e-t))}r(Br,"randomInt");function _r(e=100,t=0){return t+D()*(e-t)}r(_r,"randomFloat");function jr(e,t,n){return Math.max(e,Math.min(n,t))}r(jr,"between");function Zt(e){return e.reduce((t,n)=>t+n,0)}r(Zt,"sum");function Hr(e){return Zt(e)/e.length}r(Hr,"avg");function zr(e){return!/^1?$|^(11+?)\1+$/.test("1".repeat(e))}r(zr,"isPrimeRX");function Nr(e){for(let t=2;t<e;t++)if(e%t===0)return!1;return e>1}r(Nr,"isPrime");var we=6;function Gr(e=0,t=1,n){we=((n??we)*9301+49297)%233280;let o=we/233280;return t+o*(e-t)}r(Gr,"seededRandom");function Wt(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}r(Wt,"parseOrderby");function Jr(e,t=!0){return`${e} ${t?"asc":"desc"}`}r(Jr,"composeOrderby");function Le(e,t,n=!0){let o=e||0,i=t||0;return o>i?n?1:-1:o<i?n?-1:1:0}r(Le,"cmp");function Zr(e,...t){if(t.length>0){let n=t.map(Wt),o=Array.from(e);return o.sort((i,s)=>{for(let{field:u,asc:a}of n){let c=Le(i[u],s[u],a);if(c!==0)return c}return 0}),o}return e}r(Zr,"sortedOrderby");function ve(e){return e.filter((t,n)=>e.indexOf(t)===n)}r(ve,"arrayUnique");function Kt(e,t){return ve(e.filter(n=>!t.includes(n)))}r(Kt,"arrayMinus");function Yt(...e){return ve(e.reduce((t=[],n)=>t.concat(n),[]))}r(Yt,"arrayUnion");function J(...e){return e.flat(1/0)}r(J,"arrayFlatten");function Qt(e,t){return ve(e).filter(n=>t.includes(n))}r(Qt,"arrayIntersection");function Xr(e,t){return Kt(Yt(e,t),Qt(e,t))}r(Xr,"arraySymmetricDifference");function Ae(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return[]}r(Ae,"arrayRemoveElement");function eo(e,t){return e.includes(t)||e.push(t),e}r(eo,"arraySetElement");function De(e,t){return e.splice(0,e.length,...e.filter(t)),e}r(De,"arrayFilterInPlace");function to(e,t){let n=e.findIndex(o=>o===t);return n>=0?e.splice(n,1):e.push(t),e}r(to,"arrayToggleInPlace");function no(e){return e.splice(0,e.length),e}r(no,"arrayEmptyInPlace");function Xt(e,t=Le){return Array.from(e).sort(t)}r(Xt,"arraySorted");function ro(e){return Xt(e,(t,n)=>t-n)}r(ro,"arraySortedNumbers");function en(e,t){return e.length===t.length&&e.every((n,o)=>n===t[o])}r(en,"arrayIsEqual");function ot(e){return e.sort(()=>D()>.5?1:-1),e}r(ot,"arrayShuffleInPlace");function oo(e){return ot(Array.from(e))}r(oo,"arrayShuffle");function io(e){for(;e.length>1;){let t=Array.from(e);if(ot(t),!en(e,t))return t}return e}r(io,"arrayShuffleForce");function so(e){return e[Math.floor(D()*e.length)]}r(so,"arrayRandomElement");function ao(...e){return J(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}r(ao,"arrayMax");function uo(...e){return J(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}r(uo,"arrayMin");function co(...e){return J(e).reduce((t,n)=>t+n,0)}r(co,"arraySum");function lo(...e){let t=J(e);return t.reduce((n,o)=>n+o,0)/t.length}r(lo,"arrayAvg");function fo(e,t){let n=[],o=0,i=e.length;for(;o<i;)n.push(e.slice(o,o+=t));return n}r(fo,"arrayBatches");function po(e=0,t){if(e<=0)return[];let n=new Array(e);for(let o=0;o<e;o++)n[o]=t instanceof Function?t(o):t;return n}r(po,"createArray");var tn=v("zeed:basex","error"),nn={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789abcdefghjkmnpqrtuvwxyz","32-crockford":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-geohash":"0123456789bcdefghjkmnpqrstuvwxyz","32-agnoster":"0123456789abcdefghjkmnpqrtuvwxyz","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function j(e){let t=nn[String(e)];if(!t)if(typeof e=="string")t=e;else throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let n=new Uint8Array(256);for(let l=0;l<n.length;l++)n[l]=255;for(let l=0;l<t.length;l++){let f=t.charAt(l),d=f.charCodeAt(0);if(n[d]!==255)throw new TypeError(`${f} is ambiguous`);n[d]=l}let o=t.length,i=t.charAt(0),s=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function a(l,f=-1){let d=U(l);if(d.byteLength===0)return"";let h=0,x=0,m=d.byteLength;for(;x!==m&&d[x]===0;)x++;let g=(m-x)*u+1>>>0,p=new Uint8Array(g);for(;x!==m;){let b=d[x],A=0;for(let T=g-1;(b!==0||A<h)&&T!==-1;T--,A++)b+=256*p[T]>>>0,p[T]=b%o>>>0,b=b/o>>>0;if(b!==0)throw tn.warn("Non-zero carry",d,f,A,g),new Error("Non-zero carry");h=A,x++}let y=g-h;for(;y!==g&&p[y]===0;)y++;let w="";for(;y<g;++y)w+=t.charAt(p[y]);return f>0?w.padStart(f,i):w}r(a,"encode");function c(l,f=-1){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;l=l.replace(/\s+/gi,"");let d=0,h=0;for(;l[d]===i;)d++;let x=(l.length-d)*s+1>>>0,m=new Uint8Array(x);for(;l[d];){let p=n[l.charCodeAt(d)];if(p===255)throw new Error(`Unsupported character "${l[d]}"`);let y=0;for(let w=x-1;(p!==0||y<h)&&w!==-1;w--,y++)p+=o*m[w]>>>0,m[w]=p%256>>>0,p=p/256>>>0;if(p!==0)throw new Error("Non-zero carry");h=y,d++}let g=x-h;for(;g!==x&&m[g]===0;)g++;return f>0?new Uint8Array([...new Uint8Array(f-m.length+g),...m.slice(g)]):m.slice(g)}return r(c,"decode"),{encode:a,decode:c}}r(j,"useBase");var{encode:xo,decode:rn}=j(32);function bo(e){return rn(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"))}r(bo,"decodeBase32");var{encode:To,decode:wo}=j(16),{encode:Lo,decode:vo}=j(58),{encode:Ao,decode:Do}=j(62);function Po(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}r(Po,"estimateSizeForBase");var Mo=r(e=>(e.length>0&&(/^[A-Z0-9_\-\ ]*$/g.test(e)&&(e=e.toLowerCase()),e=e.replace(/^[-_\ ]+/gi,"").replace(/[-_\ ]+$/gi,"").replace(/[-_\ ]+([a-z0-9])/gi,(t,n)=>n.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e),"toCamelCase");function on(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}r(on,"toCapitalize");function Ro(e){return e.replace(/\w\S*/g,on)}r(Ro,"toCapitalizeWords");function So(e,t="-"){return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}r(So,"fromCamelCase");var it=["1","true","yes","y","on"];function Io(e,t=!1){return e==null||typeof e!="string"?t:it.includes(String(e).trim().toLowerCase())}r(Io,"stringToBoolean");function Oo(e,t=0){return e==null||typeof e!="string"?t:parseInt(e.trim(),10)??t}r(Oo,"stringToInteger");function $o(e,t=0){return e==null||typeof e!="string"?t:parseFloat(e.trim())??t}r($o,"stringToFloat");function sn(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:it.includes(String(e).trim().toLowerCase())}r(sn,"valueToBoolean");function an(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseInt(String(e).trim(),10)??t}r(an,"valueToInteger");function un(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseFloat(String(e).trim())??t}r(un,"valueToFloat");function Pe(e,t=""){return e==null?t:String(e)??t}r(Pe,"valueToString");var Bo=un,_o=an,jo=Pe,Ho=sn;function cn(e,t={}){let{trace:n=!0,pretty:o=!0}=t;return e.map(i=>{if(i&&typeof i=="object"){if(o&&(i instanceof Uint8Array||i instanceof ArrayBuffer))return`
3
+ ${Xe(i)}
4
+ `;if(i instanceof Error)return n?`${i.name||"Error"}: ${i.message}
5
+ ${i.stack}`:`${i.name||"Error"}: ${i.message}`;try{return o?JSON.stringify(i,null,2):JSON.stringify(i)}catch{}}return String(i)})}r(cn,"formatMessages");function zo(e,t={}){return cn(e,t).join(" ")}r(zo,"renderMessages");function No(e){try{return decodeURIComponent(escape(e))}catch{}return e}r(No,"fixBrokenUth8String");var Ee=864e5;function Me(e){return Math.floor(e/1e4)}r(Me,"dayYear");function st(e){return Math.floor(e/100%100)}r(st,"dayMonth");function ln(e){return Math.floor(e%100)}r(ln,"dayDay");function qo(e){return[Me(e),st(e),ln(e)]}r(qo,"dayToParts");function at(e,t=!1){return t?new Date(`${dn(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}r(at,"dayToDate");function ut(){return ce(new Date)}r(ut,"dayFromToday");function Jo(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return ct(e);if(Array.isArray(e)&&e.length===3){let[n,o,i]=e;return Re(n,o,i)}else if(e instanceof Date)return ce(e,t)}r(Jo,"dayFromAny");function Zo(e){return at(e,!0)}r(Zo,"dayToDateGMT");function ce(e,t=!1){return t?ct(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}r(ce,"dayFromDate");function Wo(e){return ce(e,!0)}r(Wo,"dayFromDateGMT");function Ue(e,t=!0){return at(e,t).getTime()}r(Ue,"dayToTimestamp");function fn(e,t=!0){return ce(new Date(e),t)}r(fn,"dayFromTimestamp");function dn(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}r(dn,"dayToString");function Re(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}r(Re,"dayFromParts");function ct(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return+t}r(ct,"dayFromString");function Ko(e,t=0){let n=Me(e),o=st(e);return t!==0&&(o+=t,n+=Math.floor((o-1)/12),o=Math.floor((o-1)%12)+1,o===0&&(o=12)),Re(n,o,1)}r(Ko,"dayMonthStart");function Yo(e,t=0){let n=Me(e);return Re(n+t,1,1)}r(Yo,"dayYearStart");function ue(e,t){return fn(Ue(e)+t*864e5)}r(ue,"dayOffset");function Qo(e,t){return Math.round((Ue(t)-Ue(e))/864e5)}r(Qo,"dayDiff");function Xo(e,t){let n=[];for(t==null&&(t=ut()),e<0&&(e=ue(t,e+1));e<=t;)n.push(e),e=ue(e,1);return n}r(Xo,"dayRange");function*ei(e,t){let n=[];for(t==null&&(t=ut()),e<0&&(e=ue(t,e+1));e<=t;)yield e,e=ue(e,1);return n}r(ei,"dayIterator");var lt=v("zeed:promise","error");function ft(){let e,t;return[new Promise((o,i)=>{e=o,t=i}),e,t]}r(ft,"createPromise");async function oi(e){return new Promise(t=>setTimeout(t,e))}r(oi,"sleep");async function ii(){return new Promise(e=>setTimeout(e,0))}r(ii,"immediate");var dt=Symbol("timeout");async function si(e,t,n=dt){return new Promise(async(o,i)=>{let s=!1,u=setTimeout(()=>{s=!0,o(n)},t);try{let a=await e;clearTimeout(u),s||o(a)}catch(a){clearTimeout(u),s||i(a)}})}r(si,"timeout");var pt=new Error("Timeout reached");function ai(e){return e===dt||e===pt}r(ai,"isTimeout");async function gt(e,t){return t<=0?await e:new Promise(async(n,o)=>{let i=!1,s=setTimeout(()=>{i=!0,o(pt)},t);try{let u=await e;clearTimeout(s),i||n(u)}catch(u){clearTimeout(s),i||o(u)}})}r(gt,"tryTimeout");function ui(e,t,n=1e3){return new Promise((o,i)=>{let s=r(c=>{a&&(clearTimeout(a),u(),o(c))},"fn"),u=r(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):lt.warn("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{u(),i(new Error("Did not response in time"))},n);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):lt.warn("No listener method found for",e)})}r(ui,"waitOn");function E(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}r(E,"isPromise");function C(e){return Promise.resolve(e)}r(C,"promisify");var L=class{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=L.from(t)?.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate()}else this.days=t}static fromNumber(t){return new L(t)}static fromString(t){return L.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?L.fromString(t.toISOString().substr(0,10)):L.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return L.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new L(t);if(typeof t=="string")return L.fromString(t);if(Array.isArray(t)&&t.length===3){let[o,i=1,s=1]=t;return i<1||i>12||s<1||s>31?void 0:new L(o*1e4+i*100+s)}else{if(t instanceof Date)return L.fromDate(t,n);if(t instanceof L)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let n=String(this.days);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}get year(){return Math.floor(this.days/1e4)}get month(){return Math.floor(this.days/100%100)}get day(){return Math.floor(this.days%100)}dayOffset(t){return L.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return L.from([this.year,this.month,1])}yearStart(){return L.from([this.year,1,1])}monthOffset(t){let n=this.month+t,o=Math.floor((n-1)%12)+1;o===0&&(o=12);let i=Math.floor((n-1)/12);return L.from([this.year+i,o,this.day])}daysUntil(t){return Math.round((new L(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};r(L,"Day");async function pi(e,t,n){let o=L.from(e),i=L.from(t);for(;o&&i&&o?.days<=i?.days;){let s=n(o);E(s)&&await s,o=o.dayOffset(1)}}r(pi,"forEachDay");function gi(){return new L}r(gi,"today");function mi(e){return new L(e)}r(mi,"day");function yi(e){return L.fromDate(new Date(e)).days}r(yi,"dateStringToDays");function pn(e,t=2){return+(+e).toFixed(t)}r(pn,"decimal");function bi(e,t=2){return+(+e/10**t).toFixed(t)}r(bi,"decimalFromCents");function Ti(e,t=2){return Math.round(+e*10**t)}r(Ti,"decimalToCents");function wi(e,t=2){return t*(pn(e,t)%1)}r(wi,"decimalCentsPart");function F(e){return e!=null&&typeof e=="object"}r(F,"isObject");function Se(e){return Object(e)!==e}r(Se,"isPrimitive");function k(e){return Array.isArray(e)}r(k,"isArray");function le(e){return F(e)&&!k(e)}r(le,"isRecord");function Ai(e){return e?.constructor===Object}r(Ai,"isRecordPlain");function Di(e){return typeof e=="string"}r(Di,"isString");function Pi(e){return typeof e=="number"}r(Pi,"isNumber");function Ui(e){return typeof e=="number"&&Number.isInteger(e)}r(Ui,"isInteger");function Ei(e){return typeof e=="number"&&Number.isSafeInteger(e)}r(Ei,"isSafeInteger");function mt(e){return typeof e=="boolean"}r(mt,"isBoolean");function Mi(e){return e==null}r(Mi,"isNullOrUndefined");function Ri(e){return e==null}r(Ri,"isNull");function Si(e){return F(e)&&e.constructor.name==="Uint8Array"}r(Si,"isUint8Array");function Ci(e){return e!=null}r(Ci,"isNotNull");function Fi(e){return e!=null&&e!==!1&&e!==!0}r(Fi,"isValue");function gn(e,t,n=new WeakSet){if(e===t)return!0;if(n.has(t)||(Se(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let o in e){if(!e.hasOwnProperty(o))continue;if(!t.hasOwnProperty(o))return!1;let i=e[o],s=t[o];if(!gn(i,s,n))return!1}for(let o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}r(gn,"deepEqual");function mn(e,t=new WeakSet){if(t.has(e))return"[Circular ~]";if(Se(e)||t.add(e),le(e)){for(let n in e)if(!!e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}mn(e[n],t)}}else if(k(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}r(mn,"deepStripUndefinedInPlace");function fe(e,...t){for(let n of t)F(e)||(e={}),!(n==null||!F(n))&&Object.keys(n).forEach(o=>{let i=e[o],s=n[o];Array.isArray(i)&&Array.isArray(s)?e[o]=i.concat(s):F(i)&&F(s)?e[o]=fe(Object.assign({},i),s):e[o]=s});return e}r(fe,"deepMerge");var yt=r(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),"escapeHTML"),_i=r(e=>e.replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&apos;/gi,"'").replace(/&amp;/gi,"&"),"unescapeHTML");function zi(e,t,n=[]){return e.filter(o=>!t.some(i=>!i(o))).map(o=>{for(let i of n)o=i(o);return o}).filter(o=>o!=null)}r(zi,"listQuery");function Ni(e,t){return e.reduce((n,o)=>{let i=String(o[t]);return(n[i]=n[i]||[]).push(o),n},{})}r(Ni,"listGroupBy");function Gi(e,t){return Array.from(e.reduce((n,o)=>n.add(o[t]),new Set))}r(Gi,"listDistinctUnion");function Vi(e,t){return e.map(n=>n[t])}r(Vi,"listOfKey");function Wi(e,t){return F(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>{let i=t(n,o);return k(i)&&i.length===2?i:[n,i]}).filter(n=>n!=null)):{}}r(Wi,"objectMap");function Ki(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}r(Ki,"objectMergeDisposable");function Yi(e){return Object.keys(e).length<=0}r(Yi,"objectIsEmpty");var ht=/[\u0000-\u001F\u0080-\u009F]/g,yn=/^\.+/,hn=/\.+$/;function xt(){return/[<>:"/\\|?*\u0000-\u001F]/g}r(xt,"filenameReservedRegex");function xn(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}r(xn,"windowsReservedNameRegex");function es(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(xt().test(t)&&ht.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(xt(),t).replace(ht,t).replace(yn,t).replace(hn,""),e=xn().test(e)?e+t:e,e.slice(0,100)}r(es,"toValidFilename");var bn=/[\\\-\[\]\/{}()*+?.^$|]/g;function bt(e){return e?e instanceof RegExp?e.source:e.replace(bn,"\\$&"):""}r(bt,"escapeRegExp");var X=r(e=>Math.abs(e)%1===.5,"isHalf"),Tt=r(e=>e%2===0,"isEven"),is=r(e=>Math.ceil(e),"roundUp"),ss=r(e=>Math.floor(e),"roundDown"),as=r(e=>Math.round(e),"roundHalfUp"),us=r(e=>{let t=Math.round(e);return X(e)&&Tt(t)?t-1:t},"roundHalfOdd"),cs=r(e=>X(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),ls=r(e=>X(e)?Math.floor(e):Math.round(e),"roundHalfDown"),fs=r(e=>{let t=Math.round(e);return X(e)?Tt(t)?t:t-1:t},"roundHalfEven"),ds=r(e=>X(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");function wt(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-D()}r(wt,"startSortWeight");function Lt(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+D()}r(Lt,"endSortWeight");function ys(e,t,n){let o=n.length,i=e<t;if(o<=0||e>=o-1)return Lt(n);if(e<=0)return wt(n);n=Tn([...n]);let s=i?-1:0,u=n[e+s].sort_weight||0,c=(n[e+s+1].sort_weight||0)-u;if(c===0)return i?wt(n):Lt(n);let l=u+c/2,f=c*.01*(D()-.5);return l+f}r(ys,"moveSortWeight");function Tn(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}r(Tn,"sortedItems");function Ts(e={}){let{getter:t=r(a=>a.sort,"getter")}=e;function n(a){return a.sort((c,l)=>(t(c)||0)-(t(l)||0)),a}r(n,"items");function o(a){return a.reduce((c,l)=>Math.min(c,t(l)||0),0)-1-D()}r(o,"start");function i(a){return a.reduce((c,l)=>Math.max(c,t(l)||0),0)+1+D()}r(i,"end");function s(a,c){a==null&&(a=(c??0)-1),c==null&&(c=(a??0)+1);let l=c-a,f=a+l/2,d=l*.01*(D()-.5);return f+d}r(s,"between");function u(a,c,l){let f=l.length,d=a<c;if(f<=0||a>=f-1)return i(l);if(a<=0)return o(l);l=n([...l]);let h=d?-1:0,x=t(l[a+h])||0,g=(t(l[a+h+1])||0)-x;if(g===0)return d?o(l):i(l);let p=x+g/2,y=g*.01*(D()-.5);return p+y}return r(u,"move"),{start:o,end:i,between:s,move:u,items:n}}r(Ts,"useSorted");var wn=/((?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00A1-\uFFFF][a-z0-9\u00A1-\uFFFF_-]{0,62})?[a-z0-9\u00A1-\uFFFF]\.)+(?:[a-z\u00A1-\uFFFF]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?)/gim;function As(e){return e.split(wn).map((t,n)=>{let o=yt(t);return n%2?`<a target="_blank" href="${o}">${Ln(o)}</a>`:o}).join("")}r(As,"linkifyPlainText");function Ln(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}r(Ln,"toHumanReadableUrl");function vt(e){let t=[];for(let[n,o]of Object.entries(e))if(o!=null){Array.isArray(o)||(o=[o]);for(let i of o)i!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`)}return t.join("&")}r(vt,"encodeQuery");function Ds(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let o=0;o<n.length;o++){let i=n[o].split("="),s=decodeURIComponent(i[0]),u=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(u)):t[s]=u}return t}r(Ds,"parseQuery");function Ms(e,t,n){let o=e[t];return o===void 0&&(o=n(t,e),e[t]=o),o}r(Ms,"ensureKey");async function Rs(e,t,n){let o=e[t];return o===void 0&&(o=await n(t,e),e[t]=o),o}r(Rs,"ensureKeyAsync");function Ss(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}r(Ss,"size");function Cs(e){return e!=null&&e.length>0?e[e.length-1]:void 0}r(Cs,"last");function Fs(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:e?.size!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t)}return!0}r(Fs,"empty");function Ce(e){return Object(e)!==e?e:JSON.parse(R(e))}r(Ce,"cloneObject");function ks(e){return Object(e)!==e?e:JSON.parse(R(e))}r(ks,"cloneJsonObject");function Is(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let o=e(n);return t.set(n,o),o}}r(Is,"memoize");function Os(e){let t=new Map;return async(...n)=>{let o=R(n);if(t.has(o))return t.get(o);let i=await e(...n);return t.set(o,i),i}}r(Os,"memoizeAsync");function $s(e,t){let n=[];for(let o=0;o<e;o++)n.push(t(o,e));return n}r($s,"forTimes");var vn=/\\\s|\s+|#[^\n]*\n?/gm,An=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,At=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm,Dn=v("zeed:xrx","error");function Pn(e){return typeof e=="string"?e:e.source||""}r(Pn,"regExpString");function Hs(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}r(Hs,"regExpEscape");var Fe=class{constructor(t,n){this.namedGroups={};this.names=[];let o=n??"",i;if(t instanceof RegExp?(n==null&&(o=t.flags),i=t.source):i=t,o&&o.includes("x")&&(o=o.replace("x",""),i=i.replace(vn,a=>a[0]==="\\"?a:"")),!(t instanceof RegExp)){let a=0;i=i.replace(An,(c,l)=>(a+=1,l?(l!=="index"&&l!=="length"&&!this.namedGroups[l]?this.namedGroups[l]=a:Dn.error(`Unallowed or duplicate group name: ${l}`),"("):c)),this.names=Object.keys(this.namedGroups)}i=Pn(i),At.lastIndex=0;let u=At.exec(i);u&&(this.lookBehind={rx:new RegExp(`${u[3]}$(?!\\s)`),expect:u?u[2]==="=":!u},i=i.substr(u[0].length)),this.rx=new RegExp(i,o)}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t}_handleMatch(t){if(this.lookBehind){let n=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(n))return null}for(let n of this.names)t[n]=t[this.namedGroups[n]];return t}exec(t){let n;for(;n=this.rx.exec(t);)if(this.rx.lastIndex===n.index&&this.rx.lastIndex++,n=this._handleMatch(n),n!=null)return n}execAll(t){let n=[],o;for(this.rx.lastIndex=0;o=this.exec(t);)n.push(o);return this.rx.lastIndex=0,n}replace(t,n){let o=typeof n=="function"?n:()=>n;return t.replace(this.rx,i=>o(i))}};r(Fe,"XRX");var Un=",";function ya(e,t={}){let{separator:n=Un}=t,o="";for(let i=0;i<e.length;i++)o+=`${e[i].map(s=>{if(s==null||s==="")return"";if(mt(s))return s?1:0;let u=String(s);return(le(s)||k(s))&&(u=R(s)),u.includes('"')||u.includes(`
6
+ `)||u.includes(n)?`"${u.replace(/"/g,'""')}"`:u}).join(n)}
7
+ `;return o}r(ya,"csvStringify");function En(e,t={}){let n=/("((?:(?:[^"]*?)(?:"")?)*)"|([^,;\t\n]*))([,;\t]|\n|\r\n)/g;t.separator&&(n=new RegExp(n.source.replaceAll(",;\\t",bt(t.separator)),n.flags));let o=[],i=[],s,u=`${e.replaceAll(`\r
8
+ `,`
9
+ `).trim()}
10
+ `;for(;s=n.exec(u);){let a=s[2]??s[3]??"";a=a.replaceAll('""','"'),i.push(a),s[4]===`
11
+ `&&(o.push(i),i=[])}return o}r(En,"csvParse");function ha(e,t={}){let n=En(e,t),o=n[0];return n.slice(1).map(i=>Object.fromEntries(i.map((s,u)=>[o[u],s])))}r(ha,"csvParseToObjects");var Mn=v("zeed:dispose","error");async function Rn(e){typeof e=="function"?await C(e()):E(e)?await e:typeof e.dispose=="function"?await C(e.dispose()):E(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await C(e.cleanup()):E(e.cleanup)&&await e.cleanup}r(Rn,"callDisposer");function ke(e){let{name:t}=typeof e=="string"?{name:e}:e??{},n=[],o=r(async u=>{u!=null&&n.includes(u)&&(De(n,a=>a!==u),await Rn(u))},"untrack"),i=r(async()=>{for(t&&Mn.debug(`dispose ${t}: ${n.length} entries`);n.length>0;)await o(n[0])},"dispose"),s=r(u=>{if(u!=null)return n.unshift(u),()=>o(u)},"track");return Object.assign(i,{track:s,add:s,untrack:o,dispose:i,exec:i,getSize(){return n.length},isDisposed(){return n.length<=0}})}r(ke,"useDispose");var va=ke;function Aa(e={}){let{mode:t="fifo"}=e,n=[],o=r(async(s=!1)=>{for(;n.length>0;){let u=n[0];if(De(n,a=>a!==u),typeof u=="function"){let a=u();if(E(a)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await a}}else if(E(u)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await u}else throw new Error(`Unhandled disposable: ${u}`)}},"exec");return Object.assign(o,{add:r(s=>{t==="lifo"?n.unshift(s):n.push(s)},"add"),exec:o,getSize(){return n.length}})}r(Aa,"useDefer");function Da(e,t=0){let n=setTimeout(e,t);return()=>{n&&(clearTimeout(n),n=void 0)}}r(Da,"useTimeout");function Pa(e,t){let n=setInterval(e,t);return()=>{n&&(clearInterval(n),n=void 0)}}r(Pa,"useInterval");function Ua(e,t,n,...o){return e==null?()=>{}:(e.on?e.on(t,n,...o):e.addEventListener&&e.addEventListener(t,n,...o),()=>{e.off?e.off(t,n,...o):e.removeEventListener&&e.removeEventListener(t,n,...o)})}r(Ua,"useEventListener");function Sa(){let e=!0;return(t,n)=>{let o=!1;if(e){e=!1;try{t(),o=!0}finally{e=!0}}else n!==void 0&&n();return o}}r(Sa,"useMutex");function Ca(){let e=!0;return async(t,n)=>{let o=!1;if(e){e=!1;try{let i=t();E(i)&&await i,o=!0}finally{e=!0}}else if(n!==void 0){let i=n();E(i)&&await i}return o}}r(Ca,"useAsyncMutex");var Z=v("zeed:emitter","error"),P=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=ke();this.call=new Proxy({},{get:(t,n)=>async(...o)=>await this.emit(n,...o)})}async emit(t,...n){let o=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...n)),i.length>0){let s=i.map(u=>{try{return C(u(...n))}catch(a){Z.warn("emit warning:",a)}return null}).filter(u=>u!=null);o=!0,await Promise.all(s)}}catch(i){Z.error("emit exception",i)}return o}onAny(t){this.subscribersOnAny.push(t)}on(t,n){let o=this.subscribers[t]||[];return o.push(n),this.subscribers[t]=o,()=>{this.off(t,n)}}onCall(t){for(let[n,o]of Object.entries(t))this.on(n,o)}once(t,n){let o=r(async(...i)=>(this.off(t,o),await C(n(...i))),"onceListener");return this.on(t,o),()=>{this.off(t,n)}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(o=>n&&o!==n),this}removeAllListeners(){return this.subscribers={},this}};r(P,"Emitter");function ja(){let e=Y().emitter;return e||(e=new P,Y().emitter=e),e}r(ja,"getGlobalEmitter");var Ha=new P;function za(e,t){let n=Math.round(D()*100),o=[],i,s=r((a,c)=>{let l={key:a,obj:c};o.push(l),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):Z.error(n,"Cannot listen to key"):e.onAny?e.onAny((a,c)=>{s(a,c)}):Z.error(n,"cannot listen to all for",e),r((a,c=!0)=>new Promise((l,f)=>{a||(a=t,a||o.length&&(a=o[0].key)),i=r(()=>{for(;o.length>0;){let d=o.shift();if(d.key===a)i=void 0,l(d.obj);else{if(c){Z.warn(n,`Unhandled event ${a} with value: ${d.obj}`);continue}f(new Error(`Expected ${a}, but found ${d.key} with value=${d.obj}`)),Z.error(n,`Unhandled event ${a} with value: ${d.obj}`)}break}},"lazyResolve"),i()}),"on")}r(za,"lazyListener");var Dt=r(()=>Date.now(),"getTimestamp");function Va(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}r(Va,"formatMilliseconds");function qa(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t)}catch{}if(!(n instanceof Date)){let o=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);o&&(n=new Date(+o[1],+o[2]-1,+o[3],12,0))}if(n instanceof Date)return n}}}r(qa,"parseDate");var{encode:Pt,decode:Sn}=j(62),{encode:Ut,decode:Cn}=j(32),de=16;function Oe(){return q(de)}r(Oe,"uuidBytes");function Fn(e=Oe()){return Pt(e,22)}r(Fn,"uuidB62");function kn(e){return Pt(e,22)}r(kn,"uuidEncodeB62");function In(e){return Sn(e,de)}r(In,"uuidDecodeB62");function On(e=Oe()){return Ut(e,26)}r(On,"uuidB32");function $n(e){return Ut(e,26)}r($n,"uuidEncodeB32");function Bn(e){return Cn(e,de)}r(Bn,"uuidDecodeB32");var _n="10000000-1000-4000-8000-100000000000",jn=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>_n.replace(/[018]/g,e=>(e^q(1)[0]&15>>e/4).toString(16));function Hn(e){let t=We(e);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}r(Hn,"uuidEncodeV4");function zn(e){return Ke(e.replaceAll("-",""))}r(zn,"uuidDecodeV4");var Et=16e11;function Nn(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let o=0;o<t.length;o++){let i=e&255;t[n-o]=i,e=(e-i)/256}return t}r(Nn,"longToByteArray");function Mt(){let e=Dt()-Et;return new Uint8Array([...Nn(e),...q(10)])}r(Mt,"suidBytes");function Xa(){return Vn(Mt())}r(Xa,"suid");function eu(e){return Gn(St(e))}r(eu,"suidDate");function Gn(e){return new Date(Et+e.slice(0,6).reduce((t,n)=>t*256+n,0))}r(Gn,"suidBytesDate");var tu=r(()=>new Uint32Array(q(4))[0],"uuid32bit"),$e={base62:{uuid:Fn,uuidDecode:In,uuidEncode:kn},base32:{uuid:On,uuidDecode:Bn,uuidEncode:$n},uuidv4:{uuid:jn,uuidDecode:zn,uuidEncode:Hn}},pe="base62",Rt=!1;function nu(e,t=!1){pe=e,Rt=t}r(nu,"setUuidDefaultEncoding");function H(){return $e[pe].uuid(Rt?Mt():Oe())}r(H,"uuid");function St(e){return $e[pe].uuidDecode(e)}r(St,"uuidDecode");function Vn(e){return $e[pe].uuidEncode(e)}r(Vn,"uuidEncode");function ru(e){try{return St(e).length===de}catch{}return!1}r(ru,"uuidIsValid");var Ie={};function z(e="id"){return Ie[e]==null&&(Ie[e]=0),`${e}-${Ie[e]++}`}r(z,"uname");var qn=0;function ou(){return`id-${qn++}`}r(ou,"qid");var ge=class extends P{constructor(){super(...arguments);this.id=H()}close(){this.dispose()}};r(ge,"Channel");var ee=class extends ge{constructor(){super(...arguments);this.isConnected=!0}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:H()})}};r(ee,"LocalChannel");function cu(){let e=new ee,t=new ee;return e.other=t,t.other=e,[e,t]}r(cu,"createLocalChannelPair");var Be=class{async encode(t){return t}async decode(t){return t}};r(Be,"NoopEncoder");var N=class{async encode(t){return xe(t)}async decode(t){return be(t)}};r(N,"JsonEncoder");var _e=class{constructor(t){this.key=t}async encode(t){let n=xe(t);return await nt(n,this.key)}async decode(t){let n=await rt(t,this.key);return be(n)}};r(_e,"CryptoEncoder");var Ct=r((e,t,n={})=>new Proxy(n,{get:(o,i)=>i in o?o[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function wu(e={}){let{name:t=z("hub"),encoder:n=new N,retryAfter:o=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,u=v(t,s),a={},c,l=[],f,d={},h=r(()=>{clearTimeout(f)},"dispose"),x=r(async()=>{if(clearTimeout(f),c){if(c.isConnected)for(;l.length;){let y=l[0];try{c.postMessage(await n.encode(y)),l.shift()}catch(w){u.warn("postMessage",w);break}}l.length>0&&o>0&&(f=setTimeout(x,o))}},"postNext"),m=r(async y=>{u("enqueue postMessage",y),l.push(y),await x()},"postMessage"),g=r(async y=>{c=y,c.on("connect",x),c.on("message",async w=>{u("onmessage",typeof w);let{name:b,args:A,id:T,result:I,error:$}=await n.decode(w.data);if(b){u(`name ${b} id ${T}`);try{if(a[b]==null)throw new Error(`handler for ${b} was not found`);let M=a[b](...A);E(M)&&(M=await M),u(`result ${M}`),T&&await m({id:T,result:M})}catch(M){let B=M instanceof Error?M:new Error(Pe(M));u.warn("execution error",B.name),await m({id:T,error:{message:B.message,stack:B.stack,name:B.name}})}}else if(T)if(u(`response for id=${T}: result=${I}, error=${$}`),d[T]==null)I===void 0?u(`skip response for ${T}`):u.warn(`no response hook for ${T}`);else{let[M,B]=d[T];if(M&&B)if(delete d[T],$){let ne=new Error($.message);ne.stack=$.stack,ne.name=$.name,u.warn("reject",ne.name),B(ne)}else u("resolve",I),M(I)}else i||u.warn("Unhandled message",w)}),await x()},"connect"),p=r(async(y,w,b={})=>{let{timeout:A=5e3}=b,T=H();return await m({name:y,args:w,id:T}),gt(new Promise((I,$)=>d[T]=[I,$]),A)},"fetchMessage");return e.channel&&g(e.channel),{dispose:h,connect:g,listen(y){Object.assign(a,y)},send(){return Ct(p,{},{options(y){return Ct(p,{...y})}})}}}r(wu,"useMessageHub");var me=class extends P{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:o,encoder:i=new N,channel:s,debug:u=!1}=n;this.channel=s,this.encoder=i,this.debug=u,this.name=o??this.channel.id??z("pubsub"),this.log=v(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected")}),this.channel.on("disconnect",()=>{this.log("channel disconnected")})),this.channel.on("message",async({data:a})=>{let c=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${c?.event}, info=`,c):this.log(`channel message, event=${c?.event}`),c){let{event:l,args:f}=c;await this.emitSuper(l,...f)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...o){return await super.emit(n,...o)}async emit(n,...o){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,o.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:n,args:o});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(n)})`,i)}return!1}};r(me,"PubSub");function Eu(e){return new me(e)}r(Eu,"usePubSub");var Jn=1;var Ft=r(e=>e,"defaultSerialize"),Zn=Ft;function Su(e,t){let{post:n,on:o,eventNames:i=[],serialize:s=Ft,deserialize:u=Zn}=t,a=new Map;return o(async c=>{let l=u(c),[f,d,h,x]=l;if(f===1||f===2){let m,g;if(x!=null)try{let p=e[x];m=await p(...d)}catch(p){g=String(p)}else g="Method implementation missing";f===1&&h&&n(s(g?[4,g,h]:[3,m,h]))}else if(h){let m=a.get(h);m!=null&&(f===4?m.reject(d):m.resolve(d)),a.delete(h)}}),new Proxy({},{get(c,l){let f=r((...h)=>{n(s([2,h,null,l]))},"sendEvent");if(t.onlyEvents||i.includes(l))return f.asEvent=f,f;let d=r((...h)=>new Promise((x,m)=>{let g=Jn++;a.set(g,{resolve:x,reject:m}),n(s([1,h,g,l]))}),"sendCall");return d.asEvent=f,d}})}r(Su,"useRPC");var te=class extends P{constructor(n={}){super();this._isCancelled=!1;this._children=[];this._totalUnits=n.totalUnits??0,this._completedUnits=n.completeUnits??0,this._isCancelable=n.isCancelable??!0,this.dispose.add(async()=>{for(let o of this._children)await o.dispose();await this.emit("progressDispose",this)})}update(){this.emit("progressChanged",this)}async cancel(){if(this._isCancelable&&!this.isCancelled){this._isCancelled=!0,await this.emit("progressCancelled",this);for(let n of this._children)await n.cancel()}}addChild(n){n.on("progressDispose",()=>{Ae(this._children,n)}),n.on("progressChanged",()=>{this.update()}),this._children.includes(n)||this._children.push(n),this.update()}removeChild(n){Ae(this._children,n),this.update()}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let o of this._children)n+=o.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let o of this._children)n+=o.getCompletedUnits();return n}isIndeterminate(){return this._totalUnits<=0}isCancelled(){return this._isCancelled}isFinished(){return this.dispose.isDisposed()||!this.isIndeterminate()&&this.getTotalUnits()<=this.getCompletedUnits()}getFraction(){return this.isIndeterminate()?0:Math.min(1,Math.max(0,this.getCompletedUnits()/this.getTotalUnits()))}getChildrenCount(){return this._children.length}setTotalUnit(n){this._totalUnits=n,this.update()}setCompletetedUnit(n){this._completedUnits=n,this.update()}incCompletedUnit(n=1){this._completedUnits+=n,this.update()}};r(te,"Progress");var Wn=(o=>(o[o.waiting=0]="waiting",o[o.running=1]="running",o[o.finished=2]="finished",o))(Wn||{}),Kn=(o=>(o[o.replace=0]="replace",o[o.memoize=1]="memoize",o[o.error=2]="error",o))(Kn||{});function Wu(e={}){let{maxParallel:t=3}=e,n=new P,o=0,i=0,s=0,u=0,a={};async function c(){if(o>0){let[g,p]=ft();return n.once("didFinish",p),g}}r(c,"waitFinishAll");function l(){n.emit("didFinish"),o=0,i=0}r(l,"didFinish");function f(){let g=0,p=0;for(let{max:y,resolved:w,state:b}of Object.values(a))g+=y,p+=b===2?y:Math.min(y,w);n.emit("didUpdate",o,i,g,p)}r(f,"didUpdate");function d(){if(f(),o>0&&o===i&&l(),s>=t)return;let g=Object.values(a).filter(p=>p.state===0);if(g.length>0){let p;for(let y of g)y.group!=null&&Object.values(a).some(w=>w.state===1&&w.id!==y.id&&w.group===y.group)||(p==null||y.priority<p.priority)&&(p=y);if(p!=null){let y=p.id,w=p.done;p.state=1,++s,n.emit("didStart",y);let b=r(A=>{p&&(p.result=A,p.state=2,p.resolved=p.max),--s,++i,d()},"taskFinished");p.task(p).then(A=>{w(A),n.emit("didResolve",y,A),b(A)}).catch(A=>{w(),n.emit("didReject",y,A),b()})}}}r(d,"performNext");function h(g){let p=a[g];p&&p.state===0&&(a[g].state=2,++i,n.emit("didCancel",g),f())}r(h,"cancel");function x(){Object.keys(a).forEach(h)}r(x,"cancelAll");function m(g,p={}){let y,w=new Promise(T=>y=T),b=p.id??H();if(a[b]!=null){let T=p.idConflictResolution??1;if(T===0)h(b);else if(T===1){let I=a[b];return{id:b,promise:(async()=>{if(I.state===2)return a[b].result})(),dispose:()=>h(b),cancel:()=>h(b)}}else throw new Error(`Pool task with id=${b} already exists!`)}let A=new te({totalUnits:p.max??1,completeUnits:p.resolved??0});return a[b]={id:b,task:g,priority:++u,group:p.group,state:0,max:p.max??1,resolved:p.resolved??0,done:y,payload:p.payload,progress:A,setMax(T){A.setTotalUnit(T),a[b].max=T,f()},setResolved(T){A.setCompletetedUnit(T),a[b].resolved=T,f()},incResolved(T=1){A.incCompletedUnit(T),a[b].resolved+=T,f()}},++o,d(),{id:b,promise:w,dispose:()=>h(b),cancel:()=>h(b)}}return r(m,"enqueue"),{events:n,cancel:h,cancelAll:x,enqueue:m,dispose:x,waitFinishAll:c}}r(Wu,"usePool");var je=class extends P{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:o=z("queue"),logLevel:i}=n;this.name=o,this.log=v(`zeed:queue:${o}`,i??1/0)}async performNext(){if(this.log("performNext, queue.length =",this.queue.length),this.currentTask!=null){this.log("performNext => skip while another task is running");return}if(this.paused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.paused;){let n=this.queue.shift();if(this.log(`performNext => ${n?.name}`),n==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:o,task:i,resolve:s}=n;this.currentTask=i();let u;try{this.log.info(`start task ${o}`),u=await this.currentTask,this.log(`finished task ${o} with result =`,u)}catch(a){this.log.warn("Error performing task",a)}s(u),this.currentTask=void 0,this.countResolved+=1,this.emit("didUpdate",this.countMax,this.countResolved)}for(this.queue.length===0&&(this.emit("didFinish"),this.countMax=0,this.countResolved=0);this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(n,o={}){let{immediate:i=!1,name:s=z(this.name)}=o;return i?(this.log.info(`immediate execution ${s}`),await n()):(this.log(`enqueue ${s}`),new Promise(u=>{this.queue.push({name:s,task:n,resolve:u}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(n,o={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:o.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let o=this.queue.map(i=>i.resolve);this.queue=[],o.forEach(i=>i(void 0)),await this.wait()}async pause(){this.log("pause"),this.paused=!0,await this.wait()}resume(){this.log("resume"),this.paused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.paused)))return new Promise(n=>{this.waitToFinish.push(n)})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};r(je,"SerialQueue");var W=!1,S=W?v("zeed:throttle","error"):()=>{};function sc(e,t={}){let{delay:n=100,trailing:o=!0,leading:i=!0}=t,s=0,u=0,a=0,c,l=Date.now();function f(){return s?(clearTimeout(s),s=void 0,!0):!1}r(f,"clearExistingTimeout");function d(...h){let x=Date.now(),m=x-u;function g(){let y=Date.now();return`total ${(y-l).toFixed(1)}ms - elapsed ${(y-u).toFixed(1)}ms - visited ${a}x`}r(g,"debugElapsed");let p=r(()=>{a=0,u=Date.now(),e.apply(this,h)},"exec");if(c=p,m>n||!s){W&&S("elapsed",g()),i&&(m>n?(W&&S("\u{1F680} leading",g()),p()):++a);let y=m>n?n:n-m;S(`\u23F1 start timeout with ${y.toFixed(1)}ms`,g()),f(),u=x,s=setTimeout(()=>{W&&S("\u23F1 reached timeout",g()),s=0,o&&(!i||a>0)&&(W&&S("\u{1F680} trailing",g()),c?.())},y)}else++a,W&&S("visited",g())}return r(d,"wrapper"),d.cancel=f,d.stop=()=>{f()&&c&&c()},d.immediate=r(async function(...x){f(),u=Date.now(),e.apply(this,x)},"immediate"),d.dispose=()=>d.stop(),d}r(sc,"throttle");function ac(e,t={}){let{delay:n=100}=t,o=0,i=!1,s;function u(){o&&(S("clear"),clearTimeout(o),o=0)}r(u,"clearExistingTimeout");async function a(){try{if(u(),s!=null){S("exec");let f=[...s];s=void 0,i=!0,await C(e(...f)),i=!1,S("exec done"),s!=null&&(u(),S("exec trigger next"),o=setTimeout(a,n))}}catch{}}r(a,"exec");function c(...f){s=[...f],u(),S("trigger"),i===!1&&(o=setTimeout(a,n))}r(c,"wrapper");async function l(...f){u(),s=[...f],await a()}return r(l,"immediate"),c.cancel=u,c.dispose=u,c.immediate=l,c}r(ac,"debounce");function lc(e=globalThis?.location?.hostname??""){return["::ffff:127.0.0.1","localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}r(lc,"isLocalHost");function gc(e){let{level:t=void 0,filter:n=void 0,messages:o=[]}=e,i=V(n),s=re(t);return u=>{!s(u.level)||!i(u.name)||o.push(u)}}r(gc,"LoggerMemoryHandler");var K=v("zeed:network","error"),He={cache:"no-cache",redirect:"follow",headers:{}};function Yn(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,o]=t[1].split(":",2);return{url:e.replace(`${t[1]}@`,""),username:n,password:o}}}r(Yn,"parseBasicAuth");async function kt(e,t={},n=fetch){try{k(t)&&(t=fe({},...J(t)));let o=Yn(String(e));o&&(e=o.url,t=fe({},t,Qn(o.username,o.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await n(String(e),t);if(i.status<400)return i;try{K.warn(`Fetch of ${String(e)} returned status=${i.status}. Options:`,t),K.warn(`Response: ${await i.text()}`)}catch(s){K.error("Exception:",s)}}catch(o){K.error("fetchBasic",o)}}r(kt,"fetchBasic");async function Tc(e,t={},n=fetch){try{let o=await kt(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(o)return await o.json()}catch(o){K.error("fetchJSON error:",o)}}r(Tc,"fetchJson");async function wc(e,t={},n=fetch){try{let o=await kt(e,[He,{method:"GET"},t],n);if(o)return await o.text()}catch(o){K.error("fetchHTML error:",o)}}r(wc,"fetchText");function Lc(e,t="POST"){return{method:t,...He,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:vt(e)}}r(Lc,"fetchOptionsFormURLEncoded");function vc(e,t="POST"){return{method:t,...He,headers:{"Content-Type":"application/json; charset=utf-8"},body:R(e)}}r(vc,"fetchOptionsJson");function Qn(e,t){return{headers:{Authorization:`Basic ${Ye(`${e}:${t}`)}`}}}r(Qn,"fetchOptionsBasicAuth");function It(){if(typeof window<"u")return window}r(It,"getWindow");function Xn(){if(typeof navigator<"u")return navigator}r(Xn,"getNavigator");function Pc(){return It()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}r(Pc,"getGlobal");var O=Xn(),G=It();function er(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,test:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){return e.ios=O?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!O?.platform?.startsWith("Mac"),e.windows=!!O?.platform?.startsWith("Win"),e.beaker=G?.beaker!=null,e.electron=(O?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=G?.webkit?.messageHandlers!=null,e.pwa=O?.serviceWorker!=null,e.pwaInstalled=O?.standalone||G?.matchMedia?.("(display-mode: standalone)")?.matches,e.node=typeof process<"u"&&process?.release?.name==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,e.jest=typeof jest<"u"||typeof vitest<"u",e.test=e.jest,e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=G&&"ontouchstart"in G||(O?.maxTouchPoints||0)>1||O?.msPointerEnabled&&G?.MSGesture||G?.DocumentTouch&&document instanceof DocumentTouch,e}r(er,"detect");var tr=r(()=>typeof window<"u"&&globalThis===window,"isBrowser"),Uc=er();function Ec(e){tr()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}r(Ec,"useExitHandler");var ze=class{constructor(t={}){this.store={}}setItem(t,n){this.store[t]=Ce(n)}getItem(t){return Ce(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};r(ze,"MemStorage");var kc=r(()=>{},"noop");export{r as a,Y as b,Bt as c,V as d,ye as e,re as f,oe as g,Q as h,Ne as i,Ge as j,Ht as k,v as l,wr as m,R as n,Lr as o,Nt as p,Gt as q,Je as r,Ze as s,U as t,Ur as u,We as v,Ke as w,Ye as x,Er as y,Vt as z,Mr as A,Qe as B,xe as C,be as D,Xe as E,q as F,tt as G,Te as H,et as I,qt as J,Fr as K,kr as L,nt as M,rt as N,Jt as O,D as P,$r as Q,Br as R,_r as S,jr as T,Zt as U,Hr as V,zr as W,Nr as X,Gr as Y,Wt as Z,Jr as _,Le as $,Zr as aa,ve as ba,Kt as ca,Yt as da,J as ea,Qt as fa,Xr as ga,Ae as ha,eo as ia,De as ja,to as ka,no as la,Xt as ma,ro as na,en as oa,ot as pa,oo as qa,io as ra,so as sa,ao as ta,uo as ua,co as va,lo as wa,fo as xa,po as ya,j as za,xo as Aa,bo as Ba,To as Ca,wo as Da,Lo as Ea,vo as Fa,Ao as Ga,Do as Ha,Po as Ia,Mo as Ja,on as Ka,Ro as La,So as Ma,Io as Na,Oo as Oa,$o as Pa,sn as Qa,an as Ra,un as Sa,Pe as Ta,Bo as Ua,_o as Va,jo as Wa,Ho as Xa,cn as Ya,zo as Za,No as _a,Ee as $a,Me as ab,st as bb,ln as cb,qo as db,at as eb,ut as fb,Jo as gb,Zo as hb,ce as ib,Wo as jb,Ue as kb,fn as lb,dn as mb,Re as nb,ct as ob,Ko as pb,Yo as qb,ue as rb,Qo as sb,Xo as tb,ei as ub,ft as vb,oi as wb,ii as xb,dt as yb,si as zb,pt as Ab,ai as Bb,gt as Cb,ui as Db,E as Eb,C as Fb,L as Gb,pi as Hb,gi as Ib,mi as Jb,yi as Kb,pn as Lb,bi as Mb,Ti as Nb,wi as Ob,F as Pb,Se as Qb,k as Rb,le as Sb,Ai as Tb,Di as Ub,Pi as Vb,Ui as Wb,Ei as Xb,mt as Yb,Mi as Zb,Ri as _b,Si as $b,Ci as ac,Fi as bc,gn as cc,mn as dc,fe as ec,yt as fc,_i as gc,zi as hc,Ni as ic,Gi as jc,Vi as kc,Wi as lc,Ki as mc,Yi as nc,es as oc,bt as pc,X as qc,Tt as rc,is as sc,ss as tc,as as uc,us as vc,cs as wc,ls as xc,fs as yc,ds as zc,wt as Ac,Lt as Bc,ys as Cc,Tn as Dc,Ts as Ec,As as Fc,Ln as Gc,vt as Hc,Ds as Ic,Ms as Jc,Rs as Kc,Ss as Lc,Cs as Mc,Fs as Nc,Ce as Oc,ks as Pc,Is as Qc,Os as Rc,$s as Sc,Pn as Tc,Hs as Uc,Fe as Vc,ya as Wc,En as Xc,ha as Yc,ke as Zc,va as _c,Aa as $c,Da as ad,Pa as bd,Ua as cd,Sa as dd,Ca as ed,P as fd,ja as gd,Ha as hd,za as id,Dt as jd,Va as kd,qa as ld,Oe as md,Fn as nd,kn as od,In as pd,On as qd,$n as rd,Bn as sd,jn as td,Hn as ud,zn as vd,Mt as wd,Xa as xd,eu as yd,Gn as zd,tu as Ad,nu as Bd,H as Cd,St as Dd,Vn as Ed,ru as Fd,z as Gd,ou as Hd,ge as Id,ee as Jd,cu as Kd,Be as Ld,N as Md,_e as Nd,Ct as Od,wu as Pd,me as Qd,Eu as Rd,Su as Sd,te as Td,Wn as Ud,Kn as Vd,Wu as Wd,je as Xd,sc as Yd,ac as Zd,lc as _d,gc as $d,Yn as ae,kt as be,Tc as ce,wc as de,Lc as ee,vc as fe,Qn as ge,It as he,Xn as ie,Pc as je,er as ke,tr as le,Uc as me,Ec as ne,ze as oe,kc as pe};
12
+ //# sourceMappingURL=chunk-VBENGHAN.js.map