@kyro-cms/core 0.12.60 → 0.12.61
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.
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{bootstrap-VUWX45QN.js → bootstrap-WB6FDH2T.js} +1 -1
- package/dist/bootstrap-XDT4MRML.cjs +1 -0
- package/dist/{chunk-33E4YN62.js → chunk-26MOA3HJ.js} +10 -10
- package/dist/{chunk-M56F4LQ5.cjs → chunk-3XLXKGEU.cjs} +1 -1
- package/dist/{chunk-WQCLLM4S.cjs → chunk-4FHWIGHO.cjs} +10 -10
- package/dist/chunk-4ZWLNGLS.js +2 -0
- package/dist/{chunk-VOQUO2EZ.cjs → chunk-5DWQGEM2.cjs} +22 -22
- package/dist/{chunk-OXGJOYEO.js → chunk-637PTUHF.js} +1 -1
- package/dist/chunk-6QWX3DEB.cjs +120 -0
- package/dist/{chunk-ZMG7Z3KF.js → chunk-75BFTYBS.js} +23 -23
- package/dist/{chunk-YZEMLLD2.js → chunk-AWQGDMOE.js} +3 -3
- package/dist/chunk-D6SDGHY6.js +2 -0
- package/dist/{chunk-MP5VC5ER.cjs → chunk-FP5UK272.cjs} +1 -1
- package/dist/{chunk-AK754S3T.cjs → chunk-FSL3NLRT.cjs} +2 -2
- package/dist/{chunk-RTHJ6SS5.js → chunk-GQGFNTDZ.js} +1 -1
- package/dist/chunk-HKYBQYAJ.cjs +19 -0
- package/dist/{chunk-TDGSIF5H.cjs → chunk-JU3UAZRY.cjs} +10 -11
- package/dist/chunk-KMFLHGD5.cjs +1 -0
- package/dist/{chunk-NTKIONEC.cjs → chunk-LOP464VR.cjs} +1 -1
- package/dist/{chunk-R25WLKX4.js → chunk-N6MNQIQU.js} +101 -101
- package/dist/{chunk-BHR7OAU4.cjs → chunk-OPTVCCQQ.cjs} +101 -101
- package/dist/chunk-RDFGJHEG.js +2 -0
- package/dist/chunk-RILJCH6H.js +121 -0
- package/dist/{chunk-KCHPADCH.cjs → chunk-SOCBJPYB.cjs} +1 -1
- package/dist/chunk-T4JJVUGT.js +20 -0
- package/dist/{chunk-7N6TW4JB.js → chunk-TBTQXIHP.js} +1 -1
- package/dist/{chunk-KNOFTUQV.js → chunk-VJODUKKM.js} +11 -12
- package/dist/{chunk-DUO523BH.cjs → chunk-ZHA446FA.cjs} +1 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +1 -1
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +2 -1
- package/dist/drizzle/index.d.ts +2 -1
- package/dist/drizzle/index.js +1 -1
- package/dist/fields/index.cjs +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/graphql/index.cjs +1 -1
- package/dist/graphql/index.d.cts +2 -0
- package/dist/graphql/index.d.ts +2 -0
- package/dist/graphql/index.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{local-2IFOTHAA.js → local-4MZ7KOL3.js} +1 -1
- package/dist/{local-UESCNPQP.cjs → local-NDTKWJQ6.cjs} +1 -1
- package/dist/postgres-auth-adapter-SK3N3OSS.js +1 -1
- package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +1 -1
- package/dist/postgres-js-GXZX3AGZ.cjs +1 -0
- package/dist/{postgres-js-4CI7FMYS.js → postgres-js-WE3NBRFO.js} +1 -1
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +3 -3
- package/dist/rest/index.d.ts +3 -3
- package/dist/rest/index.js +1 -1
- package/dist/{sqlite-adapter-4TPNROJK.js → sqlite-adapter-52PL52VU.js} +1 -1
- package/dist/{sqlite-adapter-ZTABLT2X.cjs → sqlite-adapter-MNNZZXGX.cjs} +1 -1
- package/dist/trpc/index.cjs +1 -1
- package/dist/trpc/index.js +1 -1
- package/package.json +2 -2
- package/dist/bootstrap-JF6Q4L6P.cjs +0 -1
- package/dist/chunk-5LPNEYK5.cjs +0 -1
- package/dist/chunk-72VOOMJI.js +0 -20
- package/dist/chunk-AO2IXWV4.js +0 -2
- package/dist/chunk-OUMUIICN.cjs +0 -264
- package/dist/chunk-PA4ZZREG.js +0 -2
- package/dist/chunk-PCVQNVSU.cjs +0 -19
- package/dist/chunk-SQBTIMWF.js +0 -2
- package/dist/chunk-T4TSELDS.js +0 -265
- package/dist/postgres-js-3Y54EXVQ.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';var chunk7GGZA5YU_cjs=require('./chunk-7GGZA5YU.cjs'),chunk5LPNEYK5_cjs=require('./chunk-5LPNEYK5.cjs'),chunkMP5VC5ER_cjs=require('./chunk-MP5VC5ER.cjs'),chunkVOQUO2EZ_cjs=require('./chunk-VOQUO2EZ.cjs'),chunkOUMUIICN_cjs=require('./chunk-OUMUIICN.cjs'),chunkAK754S3T_cjs=require('./chunk-AK754S3T.cjs'),chunkDUO523BH_cjs=require('./chunk-DUO523BH.cjs'),chunkWCFHS7EZ_cjs=require('./chunk-WCFHS7EZ.cjs'),chunkTDGSIF5H_cjs=require('./chunk-TDGSIF5H.cjs'),chunk7JWQ2PZP_cjs=require('./chunk-7JWQ2PZP.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');var ps=chunkBUNLC3II_cjs.c((fw,Ca)=>{chunkBUNLC3II_cjs.h();function Cp(){return Object.keys(globalThis).some(t=>t.startsWith("__NEXT"))}Ca.exports=function(){return !!(globalThis.Deno||globalThis.Bun||Cp())};});function Ra(t,e){return (e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function xs(t,e=false){let r=[],n=0;for(;n<t.length;){let s=t[n],i=O(function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]});},"ErrorOrInvalid");if(s==="*"){r.push({type:"ASTERISK",index:n,value:t[n++]});continue}if(s==="+"||s==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});continue}if(s==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(s==="{"){r.push({type:"OPEN",index:n,value:t[n++]});continue}if(s==="}"){r.push({type:"CLOSE",index:n,value:t[n++]});continue}if(s===":"){let o="",a=n+1;for(;a<t.length;){let c=t.substr(a,1);if(a===n+1&&Ap.test(c)||a!==n+1&&Lp.test(c)){o+=t[a++];continue}break}if(!o){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:o}),n=a;continue}if(s==="("){let o=1,a="",c=n+1,l=false;if(t[c]==="?"){i(`Pattern cannot start with "?" at ${c}`);continue}for(;c<t.length;){if(!Ra(t[c],false)){i(`Invalid character '${t[c]}' at ${c}.`),l=true;break}if(t[c]==="\\"){a+=t[c++]+t[c++];continue}if(t[c]===")"){if(o--,o===0){c++;break}}else if(t[c]==="("&&(o++,t[c+1]!=="?")){i(`Capturing groups are not allowed at ${c}`),l=true;break}a+=t[c++];}if(l)continue;if(o){i(`Unbalanced pattern at ${n}`);continue}if(!a){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:a}),n=c;continue}r.push({type:"CHAR",index:n,value:t[n++]});}return r.push({type:"END",index:n,value:""}),r}function _s(t,e={}){let r=xs(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${pe(e.delimiter)}]+?`,s=[],i=0,o=0,c=new Set,l=O(E=>{if(o<r.length&&r[o].type===E)return r[o++].value},"tryConsume"),u=O(()=>l("OTHER_MODIFIER")??l("ASTERISK"),"tryConsumeModifier"),h=O(E=>{let T=l(E);if(T!==void 0)return T;let{type:w,index:P}=r[o];throw new TypeError(`Unexpected ${w} at ${P}, expected ${E}`)},"mustConsume"),d=O(()=>{let E="",T;for(;T=l("CHAR")??l("ESCAPED_CHAR");)E+=T;return E},"consumeText"),p=O(E=>E,"DefaultEncodePart"),x=e.encodePart||p,S="",R=O(E=>{S+=E;},"appendToPendingFixedValue"),C=O(()=>{S.length&&(s.push(new _t(3,"","",x(S),"",3)),S="");},"maybeAddPartFromPendingFixedValue"),D=O((E,T,w,P,L)=>{let y=3;switch(L){case "?":y=1;break;case "*":y=0;break;case "+":y=2;break}if(!T&&!w&&y===3){R(E);return}if(C(),!T&&!w){if(!E)return;s.push(new _t(3,"","",x(E),"",y));return}let g;w?w==="*"?g=bs:g=w:g=n;let _=2;g===n?(_=1,g=""):g===bs&&(_=0,g="");let v;if(T?v=T:w&&(v=i++),c.has(v))throw new TypeError(`Duplicate name '${v}'.`);c.add(v),s.push(new _t(_,v,x(E),g,x(P),y));},"addPart");for(;o<r.length;){let E=l("CHAR"),T=l("NAME"),w=l("REGEX");if(!T&&!w&&(w=l("ASTERISK")),T||w){let L=E??"";e.prefixes.indexOf(L)===-1&&(R(L),L=""),C();let y=u();D(L,T,w,"",y);continue}let P=E??l("ESCAPED_CHAR");if(P){R(P);continue}if(l("OPEN")){let L=d(),y=l("NAME"),g=l("REGEX");!y&&!g&&(g=l("ASTERISK"));let _=d();h("CLOSE");let v=u();D(L,y,g,_,v);continue}C(),h("END");}return s}function pe(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function ys(t){return t&&t.ignoreCase?"ui":"u"}function Aa(t,e,r){return ws(_s(t,r),e,r)}function et(t){switch(t){case 0:return "*";case 1:return "?";case 2:return "+";case 3:return ""}}function ws(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=false,r.strict??=false,r.end??=true,r.start??=true,r.endsWith="";let n=r.start?"^":"";for(let a of t){if(a.type===3){a.modifier===3?n+=pe(a.value):n+=`(?:${pe(a.value)})${et(a.modifier)}`;continue}e&&e.push(a.name);let c=`[^${pe(r.delimiter)}]+?`,l=a.value;if(a.type===1?l=c:a.type===0&&(l=bs),!a.prefix.length&&!a.suffix.length){a.modifier===3||a.modifier===1?n+=`(${l})${et(a.modifier)}`:n+=`((?:${l})${et(a.modifier)})`;continue}if(a.modifier===3||a.modifier===1){n+=`(?:${pe(a.prefix)}(${l})${pe(a.suffix)})`,n+=et(a.modifier);continue}n+=`(?:${pe(a.prefix)}`,n+=`((?:${l})(?:`,n+=pe(a.suffix),n+=pe(a.prefix),n+=`(?:${l}))*)${pe(a.suffix)})`,a.modifier===0&&(n+="?");}let s=`[${pe(r.endsWith)}]|$`,i=`[${pe(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${s})`:n+="$",new RegExp(n,ys(r));r.strict||(n+=`(?:${i}(?=${s}))?`);let o=false;if(t.length){let a=t[t.length-1];a.type===3&&a.modifier===3&&(o=r.delimiter.indexOf(a)>-1);}return o||(n+=`(?=${i}|${s})`),new RegExp(n,ys(r))}function La(t,e){return t.length?t[0]==="/"?true:!e||t.length<2?false:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":false}function Ss(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function Oa(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function Es(t){return !t||t.length<2?false:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function Ps(t){if(!t)return true;for(let e of Fa)if(t.test(e))return true;return false}function Ia(t,e){if(t=Ss(t,"#"),e||t==="")return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function Da(t,e){if(t=Ss(t,"?"),e||t==="")return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function ja(t,e){return e||t===""?t:Es(t)?ks(t):Ts(t)}function qa(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function Ua(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function Ma(t,e,r){if(r||t==="")return t;if(e&&!Fa.includes(e))return new URL(`${e}:${t}`).pathname;let n=t[0]=="/";return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function Ba(t,e,r){return vs(e)===t&&(t=""),r||t===""?t:Cs(t)}function $a(t,e){return t=Oa(t,":"),e||t===""?t:Rr(t)}function vs(t){switch(t){case "ws":case "http":return "80";case "wws":case "https":return "443";case "ftp":return "21";default:return ""}}function Rr(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Na(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Ga(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function Ts(t){if(t==="")return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function ks(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function Cs(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function Ha(t){if(t==="")return t;let e=new URL("https://example.com");return e.pathname=t[0]!=="/"?"/-"+t:t,t[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname}function za(t){return t===""?t:new URL(`data:${t}`).pathname}function Va(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function Wa(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function gs(t,e){if(typeof t!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);return {protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==""?r.search.substring(1,r.search.length):void 0,hash:r.hash!==""?r.hash.substring(1,r.hash.length):void 0}}function ve(t,e){return e?xt(t):t}function gt(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=ve(n.protocol.substring(0,n.protocol.length-1),r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=ve(n.username,r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=ve(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=ve(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=ve(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=ve(n.pathname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=ve(n.search.substring(1,n.search.length),r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(t.hash=ve(n.hash.substring(1,n.hash.length),r));}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=$a(e.protocol,r)),typeof e.username=="string"&&(t.username=Ua(e.username,r)),typeof e.password=="string"&&(t.password=qa(e.password,r)),typeof e.hostname=="string"&&(t.hostname=ja(e.hostname,r)),typeof e.port=="string"&&(t.port=Ba(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!La(t.pathname,r)){let s=n.pathname.lastIndexOf("/");s>=0&&(t.pathname=ve(n.pathname.substring(0,s+1),r)+t.pathname);}t.pathname=Ma(t.pathname,t.protocol,r);}return typeof e.search=="string"&&(t.search=Da(e.search,r)),typeof e.hash=="string"&&(t.hash=Ia(e.hash,r)),t}function xt(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function Qa(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Za(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=false,e.strict??=false,e.end??=true,e.start??=true,e.endsWith="";let r=".*",n=`[^${Qa(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,i="";for(let o=0;o<t.length;++o){let a=t[o];if(a.type===3){if(a.modifier===3){i+=xt(a.value);continue}i+=`{${xt(a.value)}}${et(a.modifier)}`;continue}let c=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(a.prefix.length!==1||!e.prefixes.includes(a.prefix)),u=o>0?t[o-1]:null,h=o<t.length-1?t[o+1]:null;if(!l&&c&&a.type===1&&a.modifier===3&&h&&!h.prefix.length&&!h.suffix.length)if(h.type===3){let d=h.value.length>0?h.value[0]:"";l=s.test(d);}else l=!h.hasCustomName();if(!l&&!a.prefix.length&&u&&u.type===3){let d=u.value[u.value.length-1];l=e.prefixes.includes(d);}l&&(i+="{"),i+=xt(a.prefix),c&&(i+=`:${a.name}`),a.type===2?i+=`(${a.value})`:a.type===1?c||(i+=`(${n})`):a.type===0&&(!c&&(!u||u.type===3||u.modifier!==3||l||a.prefix!=="")?i+="*":i+=`(${r})`),a.type===1&&c&&a.suffix.length&&s.test(a.suffix[0])&&(i+="\\"),i+=xt(a.suffix),l&&(i+="}"),a.modifier!==3&&(i+=et(a.modifier));}return i}var Rp,O,_t,Ap,Lp,bs,Ge,Op,Fp,Fa,Ka,ms,Ne,Ar,Ja=chunkBUNLC3II_cjs.b(()=>{chunkBUNLC3II_cjs.h();Rp=Object.defineProperty,O=(t,e)=>Rp(t,"name",{value:e,configurable:true}),_t=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,s,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=s,this.modifier=i;}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};O(_t,"Part");Ap=/[$_\p{ID_Start}]/u,Lp=/[$_\u200C\u200D\p{ID_Continue}]/u,bs=".*";O(Ra,"isASCII");O(xs,"lexer");O(_s,"parse");O(pe,"escapeString");O(ys,"flags");O(Aa,"stringToRegexp");O(et,"modifierToString");O(ws,"partsToRegexp");Ge={delimiter:"",prefixes:"",sensitive:true,strict:true},Op={delimiter:".",prefixes:"",sensitive:true,strict:true},Fp={delimiter:"/",prefixes:"/",sensitive:true,strict:true};O(La,"isAbsolutePathname");O(Ss,"maybeStripPrefix");O(Oa,"maybeStripSuffix");O(Es,"treatAsIPv6Hostname");Fa=["ftp","file","http","https","ws","wss"];O(Ps,"isSpecialScheme");O(Ia,"canonicalizeHash");O(Da,"canonicalizeSearch");O(ja,"canonicalizeHostname");O(qa,"canonicalizePassword");O(Ua,"canonicalizeUsername");O(Ma,"canonicalizePathname");O(Ba,"canonicalizePort");O($a,"canonicalizeProtocol");O(vs,"defaultPortForProtocol");O(Rr,"protocolEncodeCallback");O(Na,"usernameEncodeCallback");O(Ga,"passwordEncodeCallback");O(Ts,"hostnameEncodeCallback");O(ks,"ipv6HostnameEncodeCallback");O(Cs,"portEncodeCallback");O(Ha,"standardURLPathnameEncodeCallback");O(za,"pathURLPathnameEncodeCallback");O(Va,"searchEncodeCallback");O(Wa,"hashEncodeCallback");Ka=class{#o;#r=[];#n={};#t=0;#p=1;#w=0;#s=0;#y=0;#l=0;#i=false;constructor(t){this.#o=t;}get result(){return this.#n}parse(){for(this.#r=xs(this.#o,true);this.#t<this.#r.length;this.#t+=this.#p){if(this.#p=1,this.#r[this.#t].type==="END"){if(this.#s===0){this.#b(),this.#T()?this.#e(9,1):this.#d()?this.#e(8,1):this.#e(7,0);continue}else if(this.#s===2){this.#f(5);continue}this.#e(10,0);break}if(this.#y>0)if(this.#k())this.#y-=1;else continue;if(this.#L()){this.#y+=1;continue}switch(this.#s){case 0:this.#h()&&this.#f(1);break;case 1:if(this.#h()){this.#O();let t=7,e=1;this.#E()?(t=2,e=3):this.#i&&(t=2),this.#e(t,e);}break;case 2:this.#g()?this.#f(3):(this.#v()||this.#d()||this.#T())&&this.#f(5);break;case 3:this.#x()?this.#e(4,1):this.#g()&&this.#e(5,1);break;case 4:this.#g()&&this.#e(5,1);break;case 5:this.#F()?this.#l+=1:this.#_()&&(this.#l-=1),this.#P()&&!this.#l?this.#e(6,1):this.#v()?this.#e(7,0):this.#d()?this.#e(8,1):this.#T()&&this.#e(9,1);break;case 6:this.#v()?this.#e(7,0):this.#d()?this.#e(8,1):this.#T()&&this.#e(9,1);break;case 7:this.#d()?this.#e(8,1):this.#T()&&this.#e(9,1);break;case 8:this.#T()&&this.#e(9,1);break;}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port="");}#e(t,e){switch(this.#s){case 0:break;case 1:this.#n.protocol=this.#S();break;case 2:break;case 3:this.#n.username=this.#S();break;case 4:this.#n.password=this.#S();break;case 5:this.#n.hostname=this.#S();break;case 6:this.#n.port=this.#S();break;case 7:this.#n.pathname=this.#S();break;case 8:this.#n.search=this.#S();break;case 9:this.#n.hash=this.#S();break;}this.#s!==0&&t!==10&&([1,2,3,4].includes(this.#s)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#s)&&[8,9].includes(t)&&(this.#n.pathname??=this.#i?"/":""),[1,2,3,4,5,6,7].includes(this.#s)&&t===9&&(this.#n.search??="")),this.#m(t,e);}#m(t,e){this.#s=t,this.#w=this.#t+e,this.#t+=e,this.#p=0;}#b(){this.#t=this.#w,this.#p=0;}#f(t){this.#b(),this.#s=t;}#u(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#c(t,e){let r=this.#u(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#h(){return this.#c(this.#t,":")}#E(){return this.#c(this.#t+1,"/")&&this.#c(this.#t+2,"/")}#g(){return this.#c(this.#t,"@")}#x(){return this.#c(this.#t,":")}#P(){return this.#c(this.#t,":")}#v(){return this.#c(this.#t,"/")}#d(){if(this.#c(this.#t,"?"))return true;if(this.#r[this.#t].value!=="?")return false;let t=this.#u(this.#t-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#T(){return this.#c(this.#t,"#")}#L(){return this.#r[this.#t].type=="OPEN"}#k(){return this.#r[this.#t].type=="CLOSE"}#F(){return this.#c(this.#t,"[")}#_(){return this.#c(this.#t,"]")}#S(){let t=this.#r[this.#t],e=this.#u(this.#w).index;return this.#o.substring(e,t.index)}#O(){let t={};Object.assign(t,Ge),t.encodePart=Rr;let e=Aa(this.#S(),void 0,t);this.#i=Ps(e);}};O(Ka,"Parser");ms=["protocol","username","password","hostname","port","pathname","search","hash"],Ne="*";O(gs,"extractValues");O(ve,"processBaseURLString");O(gt,"applyInit");O(xt,"escapePatternString");O(Qa,"escapeRegexpString");O(Za,"partsToPattern");Ar=class{#o;#r={};#n={};#t={};#p={};#w=false;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let a=new Ka(t);if(a.parse(),t=a.result,n===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n;}else {if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let s={ignoreCase:r.ignoreCase===!0},i={pathname:Ne,protocol:Ne,username:Ne,password:Ne,hostname:Ne,port:Ne,search:Ne,hash:Ne};this.#o=gt(i,t,!0),vs(this.#o.protocol)===this.#o.port&&(this.#o.port="");let o;for(o of ms){if(!(o in this.#o))continue;let a={},c=this.#o[o];switch(this.#n[o]=[],o){case "protocol":Object.assign(a,Ge),a.encodePart=Rr;break;case "username":Object.assign(a,Ge),a.encodePart=Na;break;case "password":Object.assign(a,Ge),a.encodePart=Ga;break;case "hostname":Object.assign(a,Op),Es(c)?a.encodePart=ks:a.encodePart=Ts;break;case "port":Object.assign(a,Ge),a.encodePart=Cs;break;case "pathname":Ps(this.#r.protocol)?(Object.assign(a,Fp,s),a.encodePart=Ha):(Object.assign(a,Ge,s),a.encodePart=za);break;case "search":Object.assign(a,Ge,s),a.encodePart=Va;break;case "hash":Object.assign(a,Ge,s),a.encodePart=Wa;break}try{this.#p[o]=_s(c,a),this.#r[o]=ws(this.#p[o],this.#n[o],a),this.#t[o]=Za(this.#p[o],a),this.#w=this.#w||this.#p[o].some(l=>l.type===2);}catch{throw new TypeError(`invalid ${o} pattern '${this.#o[o]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}get[Symbol.toStringTag](){return "URLPattern"}test(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return false;try{typeof t=="object"?r=gt(r,t,!1):r=gt(r,gs(t,e),!1);}catch{return false}let n;for(n of ms)if(!this.#r[n].exec(r[n]))return false;return true}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{typeof t=="object"?r=gt(r,t,!1):r=gt(r,gs(t,e),!1);}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let s;for(s of ms){let i=this.#r[s].exec(r[s]);if(!i)return null;let o={};for(let[a,c]of this.#n[s].entries())if(typeof c=="string"||typeof c=="number"){let l=i[a+1];o[c]=l;}n[s]={input:r[s]??"",groups:o};}return n}static compareComponent(t,e,r){let n=O((a,c)=>{for(let l of ["type","modifier","prefix","value","suffix"]){if(a[l]<c[l])return -1;if(a[l]!==c[l])return 1}return 0},"comparePart"),s=new _t(3,"","","","",3),i=new _t(0,"","","","",3),o=O((a,c)=>{let l=0;for(;l<Math.min(a.length,c.length);++l){let u=n(a[l],c[l]);if(u)return u}return a.length===c.length?0:n(a[l]??s,c[l]??s)},"comparePartList");return !e.#t[t]&&!r.#t[t]?0:e.#t[t]&&!r.#t[t]?o(e.#p[t],[i]):!e.#t[t]&&r.#t[t]?o([i],r.#p[t]):o(e.#p[t],r.#p[t])}get protocol(){return this.#t.protocol}get username(){return this.#t.username}get password(){return this.#t.password}get hostname(){return this.#t.hostname}get port(){return this.#t.port}get pathname(){return this.#t.pathname}get search(){return this.#t.search}get hash(){return this.#t.hash}get hasRegExpGroups(){return this.#w}};O(Ar,"URLPattern");});var Ya={};chunkBUNLC3II_cjs.d(Ya,{URLPattern:()=>Ar});var Xa=chunkBUNLC3II_cjs.b(()=>{chunkBUNLC3II_cjs.h();Ja();globalThis.URLPattern||(globalThis.URLPattern=Ar);});var ze=chunkBUNLC3II_cjs.c(he=>{chunkBUNLC3II_cjs.h();Object.defineProperty(he,"__esModule",{value:true});he.isPromise=Lr;he.isActualPromise=tl;he.handleMaybePromise=He;he.fakePromise=Te;he.createDeferredPromise=Ip;he.iterateAsync=rl;he.iterateAsyncVoid=rl;he.fakeRejectPromise=tt;he.mapMaybePromise=Dp;he.mapAsyncIterator=jp;he.promiseLikeFinally=nl;he.unfakePromise=sl;var Or=Symbol.for("@whatwg-node/promise-helpers/FakePromise");function Lr(t){return t?.then!=null}function tl(t){let e=t;return e&&e.then&&e.catch&&e.finally}function He(t,e,r,n){let s=Te().then(t).then(e,r);return n&&(s=s.finally(n)),sl(s)}function Te(t){return t&&tl(t)?t:Lr(t)?{then:(e,r)=>Te(t.then(e,r)),catch:e=>Te(t.then(r=>r,e)),finally:e=>Te(e?nl(t,e):t),[Symbol.toStringTag]:"Promise"}:{then(e){if(e)try{return Te(e(t))}catch(r){return tt(r)}return this},catch(){return this},finally(e){if(e)try{return Te(e()).then(()=>t,()=>t)}catch(r){return tt(r)}return this},[Symbol.toStringTag]:"Promise",__fakePromiseValue:t,[Or]:"resolved"}}function Ip(){if(Promise.withResolvers)return Promise.withResolvers();let t,e;return {promise:new Promise(function(s,i){t=s,e=i;}),get resolve(){return t},get reject(){return e}}}function rl(t,e,r){if(t?.length===0)return;let n=t[Symbol.iterator](),s=0;function i(){let{done:o,value:a}=n.next();if(o)return;let c=false;function l(){c=true;}return He(function(){return e(a,l,s++)},function(h){if(h&&r?.push(h),!c)return i()})}return i()}function tt(t){return {then(e,r){if(r)try{return Te(r(t))}catch(n){return tt(n)}return this},catch(e){if(e)try{return Te(e(t))}catch(r){return tt(r)}return this},finally(e){if(e)try{e();}catch(r){return tt(r)}return this},__fakeRejectError:t,[Symbol.toStringTag]:"Promise",[Or]:"rejected"}}function Dp(t,e,r){return He(()=>t,e,r)}function jp(t,e,r,n){Symbol.asyncIterator in t&&(t=t[Symbol.asyncIterator]());let s,i,o;if(n){let l;o=u=>(l||=He(n,()=>u,()=>u),l);}typeof t.return=="function"&&(s=t.return,i=l=>{let u=()=>{throw l};return s.call(t).then(u,u)});function a(l){return l.done?o?o(l):l:He(()=>l.value,u=>He(()=>e(u),el,i))}let c;if(r){let l,u=r;c=h=>(l||=He(()=>h,d=>He(()=>u(d),el,i)),l);}return {next(){return t.next().then(a,c)},return(){let l=s?s.call(t).then(a,c):Te({value:void 0,done:true});return o?l.then(o):l},throw(l){return typeof t.throw=="function"?t.throw(l).then(a,c):i?i(l):tt(l)},[Symbol.asyncIterator](){return this}}}function el(t){return {value:t,done:false}}function qp(t){return t?.[Or]==="resolved"}function Up(t){return t?.[Or]==="rejected"}function nl(t,e){return "finally"in t?t.finally(e):t.then(r=>{let n=e();return Lr(n)?n.then(()=>r):r},r=>{let n=e();if(Lr(n))return n.then(()=>{throw r});throw r})}function sl(t){if(qp(t))return t.__fakePromiseValue;if(Up(t))throw t.__fakeRejectError;return t}});var Rs=chunkBUNLC3II_cjs.c((Sw,il)=>{chunkBUNLC3II_cjs.h();var{EventEmitter:Mp}=chunkBUNLC3II_cjs.a("events"),{inherits:Bp}=chunkBUNLC3II_cjs.a("util");function rt(t){if(typeof t=="string"&&(t=Buffer.from(t)),!Buffer.isBuffer(t))throw new TypeError("The needle has to be a String or a Buffer.");let e=t.length,r=e-1;if(e===0)throw new Error("The needle cannot be an empty String/Buffer.");if(e>256)throw new Error("The needle cannot have a length bigger than 256.");this.maxMatches=1/0,this.matches=0,this._occ=new Uint8Array(256).fill(e),this._lookbehind_size=0,this._needle=t,this._bufpos=0,this._lookbehind=Buffer.alloc(r);for(var n=0;n<r;++n)this._occ[t[n]]=r-n;}Bp(rt,Mp);rt.prototype.reset=function(){this._lookbehind_size=0,this.matches=0,this._bufpos=0;};rt.prototype.push=function(t,e){Buffer.isBuffer(t)||(t=Buffer.from(t,"binary"));let r=t.length;this._bufpos=e||0;let n;for(;n!==r&&this.matches<this.maxMatches;)n=this._sbmh_feed(t);return n};rt.prototype._sbmh_feed=function(t){let e=t.length,r=this._needle,n=r.length,s=n-1,i=r[s],o=-this._lookbehind_size,a;if(o<0){for(;o<0&&o<=e-n;){if(a=t[o+s],a===i&&this._sbmh_memcmp(t,o,s))return this._lookbehind_size=0,++this.matches,this.emit("info",true),this._bufpos=o+n;o+=this._occ[a];}for(;o<0&&!this._sbmh_memcmp(t,o,e-o);)++o;if(o>=0)this.emit("info",false,this._lookbehind,0,this._lookbehind_size),this._lookbehind_size=0;else {let c=this._lookbehind_size+o;return c>0&&this.emit("info",false,this._lookbehind,0,c),this._lookbehind_size-=c,this._lookbehind.copy(this._lookbehind,0,c,this._lookbehind_size),t.copy(this._lookbehind,this._lookbehind_size),this._lookbehind_size+=e,this._bufpos=e,e}}if(o=t.indexOf(r,o+this._bufpos),o!==-1)return ++this.matches,o===0?this.emit("info",true):this.emit("info",true,t,this._bufpos,o),this._bufpos=o+n;for(o=e-s,o<0&&(o=0);o!==e&&(t[o]!==r[0]||Buffer.compare(t.subarray(o+1,e),r.subarray(1,e-o))!==0);)++o;return o!==e&&(t.copy(this._lookbehind,0,o,e),this._lookbehind_size=e-o),o!==0&&this.emit("info",false,t,this._bufpos,o),this._bufpos=e,e};rt.prototype._sbmh_lookup_char=function(t,e){return e<0?this._lookbehind[this._lookbehind_size+e]:t[e]};rt.prototype._sbmh_memcmp=function(t,e,r){for(var n=0;n<r;++n)if(this._sbmh_lookup_char(t,e+n)!==this._needle[n])return false;return true};il.exports=rt;});var ll=chunkBUNLC3II_cjs.c((Pw,al)=>{chunkBUNLC3II_cjs.h();var $p=chunkBUNLC3II_cjs.a("util").inherits,ol=chunkBUNLC3II_cjs.a("stream").Readable;function As(t){ol.call(this,t);}$p(As,ol);As.prototype._read=function(t){};al.exports=As;});var Fr=chunkBUNLC3II_cjs.c((Tw,cl)=>{chunkBUNLC3II_cjs.h();cl.exports=function(e,r,n){if(!e||e[r]===void 0||e[r]===null)return n;if(typeof e[r]!="number"||isNaN(e[r]))throw new TypeError("Limit "+r+" is not a valid number");return e[r]};});var dl=chunkBUNLC3II_cjs.c((Cw,hl)=>{chunkBUNLC3II_cjs.h();var fl=chunkBUNLC3II_cjs.a("events").EventEmitter,Np=chunkBUNLC3II_cjs.a("util").inherits,ul=Fr(),Gp=Rs(),Hp=Buffer.from(`\r
|
|
1
|
+
'use strict';var chunk7GGZA5YU_cjs=require('./chunk-7GGZA5YU.cjs'),chunkKMFLHGD5_cjs=require('./chunk-KMFLHGD5.cjs'),chunkFP5UK272_cjs=require('./chunk-FP5UK272.cjs'),chunk5DWQGEM2_cjs=require('./chunk-5DWQGEM2.cjs'),chunk6QWX3DEB_cjs=require('./chunk-6QWX3DEB.cjs'),chunkFSL3NLRT_cjs=require('./chunk-FSL3NLRT.cjs'),chunkZHA446FA_cjs=require('./chunk-ZHA446FA.cjs'),chunkWCFHS7EZ_cjs=require('./chunk-WCFHS7EZ.cjs'),chunkJU3UAZRY_cjs=require('./chunk-JU3UAZRY.cjs'),chunk7JWQ2PZP_cjs=require('./chunk-7JWQ2PZP.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');var ps=chunkBUNLC3II_cjs.c((fw,Ca)=>{chunkBUNLC3II_cjs.h();function Cp(){return Object.keys(globalThis).some(t=>t.startsWith("__NEXT"))}Ca.exports=function(){return !!(globalThis.Deno||globalThis.Bun||Cp())};});function Ra(t,e){return (e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function xs(t,e=false){let r=[],n=0;for(;n<t.length;){let s=t[n],i=O(function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]});},"ErrorOrInvalid");if(s==="*"){r.push({type:"ASTERISK",index:n,value:t[n++]});continue}if(s==="+"||s==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});continue}if(s==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(s==="{"){r.push({type:"OPEN",index:n,value:t[n++]});continue}if(s==="}"){r.push({type:"CLOSE",index:n,value:t[n++]});continue}if(s===":"){let o="",a=n+1;for(;a<t.length;){let c=t.substr(a,1);if(a===n+1&&Ap.test(c)||a!==n+1&&Lp.test(c)){o+=t[a++];continue}break}if(!o){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:o}),n=a;continue}if(s==="("){let o=1,a="",c=n+1,l=false;if(t[c]==="?"){i(`Pattern cannot start with "?" at ${c}`);continue}for(;c<t.length;){if(!Ra(t[c],false)){i(`Invalid character '${t[c]}' at ${c}.`),l=true;break}if(t[c]==="\\"){a+=t[c++]+t[c++];continue}if(t[c]===")"){if(o--,o===0){c++;break}}else if(t[c]==="("&&(o++,t[c+1]!=="?")){i(`Capturing groups are not allowed at ${c}`),l=true;break}a+=t[c++];}if(l)continue;if(o){i(`Unbalanced pattern at ${n}`);continue}if(!a){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:a}),n=c;continue}r.push({type:"CHAR",index:n,value:t[n++]});}return r.push({type:"END",index:n,value:""}),r}function _s(t,e={}){let r=xs(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${pe(e.delimiter)}]+?`,s=[],i=0,o=0,c=new Set,l=O(E=>{if(o<r.length&&r[o].type===E)return r[o++].value},"tryConsume"),u=O(()=>l("OTHER_MODIFIER")??l("ASTERISK"),"tryConsumeModifier"),h=O(E=>{let T=l(E);if(T!==void 0)return T;let{type:w,index:P}=r[o];throw new TypeError(`Unexpected ${w} at ${P}, expected ${E}`)},"mustConsume"),d=O(()=>{let E="",T;for(;T=l("CHAR")??l("ESCAPED_CHAR");)E+=T;return E},"consumeText"),p=O(E=>E,"DefaultEncodePart"),x=e.encodePart||p,S="",R=O(E=>{S+=E;},"appendToPendingFixedValue"),C=O(()=>{S.length&&(s.push(new _t(3,"","",x(S),"",3)),S="");},"maybeAddPartFromPendingFixedValue"),D=O((E,T,w,P,L)=>{let y=3;switch(L){case "?":y=1;break;case "*":y=0;break;case "+":y=2;break}if(!T&&!w&&y===3){R(E);return}if(C(),!T&&!w){if(!E)return;s.push(new _t(3,"","",x(E),"",y));return}let g;w?w==="*"?g=bs:g=w:g=n;let _=2;g===n?(_=1,g=""):g===bs&&(_=0,g="");let v;if(T?v=T:w&&(v=i++),c.has(v))throw new TypeError(`Duplicate name '${v}'.`);c.add(v),s.push(new _t(_,v,x(E),g,x(P),y));},"addPart");for(;o<r.length;){let E=l("CHAR"),T=l("NAME"),w=l("REGEX");if(!T&&!w&&(w=l("ASTERISK")),T||w){let L=E??"";e.prefixes.indexOf(L)===-1&&(R(L),L=""),C();let y=u();D(L,T,w,"",y);continue}let P=E??l("ESCAPED_CHAR");if(P){R(P);continue}if(l("OPEN")){let L=d(),y=l("NAME"),g=l("REGEX");!y&&!g&&(g=l("ASTERISK"));let _=d();h("CLOSE");let v=u();D(L,y,g,_,v);continue}C(),h("END");}return s}function pe(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function ys(t){return t&&t.ignoreCase?"ui":"u"}function Aa(t,e,r){return ws(_s(t,r),e,r)}function et(t){switch(t){case 0:return "*";case 1:return "?";case 2:return "+";case 3:return ""}}function ws(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=false,r.strict??=false,r.end??=true,r.start??=true,r.endsWith="";let n=r.start?"^":"";for(let a of t){if(a.type===3){a.modifier===3?n+=pe(a.value):n+=`(?:${pe(a.value)})${et(a.modifier)}`;continue}e&&e.push(a.name);let c=`[^${pe(r.delimiter)}]+?`,l=a.value;if(a.type===1?l=c:a.type===0&&(l=bs),!a.prefix.length&&!a.suffix.length){a.modifier===3||a.modifier===1?n+=`(${l})${et(a.modifier)}`:n+=`((?:${l})${et(a.modifier)})`;continue}if(a.modifier===3||a.modifier===1){n+=`(?:${pe(a.prefix)}(${l})${pe(a.suffix)})`,n+=et(a.modifier);continue}n+=`(?:${pe(a.prefix)}`,n+=`((?:${l})(?:`,n+=pe(a.suffix),n+=pe(a.prefix),n+=`(?:${l}))*)${pe(a.suffix)})`,a.modifier===0&&(n+="?");}let s=`[${pe(r.endsWith)}]|$`,i=`[${pe(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${s})`:n+="$",new RegExp(n,ys(r));r.strict||(n+=`(?:${i}(?=${s}))?`);let o=false;if(t.length){let a=t[t.length-1];a.type===3&&a.modifier===3&&(o=r.delimiter.indexOf(a)>-1);}return o||(n+=`(?=${i}|${s})`),new RegExp(n,ys(r))}function La(t,e){return t.length?t[0]==="/"?true:!e||t.length<2?false:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":false}function Ss(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function Oa(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function Es(t){return !t||t.length<2?false:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function Ps(t){if(!t)return true;for(let e of Fa)if(t.test(e))return true;return false}function Ia(t,e){if(t=Ss(t,"#"),e||t==="")return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function Da(t,e){if(t=Ss(t,"?"),e||t==="")return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function ja(t,e){return e||t===""?t:Es(t)?ks(t):Ts(t)}function qa(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function Ua(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function Ma(t,e,r){if(r||t==="")return t;if(e&&!Fa.includes(e))return new URL(`${e}:${t}`).pathname;let n=t[0]=="/";return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function Ba(t,e,r){return vs(e)===t&&(t=""),r||t===""?t:Cs(t)}function $a(t,e){return t=Oa(t,":"),e||t===""?t:Rr(t)}function vs(t){switch(t){case "ws":case "http":return "80";case "wws":case "https":return "443";case "ftp":return "21";default:return ""}}function Rr(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Na(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Ga(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function Ts(t){if(t==="")return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function ks(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function Cs(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function za(t){if(t==="")return t;let e=new URL("https://example.com");return e.pathname=t[0]!=="/"?"/-"+t:t,t[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname}function Ha(t){return t===""?t:new URL(`data:${t}`).pathname}function Va(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function Wa(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function gs(t,e){if(typeof t!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);return {protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==""?r.search.substring(1,r.search.length):void 0,hash:r.hash!==""?r.hash.substring(1,r.hash.length):void 0}}function ve(t,e){return e?xt(t):t}function gt(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=ve(n.protocol.substring(0,n.protocol.length-1),r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=ve(n.username,r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=ve(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=ve(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=ve(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=ve(n.pathname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=ve(n.search.substring(1,n.search.length),r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(t.hash=ve(n.hash.substring(1,n.hash.length),r));}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=$a(e.protocol,r)),typeof e.username=="string"&&(t.username=Ua(e.username,r)),typeof e.password=="string"&&(t.password=qa(e.password,r)),typeof e.hostname=="string"&&(t.hostname=ja(e.hostname,r)),typeof e.port=="string"&&(t.port=Ba(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!La(t.pathname,r)){let s=n.pathname.lastIndexOf("/");s>=0&&(t.pathname=ve(n.pathname.substring(0,s+1),r)+t.pathname);}t.pathname=Ma(t.pathname,t.protocol,r);}return typeof e.search=="string"&&(t.search=Da(e.search,r)),typeof e.hash=="string"&&(t.hash=Ia(e.hash,r)),t}function xt(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function Qa(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Za(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=false,e.strict??=false,e.end??=true,e.start??=true,e.endsWith="";let r=".*",n=`[^${Qa(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,i="";for(let o=0;o<t.length;++o){let a=t[o];if(a.type===3){if(a.modifier===3){i+=xt(a.value);continue}i+=`{${xt(a.value)}}${et(a.modifier)}`;continue}let c=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(a.prefix.length!==1||!e.prefixes.includes(a.prefix)),u=o>0?t[o-1]:null,h=o<t.length-1?t[o+1]:null;if(!l&&c&&a.type===1&&a.modifier===3&&h&&!h.prefix.length&&!h.suffix.length)if(h.type===3){let d=h.value.length>0?h.value[0]:"";l=s.test(d);}else l=!h.hasCustomName();if(!l&&!a.prefix.length&&u&&u.type===3){let d=u.value[u.value.length-1];l=e.prefixes.includes(d);}l&&(i+="{"),i+=xt(a.prefix),c&&(i+=`:${a.name}`),a.type===2?i+=`(${a.value})`:a.type===1?c||(i+=`(${n})`):a.type===0&&(!c&&(!u||u.type===3||u.modifier!==3||l||a.prefix!=="")?i+="*":i+=`(${r})`),a.type===1&&c&&a.suffix.length&&s.test(a.suffix[0])&&(i+="\\"),i+=xt(a.suffix),l&&(i+="}"),a.modifier!==3&&(i+=et(a.modifier));}return i}var Rp,O,_t,Ap,Lp,bs,Ge,Op,Fp,Fa,Ka,ms,Ne,Ar,Ja=chunkBUNLC3II_cjs.b(()=>{chunkBUNLC3II_cjs.h();Rp=Object.defineProperty,O=(t,e)=>Rp(t,"name",{value:e,configurable:true}),_t=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,s,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=s,this.modifier=i;}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};O(_t,"Part");Ap=/[$_\p{ID_Start}]/u,Lp=/[$_\u200C\u200D\p{ID_Continue}]/u,bs=".*";O(Ra,"isASCII");O(xs,"lexer");O(_s,"parse");O(pe,"escapeString");O(ys,"flags");O(Aa,"stringToRegexp");O(et,"modifierToString");O(ws,"partsToRegexp");Ge={delimiter:"",prefixes:"",sensitive:true,strict:true},Op={delimiter:".",prefixes:"",sensitive:true,strict:true},Fp={delimiter:"/",prefixes:"/",sensitive:true,strict:true};O(La,"isAbsolutePathname");O(Ss,"maybeStripPrefix");O(Oa,"maybeStripSuffix");O(Es,"treatAsIPv6Hostname");Fa=["ftp","file","http","https","ws","wss"];O(Ps,"isSpecialScheme");O(Ia,"canonicalizeHash");O(Da,"canonicalizeSearch");O(ja,"canonicalizeHostname");O(qa,"canonicalizePassword");O(Ua,"canonicalizeUsername");O(Ma,"canonicalizePathname");O(Ba,"canonicalizePort");O($a,"canonicalizeProtocol");O(vs,"defaultPortForProtocol");O(Rr,"protocolEncodeCallback");O(Na,"usernameEncodeCallback");O(Ga,"passwordEncodeCallback");O(Ts,"hostnameEncodeCallback");O(ks,"ipv6HostnameEncodeCallback");O(Cs,"portEncodeCallback");O(za,"standardURLPathnameEncodeCallback");O(Ha,"pathURLPathnameEncodeCallback");O(Va,"searchEncodeCallback");O(Wa,"hashEncodeCallback");Ka=class{#o;#r=[];#n={};#t=0;#p=1;#w=0;#s=0;#y=0;#l=0;#i=false;constructor(t){this.#o=t;}get result(){return this.#n}parse(){for(this.#r=xs(this.#o,true);this.#t<this.#r.length;this.#t+=this.#p){if(this.#p=1,this.#r[this.#t].type==="END"){if(this.#s===0){this.#b(),this.#T()?this.#e(9,1):this.#d()?this.#e(8,1):this.#e(7,0);continue}else if(this.#s===2){this.#f(5);continue}this.#e(10,0);break}if(this.#y>0)if(this.#k())this.#y-=1;else continue;if(this.#L()){this.#y+=1;continue}switch(this.#s){case 0:this.#h()&&this.#f(1);break;case 1:if(this.#h()){this.#O();let t=7,e=1;this.#E()?(t=2,e=3):this.#i&&(t=2),this.#e(t,e);}break;case 2:this.#g()?this.#f(3):(this.#v()||this.#d()||this.#T())&&this.#f(5);break;case 3:this.#x()?this.#e(4,1):this.#g()&&this.#e(5,1);break;case 4:this.#g()&&this.#e(5,1);break;case 5:this.#F()?this.#l+=1:this.#_()&&(this.#l-=1),this.#P()&&!this.#l?this.#e(6,1):this.#v()?this.#e(7,0):this.#d()?this.#e(8,1):this.#T()&&this.#e(9,1);break;case 6:this.#v()?this.#e(7,0):this.#d()?this.#e(8,1):this.#T()&&this.#e(9,1);break;case 7:this.#d()?this.#e(8,1):this.#T()&&this.#e(9,1);break;case 8:this.#T()&&this.#e(9,1);break;}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port="");}#e(t,e){switch(this.#s){case 0:break;case 1:this.#n.protocol=this.#S();break;case 2:break;case 3:this.#n.username=this.#S();break;case 4:this.#n.password=this.#S();break;case 5:this.#n.hostname=this.#S();break;case 6:this.#n.port=this.#S();break;case 7:this.#n.pathname=this.#S();break;case 8:this.#n.search=this.#S();break;case 9:this.#n.hash=this.#S();break;}this.#s!==0&&t!==10&&([1,2,3,4].includes(this.#s)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#s)&&[8,9].includes(t)&&(this.#n.pathname??=this.#i?"/":""),[1,2,3,4,5,6,7].includes(this.#s)&&t===9&&(this.#n.search??="")),this.#m(t,e);}#m(t,e){this.#s=t,this.#w=this.#t+e,this.#t+=e,this.#p=0;}#b(){this.#t=this.#w,this.#p=0;}#f(t){this.#b(),this.#s=t;}#u(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#c(t,e){let r=this.#u(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#h(){return this.#c(this.#t,":")}#E(){return this.#c(this.#t+1,"/")&&this.#c(this.#t+2,"/")}#g(){return this.#c(this.#t,"@")}#x(){return this.#c(this.#t,":")}#P(){return this.#c(this.#t,":")}#v(){return this.#c(this.#t,"/")}#d(){if(this.#c(this.#t,"?"))return true;if(this.#r[this.#t].value!=="?")return false;let t=this.#u(this.#t-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#T(){return this.#c(this.#t,"#")}#L(){return this.#r[this.#t].type=="OPEN"}#k(){return this.#r[this.#t].type=="CLOSE"}#F(){return this.#c(this.#t,"[")}#_(){return this.#c(this.#t,"]")}#S(){let t=this.#r[this.#t],e=this.#u(this.#w).index;return this.#o.substring(e,t.index)}#O(){let t={};Object.assign(t,Ge),t.encodePart=Rr;let e=Aa(this.#S(),void 0,t);this.#i=Ps(e);}};O(Ka,"Parser");ms=["protocol","username","password","hostname","port","pathname","search","hash"],Ne="*";O(gs,"extractValues");O(ve,"processBaseURLString");O(gt,"applyInit");O(xt,"escapePatternString");O(Qa,"escapeRegexpString");O(Za,"partsToPattern");Ar=class{#o;#r={};#n={};#t={};#p={};#w=false;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let a=new Ka(t);if(a.parse(),t=a.result,n===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n;}else {if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let s={ignoreCase:r.ignoreCase===!0},i={pathname:Ne,protocol:Ne,username:Ne,password:Ne,hostname:Ne,port:Ne,search:Ne,hash:Ne};this.#o=gt(i,t,!0),vs(this.#o.protocol)===this.#o.port&&(this.#o.port="");let o;for(o of ms){if(!(o in this.#o))continue;let a={},c=this.#o[o];switch(this.#n[o]=[],o){case "protocol":Object.assign(a,Ge),a.encodePart=Rr;break;case "username":Object.assign(a,Ge),a.encodePart=Na;break;case "password":Object.assign(a,Ge),a.encodePart=Ga;break;case "hostname":Object.assign(a,Op),Es(c)?a.encodePart=ks:a.encodePart=Ts;break;case "port":Object.assign(a,Ge),a.encodePart=Cs;break;case "pathname":Ps(this.#r.protocol)?(Object.assign(a,Fp,s),a.encodePart=za):(Object.assign(a,Ge,s),a.encodePart=Ha);break;case "search":Object.assign(a,Ge,s),a.encodePart=Va;break;case "hash":Object.assign(a,Ge,s),a.encodePart=Wa;break}try{this.#p[o]=_s(c,a),this.#r[o]=ws(this.#p[o],this.#n[o],a),this.#t[o]=Za(this.#p[o],a),this.#w=this.#w||this.#p[o].some(l=>l.type===2);}catch{throw new TypeError(`invalid ${o} pattern '${this.#o[o]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}get[Symbol.toStringTag](){return "URLPattern"}test(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return false;try{typeof t=="object"?r=gt(r,t,!1):r=gt(r,gs(t,e),!1);}catch{return false}let n;for(n of ms)if(!this.#r[n].exec(r[n]))return false;return true}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{typeof t=="object"?r=gt(r,t,!1):r=gt(r,gs(t,e),!1);}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let s;for(s of ms){let i=this.#r[s].exec(r[s]);if(!i)return null;let o={};for(let[a,c]of this.#n[s].entries())if(typeof c=="string"||typeof c=="number"){let l=i[a+1];o[c]=l;}n[s]={input:r[s]??"",groups:o};}return n}static compareComponent(t,e,r){let n=O((a,c)=>{for(let l of ["type","modifier","prefix","value","suffix"]){if(a[l]<c[l])return -1;if(a[l]!==c[l])return 1}return 0},"comparePart"),s=new _t(3,"","","","",3),i=new _t(0,"","","","",3),o=O((a,c)=>{let l=0;for(;l<Math.min(a.length,c.length);++l){let u=n(a[l],c[l]);if(u)return u}return a.length===c.length?0:n(a[l]??s,c[l]??s)},"comparePartList");return !e.#t[t]&&!r.#t[t]?0:e.#t[t]&&!r.#t[t]?o(e.#p[t],[i]):!e.#t[t]&&r.#t[t]?o([i],r.#p[t]):o(e.#p[t],r.#p[t])}get protocol(){return this.#t.protocol}get username(){return this.#t.username}get password(){return this.#t.password}get hostname(){return this.#t.hostname}get port(){return this.#t.port}get pathname(){return this.#t.pathname}get search(){return this.#t.search}get hash(){return this.#t.hash}get hasRegExpGroups(){return this.#w}};O(Ar,"URLPattern");});var Ya={};chunkBUNLC3II_cjs.d(Ya,{URLPattern:()=>Ar});var Xa=chunkBUNLC3II_cjs.b(()=>{chunkBUNLC3II_cjs.h();Ja();globalThis.URLPattern||(globalThis.URLPattern=Ar);});var He=chunkBUNLC3II_cjs.c(he=>{chunkBUNLC3II_cjs.h();Object.defineProperty(he,"__esModule",{value:true});he.isPromise=Lr;he.isActualPromise=tl;he.handleMaybePromise=ze;he.fakePromise=Te;he.createDeferredPromise=Ip;he.iterateAsync=rl;he.iterateAsyncVoid=rl;he.fakeRejectPromise=tt;he.mapMaybePromise=Dp;he.mapAsyncIterator=jp;he.promiseLikeFinally=nl;he.unfakePromise=sl;var Or=Symbol.for("@whatwg-node/promise-helpers/FakePromise");function Lr(t){return t?.then!=null}function tl(t){let e=t;return e&&e.then&&e.catch&&e.finally}function ze(t,e,r,n){let s=Te().then(t).then(e,r);return n&&(s=s.finally(n)),sl(s)}function Te(t){return t&&tl(t)?t:Lr(t)?{then:(e,r)=>Te(t.then(e,r)),catch:e=>Te(t.then(r=>r,e)),finally:e=>Te(e?nl(t,e):t),[Symbol.toStringTag]:"Promise"}:{then(e){if(e)try{return Te(e(t))}catch(r){return tt(r)}return this},catch(){return this},finally(e){if(e)try{return Te(e()).then(()=>t,()=>t)}catch(r){return tt(r)}return this},[Symbol.toStringTag]:"Promise",__fakePromiseValue:t,[Or]:"resolved"}}function Ip(){if(Promise.withResolvers)return Promise.withResolvers();let t,e;return {promise:new Promise(function(s,i){t=s,e=i;}),get resolve(){return t},get reject(){return e}}}function rl(t,e,r){if(t?.length===0)return;let n=t[Symbol.iterator](),s=0;function i(){let{done:o,value:a}=n.next();if(o)return;let c=false;function l(){c=true;}return ze(function(){return e(a,l,s++)},function(h){if(h&&r?.push(h),!c)return i()})}return i()}function tt(t){return {then(e,r){if(r)try{return Te(r(t))}catch(n){return tt(n)}return this},catch(e){if(e)try{return Te(e(t))}catch(r){return tt(r)}return this},finally(e){if(e)try{e();}catch(r){return tt(r)}return this},__fakeRejectError:t,[Symbol.toStringTag]:"Promise",[Or]:"rejected"}}function Dp(t,e,r){return ze(()=>t,e,r)}function jp(t,e,r,n){Symbol.asyncIterator in t&&(t=t[Symbol.asyncIterator]());let s,i,o;if(n){let l;o=u=>(l||=ze(n,()=>u,()=>u),l);}typeof t.return=="function"&&(s=t.return,i=l=>{let u=()=>{throw l};return s.call(t).then(u,u)});function a(l){return l.done?o?o(l):l:ze(()=>l.value,u=>ze(()=>e(u),el,i))}let c;if(r){let l,u=r;c=h=>(l||=ze(()=>h,d=>ze(()=>u(d),el,i)),l);}return {next(){return t.next().then(a,c)},return(){let l=s?s.call(t).then(a,c):Te({value:void 0,done:true});return o?l.then(o):l},throw(l){return typeof t.throw=="function"?t.throw(l).then(a,c):i?i(l):tt(l)},[Symbol.asyncIterator](){return this}}}function el(t){return {value:t,done:false}}function qp(t){return t?.[Or]==="resolved"}function Up(t){return t?.[Or]==="rejected"}function nl(t,e){return "finally"in t?t.finally(e):t.then(r=>{let n=e();return Lr(n)?n.then(()=>r):r},r=>{let n=e();if(Lr(n))return n.then(()=>{throw r});throw r})}function sl(t){if(qp(t))return t.__fakePromiseValue;if(Up(t))throw t.__fakeRejectError;return t}});var Rs=chunkBUNLC3II_cjs.c((Sw,il)=>{chunkBUNLC3II_cjs.h();var{EventEmitter:Mp}=chunkBUNLC3II_cjs.a("events"),{inherits:Bp}=chunkBUNLC3II_cjs.a("util");function rt(t){if(typeof t=="string"&&(t=Buffer.from(t)),!Buffer.isBuffer(t))throw new TypeError("The needle has to be a String or a Buffer.");let e=t.length,r=e-1;if(e===0)throw new Error("The needle cannot be an empty String/Buffer.");if(e>256)throw new Error("The needle cannot have a length bigger than 256.");this.maxMatches=1/0,this.matches=0,this._occ=new Uint8Array(256).fill(e),this._lookbehind_size=0,this._needle=t,this._bufpos=0,this._lookbehind=Buffer.alloc(r);for(var n=0;n<r;++n)this._occ[t[n]]=r-n;}Bp(rt,Mp);rt.prototype.reset=function(){this._lookbehind_size=0,this.matches=0,this._bufpos=0;};rt.prototype.push=function(t,e){Buffer.isBuffer(t)||(t=Buffer.from(t,"binary"));let r=t.length;this._bufpos=e||0;let n;for(;n!==r&&this.matches<this.maxMatches;)n=this._sbmh_feed(t);return n};rt.prototype._sbmh_feed=function(t){let e=t.length,r=this._needle,n=r.length,s=n-1,i=r[s],o=-this._lookbehind_size,a;if(o<0){for(;o<0&&o<=e-n;){if(a=t[o+s],a===i&&this._sbmh_memcmp(t,o,s))return this._lookbehind_size=0,++this.matches,this.emit("info",true),this._bufpos=o+n;o+=this._occ[a];}for(;o<0&&!this._sbmh_memcmp(t,o,e-o);)++o;if(o>=0)this.emit("info",false,this._lookbehind,0,this._lookbehind_size),this._lookbehind_size=0;else {let c=this._lookbehind_size+o;return c>0&&this.emit("info",false,this._lookbehind,0,c),this._lookbehind_size-=c,this._lookbehind.copy(this._lookbehind,0,c,this._lookbehind_size),t.copy(this._lookbehind,this._lookbehind_size),this._lookbehind_size+=e,this._bufpos=e,e}}if(o=t.indexOf(r,o+this._bufpos),o!==-1)return ++this.matches,o===0?this.emit("info",true):this.emit("info",true,t,this._bufpos,o),this._bufpos=o+n;for(o=e-s,o<0&&(o=0);o!==e&&(t[o]!==r[0]||Buffer.compare(t.subarray(o+1,e),r.subarray(1,e-o))!==0);)++o;return o!==e&&(t.copy(this._lookbehind,0,o,e),this._lookbehind_size=e-o),o!==0&&this.emit("info",false,t,this._bufpos,o),this._bufpos=e,e};rt.prototype._sbmh_lookup_char=function(t,e){return e<0?this._lookbehind[this._lookbehind_size+e]:t[e]};rt.prototype._sbmh_memcmp=function(t,e,r){for(var n=0;n<r;++n)if(this._sbmh_lookup_char(t,e+n)!==this._needle[n])return false;return true};il.exports=rt;});var ll=chunkBUNLC3II_cjs.c((Pw,al)=>{chunkBUNLC3II_cjs.h();var $p=chunkBUNLC3II_cjs.a("util").inherits,ol=chunkBUNLC3II_cjs.a("stream").Readable;function As(t){ol.call(this,t);}$p(As,ol);As.prototype._read=function(t){};al.exports=As;});var Fr=chunkBUNLC3II_cjs.c((Tw,cl)=>{chunkBUNLC3II_cjs.h();cl.exports=function(e,r,n){if(!e||e[r]===void 0||e[r]===null)return n;if(typeof e[r]!="number"||isNaN(e[r]))throw new TypeError("Limit "+r+" is not a valid number");return e[r]};});var dl=chunkBUNLC3II_cjs.c((Cw,hl)=>{chunkBUNLC3II_cjs.h();var fl=chunkBUNLC3II_cjs.a("events").EventEmitter,Np=chunkBUNLC3II_cjs.a("util").inherits,ul=Fr(),Gp=Rs(),zp=Buffer.from(`\r
|
|
2
2
|
\r
|
|
3
|
-
`),
|
|
3
|
+
`),Hp=/\r\n/g,Vp=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function wt(t){fl.call(this),t=t||{};let e=this;this.nread=0,this.maxed=false,this.npairs=0,this.maxHeaderPairs=ul(t,"maxHeaderPairs",2e3),this.maxHeaderSize=ul(t,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=false,this.ss=new Gp(zp),this.ss.on("info",function(r,n,s,i){n&&!e.maxed&&(e.nread+i-s>=e.maxHeaderSize?(i=e.maxHeaderSize-e.nread+s,e.nread=e.maxHeaderSize,e.maxed=true):e.nread+=i-s,e.buffer+=n.toString("binary",s,i)),r&&e._finish();});}Np(wt,fl);wt.prototype.push=function(t){let e=this.ss.push(t);if(this.finished)return e};wt.prototype.reset=function(){this.finished=false,this.buffer="",this.header={},this.ss.reset();};wt.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let t=this.header;this.header={},this.buffer="",this.finished=true,this.nread=this.npairs=0,this.maxed=false,this.emit("header",t);};wt.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let t=this.buffer.split(Hp),e=t.length,r,n;for(var s=0;s<e;++s){if(t[s].length===0)continue;if((t[s][0]===" "||t[s][0]===" ")&&n){this.header[n][this.header[n].length-1]+=t[s];continue}let i=t[s].indexOf(":");if(i===-1||i===0)return;if(r=Vp.exec(t[s]),n=r[1].toLowerCase(),this.header[n]=this.header[n]||[],this.header[n].push(r[2]||""),++this.npairs===this.maxHeaderPairs)break}};hl.exports=wt;});var Os=chunkBUNLC3II_cjs.c((Aw,ml)=>{chunkBUNLC3II_cjs.h();var Ls=chunkBUNLC3II_cjs.a("stream").Writable,Wp=chunkBUNLC3II_cjs.a("util").inherits,Kp=Rs(),pl=ll(),Qp=dl(),Zp=45,Jp=Buffer.from("-"),Yp=Buffer.from(`\r
|
|
4
4
|
`),Xp=function(){};function _e(t){if(!(this instanceof _e))return new _e(t);if(Ls.call(this,t),!t||!t.headerFirst&&typeof t.boundary!="string")throw new TypeError("Boundary required");typeof t.boundary=="string"?this.setBoundary(t.boundary):this._bparser=void 0,this._headerFirst=t.headerFirst,this._dashes=0,this._parts=0,this._finished=false,this._realFinish=false,this._isPreamble=true,this._justMatched=false,this._firstWrite=true,this._inHeader=true,this._part=void 0,this._cb=void 0,this._ignoreData=false,this._partOpts={highWaterMark:t.partHwm},this._pause=false;let e=this;this._hparser=new Qp(t),this._hparser.on("header",function(r){e._inHeader=false,e._part.emit("header",r);});}Wp(_e,Ls);_e.prototype.emit=function(t){if(t==="finish"&&!this._realFinish){if(!this._finished){let e=this;process.nextTick(function(){if(e.emit("error",new Error("Unexpected end of multipart data")),e._part&&!e._ignoreData){let r=e._isPreamble?"Preamble":"Part";e._part.emit("error",new Error(r+" terminated early due to unexpected end of multipart data")),e._part.push(null),process.nextTick(function(){e._realFinish=true,e.emit("finish"),e._realFinish=false;});return}e._realFinish=true,e.emit("finish"),e._realFinish=false;});}}else Ls.prototype.emit.apply(this,arguments);};_e.prototype._write=function(t,e,r){if(!this._hparser&&!this._bparser)return r();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new pl(this._partOpts),this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._ignore());let n=this._hparser.push(t);if(!this._inHeader&&n!==void 0&&n<t.length)t=t.slice(n);else return r()}this._firstWrite&&(this._bparser.push(Yp),this._firstWrite=false),this._bparser.push(t),this._pause?this._cb=r:r();};_e.prototype.reset=function(){this._part=void 0,this._bparser=void 0,this._hparser=void 0;};_e.prototype.setBoundary=function(t){let e=this;this._bparser=new Kp(`\r
|
|
5
5
|
--`+t),this._bparser.on("info",function(r,n,s,i){e._oninfo(r,n,s,i);});};_e.prototype._ignore=function(){this._part&&!this._ignoreData&&(this._ignoreData=true,this._part.on("error",Xp),this._part.resume());};_e.prototype._oninfo=function(t,e,r,n){let s,i=this,o=0,a,c=true;if(!this._part&&this._justMatched&&e){for(;this._dashes<2&&r+o<n;)if(e[r+o]===Zp)++o,++this._dashes;else {this._dashes&&(s=Jp),this._dashes=0;break}if(this._dashes===2&&(r+o<n&&this.listenerCount("trailer")!==0&&this.emit("trailer",e.slice(r+o,n)),this.reset(),this._finished=true,i._parts===0&&(i._realFinish=true,i.emit("finish"),i._realFinish=false)),this._dashes)return}this._justMatched&&(this._justMatched=false),this._part||(this._part=new pl(this._partOpts),this._part._read=function(l){i._unpause();},this._isPreamble&&this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._isPreamble!==true&&this.listenerCount("part")!==0?this.emit("part",this._part):this._ignore(),this._isPreamble||(this._inHeader=true)),e&&r<n&&!this._ignoreData&&(this._isPreamble||!this._inHeader?(s&&(c=this._part.push(s)),c=this._part.push(e.slice(r,n)),c||(this._pause=true)):!this._isPreamble&&this._inHeader&&(s&&this._hparser.push(s),a=this._hparser.push(e.slice(r,n)),!this._inHeader&&a!==void 0&&a<n&&this._oninfo(false,e,r+a,n))),t&&(this._hparser.reset(),this._isPreamble?this._isPreamble=false:r!==n&&(++this._parts,this._part.on("end",function(){--i._parts===0&&(i._finished?(i._realFinish=true,i.emit("finish"),i._realFinish=false):i._unpause());})),this._part.push(null),this._part=void 0,this._ignoreData=false,this._justMatched=true,this._dashes=0);};_e.prototype._unpause=function(){if(this._pause&&(this._pause=false,this._cb)){let t=this._cb;this._cb=void 0,t();}};ml.exports=_e;});var Ir=chunkBUNLC3II_cjs.c((Fs,gl)=>{chunkBUNLC3II_cjs.h();var bl=new TextDecoder("utf-8"),yl=new Map([["utf-8",bl],["utf8",bl]]);function em(t){let e;for(;;)switch(t){case "utf-8":case "utf8":return Bt.utf8;case "latin1":case "ascii":case "us-ascii":case "iso-8859-1":case "iso8859-1":case "iso88591":case "iso_8859-1":case "windows-1252":case "iso_8859-1:1987":case "cp1252":case "x-cp1252":return Bt.latin1;case "utf16le":case "utf-16le":case "ucs2":case "ucs-2":return Bt.utf16le;case "base64":return Bt.base64;default:if(e===void 0){e=true,t=t.toLowerCase();continue}return Bt.other.bind(t)}}var Bt={utf8:(t,e)=>t.length===0?"":(typeof t=="string"&&(t=Buffer.from(t,e)),t.utf8Slice(0,t.length)),latin1:(t,e)=>t.length===0?"":typeof t=="string"?t:t.latin1Slice(0,t.length),utf16le:(t,e)=>t.length===0?"":(typeof t=="string"&&(t=Buffer.from(t,e)),t.ucs2Slice(0,t.length)),base64:(t,e)=>t.length===0?"":(typeof t=="string"&&(t=Buffer.from(t,e)),t.base64Slice(0,t.length)),other:(t,e)=>{if(t.length===0)return "";if(typeof t=="string"&&(t=Buffer.from(t,e)),yl.has(Fs.toString()))try{return yl.get(Fs).decode(t)}catch{}return typeof t=="string"?t:t.toString()}};function tm(t,e,r){return t&&em(r)(t,e)}gl.exports=tm;});var Ds=chunkBUNLC3II_cjs.c((Fw,El)=>{chunkBUNLC3II_cjs.h();var Dr=Ir(),xl=/%[a-fA-F0-9][a-fA-F0-9]/g,rm={"%00":"\0","%01":"","%02":"","%03":"","%04":"","%05":"","%06":"","%07":"\x07","%08":"\b","%09":" ","%0a":`
|
|
6
6
|
`,"%0A":`
|
|
7
|
-
`,"%0b":"\v","%0B":"\v","%0c":"\f","%0C":"\f","%0d":"\r","%0D":"\r","%0e":"","%0E":"","%0f":"","%0F":"","%10":"","%11":"","%12":"","%13":"","%14":"","%15":"","%16":"","%17":"","%18":"","%19":"","%1a":"","%1A":"","%1b":"\x1B","%1B":"\x1B","%1c":"","%1C":"","%1d":"","%1D":"","%1e":"","%1E":"","%1f":"","%1F":"","%20":" ","%21":"!","%22":'"',"%23":"#","%24":"$","%25":"%","%26":"&","%27":"'","%28":"(","%29":")","%2a":"*","%2A":"*","%2b":"+","%2B":"+","%2c":",","%2C":",","%2d":"-","%2D":"-","%2e":".","%2E":".","%2f":"/","%2F":"/","%30":"0","%31":"1","%32":"2","%33":"3","%34":"4","%35":"5","%36":"6","%37":"7","%38":"8","%39":"9","%3a":":","%3A":":","%3b":";","%3B":";","%3c":"<","%3C":"<","%3d":"=","%3D":"=","%3e":">","%3E":">","%3f":"?","%3F":"?","%40":"@","%41":"A","%42":"B","%43":"C","%44":"D","%45":"E","%46":"F","%47":"G","%48":"H","%49":"I","%4a":"J","%4A":"J","%4b":"K","%4B":"K","%4c":"L","%4C":"L","%4d":"M","%4D":"M","%4e":"N","%4E":"N","%4f":"O","%4F":"O","%50":"P","%51":"Q","%52":"R","%53":"S","%54":"T","%55":"U","%56":"V","%57":"W","%58":"X","%59":"Y","%5a":"Z","%5A":"Z","%5b":"[","%5B":"[","%5c":"\\","%5C":"\\","%5d":"]","%5D":"]","%5e":"^","%5E":"^","%5f":"_","%5F":"_","%60":"`","%61":"a","%62":"b","%63":"c","%64":"d","%65":"e","%66":"f","%67":"g","%68":"h","%69":"i","%6a":"j","%6A":"j","%6b":"k","%6B":"k","%6c":"l","%6C":"l","%6d":"m","%6D":"m","%6e":"n","%6E":"n","%6f":"o","%6F":"o","%70":"p","%71":"q","%72":"r","%73":"s","%74":"t","%75":"u","%76":"v","%77":"w","%78":"x","%79":"y","%7a":"z","%7A":"z","%7b":"{","%7B":"{","%7c":"|","%7C":"|","%7d":"}","%7D":"}","%7e":"~","%7E":"~","%7f":"\x7F","%7F":"\x7F","%80":"\x80","%81":"\x81","%82":"\x82","%83":"\x83","%84":"\x84","%85":"\x85","%86":"\x86","%87":"\x87","%88":"\x88","%89":"\x89","%8a":"\x8A","%8A":"\x8A","%8b":"\x8B","%8B":"\x8B","%8c":"\x8C","%8C":"\x8C","%8d":"\x8D","%8D":"\x8D","%8e":"\x8E","%8E":"\x8E","%8f":"\x8F","%8F":"\x8F","%90":"\x90","%91":"\x91","%92":"\x92","%93":"\x93","%94":"\x94","%95":"\x95","%96":"\x96","%97":"\x97","%98":"\x98","%99":"\x99","%9a":"\x9A","%9A":"\x9A","%9b":"\x9B","%9B":"\x9B","%9c":"\x9C","%9C":"\x9C","%9d":"\x9D","%9D":"\x9D","%9e":"\x9E","%9E":"\x9E","%9f":"\x9F","%9F":"\x9F","%a0":"\xA0","%A0":"\xA0","%a1":"\xA1","%A1":"\xA1","%a2":"\xA2","%A2":"\xA2","%a3":"\xA3","%A3":"\xA3","%a4":"\xA4","%A4":"\xA4","%a5":"\xA5","%A5":"\xA5","%a6":"\xA6","%A6":"\xA6","%a7":"\xA7","%A7":"\xA7","%a8":"\xA8","%A8":"\xA8","%a9":"\xA9","%A9":"\xA9","%aa":"\xAA","%Aa":"\xAA","%aA":"\xAA","%AA":"\xAA","%ab":"\xAB","%Ab":"\xAB","%aB":"\xAB","%AB":"\xAB","%ac":"\xAC","%Ac":"\xAC","%aC":"\xAC","%AC":"\xAC","%ad":"\xAD","%Ad":"\xAD","%aD":"\xAD","%AD":"\xAD","%ae":"\xAE","%Ae":"\xAE","%aE":"\xAE","%AE":"\xAE","%af":"\xAF","%Af":"\xAF","%aF":"\xAF","%AF":"\xAF","%b0":"\xB0","%B0":"\xB0","%b1":"\xB1","%B1":"\xB1","%b2":"\xB2","%B2":"\xB2","%b3":"\xB3","%B3":"\xB3","%b4":"\xB4","%B4":"\xB4","%b5":"\xB5","%B5":"\xB5","%b6":"\xB6","%B6":"\xB6","%b7":"\xB7","%B7":"\xB7","%b8":"\xB8","%B8":"\xB8","%b9":"\xB9","%B9":"\xB9","%ba":"\xBA","%Ba":"\xBA","%bA":"\xBA","%BA":"\xBA","%bb":"\xBB","%Bb":"\xBB","%bB":"\xBB","%BB":"\xBB","%bc":"\xBC","%Bc":"\xBC","%bC":"\xBC","%BC":"\xBC","%bd":"\xBD","%Bd":"\xBD","%bD":"\xBD","%BD":"\xBD","%be":"\xBE","%Be":"\xBE","%bE":"\xBE","%BE":"\xBE","%bf":"\xBF","%Bf":"\xBF","%bF":"\xBF","%BF":"\xBF","%c0":"\xC0","%C0":"\xC0","%c1":"\xC1","%C1":"\xC1","%c2":"\xC2","%C2":"\xC2","%c3":"\xC3","%C3":"\xC3","%c4":"\xC4","%C4":"\xC4","%c5":"\xC5","%C5":"\xC5","%c6":"\xC6","%C6":"\xC6","%c7":"\xC7","%C7":"\xC7","%c8":"\xC8","%C8":"\xC8","%c9":"\xC9","%C9":"\xC9","%ca":"\xCA","%Ca":"\xCA","%cA":"\xCA","%CA":"\xCA","%cb":"\xCB","%Cb":"\xCB","%cB":"\xCB","%CB":"\xCB","%cc":"\xCC","%Cc":"\xCC","%cC":"\xCC","%CC":"\xCC","%cd":"\xCD","%Cd":"\xCD","%cD":"\xCD","%CD":"\xCD","%ce":"\xCE","%Ce":"\xCE","%cE":"\xCE","%CE":"\xCE","%cf":"\xCF","%Cf":"\xCF","%cF":"\xCF","%CF":"\xCF","%d0":"\xD0","%D0":"\xD0","%d1":"\xD1","%D1":"\xD1","%d2":"\xD2","%D2":"\xD2","%d3":"\xD3","%D3":"\xD3","%d4":"\xD4","%D4":"\xD4","%d5":"\xD5","%D5":"\xD5","%d6":"\xD6","%D6":"\xD6","%d7":"\xD7","%D7":"\xD7","%d8":"\xD8","%D8":"\xD8","%d9":"\xD9","%D9":"\xD9","%da":"\xDA","%Da":"\xDA","%dA":"\xDA","%DA":"\xDA","%db":"\xDB","%Db":"\xDB","%dB":"\xDB","%DB":"\xDB","%dc":"\xDC","%Dc":"\xDC","%dC":"\xDC","%DC":"\xDC","%dd":"\xDD","%Dd":"\xDD","%dD":"\xDD","%DD":"\xDD","%de":"\xDE","%De":"\xDE","%dE":"\xDE","%DE":"\xDE","%df":"\xDF","%Df":"\xDF","%dF":"\xDF","%DF":"\xDF","%e0":"\xE0","%E0":"\xE0","%e1":"\xE1","%E1":"\xE1","%e2":"\xE2","%E2":"\xE2","%e3":"\xE3","%E3":"\xE3","%e4":"\xE4","%E4":"\xE4","%e5":"\xE5","%E5":"\xE5","%e6":"\xE6","%E6":"\xE6","%e7":"\xE7","%E7":"\xE7","%e8":"\xE8","%E8":"\xE8","%e9":"\xE9","%E9":"\xE9","%ea":"\xEA","%Ea":"\xEA","%eA":"\xEA","%EA":"\xEA","%eb":"\xEB","%Eb":"\xEB","%eB":"\xEB","%EB":"\xEB","%ec":"\xEC","%Ec":"\xEC","%eC":"\xEC","%EC":"\xEC","%ed":"\xED","%Ed":"\xED","%eD":"\xED","%ED":"\xED","%ee":"\xEE","%Ee":"\xEE","%eE":"\xEE","%EE":"\xEE","%ef":"\xEF","%Ef":"\xEF","%eF":"\xEF","%EF":"\xEF","%f0":"\xF0","%F0":"\xF0","%f1":"\xF1","%F1":"\xF1","%f2":"\xF2","%F2":"\xF2","%f3":"\xF3","%F3":"\xF3","%f4":"\xF4","%F4":"\xF4","%f5":"\xF5","%F5":"\xF5","%f6":"\xF6","%F6":"\xF6","%f7":"\xF7","%F7":"\xF7","%f8":"\xF8","%F8":"\xF8","%f9":"\xF9","%F9":"\xF9","%fa":"\xFA","%Fa":"\xFA","%fA":"\xFA","%FA":"\xFA","%fb":"\xFB","%Fb":"\xFB","%fB":"\xFB","%FB":"\xFB","%fc":"\xFC","%Fc":"\xFC","%fC":"\xFC","%FC":"\xFC","%fd":"\xFD","%Fd":"\xFD","%fD":"\xFD","%FD":"\xFD","%fe":"\xFE","%Fe":"\xFE","%fE":"\xFE","%FE":"\xFE","%ff":"\xFF","%Ff":"\xFF","%fF":"\xFF","%FF":"\xFF"};function _l(t){return rm[t]}var jr=0,wl=1,Is=2,Sl=3;function nm(t){let e=[],r=jr,n="",s=false,i=false,o=0,a="",c=t.length;for(var l=0;l<c;++l){let u=t[l];if(u==="\\"&&s)if(i)i=false;else {i=true;continue}else if(u==='"')if(i)i=false;else {if(s)for(s=false,r=jr;l+1<c&&t[l+1]!==";";)++l;else s=true;continue}else if(i&&s&&(a+="\\"),i=false,(r===Is||r===Sl)&&u==="'"){r===Is?(r=Sl,n=a.substring(1)):r=wl,a="";continue}else if(r===jr&&(u==="*"||u==="=")&&e.length){r=u==="*"?Is:wl,e[o]=[a,void 0],a="";continue}else if(!s&&u===";"){r=jr,n?(a.length&&(a=Dr(a.replace(xl,_l),"binary",n)),n=""):a.length&&(a=Dr(a,"binary","utf8")),e[o]===void 0?e[o]=a:e[o][1]=a,a="",++o;continue}else if(!s&&(u===" "||u===" "))continue;a+=u;}return n&&a.length?a=Dr(a.replace(xl,_l),"binary",n):a&&(a=Dr(a,"binary","utf8")),e[o]===void 0?a&&(e[o]=a):e[o][1]=a,e}El.exports=nm;});var vl=chunkBUNLC3II_cjs.c((Dw,Pl)=>{chunkBUNLC3II_cjs.h();Pl.exports=function(e){if(typeof e!="string")return "";for(var r=e.length-1;r>=0;--r)switch(e.charCodeAt(r)){case 47:case 92:return e=e.slice(r+1),e===".."||e==="."?"":e}return e===".."||e==="."?"":e};});var Rl=chunkBUNLC3II_cjs.c((qw,Cl)=>{chunkBUNLC3II_cjs.h();var{Readable:kl}=chunkBUNLC3II_cjs.a("stream"),{inherits:sm}=chunkBUNLC3II_cjs.a("util"),im=Os(),Tl=Ds(),om=Ir(),am=vl(),nt=Fr(),lm=/^boundary$/i,cm=/^form-data$/i,um=/^charset$/i,fm=/^filename$/i,hm=/^name$/i;qr.detect=/^multipart\/form-data/i;function qr(t,e){let r,n,s=this,i,o=e.limits,a=e.isPartAFile||((v,A,I)=>A==="application/octet-stream"||I!==void 0),c=e.parsedConType||[],l=e.defCharset||"utf8",u=e.preservePath,h={highWaterMark:e.fileHwm};for(r=0,n=c.length;r<n;++r)if(Array.isArray(c[r])&&lm.test(c[r][0])){i=c[r][1];break}function d(){P===0&&g&&!t._done&&(g=false,s.end());}if(typeof i!="string")throw new Error("Multipart: Boundary not found");let p=nt(o,"fieldSize",1*1024*1024),x=nt(o,"fileSize",1/0),S=nt(o,"files",1/0),R=nt(o,"fields",1/0),C=nt(o,"parts",1/0),D=nt(o,"headerPairs",2e3),E=nt(o,"headerSize",80*1024),T=0,w=0,P=0,L,y,g=false;this._needDrain=false,this._pause=false,this._cb=void 0,this._nparts=0,this._boy=t;let _={boundary:i,maxHeaderPairs:D,maxHeaderSize:E,partHwm:h.highWaterMark,highWaterMark:e.highWaterMark};this.parser=new im(_),this.parser.on("drain",function(){if(s._needDrain=false,s._cb&&!s._pause){let v=s._cb;s._cb=void 0,v();}}).on("part",function v(A){if(++s._nparts>C)return s.parser.removeListener("part",v),s.parser.on("part",St),t.hitPartsLimit=true,t.emit("partsLimit"),St(A);if(y){let I=y;I.emit("end"),I.removeAllListeners("end");}A.on("header",function(I){let M,V,B,Z,se,re,we=0;if(I["content-type"]&&(B=Tl(I["content-type"][0]),B[0])){for(M=B[0].toLowerCase(),r=0,n=B.length;r<n;++r)if(um.test(B[r][0])){Z=B[r][1].toLowerCase();break}}if(M===void 0&&(M="text/plain"),Z===void 0&&(Z=l),I["content-disposition"]){if(B=Tl(I["content-disposition"][0]),!cm.test(B[0]))return St(A);for(r=0,n=B.length;r<n;++r)hm.test(B[r][0])?V=B[r][1]:fm.test(B[r][0])&&(re=B[r][1],u||(re=am(re)));}else return St(A);I["content-transfer-encoding"]?se=I["content-transfer-encoding"][0].toLowerCase():se="7bit";let En,Pn;if(a(V,M,re)){if(T===S)return t.hitFilesLimit||(t.hitFilesLimit=true,t.emit("filesLimit")),St(A);if(++T,t.listenerCount("file")===0){s.parser._ignore();return}++P;let Y=new js(h);L=Y,Y.on("end",function(){if(--P,s._pause=false,d(),s._cb&&!s._needDrain){let Se=s._cb;s._cb=void 0,Se();}}),Y._read=function(Se){if(s._pause&&(s._pause=false,s._cb&&!s._needDrain)){let Ae=s._cb;s._cb=void 0,Ae();}},t.emit("file",V,Y,re,se,M),En=function(Se){if((we+=Se.length)>x){let Ae=x-we+Se.length;Ae>0&&Y.push(Se.slice(0,Ae)),Y.truncated=true,Y.bytesRead=x,A.removeAllListeners("data"),Y.emit("limit");return}else Y.push(Se)||(s._pause=true);Y.bytesRead=we;},Pn=function(){L=void 0,Y.push(null);};}else {if(w===R)return t.hitFieldsLimit||(t.hitFieldsLimit=true,t.emit("fieldsLimit")),St(A);++w,++P;let Y="",Se=false;y=A,En=function(Ae){if((we+=Ae.length)>p){let hf=p-(we-Ae.length);Y+=Ae.toString("binary",0,hf),Se=true,A.removeAllListeners("data");}else Y+=Ae.toString("binary");},Pn=function(){y=void 0,Y.length&&(Y=om(Y,"binary",Z)),t.emit("field",V,Y,false,Se,se,M),--P,d();};}A._readableState.sync=false,A.on("data",En),A.on("end",Pn);}).on("error",function(I){L&&L.emit("error",I);});}).on("error",function(v){t.emit("error",v);}).on("finish",function(){g=true,d();});}qr.prototype.write=function(t,e){let r=this.parser.write(t);r&&!this._pause?e():(this._needDrain=!r,this._cb=e);};qr.prototype.end=function(){let t=this;t.parser.writable?t.parser.end():t._boy._done||process.nextTick(function(){t._boy._done=true,t._boy.emit("finish");});};function St(t){t.resume();}function js(t){kl.call(this,t),this.bytesRead=0,this.truncated=false;}sm(js,kl);js.prototype._read=function(t){};Cl.exports=qr;});var Ll=chunkBUNLC3II_cjs.c((Mw,Al)=>{chunkBUNLC3II_cjs.h();var dm=/\+/g,pm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function qs(){this.buffer=void 0;}qs.prototype.write=function(t){t=t.replace(dm," ");let e="",r=0,n=0,s=t.length;for(;r<s;++r)this.buffer!==void 0?pm[t.charCodeAt(r)]?(this.buffer+=t[r],++n,this.buffer.length===2&&(e+=String.fromCharCode(parseInt(this.buffer,16)),this.buffer=void 0)):(e+="%"+this.buffer,this.buffer=void 0,--r):t[r]==="%"&&(r>n&&(e+=t.substring(n,r),n=r),this.buffer="",++n);return n<s&&this.buffer===void 0&&(e+=t.substring(n)),e};qs.prototype.reset=function(){this.buffer=void 0;};Al.exports=qs;});var Fl=chunkBUNLC3II_cjs.c(($w,Ol)=>{chunkBUNLC3II_cjs.h();var mm=Ll(),Et=Ir(),Us=Fr(),bm=/^charset$/i;Ur.detect=/^application\/x-www-form-urlencoded/i;function Ur(t,e){let r=e.limits,n=e.parsedConType;this.boy=t,this.fieldSizeLimit=Us(r,"fieldSize",1*1024*1024),this.fieldNameSizeLimit=Us(r,"fieldNameSize",100),this.fieldsLimit=Us(r,"fields",1/0);let s;for(var i=0,o=n.length;i<o;++i)if(Array.isArray(n[i])&&bm.test(n[i][0])){s=n[i][1].toLowerCase();break}s===void 0&&(s=e.defCharset||"utf8"),this.decoder=new mm,this.charset=s,this._fields=0,this._state="key",this._checkingBytes=true,this._bytesKey=0,this._bytesVal=0,this._key="",this._val="",this._keyTrunc=false,this._valTrunc=false,this._hitLimit=false;}Ur.prototype.write=function(t,e){if(this._fields===this.fieldsLimit)return this.boy.hitFieldsLimit||(this.boy.hitFieldsLimit=true,this.boy.emit("fieldsLimit")),e();let r,n,s,i=0,o=t.length;for(;i<o;)if(this._state==="key"){for(r=n=void 0,s=i;s<o;++s){if(this._checkingBytes||++i,t[s]===61){r=s;break}else if(t[s]===38){n=s;break}if(this._checkingBytes&&this._bytesKey===this.fieldNameSizeLimit){this._hitLimit=true;break}else this._checkingBytes&&++this._bytesKey;}if(r!==void 0)r>i&&(this._key+=this.decoder.write(t.toString("binary",i,r))),this._state="val",this._hitLimit=false,this._checkingBytes=true,this._val="",this._bytesVal=0,this._valTrunc=false,this.decoder.reset(),i=r+1;else if(n!==void 0){++this._fields;let a,c=this._keyTrunc;if(n>i?a=this._key+=this.decoder.write(t.toString("binary",i,n)):a=this._key,this._hitLimit=false,this._checkingBytes=true,this._key="",this._bytesKey=0,this._keyTrunc=false,this.decoder.reset(),a.length&&this.boy.emit("field",Et(a,"binary",this.charset),"",c,false),i=n+1,this._fields===this.fieldsLimit)return e()}else this._hitLimit?(s>i&&(this._key+=this.decoder.write(t.toString("binary",i,s))),i=s,(this._bytesKey=this._key.length)===this.fieldNameSizeLimit&&(this._checkingBytes=false,this._keyTrunc=true)):(i<o&&(this._key+=this.decoder.write(t.toString("binary",i))),i=o);}else {for(n=void 0,s=i;s<o;++s){if(this._checkingBytes||++i,t[s]===38){n=s;break}if(this._checkingBytes&&this._bytesVal===this.fieldSizeLimit){this._hitLimit=true;break}else this._checkingBytes&&++this._bytesVal;}if(n!==void 0){if(++this._fields,n>i&&(this._val+=this.decoder.write(t.toString("binary",i,n))),this.boy.emit("field",Et(this._key,"binary",this.charset),Et(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this._state="key",this._hitLimit=false,this._checkingBytes=true,this._key="",this._bytesKey=0,this._keyTrunc=false,this.decoder.reset(),i=n+1,this._fields===this.fieldsLimit)return e()}else this._hitLimit?(s>i&&(this._val+=this.decoder.write(t.toString("binary",i,s))),i=s,(this._val===""&&this.fieldSizeLimit===0||(this._bytesVal=this._val.length)===this.fieldSizeLimit)&&(this._checkingBytes=false,this._valTrunc=true)):(i<o&&(this._val+=this.decoder.write(t.toString("binary",i))),i=o);}e();};Ur.prototype.end=function(){this.boy._done||(this._state==="key"&&this._key.length>0?this.boy.emit("field",Et(this._key,"binary",this.charset),"",this._keyTrunc,false):this._state==="val"&&this.boy.emit("field",Et(this._key,"binary",this.charset),Et(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this.boy._done=true,this.boy.emit("finish"));};Ol.exports=Ur;});var jl=chunkBUNLC3II_cjs.c((Gw,$t)=>{chunkBUNLC3II_cjs.h();var Ms=chunkBUNLC3II_cjs.a("stream").Writable,{inherits:ym}=chunkBUNLC3II_cjs.a("util"),gm=Os(),Il=Rl(),Dl=Fl(),xm=Ds();function Fe(t){if(!(this instanceof Fe))return new Fe(t);if(typeof t!="object")throw new TypeError("Busboy expected an options-Object.");if(typeof t.headers!="object")throw new TypeError("Busboy expected an options-Object with headers-attribute.");if(typeof t.headers["content-type"]!="string")throw new TypeError("Missing Content-Type-header.");let{headers:e,...r}=t;this.opts={autoDestroy:false,...r},Ms.call(this,this.opts),this._done=false,this._parser=this.getParserByHeaders(e),this._finished=false;}ym(Fe,Ms);Fe.prototype.emit=function(t){if(t==="finish"){if(this._done){if(this._finished)return}else {this._parser?.end();return}this._finished=true;}Ms.prototype.emit.apply(this,arguments);};Fe.prototype.getParserByHeaders=function(t){let e=xm(t["content-type"]),r={defCharset:this.opts.defCharset,fileHwm:this.opts.fileHwm,headers:t,highWaterMark:this.opts.highWaterMark,isPartAFile:this.opts.isPartAFile,limits:this.opts.limits,parsedConType:e,preservePath:this.opts.preservePath};if(Il.detect.test(e[0]))return new Il(this,r);if(Dl.detect.test(e[0]))return new Dl(this,r);throw new Error("Unsupported Content-Type.")};Fe.prototype._write=function(t,e,r){this._parser.write(t,r);};$t.exports=Fe;$t.exports.default=Fe;$t.exports.Busboy=Fe;$t.exports.Dicer=gm;});var st={};chunkBUNLC3II_cjs.d(st,{__addDisposableResource:()=>ac,__assign:()=>Mr,__asyncDelegator:()=>Xl,__asyncGenerator:()=>Yl,__asyncValues:()=>ec,__await:()=>Pt,__awaiter:()=>Vl,__classPrivateFieldGet:()=>sc,__classPrivateFieldIn:()=>oc,__classPrivateFieldSet:()=>ic,__createBinding:()=>$r,__decorate:()=>Ml,__disposeResources:()=>lc,__esDecorate:()=>$l,__exportStar:()=>Kl,__extends:()=>ql,__generator:()=>Wl,__importDefault:()=>nc,__importStar:()=>rc,__makeTemplateObject:()=>tc,__metadata:()=>zl,__param:()=>Bl,__propKey:()=>Gl,__read:()=>Ns,__rest:()=>Ul,__rewriteRelativeImportExtension:()=>cc,__runInitializers:()=>Nl,__setFunctionName:()=>Hl,__spread:()=>Ql,__spreadArray:()=>Jl,__spreadArrays:()=>Zl,__values:()=>Br,default:()=>Sm});function ql(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Bs(t,e);function r(){this.constructor=t;}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r);}function Ul(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Ml(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,r,i):o(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i}function Bl(t,e){return function(r,n){e(r,n,t);}}function $l(t,e,r,n,s,i){function o(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),h,d=false,p=r.length-1;p>=0;p--){var x={};for(var S in n)x[S]=S==="access"?{}:n[S];for(var S in n.access)x.access[S]=n.access[S];x.addInitializer=function(C){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(C||null));};var R=(0, r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],x);if(a==="accessor"){if(R===void 0)continue;if(R===null||typeof R!="object")throw new TypeError("Object expected");(h=o(R.get))&&(u.get=h),(h=o(R.set))&&(u.set=h),(h=o(R.init))&&s.unshift(h);}else (h=o(R))&&(a==="field"?s.unshift(h):u[c]=h);}l&&Object.defineProperty(l,n.name,u),d=true;}function Nl(t,e,r){for(var n=arguments.length>2,s=0;s<e.length;s++)r=n?e[s].call(t,r):e[s].call(t);return n?r:void 0}function Gl(t){return typeof t=="symbol"?t:"".concat(t)}function Hl(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:true,value:r?"".concat(r," ",e):e})}function zl(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Vl(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i);})}return new(r||(r=Promise))(function(i,o){function a(u){try{l(n.next(u));}catch(h){o(h);}}function c(u){try{l(n.throw(u));}catch(h){o(h);}}function l(u){u.done?i(u.value):s(u.value).then(a,c);}l((n=n.apply(t,e||[])).next());})}function Wl(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,s&&(i=l[0]&2?s.return:l[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,l[1])).done)return i;switch(s=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,s=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r);}catch(u){l=[6,u],s=0;}finally{n=i=0;}if(l[0]&5)throw l[1];return {value:l[0]?l[1]:void 0,done:true}}}function Kl(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$r(e,t,r);}function Br(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return {next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ns(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value);}catch(a){o={error:a};}finally{try{s&&!s.done&&(r=n.return)&&r.call(n);}finally{if(o)throw o.error}}return i}function Ql(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ns(arguments[e]));return t}function Zl(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function Jl(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function Pt(t){return this instanceof Pt?(this.v=t,this):new Pt(t)}function Yl(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(p){return function(x){return Promise.resolve(x).then(p,h)}}function a(p,x){n[p]&&(s[p]=function(S){return new Promise(function(R,C){i.push([p,S,R,C])>1||c(p,S);})},x&&(s[p]=x(s[p])));}function c(p,x){try{l(n[p](x));}catch(S){d(i[0][3],S);}}function l(p){p.value instanceof Pt?Promise.resolve(p.value.v).then(u,h):d(i[0][2],p);}function u(p){c("next",p);}function h(p){c("throw",p);}function d(p,x){p(x),i.shift(),i.length&&c(i[0][0],i[0][1]);}}function Xl(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(o){return (r=!r)?{value:Pt(t[s](o)),done:false}:i?i(o):o}:i;}}function ec(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Br=="function"?Br(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(a,c){o=t[i](o),s(a,c,o.done,o.value);})};}function s(i,o,a,c){Promise.resolve(c).then(function(l){i({value:l,done:a});},o);}}function tc(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function rc(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=$s(t),n=0;n<r.length;n++)r[n]!=="default"&&$r(e,t,r[n]);return _m(e,t),e}function nc(t){return t&&t.__esModule?t:{default:t}}function sc(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function ic(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}function oc(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ac(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose];}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(s=n);}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this);}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r});}else r&&t.stack.push({async:true});return e}function lc(t){function e(i){t.error=t.hasError?new wm(i,t.error,"An error was suppressed during disposal."):i,t.hasError=true;}var r,n=0;function s(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(s);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else n|=1;}catch(o){e(o);}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return s()}function cc(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,i,o){return n?e?".jsx":".js":s&&(!i||!o)?r:s+i+"."+o.toLowerCase()+"js"}):t}var Bs,Mr,$r,_m,$s,wm,Sm,it=chunkBUNLC3II_cjs.b(()=>{chunkBUNLC3II_cjs.h();Bs=function(t,e){return Bs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n;}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s]);},Bs(t,e)};Mr=function(){return Mr=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);}return e},Mr.apply(this,arguments)};$r=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:true,get:function(){return e[r]}}),Object.defineProperty(t,n,s);}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];});_m=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e});}):function(t,e){t.default=e;},$s=function(t){return $s=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},$s(t)};wm=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};Sm={__extends:ql,__assign:Mr,__rest:Ul,__decorate:Ml,__param:Bl,__esDecorate:$l,__runInitializers:Nl,__propKey:Gl,__setFunctionName:Hl,__metadata:zl,__awaiter:Vl,__generator:Wl,__createBinding:$r,__exportStar:Kl,__values:Br,__read:Ns,__spread:Ql,__spreadArrays:Zl,__spreadArray:Jl,__await:Pt,__asyncGenerator:Yl,__asyncDelegator:Xl,__asyncValues:ec,__makeTemplateObject:tc,__importStar:rc,__importDefault:nc,__classPrivateFieldGet:sc,__classPrivateFieldSet:ic,__classPrivateFieldIn:oc,__addDisposableResource:ac,__disposeResources:lc,__rewriteRelativeImportExtension:cc};});var me=chunkBUNLC3II_cjs.c(ie=>{chunkBUNLC3II_cjs.h();Object.defineProperty(ie,"__esModule",{value:true});ie.DEFAULT_ACCEPT_ENCODING=ie.fakePromise=void 0;ie.getHeadersObj=Tm;ie.defaultHeadersSerializer=km;ie.isArrayBufferView=Rm;ie.isNodeReadable=Am;ie.isIterable=Lm;ie.shouldRedirect=Om;ie.pipeThrough=Fm;ie.endStream=Im;ie.safeWrite=Dm;ie.getSupportedFormats=fc;var Em=(it(),chunkBUNLC3II_cjs.f(st)),Pm=chunkBUNLC3II_cjs.a("events"),vm=Em.__importDefault(chunkBUNLC3II_cjs.a("zlib"));function uc(t){return t?.forEach!=null}function Tm(t){return t==null||!uc(t)?t:t.headersInit&&!t._map&&!uc(t.headersInit)?t.headersInit:Object.fromEntries(t.entries())}function km(t,e){let r=[];return t.forEach((n,s)=>{e&&s==="content-length"&&e(n),r.push(`${s}: ${n}`);}),r}var Cm=ze();Object.defineProperty(ie,"fakePromise",{enumerable:true,get:function(){return Cm.fakePromise}});function Rm(t){return t!=null&&t.buffer!=null&&t.byteLength!=null&&t.byteOffset!=null}function Am(t){return t!=null&&t.pipe!=null}function Lm(t){return t?.[Symbol.iterator]!=null}function Om(t){return t===301||t===302||t===303||t===307||t===308}function Fm({src:t,dest:e,signal:r,onError:n}){if(n&&e.once("error",n),t.once("error",s=>{e.destroy(s);}),e.once("close",()=>{t.destroyed||t.destroy();}),r){let o=function(){i.deref()?.removeEventListener("abort",a),s.deref()?.removeListener("end",o),s.deref()?.removeListener("error",o),s.deref()?.removeListener("close",o);},a=function(){s.deref()?.destroy(new Gs),o();},s=new WeakRef(t),i=new WeakRef(r);r.addEventListener("abort",a,{once:true}),t.once("end",o),t.once("error",o),t.once("close",o);}t.pipe(e,{end:true});}function Im(t){return t.end(null,null,null)}function Dm(t,e){if(!e.write(t))return (0, Pm.once)(e,"drain")}var Gs=class extends Error{constructor(e="The operation was aborted",r=void 0){super(e,r),this.name="AbortError";}};ie.DEFAULT_ACCEPT_ENCODING=fc().join(", ");function fc(){let t=["gzip","deflate","br"];return globalThis.process?.versions?.node?.startsWith("2")||t.push("deflate-raw"),vm.default.createZstdCompress!=null&&t.push("zstd"),t}});var vt=chunkBUNLC3II_cjs.c(Nr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Nr,"__esModule",{value:true});Nr.PonyfillReadableStream=void 0;var hc=chunkBUNLC3II_cjs.a("buffer"),Hs=chunkBUNLC3II_cjs.a("events"),zs=chunkBUNLC3II_cjs.a("stream"),jm=chunkBUNLC3II_cjs.a("stream/promises"),Vs=ze(),Ws=me();function dc(t,e){let r=[],n=false,s=false;return {desiredSize:t,enqueue(i){let o=typeof i=="string"?hc.Buffer.from(i):i;s?e.push(o):r.push(o);},close(){r.length>0&&this._flush(),e.push(null),n=true;},error(i){r.length>0&&this._flush(),e.destroy(i);},get _closed(){return n},_flush(){if(s=true,r.length>0){let i=r.length>1?hc.Buffer.concat(r):r[0];e.push(i),r=[];}}}}function qm(t){return t?.read!=null}function pc(t){return t?.getReader!=null}var Ks=class t{readable;constructor(e){if(e instanceof t&&e.readable!=null)this.readable=e.readable;else if(qm(e))this.readable=e;else if(pc(e))this.readable=zs.Readable.fromWeb(e);else {let r=false,n=false,s=o=>{if(!r){let a=dc(o,this.readable);return r=true,(0, Vs.handleMaybePromise)(()=>e?.start?.(a),()=>(a._flush(),!a._closed))}return true},i=o=>(0, Vs.handleMaybePromise)(()=>s(o),a=>{if(!a)return;let c=dc(o,this.readable);return (0, Vs.handleMaybePromise)(()=>e?.pull?.(c),()=>{c._flush(),n=false;})});this.readable=new zs.Readable({read(o){if(!n)return n=true,i(o)},destroy(o,a){if(e?.cancel)try{let c=e.cancel(o);if(c?.then)return c.then(()=>{a(null);},l=>{a(l);})}catch(c){a(c);return}a(null);}});}}cancel(e){return this.readable.destroy(e),(0, Hs.once)(this.readable,"close")}locked=false;getReader(e){let r=this.readable[Symbol.asyncIterator]();this.locked=true;let n=this.readable;return {read(){return r.next()},releaseLock:()=>{if(r.return){let s=r.return();if(s.then){s.then(()=>{this.locked=false;});return}}this.locked=false;},cancel:s=>{if(r.return){let i=r.return(s);if(i.then)return i.then(()=>{this.locked=false;})}return this.locked=false,(0, Ws.fakePromise)()},get closed(){return Promise.race([(0, Hs.once)(n,"end"),(0, Hs.once)(n,"error").then(s=>Promise.reject(s))])}}}[Symbol.asyncIterator](e){let r=this.readable[Symbol.asyncIterator]();return {[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{await r.return?.(),this.readable.destroyed||this.readable.destroy();},next:()=>r.next(),return:()=>(this.readable.destroyed||this.readable.destroy(),r.return?.()||(0, Ws.fakePromise)({done:true,value:void 0})),throw:s=>(this.readable.destroyed||this.readable.destroy(s),r.throw?.(s)||(0, Ws.fakePromise)({done:true,value:void 0}))}}values(e){return this[Symbol.asyncIterator]()}tee(){throw new Error("Not implemented")}async pipeToWriter(e){try{for await(let r of this)await e.write(r);await e.close();}catch(r){await e.abort(r);}}pipeTo(e){if(Mm(e))return (0, jm.pipeline)(this.readable,e.writable,{end:true});{let r=e.getWriter();return this.pipeToWriter(r)}}pipeThrough({writable:e,readable:r}){return this.pipeTo(e).catch(n=>{this.readable.destroy(n);}),Um(r)&&(r.readable.once("error",n=>this.readable.destroy(n)),r.readable.once("finish",()=>this.readable.push(null)),r.readable.once("close",()=>this.readable.push(null))),r}static[Symbol.hasInstance](e){return pc(e)}static from(e){return new t(zs.Readable.from(e))}[Symbol.toStringTag]="ReadableStream"};Nr.PonyfillReadableStream=Ks;function Um(t){return t?.readable!=null}function Mm(t){return t?.writable!=null}});var Gr=chunkBUNLC3II_cjs.c(ye=>{chunkBUNLC3II_cjs.h();Object.defineProperty(ye,"__esModule",{value:true});ye.PonyfillBlob=void 0;ye.hasBufferMethod=Gt;ye.hasArrayBufferMethod=Ht;ye.hasBytesMethod=zt;ye.hasTextMethod=mc;ye.hasSizeProperty=bc;ye.hasStreamMethod=yc;ye.hasBlobSignature=gc;ye.isArrayBuffer=xc;var ue=chunkBUNLC3II_cjs.a("buffer"),Qs=vt(),ce=me();function Nt(t){return typeof t=="string"?ue.Buffer.from(t):ue.Buffer.isBuffer(t)?t:(0, ce.isArrayBufferView)(t)?ue.Buffer.from(t.buffer,t.byteOffset,t.byteLength):ue.Buffer.from(t)}function Gt(t){return t!=null&&t.buffer!=null&&typeof t.buffer=="function"}function Ht(t){return t!=null&&t.arrayBuffer!=null&&typeof t.arrayBuffer=="function"}function zt(t){return t!=null&&t.bytes!=null&&typeof t.bytes=="function"}function mc(t){return t!=null&&t.text!=null&&typeof t.text=="function"}function bc(t){return t!=null&&typeof t.size=="number"}function yc(t){return t!=null&&t.stream!=null&&typeof t.stream=="function"}function gc(t){return t!=null&&t[Symbol.toStringTag]==="Blob"}function xc(t){return t!=null&&t.byteLength!=null&&t.slice!=null}var Zs=class{blobParts;type;encoding;_size=null;constructor(e=[],r){if(this.blobParts=e,this.type=r?.type||"application/octet-stream",this.encoding=r?.encoding||"utf8",this._size=r?.size||null,e.length===1&&gc(e[0]))return e[0]}_buffer=null;buffer(){if(this._buffer)return (0, ce.fakePromise)(this._buffer);if(this.blobParts.length===1){let n=this.blobParts[0];return Gt(n)?n.buffer().then(s=>(this._buffer=s,this._buffer)):zt(n)?n.bytes().then(s=>(this._buffer=ue.Buffer.from(s),this._buffer)):Ht(n)?n.arrayBuffer().then(s=>(this._buffer=ue.Buffer.from(s,void 0,n.size),this._buffer)):(this._buffer=Nt(n),(0, ce.fakePromise)(this._buffer))}let e=[],r=this.blobParts.map((n,s)=>{if(Gt(n)){e.push(n.buffer().then(i=>{r[s]=i;}));return}else if(Ht(n)){e.push(n.arrayBuffer().then(i=>{r[s]=ue.Buffer.from(i,void 0,n.size);}));return}else if(zt(n)){e.push(n.bytes().then(i=>{r[s]=ue.Buffer.from(i);}));return}else return Nt(n)});return e.length>0?Promise.all(e).then(()=>ue.Buffer.concat(r,this._size||void 0)):(0, ce.fakePromise)(ue.Buffer.concat(r,this._size||void 0))}arrayBuffer(){if(this._buffer)return (0, ce.fakePromise)(this._buffer);if(this.blobParts.length===1){if(xc(this.blobParts[0]))return (0, ce.fakePromise)(this.blobParts[0]);if(Ht(this.blobParts[0]))return this.blobParts[0].arrayBuffer()}return this.buffer()}bytes(){if(this._buffer)return (0, ce.fakePromise)(this._buffer);if(this.blobParts.length===1){if(ue.Buffer.isBuffer(this.blobParts[0]))return this._buffer=this.blobParts[0],(0, ce.fakePromise)(this._buffer);if(this.blobParts[0]instanceof Uint8Array)return this._buffer=ue.Buffer.from(this.blobParts[0]),(0, ce.fakePromise)(this._buffer);if(zt(this.blobParts[0]))return this.blobParts[0].bytes();if(Gt(this.blobParts[0]))return this.blobParts[0].buffer()}return this.buffer()}_text=null;text(){if(this._text)return (0, ce.fakePromise)(this._text);if(this.blobParts.length===1){let e=this.blobParts[0];if(typeof e=="string")return this._text=e,(0, ce.fakePromise)(this._text);if(mc(e))return e.text().then(n=>(this._text=n,this._text));let r=Nt(e);return this._text=r.toString(this.encoding),(0, ce.fakePromise)(this._text)}return this.buffer().then(e=>(this._text=e.toString(this.encoding),this._text))}_json=null;json(){return this._json?(0, ce.fakePromise)(this._json):this.text().then(e=>(this._json=JSON.parse(e),this._json))}_formData=null;formData(){if(this._formData)return (0, ce.fakePromise)(this._formData);throw new Error("Not implemented")}get size(){if(this._size==null){this._size=0;for(let e of this.blobParts)typeof e=="string"?this._size+=ue.Buffer.byteLength(e):bc(e)?this._size+=e.size:(0, ce.isArrayBufferView)(e)&&(this._size+=e.byteLength);}return this._size}stream(){if(this.blobParts.length===1){let r=this.blobParts[0];if(yc(r))return r.stream();let n=Nt(r);return new Qs.PonyfillReadableStream({start:s=>{s.enqueue(n),s.close();}})}if(this._buffer!=null)return new Qs.PonyfillReadableStream({start:r=>{r.enqueue(this._buffer),r.close();}});let e;return new Qs.PonyfillReadableStream({start:r=>{if(this.blobParts.length===0){r.close();return}e=this.blobParts[Symbol.iterator]();},pull:r=>{let{value:n,done:s}=e.next();if(s){r.close();return}if(n){if(Gt(n))return n.buffer().then(o=>{r.enqueue(o);});if(zt(n))return n.bytes().then(o=>{let a=ue.Buffer.from(o);r.enqueue(a);});if(Ht(n))return n.arrayBuffer().then(o=>{let a=ue.Buffer.from(o,void 0,n.size);r.enqueue(a);});let i=Nt(n);r.enqueue(i);}}})}slice(){throw new Error("Not implemented")}};ye.PonyfillBlob=Zs;});var Ys=chunkBUNLC3II_cjs.c(Hr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Hr,"__esModule",{value:true});Hr.PonyfillFile=void 0;var Bm=Gr(),Js=class extends Bm.PonyfillBlob{name;lastModified;constructor(e,r,n){super(e,n),this.name=r,this.lastModified=n?.lastModified||Date.now();}webkitRelativePath=""};Hr.PonyfillFile=Js;});var Vr=chunkBUNLC3II_cjs.c(zr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(zr,"__esModule",{value:true});zr.PonyfillSuppressedError=void 0;var Xs=class extends Error{error;suppressed;constructor(e,r,n){super(n),this.error=e,this.suppressed=r,this.name="SuppressedError",Error.captureStackTrace(this,this.constructor);}};zr.PonyfillSuppressedError=Xs;});var Wt=chunkBUNLC3II_cjs.c(Vt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Vt,"__esModule",{value:true});Vt.DisposableSymbols=void 0;Vt.patchSymbols=$m;Vt.DisposableSymbols={get dispose(){return Symbol.dispose||Symbol.for("dispose")},get asyncDispose(){return Symbol.asyncDispose||Symbol.for("asyncDispose")}};function $m(){Symbol.dispose||=Symbol.for("dispose"),Symbol.asyncDispose||=Symbol.for("asyncDispose");}});var ei=chunkBUNLC3II_cjs.c(Wr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Wr,"__esModule",{value:true});Wr.isSyncDisposable=Nm;Wr.isAsyncDisposable=Gm;var _c=Wt();function Nm(t){return t?.[_c.DisposableSymbols.dispose]!=null}function Gm(t){return t?.[_c.DisposableSymbols.asyncDispose]!=null}});var Sc=chunkBUNLC3II_cjs.c(Qr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Qr,"__esModule",{value:true});Qr.PonyfillAsyncDisposableStack=void 0;var Hm=ze(),zm=Vr(),Kr=Wt(),wc=ei(),Vm=globalThis.SuppressedError||zm.PonyfillSuppressedError,ti=class t{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return (0, wc.isAsyncDisposable)(e)?this.callbacks.push(()=>e[Kr.DisposableSymbols.asyncDispose]()):(0, wc.isSyncDisposable)(e)&&this.callbacks.push(()=>e[Kr.DisposableSymbols.dispose]()),e}adopt(e,r){return r&&this.callbacks.push(()=>r(e)),e}defer(e){e&&this.callbacks.push(e);}move(){let e=new t;return e.callbacks=this.callbacks,this.callbacks=[],e}disposeAsync(){return this[Kr.DisposableSymbols.asyncDispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e)return (0, Hm.handleMaybePromise)(e,()=>this._iterateCallbacks(),r=>(this._error=this._error?new Vm(r,this._error):r,this._iterateCallbacks()))}[Kr.DisposableSymbols.asyncDispose](){let e=this._iterateCallbacks();if(e?.then)return e.then(()=>{if(this._error){let r=this._error;throw this._error=void 0,r}});if(this._error){let r=this._error;throw this._error=void 0,r}}[Symbol.toStringTag]="AsyncDisposableStack"};Qr.PonyfillAsyncDisposableStack=ti;});var Ec=chunkBUNLC3II_cjs.c(Zr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Zr,"__esModule",{value:true});Zr.PonyfillDisposableStack=void 0;var Wm=Vr(),ri=Wt(),Km=ei(),Qm=globalThis.SuppressedError||Wm.PonyfillSuppressedError,ni=class t{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return (0, Km.isSyncDisposable)(e)&&this.callbacks.push(()=>e[ri.DisposableSymbols.dispose]()),e}adopt(e,r){return r&&this.callbacks.push(()=>r(e)),e}defer(e){e&&this.callbacks.push(e);}move(){let e=new t;return e.callbacks=this.callbacks,this.callbacks=[],e}dispose(){return this[ri.DisposableSymbols.dispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e){try{e();}catch(r){this._error=this._error?new Qm(r,this._error):r;}return this._iterateCallbacks()}}[ri.DisposableSymbols.dispose](){if(this._iterateCallbacks(),this._error){let e=this._error;throw this._error=void 0,e}}[Symbol.toStringTag]="DisposableStack"};Zr.PonyfillDisposableStack=ni;});var Pc=chunkBUNLC3II_cjs.c(Ie=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Ie,"__esModule",{value:true});Ie.SuppressedError=Ie.AsyncDisposableStack=Ie.DisposableStack=void 0;var Zm=(it(),chunkBUNLC3II_cjs.f(st)),Jm=Sc(),Ym=Ec(),Xm=Vr();Ie.DisposableStack=globalThis.DisposableStack||Ym.PonyfillDisposableStack;Ie.AsyncDisposableStack=globalThis.AsyncDisposableStack||Jm.PonyfillAsyncDisposableStack;Ie.SuppressedError=globalThis.SuppressedError||Xm.PonyfillSuppressedError;Zm.__exportStar(Wt(),Ie);});var Yr=chunkBUNLC3II_cjs.c(Jr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Jr,"__esModule",{value:true});Jr.PonyfillIteratorObject=void 0;var vc=chunkBUNLC3II_cjs.a("util"),eb=Pc(),tb=me(),si=class{iterableIterator;[Symbol.toStringTag]="IteratorObject";constructor(e,r){this.iterableIterator=e,this[Symbol.toStringTag]=r;}*map(e){let r=0;for(let n of this.iterableIterator)yield e(n,r++);}*filter(e){let r=0;for(let n of this.iterableIterator)e(n,r++)&&(yield n);}reduce(e,r){let n=0,s=r;for(let i of this.iterableIterator)s=e(s,i,n++);return s}forEach(e){let r=0;for(let n of this.iterableIterator)e(n,r++);}*take(e){let r=0;for(let n of this.iterableIterator){if(r>=e)break;yield n,r++;}}*drop(e){let r=0;for(let n of this.iterableIterator)r>=e&&(yield n),r++;}*flatMap(e){let r=0;for(let n of this.iterableIterator){let s=e(n,r++);if((0, tb.isIterable)(s))for(let i of s)yield i;else for(let i of {[Symbol.iterator]:()=>s})yield i;}}some(e){let r=0;for(let n of this.iterableIterator)if(e(n,r++))return true;return false}every(e){let r=0;for(let n of this.iterableIterator)if(!e(n,r++))return false;return true}find(e){let r=0;for(let n of this.iterableIterator)if(e(n,r++))return n}toArray(){return Array.from(this.iterableIterator)}[eb.DisposableSymbols.dispose](){this.iterableIterator.return?.();}next(...[e]){return this.iterableIterator.next(e)}[Symbol.iterator](){return this}[Symbol.for("nodejs.util.inspect.custom")](){let e={};return this.forEach((r,n)=>{let s=(0, vc.inspect)(r);e[n]=s.includes(",")?s.split(",").map(i=>i.trim()):s;}),`${this[Symbol.toStringTag]} ${(0, vc.inspect)(e)}`}};Jr.PonyfillIteratorObject=si;});var ai=chunkBUNLC3II_cjs.c(Kt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Kt,"__esModule",{value:true});Kt.PonyfillFormData=void 0;Kt.getStreamFromFormData=nb;var ot=chunkBUNLC3II_cjs.a("buffer"),ii=Yr(),rb=vt(),oi=class{map=new Map;append(e,r,n){let s=this.map.get(e);s||(s=[],this.map.set(e,s));let i=kc(r)?Tc(e,r,n):r;s.push(i);}delete(e){this.map.delete(e);}get(e){let r=this.map.get(e);return r?r[0]:null}getAll(e){return this.map.get(e)||[]}has(e){return this.map.has(e)}set(e,r,n){let s=kc(r)?Tc(e,r,n):r;this.map.set(e,[s]);}[Symbol.iterator](){return this._entries()}*_entries(){for(let[e,r]of this.map)for(let n of r)yield [e,n];}entries(){return new ii.PonyfillIteratorObject(this._entries(),"FormDataIterator")}_keys(){return this.map.keys()}keys(){return new ii.PonyfillIteratorObject(this._keys(),"FormDataIterator")}*_values(){for(let e of this.map.values())for(let r of e)yield r;}values(){return new ii.PonyfillIteratorObject(this._values(),"FormDataIterator")}forEach(e){for(let[r,n]of this)e(n,r,this);}};Kt.PonyfillFormData=oi;function nb(t,e="---"){let r,n=false,s,i=false;function o(a){let{done:c,value:l}=r.next();if(c)return a.enqueue(ot.Buffer.from(`\r
|
|
7
|
+
`,"%0b":"\v","%0B":"\v","%0c":"\f","%0C":"\f","%0d":"\r","%0D":"\r","%0e":"","%0E":"","%0f":"","%0F":"","%10":"","%11":"","%12":"","%13":"","%14":"","%15":"","%16":"","%17":"","%18":"","%19":"","%1a":"","%1A":"","%1b":"\x1B","%1B":"\x1B","%1c":"","%1C":"","%1d":"","%1D":"","%1e":"","%1E":"","%1f":"","%1F":"","%20":" ","%21":"!","%22":'"',"%23":"#","%24":"$","%25":"%","%26":"&","%27":"'","%28":"(","%29":")","%2a":"*","%2A":"*","%2b":"+","%2B":"+","%2c":",","%2C":",","%2d":"-","%2D":"-","%2e":".","%2E":".","%2f":"/","%2F":"/","%30":"0","%31":"1","%32":"2","%33":"3","%34":"4","%35":"5","%36":"6","%37":"7","%38":"8","%39":"9","%3a":":","%3A":":","%3b":";","%3B":";","%3c":"<","%3C":"<","%3d":"=","%3D":"=","%3e":">","%3E":">","%3f":"?","%3F":"?","%40":"@","%41":"A","%42":"B","%43":"C","%44":"D","%45":"E","%46":"F","%47":"G","%48":"H","%49":"I","%4a":"J","%4A":"J","%4b":"K","%4B":"K","%4c":"L","%4C":"L","%4d":"M","%4D":"M","%4e":"N","%4E":"N","%4f":"O","%4F":"O","%50":"P","%51":"Q","%52":"R","%53":"S","%54":"T","%55":"U","%56":"V","%57":"W","%58":"X","%59":"Y","%5a":"Z","%5A":"Z","%5b":"[","%5B":"[","%5c":"\\","%5C":"\\","%5d":"]","%5D":"]","%5e":"^","%5E":"^","%5f":"_","%5F":"_","%60":"`","%61":"a","%62":"b","%63":"c","%64":"d","%65":"e","%66":"f","%67":"g","%68":"h","%69":"i","%6a":"j","%6A":"j","%6b":"k","%6B":"k","%6c":"l","%6C":"l","%6d":"m","%6D":"m","%6e":"n","%6E":"n","%6f":"o","%6F":"o","%70":"p","%71":"q","%72":"r","%73":"s","%74":"t","%75":"u","%76":"v","%77":"w","%78":"x","%79":"y","%7a":"z","%7A":"z","%7b":"{","%7B":"{","%7c":"|","%7C":"|","%7d":"}","%7D":"}","%7e":"~","%7E":"~","%7f":"\x7F","%7F":"\x7F","%80":"\x80","%81":"\x81","%82":"\x82","%83":"\x83","%84":"\x84","%85":"\x85","%86":"\x86","%87":"\x87","%88":"\x88","%89":"\x89","%8a":"\x8A","%8A":"\x8A","%8b":"\x8B","%8B":"\x8B","%8c":"\x8C","%8C":"\x8C","%8d":"\x8D","%8D":"\x8D","%8e":"\x8E","%8E":"\x8E","%8f":"\x8F","%8F":"\x8F","%90":"\x90","%91":"\x91","%92":"\x92","%93":"\x93","%94":"\x94","%95":"\x95","%96":"\x96","%97":"\x97","%98":"\x98","%99":"\x99","%9a":"\x9A","%9A":"\x9A","%9b":"\x9B","%9B":"\x9B","%9c":"\x9C","%9C":"\x9C","%9d":"\x9D","%9D":"\x9D","%9e":"\x9E","%9E":"\x9E","%9f":"\x9F","%9F":"\x9F","%a0":"\xA0","%A0":"\xA0","%a1":"\xA1","%A1":"\xA1","%a2":"\xA2","%A2":"\xA2","%a3":"\xA3","%A3":"\xA3","%a4":"\xA4","%A4":"\xA4","%a5":"\xA5","%A5":"\xA5","%a6":"\xA6","%A6":"\xA6","%a7":"\xA7","%A7":"\xA7","%a8":"\xA8","%A8":"\xA8","%a9":"\xA9","%A9":"\xA9","%aa":"\xAA","%Aa":"\xAA","%aA":"\xAA","%AA":"\xAA","%ab":"\xAB","%Ab":"\xAB","%aB":"\xAB","%AB":"\xAB","%ac":"\xAC","%Ac":"\xAC","%aC":"\xAC","%AC":"\xAC","%ad":"\xAD","%Ad":"\xAD","%aD":"\xAD","%AD":"\xAD","%ae":"\xAE","%Ae":"\xAE","%aE":"\xAE","%AE":"\xAE","%af":"\xAF","%Af":"\xAF","%aF":"\xAF","%AF":"\xAF","%b0":"\xB0","%B0":"\xB0","%b1":"\xB1","%B1":"\xB1","%b2":"\xB2","%B2":"\xB2","%b3":"\xB3","%B3":"\xB3","%b4":"\xB4","%B4":"\xB4","%b5":"\xB5","%B5":"\xB5","%b6":"\xB6","%B6":"\xB6","%b7":"\xB7","%B7":"\xB7","%b8":"\xB8","%B8":"\xB8","%b9":"\xB9","%B9":"\xB9","%ba":"\xBA","%Ba":"\xBA","%bA":"\xBA","%BA":"\xBA","%bb":"\xBB","%Bb":"\xBB","%bB":"\xBB","%BB":"\xBB","%bc":"\xBC","%Bc":"\xBC","%bC":"\xBC","%BC":"\xBC","%bd":"\xBD","%Bd":"\xBD","%bD":"\xBD","%BD":"\xBD","%be":"\xBE","%Be":"\xBE","%bE":"\xBE","%BE":"\xBE","%bf":"\xBF","%Bf":"\xBF","%bF":"\xBF","%BF":"\xBF","%c0":"\xC0","%C0":"\xC0","%c1":"\xC1","%C1":"\xC1","%c2":"\xC2","%C2":"\xC2","%c3":"\xC3","%C3":"\xC3","%c4":"\xC4","%C4":"\xC4","%c5":"\xC5","%C5":"\xC5","%c6":"\xC6","%C6":"\xC6","%c7":"\xC7","%C7":"\xC7","%c8":"\xC8","%C8":"\xC8","%c9":"\xC9","%C9":"\xC9","%ca":"\xCA","%Ca":"\xCA","%cA":"\xCA","%CA":"\xCA","%cb":"\xCB","%Cb":"\xCB","%cB":"\xCB","%CB":"\xCB","%cc":"\xCC","%Cc":"\xCC","%cC":"\xCC","%CC":"\xCC","%cd":"\xCD","%Cd":"\xCD","%cD":"\xCD","%CD":"\xCD","%ce":"\xCE","%Ce":"\xCE","%cE":"\xCE","%CE":"\xCE","%cf":"\xCF","%Cf":"\xCF","%cF":"\xCF","%CF":"\xCF","%d0":"\xD0","%D0":"\xD0","%d1":"\xD1","%D1":"\xD1","%d2":"\xD2","%D2":"\xD2","%d3":"\xD3","%D3":"\xD3","%d4":"\xD4","%D4":"\xD4","%d5":"\xD5","%D5":"\xD5","%d6":"\xD6","%D6":"\xD6","%d7":"\xD7","%D7":"\xD7","%d8":"\xD8","%D8":"\xD8","%d9":"\xD9","%D9":"\xD9","%da":"\xDA","%Da":"\xDA","%dA":"\xDA","%DA":"\xDA","%db":"\xDB","%Db":"\xDB","%dB":"\xDB","%DB":"\xDB","%dc":"\xDC","%Dc":"\xDC","%dC":"\xDC","%DC":"\xDC","%dd":"\xDD","%Dd":"\xDD","%dD":"\xDD","%DD":"\xDD","%de":"\xDE","%De":"\xDE","%dE":"\xDE","%DE":"\xDE","%df":"\xDF","%Df":"\xDF","%dF":"\xDF","%DF":"\xDF","%e0":"\xE0","%E0":"\xE0","%e1":"\xE1","%E1":"\xE1","%e2":"\xE2","%E2":"\xE2","%e3":"\xE3","%E3":"\xE3","%e4":"\xE4","%E4":"\xE4","%e5":"\xE5","%E5":"\xE5","%e6":"\xE6","%E6":"\xE6","%e7":"\xE7","%E7":"\xE7","%e8":"\xE8","%E8":"\xE8","%e9":"\xE9","%E9":"\xE9","%ea":"\xEA","%Ea":"\xEA","%eA":"\xEA","%EA":"\xEA","%eb":"\xEB","%Eb":"\xEB","%eB":"\xEB","%EB":"\xEB","%ec":"\xEC","%Ec":"\xEC","%eC":"\xEC","%EC":"\xEC","%ed":"\xED","%Ed":"\xED","%eD":"\xED","%ED":"\xED","%ee":"\xEE","%Ee":"\xEE","%eE":"\xEE","%EE":"\xEE","%ef":"\xEF","%Ef":"\xEF","%eF":"\xEF","%EF":"\xEF","%f0":"\xF0","%F0":"\xF0","%f1":"\xF1","%F1":"\xF1","%f2":"\xF2","%F2":"\xF2","%f3":"\xF3","%F3":"\xF3","%f4":"\xF4","%F4":"\xF4","%f5":"\xF5","%F5":"\xF5","%f6":"\xF6","%F6":"\xF6","%f7":"\xF7","%F7":"\xF7","%f8":"\xF8","%F8":"\xF8","%f9":"\xF9","%F9":"\xF9","%fa":"\xFA","%Fa":"\xFA","%fA":"\xFA","%FA":"\xFA","%fb":"\xFB","%Fb":"\xFB","%fB":"\xFB","%FB":"\xFB","%fc":"\xFC","%Fc":"\xFC","%fC":"\xFC","%FC":"\xFC","%fd":"\xFD","%Fd":"\xFD","%fD":"\xFD","%FD":"\xFD","%fe":"\xFE","%Fe":"\xFE","%fE":"\xFE","%FE":"\xFE","%ff":"\xFF","%Ff":"\xFF","%fF":"\xFF","%FF":"\xFF"};function _l(t){return rm[t]}var jr=0,wl=1,Is=2,Sl=3;function nm(t){let e=[],r=jr,n="",s=false,i=false,o=0,a="",c=t.length;for(var l=0;l<c;++l){let u=t[l];if(u==="\\"&&s)if(i)i=false;else {i=true;continue}else if(u==='"')if(i)i=false;else {if(s)for(s=false,r=jr;l+1<c&&t[l+1]!==";";)++l;else s=true;continue}else if(i&&s&&(a+="\\"),i=false,(r===Is||r===Sl)&&u==="'"){r===Is?(r=Sl,n=a.substring(1)):r=wl,a="";continue}else if(r===jr&&(u==="*"||u==="=")&&e.length){r=u==="*"?Is:wl,e[o]=[a,void 0],a="";continue}else if(!s&&u===";"){r=jr,n?(a.length&&(a=Dr(a.replace(xl,_l),"binary",n)),n=""):a.length&&(a=Dr(a,"binary","utf8")),e[o]===void 0?e[o]=a:e[o][1]=a,a="",++o;continue}else if(!s&&(u===" "||u===" "))continue;a+=u;}return n&&a.length?a=Dr(a.replace(xl,_l),"binary",n):a&&(a=Dr(a,"binary","utf8")),e[o]===void 0?a&&(e[o]=a):e[o][1]=a,e}El.exports=nm;});var vl=chunkBUNLC3II_cjs.c((Dw,Pl)=>{chunkBUNLC3II_cjs.h();Pl.exports=function(e){if(typeof e!="string")return "";for(var r=e.length-1;r>=0;--r)switch(e.charCodeAt(r)){case 47:case 92:return e=e.slice(r+1),e===".."||e==="."?"":e}return e===".."||e==="."?"":e};});var Rl=chunkBUNLC3II_cjs.c((qw,Cl)=>{chunkBUNLC3II_cjs.h();var{Readable:kl}=chunkBUNLC3II_cjs.a("stream"),{inherits:sm}=chunkBUNLC3II_cjs.a("util"),im=Os(),Tl=Ds(),om=Ir(),am=vl(),nt=Fr(),lm=/^boundary$/i,cm=/^form-data$/i,um=/^charset$/i,fm=/^filename$/i,hm=/^name$/i;qr.detect=/^multipart\/form-data/i;function qr(t,e){let r,n,s=this,i,o=e.limits,a=e.isPartAFile||((v,A,I)=>A==="application/octet-stream"||I!==void 0),c=e.parsedConType||[],l=e.defCharset||"utf8",u=e.preservePath,h={highWaterMark:e.fileHwm};for(r=0,n=c.length;r<n;++r)if(Array.isArray(c[r])&&lm.test(c[r][0])){i=c[r][1];break}function d(){P===0&&g&&!t._done&&(g=false,s.end());}if(typeof i!="string")throw new Error("Multipart: Boundary not found");let p=nt(o,"fieldSize",1*1024*1024),x=nt(o,"fileSize",1/0),S=nt(o,"files",1/0),R=nt(o,"fields",1/0),C=nt(o,"parts",1/0),D=nt(o,"headerPairs",2e3),E=nt(o,"headerSize",80*1024),T=0,w=0,P=0,L,y,g=false;this._needDrain=false,this._pause=false,this._cb=void 0,this._nparts=0,this._boy=t;let _={boundary:i,maxHeaderPairs:D,maxHeaderSize:E,partHwm:h.highWaterMark,highWaterMark:e.highWaterMark};this.parser=new im(_),this.parser.on("drain",function(){if(s._needDrain=false,s._cb&&!s._pause){let v=s._cb;s._cb=void 0,v();}}).on("part",function v(A){if(++s._nparts>C)return s.parser.removeListener("part",v),s.parser.on("part",St),t.hitPartsLimit=true,t.emit("partsLimit"),St(A);if(y){let I=y;I.emit("end"),I.removeAllListeners("end");}A.on("header",function(I){let M,V,B,Z,se,re,we=0;if(I["content-type"]&&(B=Tl(I["content-type"][0]),B[0])){for(M=B[0].toLowerCase(),r=0,n=B.length;r<n;++r)if(um.test(B[r][0])){Z=B[r][1].toLowerCase();break}}if(M===void 0&&(M="text/plain"),Z===void 0&&(Z=l),I["content-disposition"]){if(B=Tl(I["content-disposition"][0]),!cm.test(B[0]))return St(A);for(r=0,n=B.length;r<n;++r)hm.test(B[r][0])?V=B[r][1]:fm.test(B[r][0])&&(re=B[r][1],u||(re=am(re)));}else return St(A);I["content-transfer-encoding"]?se=I["content-transfer-encoding"][0].toLowerCase():se="7bit";let En,Pn;if(a(V,M,re)){if(T===S)return t.hitFilesLimit||(t.hitFilesLimit=true,t.emit("filesLimit")),St(A);if(++T,t.listenerCount("file")===0){s.parser._ignore();return}++P;let Y=new js(h);L=Y,Y.on("end",function(){if(--P,s._pause=false,d(),s._cb&&!s._needDrain){let Se=s._cb;s._cb=void 0,Se();}}),Y._read=function(Se){if(s._pause&&(s._pause=false,s._cb&&!s._needDrain)){let Ae=s._cb;s._cb=void 0,Ae();}},t.emit("file",V,Y,re,se,M),En=function(Se){if((we+=Se.length)>x){let Ae=x-we+Se.length;Ae>0&&Y.push(Se.slice(0,Ae)),Y.truncated=true,Y.bytesRead=x,A.removeAllListeners("data"),Y.emit("limit");return}else Y.push(Se)||(s._pause=true);Y.bytesRead=we;},Pn=function(){L=void 0,Y.push(null);};}else {if(w===R)return t.hitFieldsLimit||(t.hitFieldsLimit=true,t.emit("fieldsLimit")),St(A);++w,++P;let Y="",Se=false;y=A,En=function(Ae){if((we+=Ae.length)>p){let hf=p-(we-Ae.length);Y+=Ae.toString("binary",0,hf),Se=true,A.removeAllListeners("data");}else Y+=Ae.toString("binary");},Pn=function(){y=void 0,Y.length&&(Y=om(Y,"binary",Z)),t.emit("field",V,Y,false,Se,se,M),--P,d();};}A._readableState.sync=false,A.on("data",En),A.on("end",Pn);}).on("error",function(I){L&&L.emit("error",I);});}).on("error",function(v){t.emit("error",v);}).on("finish",function(){g=true,d();});}qr.prototype.write=function(t,e){let r=this.parser.write(t);r&&!this._pause?e():(this._needDrain=!r,this._cb=e);};qr.prototype.end=function(){let t=this;t.parser.writable?t.parser.end():t._boy._done||process.nextTick(function(){t._boy._done=true,t._boy.emit("finish");});};function St(t){t.resume();}function js(t){kl.call(this,t),this.bytesRead=0,this.truncated=false;}sm(js,kl);js.prototype._read=function(t){};Cl.exports=qr;});var Ll=chunkBUNLC3II_cjs.c((Mw,Al)=>{chunkBUNLC3II_cjs.h();var dm=/\+/g,pm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function qs(){this.buffer=void 0;}qs.prototype.write=function(t){t=t.replace(dm," ");let e="",r=0,n=0,s=t.length;for(;r<s;++r)this.buffer!==void 0?pm[t.charCodeAt(r)]?(this.buffer+=t[r],++n,this.buffer.length===2&&(e+=String.fromCharCode(parseInt(this.buffer,16)),this.buffer=void 0)):(e+="%"+this.buffer,this.buffer=void 0,--r):t[r]==="%"&&(r>n&&(e+=t.substring(n,r),n=r),this.buffer="",++n);return n<s&&this.buffer===void 0&&(e+=t.substring(n)),e};qs.prototype.reset=function(){this.buffer=void 0;};Al.exports=qs;});var Fl=chunkBUNLC3II_cjs.c(($w,Ol)=>{chunkBUNLC3II_cjs.h();var mm=Ll(),Et=Ir(),Us=Fr(),bm=/^charset$/i;Ur.detect=/^application\/x-www-form-urlencoded/i;function Ur(t,e){let r=e.limits,n=e.parsedConType;this.boy=t,this.fieldSizeLimit=Us(r,"fieldSize",1*1024*1024),this.fieldNameSizeLimit=Us(r,"fieldNameSize",100),this.fieldsLimit=Us(r,"fields",1/0);let s;for(var i=0,o=n.length;i<o;++i)if(Array.isArray(n[i])&&bm.test(n[i][0])){s=n[i][1].toLowerCase();break}s===void 0&&(s=e.defCharset||"utf8"),this.decoder=new mm,this.charset=s,this._fields=0,this._state="key",this._checkingBytes=true,this._bytesKey=0,this._bytesVal=0,this._key="",this._val="",this._keyTrunc=false,this._valTrunc=false,this._hitLimit=false;}Ur.prototype.write=function(t,e){if(this._fields===this.fieldsLimit)return this.boy.hitFieldsLimit||(this.boy.hitFieldsLimit=true,this.boy.emit("fieldsLimit")),e();let r,n,s,i=0,o=t.length;for(;i<o;)if(this._state==="key"){for(r=n=void 0,s=i;s<o;++s){if(this._checkingBytes||++i,t[s]===61){r=s;break}else if(t[s]===38){n=s;break}if(this._checkingBytes&&this._bytesKey===this.fieldNameSizeLimit){this._hitLimit=true;break}else this._checkingBytes&&++this._bytesKey;}if(r!==void 0)r>i&&(this._key+=this.decoder.write(t.toString("binary",i,r))),this._state="val",this._hitLimit=false,this._checkingBytes=true,this._val="",this._bytesVal=0,this._valTrunc=false,this.decoder.reset(),i=r+1;else if(n!==void 0){++this._fields;let a,c=this._keyTrunc;if(n>i?a=this._key+=this.decoder.write(t.toString("binary",i,n)):a=this._key,this._hitLimit=false,this._checkingBytes=true,this._key="",this._bytesKey=0,this._keyTrunc=false,this.decoder.reset(),a.length&&this.boy.emit("field",Et(a,"binary",this.charset),"",c,false),i=n+1,this._fields===this.fieldsLimit)return e()}else this._hitLimit?(s>i&&(this._key+=this.decoder.write(t.toString("binary",i,s))),i=s,(this._bytesKey=this._key.length)===this.fieldNameSizeLimit&&(this._checkingBytes=false,this._keyTrunc=true)):(i<o&&(this._key+=this.decoder.write(t.toString("binary",i))),i=o);}else {for(n=void 0,s=i;s<o;++s){if(this._checkingBytes||++i,t[s]===38){n=s;break}if(this._checkingBytes&&this._bytesVal===this.fieldSizeLimit){this._hitLimit=true;break}else this._checkingBytes&&++this._bytesVal;}if(n!==void 0){if(++this._fields,n>i&&(this._val+=this.decoder.write(t.toString("binary",i,n))),this.boy.emit("field",Et(this._key,"binary",this.charset),Et(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this._state="key",this._hitLimit=false,this._checkingBytes=true,this._key="",this._bytesKey=0,this._keyTrunc=false,this.decoder.reset(),i=n+1,this._fields===this.fieldsLimit)return e()}else this._hitLimit?(s>i&&(this._val+=this.decoder.write(t.toString("binary",i,s))),i=s,(this._val===""&&this.fieldSizeLimit===0||(this._bytesVal=this._val.length)===this.fieldSizeLimit)&&(this._checkingBytes=false,this._valTrunc=true)):(i<o&&(this._val+=this.decoder.write(t.toString("binary",i))),i=o);}e();};Ur.prototype.end=function(){this.boy._done||(this._state==="key"&&this._key.length>0?this.boy.emit("field",Et(this._key,"binary",this.charset),"",this._keyTrunc,false):this._state==="val"&&this.boy.emit("field",Et(this._key,"binary",this.charset),Et(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this.boy._done=true,this.boy.emit("finish"));};Ol.exports=Ur;});var jl=chunkBUNLC3II_cjs.c((Gw,$t)=>{chunkBUNLC3II_cjs.h();var Ms=chunkBUNLC3II_cjs.a("stream").Writable,{inherits:ym}=chunkBUNLC3II_cjs.a("util"),gm=Os(),Il=Rl(),Dl=Fl(),xm=Ds();function Fe(t){if(!(this instanceof Fe))return new Fe(t);if(typeof t!="object")throw new TypeError("Busboy expected an options-Object.");if(typeof t.headers!="object")throw new TypeError("Busboy expected an options-Object with headers-attribute.");if(typeof t.headers["content-type"]!="string")throw new TypeError("Missing Content-Type-header.");let{headers:e,...r}=t;this.opts={autoDestroy:false,...r},Ms.call(this,this.opts),this._done=false,this._parser=this.getParserByHeaders(e),this._finished=false;}ym(Fe,Ms);Fe.prototype.emit=function(t){if(t==="finish"){if(this._done){if(this._finished)return}else {this._parser?.end();return}this._finished=true;}Ms.prototype.emit.apply(this,arguments);};Fe.prototype.getParserByHeaders=function(t){let e=xm(t["content-type"]),r={defCharset:this.opts.defCharset,fileHwm:this.opts.fileHwm,headers:t,highWaterMark:this.opts.highWaterMark,isPartAFile:this.opts.isPartAFile,limits:this.opts.limits,parsedConType:e,preservePath:this.opts.preservePath};if(Il.detect.test(e[0]))return new Il(this,r);if(Dl.detect.test(e[0]))return new Dl(this,r);throw new Error("Unsupported Content-Type.")};Fe.prototype._write=function(t,e,r){this._parser.write(t,r);};$t.exports=Fe;$t.exports.default=Fe;$t.exports.Busboy=Fe;$t.exports.Dicer=gm;});var st={};chunkBUNLC3II_cjs.d(st,{__addDisposableResource:()=>ac,__assign:()=>Mr,__asyncDelegator:()=>Xl,__asyncGenerator:()=>Yl,__asyncValues:()=>ec,__await:()=>Pt,__awaiter:()=>Vl,__classPrivateFieldGet:()=>sc,__classPrivateFieldIn:()=>oc,__classPrivateFieldSet:()=>ic,__createBinding:()=>$r,__decorate:()=>Ml,__disposeResources:()=>lc,__esDecorate:()=>$l,__exportStar:()=>Kl,__extends:()=>ql,__generator:()=>Wl,__importDefault:()=>nc,__importStar:()=>rc,__makeTemplateObject:()=>tc,__metadata:()=>Hl,__param:()=>Bl,__propKey:()=>Gl,__read:()=>Ns,__rest:()=>Ul,__rewriteRelativeImportExtension:()=>cc,__runInitializers:()=>Nl,__setFunctionName:()=>zl,__spread:()=>Ql,__spreadArray:()=>Jl,__spreadArrays:()=>Zl,__values:()=>Br,default:()=>Sm});function ql(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Bs(t,e);function r(){this.constructor=t;}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r);}function Ul(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Ml(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,r,i):o(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i}function Bl(t,e){return function(r,n){e(r,n,t);}}function $l(t,e,r,n,s,i){function o(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),h,d=false,p=r.length-1;p>=0;p--){var x={};for(var S in n)x[S]=S==="access"?{}:n[S];for(var S in n.access)x.access[S]=n.access[S];x.addInitializer=function(C){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(C||null));};var R=(0, r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],x);if(a==="accessor"){if(R===void 0)continue;if(R===null||typeof R!="object")throw new TypeError("Object expected");(h=o(R.get))&&(u.get=h),(h=o(R.set))&&(u.set=h),(h=o(R.init))&&s.unshift(h);}else (h=o(R))&&(a==="field"?s.unshift(h):u[c]=h);}l&&Object.defineProperty(l,n.name,u),d=true;}function Nl(t,e,r){for(var n=arguments.length>2,s=0;s<e.length;s++)r=n?e[s].call(t,r):e[s].call(t);return n?r:void 0}function Gl(t){return typeof t=="symbol"?t:"".concat(t)}function zl(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:true,value:r?"".concat(r," ",e):e})}function Hl(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Vl(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i);})}return new(r||(r=Promise))(function(i,o){function a(u){try{l(n.next(u));}catch(h){o(h);}}function c(u){try{l(n.throw(u));}catch(h){o(h);}}function l(u){u.done?i(u.value):s(u.value).then(a,c);}l((n=n.apply(t,e||[])).next());})}function Wl(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,s&&(i=l[0]&2?s.return:l[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,l[1])).done)return i;switch(s=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,s=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r);}catch(u){l=[6,u],s=0;}finally{n=i=0;}if(l[0]&5)throw l[1];return {value:l[0]?l[1]:void 0,done:true}}}function Kl(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$r(e,t,r);}function Br(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return {next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ns(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value);}catch(a){o={error:a};}finally{try{s&&!s.done&&(r=n.return)&&r.call(n);}finally{if(o)throw o.error}}return i}function Ql(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ns(arguments[e]));return t}function Zl(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function Jl(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function Pt(t){return this instanceof Pt?(this.v=t,this):new Pt(t)}function Yl(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(p){return function(x){return Promise.resolve(x).then(p,h)}}function a(p,x){n[p]&&(s[p]=function(S){return new Promise(function(R,C){i.push([p,S,R,C])>1||c(p,S);})},x&&(s[p]=x(s[p])));}function c(p,x){try{l(n[p](x));}catch(S){d(i[0][3],S);}}function l(p){p.value instanceof Pt?Promise.resolve(p.value.v).then(u,h):d(i[0][2],p);}function u(p){c("next",p);}function h(p){c("throw",p);}function d(p,x){p(x),i.shift(),i.length&&c(i[0][0],i[0][1]);}}function Xl(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(o){return (r=!r)?{value:Pt(t[s](o)),done:false}:i?i(o):o}:i;}}function ec(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Br=="function"?Br(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(a,c){o=t[i](o),s(a,c,o.done,o.value);})};}function s(i,o,a,c){Promise.resolve(c).then(function(l){i({value:l,done:a});},o);}}function tc(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function rc(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=$s(t),n=0;n<r.length;n++)r[n]!=="default"&&$r(e,t,r[n]);return _m(e,t),e}function nc(t){return t&&t.__esModule?t:{default:t}}function sc(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function ic(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}function oc(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ac(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose];}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(s=n);}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this);}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r});}else r&&t.stack.push({async:true});return e}function lc(t){function e(i){t.error=t.hasError?new wm(i,t.error,"An error was suppressed during disposal."):i,t.hasError=true;}var r,n=0;function s(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(s);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else n|=1;}catch(o){e(o);}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return s()}function cc(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,i,o){return n?e?".jsx":".js":s&&(!i||!o)?r:s+i+"."+o.toLowerCase()+"js"}):t}var Bs,Mr,$r,_m,$s,wm,Sm,it=chunkBUNLC3II_cjs.b(()=>{chunkBUNLC3II_cjs.h();Bs=function(t,e){return Bs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n;}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s]);},Bs(t,e)};Mr=function(){return Mr=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);}return e},Mr.apply(this,arguments)};$r=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:true,get:function(){return e[r]}}),Object.defineProperty(t,n,s);}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];});_m=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e});}):function(t,e){t.default=e;},$s=function(t){return $s=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},$s(t)};wm=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};Sm={__extends:ql,__assign:Mr,__rest:Ul,__decorate:Ml,__param:Bl,__esDecorate:$l,__runInitializers:Nl,__propKey:Gl,__setFunctionName:zl,__metadata:Hl,__awaiter:Vl,__generator:Wl,__createBinding:$r,__exportStar:Kl,__values:Br,__read:Ns,__spread:Ql,__spreadArrays:Zl,__spreadArray:Jl,__await:Pt,__asyncGenerator:Yl,__asyncDelegator:Xl,__asyncValues:ec,__makeTemplateObject:tc,__importStar:rc,__importDefault:nc,__classPrivateFieldGet:sc,__classPrivateFieldSet:ic,__classPrivateFieldIn:oc,__addDisposableResource:ac,__disposeResources:lc,__rewriteRelativeImportExtension:cc};});var me=chunkBUNLC3II_cjs.c(ie=>{chunkBUNLC3II_cjs.h();Object.defineProperty(ie,"__esModule",{value:true});ie.DEFAULT_ACCEPT_ENCODING=ie.fakePromise=void 0;ie.getHeadersObj=Tm;ie.defaultHeadersSerializer=km;ie.isArrayBufferView=Rm;ie.isNodeReadable=Am;ie.isIterable=Lm;ie.shouldRedirect=Om;ie.pipeThrough=Fm;ie.endStream=Im;ie.safeWrite=Dm;ie.getSupportedFormats=fc;var Em=(it(),chunkBUNLC3II_cjs.f(st)),Pm=chunkBUNLC3II_cjs.a("events"),vm=Em.__importDefault(chunkBUNLC3II_cjs.a("zlib"));function uc(t){return t?.forEach!=null}function Tm(t){return t==null||!uc(t)?t:t.headersInit&&!t._map&&!uc(t.headersInit)?t.headersInit:Object.fromEntries(t.entries())}function km(t,e){let r=[];return t.forEach((n,s)=>{e&&s==="content-length"&&e(n),r.push(`${s}: ${n}`);}),r}var Cm=He();Object.defineProperty(ie,"fakePromise",{enumerable:true,get:function(){return Cm.fakePromise}});function Rm(t){return t!=null&&t.buffer!=null&&t.byteLength!=null&&t.byteOffset!=null}function Am(t){return t!=null&&t.pipe!=null}function Lm(t){return t?.[Symbol.iterator]!=null}function Om(t){return t===301||t===302||t===303||t===307||t===308}function Fm({src:t,dest:e,signal:r,onError:n}){if(n&&e.once("error",n),t.once("error",s=>{e.destroy(s);}),e.once("close",()=>{t.destroyed||t.destroy();}),r){let o=function(){i.deref()?.removeEventListener("abort",a),s.deref()?.removeListener("end",o),s.deref()?.removeListener("error",o),s.deref()?.removeListener("close",o);},a=function(){s.deref()?.destroy(new Gs),o();},s=new WeakRef(t),i=new WeakRef(r);r.addEventListener("abort",a,{once:true}),t.once("end",o),t.once("error",o),t.once("close",o);}t.pipe(e,{end:true});}function Im(t){return t.end(null,null,null)}function Dm(t,e){if(!e.write(t))return (0, Pm.once)(e,"drain")}var Gs=class extends Error{constructor(e="The operation was aborted",r=void 0){super(e,r),this.name="AbortError";}};ie.DEFAULT_ACCEPT_ENCODING=fc().join(", ");function fc(){let t=["gzip","deflate","br"];return globalThis.process?.versions?.node?.startsWith("2")||t.push("deflate-raw"),vm.default.createZstdCompress!=null&&t.push("zstd"),t}});var vt=chunkBUNLC3II_cjs.c(Nr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Nr,"__esModule",{value:true});Nr.PonyfillReadableStream=void 0;var hc=chunkBUNLC3II_cjs.a("buffer"),zs=chunkBUNLC3II_cjs.a("events"),Hs=chunkBUNLC3II_cjs.a("stream"),jm=chunkBUNLC3II_cjs.a("stream/promises"),Vs=He(),Ws=me();function dc(t,e){let r=[],n=false,s=false;return {desiredSize:t,enqueue(i){let o=typeof i=="string"?hc.Buffer.from(i):i;s?e.push(o):r.push(o);},close(){r.length>0&&this._flush(),e.push(null),n=true;},error(i){r.length>0&&this._flush(),e.destroy(i);},get _closed(){return n},_flush(){if(s=true,r.length>0){let i=r.length>1?hc.Buffer.concat(r):r[0];e.push(i),r=[];}}}}function qm(t){return t?.read!=null}function pc(t){return t?.getReader!=null}var Ks=class t{readable;constructor(e){if(e instanceof t&&e.readable!=null)this.readable=e.readable;else if(qm(e))this.readable=e;else if(pc(e))this.readable=Hs.Readable.fromWeb(e);else {let r=false,n=false,s=o=>{if(!r){let a=dc(o,this.readable);return r=true,(0, Vs.handleMaybePromise)(()=>e?.start?.(a),()=>(a._flush(),!a._closed))}return true},i=o=>(0, Vs.handleMaybePromise)(()=>s(o),a=>{if(!a)return;let c=dc(o,this.readable);return (0, Vs.handleMaybePromise)(()=>e?.pull?.(c),()=>{c._flush(),n=false;})});this.readable=new Hs.Readable({read(o){if(!n)return n=true,i(o)},destroy(o,a){if(e?.cancel)try{let c=e.cancel(o);if(c?.then)return c.then(()=>{a(null);},l=>{a(l);})}catch(c){a(c);return}a(null);}});}}cancel(e){return this.readable.destroy(e),(0, zs.once)(this.readable,"close")}locked=false;getReader(e){let r=this.readable[Symbol.asyncIterator]();this.locked=true;let n=this.readable;return {read(){return r.next()},releaseLock:()=>{if(r.return){let s=r.return();if(s.then){s.then(()=>{this.locked=false;});return}}this.locked=false;},cancel:s=>{if(r.return){let i=r.return(s);if(i.then)return i.then(()=>{this.locked=false;})}return this.locked=false,(0, Ws.fakePromise)()},get closed(){return Promise.race([(0, zs.once)(n,"end"),(0, zs.once)(n,"error").then(s=>Promise.reject(s))])}}}[Symbol.asyncIterator](e){let r=this.readable[Symbol.asyncIterator]();return {[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{await r.return?.(),this.readable.destroyed||this.readable.destroy();},next:()=>r.next(),return:()=>(this.readable.destroyed||this.readable.destroy(),r.return?.()||(0, Ws.fakePromise)({done:true,value:void 0})),throw:s=>(this.readable.destroyed||this.readable.destroy(s),r.throw?.(s)||(0, Ws.fakePromise)({done:true,value:void 0}))}}values(e){return this[Symbol.asyncIterator]()}tee(){throw new Error("Not implemented")}async pipeToWriter(e){try{for await(let r of this)await e.write(r);await e.close();}catch(r){await e.abort(r);}}pipeTo(e){if(Mm(e))return (0, jm.pipeline)(this.readable,e.writable,{end:true});{let r=e.getWriter();return this.pipeToWriter(r)}}pipeThrough({writable:e,readable:r}){return this.pipeTo(e).catch(n=>{this.readable.destroy(n);}),Um(r)&&(r.readable.once("error",n=>this.readable.destroy(n)),r.readable.once("finish",()=>this.readable.push(null)),r.readable.once("close",()=>this.readable.push(null))),r}static[Symbol.hasInstance](e){return pc(e)}static from(e){return new t(Hs.Readable.from(e))}[Symbol.toStringTag]="ReadableStream"};Nr.PonyfillReadableStream=Ks;function Um(t){return t?.readable!=null}function Mm(t){return t?.writable!=null}});var Gr=chunkBUNLC3II_cjs.c(ye=>{chunkBUNLC3II_cjs.h();Object.defineProperty(ye,"__esModule",{value:true});ye.PonyfillBlob=void 0;ye.hasBufferMethod=Gt;ye.hasArrayBufferMethod=zt;ye.hasBytesMethod=Ht;ye.hasTextMethod=mc;ye.hasSizeProperty=bc;ye.hasStreamMethod=yc;ye.hasBlobSignature=gc;ye.isArrayBuffer=xc;var ue=chunkBUNLC3II_cjs.a("buffer"),Qs=vt(),ce=me();function Nt(t){return typeof t=="string"?ue.Buffer.from(t):ue.Buffer.isBuffer(t)?t:(0, ce.isArrayBufferView)(t)?ue.Buffer.from(t.buffer,t.byteOffset,t.byteLength):ue.Buffer.from(t)}function Gt(t){return t!=null&&t.buffer!=null&&typeof t.buffer=="function"}function zt(t){return t!=null&&t.arrayBuffer!=null&&typeof t.arrayBuffer=="function"}function Ht(t){return t!=null&&t.bytes!=null&&typeof t.bytes=="function"}function mc(t){return t!=null&&t.text!=null&&typeof t.text=="function"}function bc(t){return t!=null&&typeof t.size=="number"}function yc(t){return t!=null&&t.stream!=null&&typeof t.stream=="function"}function gc(t){return t!=null&&t[Symbol.toStringTag]==="Blob"}function xc(t){return t!=null&&t.byteLength!=null&&t.slice!=null}var Zs=class{blobParts;type;encoding;_size=null;constructor(e=[],r){if(this.blobParts=e,this.type=r?.type||"application/octet-stream",this.encoding=r?.encoding||"utf8",this._size=r?.size||null,e.length===1&&gc(e[0]))return e[0]}_buffer=null;buffer(){if(this._buffer)return (0, ce.fakePromise)(this._buffer);if(this.blobParts.length===1){let n=this.blobParts[0];return Gt(n)?n.buffer().then(s=>(this._buffer=s,this._buffer)):Ht(n)?n.bytes().then(s=>(this._buffer=ue.Buffer.from(s),this._buffer)):zt(n)?n.arrayBuffer().then(s=>(this._buffer=ue.Buffer.from(s,void 0,n.size),this._buffer)):(this._buffer=Nt(n),(0, ce.fakePromise)(this._buffer))}let e=[],r=this.blobParts.map((n,s)=>{if(Gt(n)){e.push(n.buffer().then(i=>{r[s]=i;}));return}else if(zt(n)){e.push(n.arrayBuffer().then(i=>{r[s]=ue.Buffer.from(i,void 0,n.size);}));return}else if(Ht(n)){e.push(n.bytes().then(i=>{r[s]=ue.Buffer.from(i);}));return}else return Nt(n)});return e.length>0?Promise.all(e).then(()=>ue.Buffer.concat(r,this._size||void 0)):(0, ce.fakePromise)(ue.Buffer.concat(r,this._size||void 0))}arrayBuffer(){if(this._buffer)return (0, ce.fakePromise)(this._buffer);if(this.blobParts.length===1){if(xc(this.blobParts[0]))return (0, ce.fakePromise)(this.blobParts[0]);if(zt(this.blobParts[0]))return this.blobParts[0].arrayBuffer()}return this.buffer()}bytes(){if(this._buffer)return (0, ce.fakePromise)(this._buffer);if(this.blobParts.length===1){if(ue.Buffer.isBuffer(this.blobParts[0]))return this._buffer=this.blobParts[0],(0, ce.fakePromise)(this._buffer);if(this.blobParts[0]instanceof Uint8Array)return this._buffer=ue.Buffer.from(this.blobParts[0]),(0, ce.fakePromise)(this._buffer);if(Ht(this.blobParts[0]))return this.blobParts[0].bytes();if(Gt(this.blobParts[0]))return this.blobParts[0].buffer()}return this.buffer()}_text=null;text(){if(this._text)return (0, ce.fakePromise)(this._text);if(this.blobParts.length===1){let e=this.blobParts[0];if(typeof e=="string")return this._text=e,(0, ce.fakePromise)(this._text);if(mc(e))return e.text().then(n=>(this._text=n,this._text));let r=Nt(e);return this._text=r.toString(this.encoding),(0, ce.fakePromise)(this._text)}return this.buffer().then(e=>(this._text=e.toString(this.encoding),this._text))}_json=null;json(){return this._json?(0, ce.fakePromise)(this._json):this.text().then(e=>(this._json=JSON.parse(e),this._json))}_formData=null;formData(){if(this._formData)return (0, ce.fakePromise)(this._formData);throw new Error("Not implemented")}get size(){if(this._size==null){this._size=0;for(let e of this.blobParts)typeof e=="string"?this._size+=ue.Buffer.byteLength(e):bc(e)?this._size+=e.size:(0, ce.isArrayBufferView)(e)&&(this._size+=e.byteLength);}return this._size}stream(){if(this.blobParts.length===1){let r=this.blobParts[0];if(yc(r))return r.stream();let n=Nt(r);return new Qs.PonyfillReadableStream({start:s=>{s.enqueue(n),s.close();}})}if(this._buffer!=null)return new Qs.PonyfillReadableStream({start:r=>{r.enqueue(this._buffer),r.close();}});let e;return new Qs.PonyfillReadableStream({start:r=>{if(this.blobParts.length===0){r.close();return}e=this.blobParts[Symbol.iterator]();},pull:r=>{let{value:n,done:s}=e.next();if(s){r.close();return}if(n){if(Gt(n))return n.buffer().then(o=>{r.enqueue(o);});if(Ht(n))return n.bytes().then(o=>{let a=ue.Buffer.from(o);r.enqueue(a);});if(zt(n))return n.arrayBuffer().then(o=>{let a=ue.Buffer.from(o,void 0,n.size);r.enqueue(a);});let i=Nt(n);r.enqueue(i);}}})}slice(){throw new Error("Not implemented")}};ye.PonyfillBlob=Zs;});var Ys=chunkBUNLC3II_cjs.c(zr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(zr,"__esModule",{value:true});zr.PonyfillFile=void 0;var Bm=Gr(),Js=class extends Bm.PonyfillBlob{name;lastModified;constructor(e,r,n){super(e,n),this.name=r,this.lastModified=n?.lastModified||Date.now();}webkitRelativePath=""};zr.PonyfillFile=Js;});var Vr=chunkBUNLC3II_cjs.c(Hr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Hr,"__esModule",{value:true});Hr.PonyfillSuppressedError=void 0;var Xs=class extends Error{error;suppressed;constructor(e,r,n){super(n),this.error=e,this.suppressed=r,this.name="SuppressedError",Error.captureStackTrace(this,this.constructor);}};Hr.PonyfillSuppressedError=Xs;});var Wt=chunkBUNLC3II_cjs.c(Vt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Vt,"__esModule",{value:true});Vt.DisposableSymbols=void 0;Vt.patchSymbols=$m;Vt.DisposableSymbols={get dispose(){return Symbol.dispose||Symbol.for("dispose")},get asyncDispose(){return Symbol.asyncDispose||Symbol.for("asyncDispose")}};function $m(){Symbol.dispose||=Symbol.for("dispose"),Symbol.asyncDispose||=Symbol.for("asyncDispose");}});var ei=chunkBUNLC3II_cjs.c(Wr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Wr,"__esModule",{value:true});Wr.isSyncDisposable=Nm;Wr.isAsyncDisposable=Gm;var _c=Wt();function Nm(t){return t?.[_c.DisposableSymbols.dispose]!=null}function Gm(t){return t?.[_c.DisposableSymbols.asyncDispose]!=null}});var Sc=chunkBUNLC3II_cjs.c(Qr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Qr,"__esModule",{value:true});Qr.PonyfillAsyncDisposableStack=void 0;var zm=He(),Hm=Vr(),Kr=Wt(),wc=ei(),Vm=globalThis.SuppressedError||Hm.PonyfillSuppressedError,ti=class t{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return (0, wc.isAsyncDisposable)(e)?this.callbacks.push(()=>e[Kr.DisposableSymbols.asyncDispose]()):(0, wc.isSyncDisposable)(e)&&this.callbacks.push(()=>e[Kr.DisposableSymbols.dispose]()),e}adopt(e,r){return r&&this.callbacks.push(()=>r(e)),e}defer(e){e&&this.callbacks.push(e);}move(){let e=new t;return e.callbacks=this.callbacks,this.callbacks=[],e}disposeAsync(){return this[Kr.DisposableSymbols.asyncDispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e)return (0, zm.handleMaybePromise)(e,()=>this._iterateCallbacks(),r=>(this._error=this._error?new Vm(r,this._error):r,this._iterateCallbacks()))}[Kr.DisposableSymbols.asyncDispose](){let e=this._iterateCallbacks();if(e?.then)return e.then(()=>{if(this._error){let r=this._error;throw this._error=void 0,r}});if(this._error){let r=this._error;throw this._error=void 0,r}}[Symbol.toStringTag]="AsyncDisposableStack"};Qr.PonyfillAsyncDisposableStack=ti;});var Ec=chunkBUNLC3II_cjs.c(Zr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Zr,"__esModule",{value:true});Zr.PonyfillDisposableStack=void 0;var Wm=Vr(),ri=Wt(),Km=ei(),Qm=globalThis.SuppressedError||Wm.PonyfillSuppressedError,ni=class t{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return (0, Km.isSyncDisposable)(e)&&this.callbacks.push(()=>e[ri.DisposableSymbols.dispose]()),e}adopt(e,r){return r&&this.callbacks.push(()=>r(e)),e}defer(e){e&&this.callbacks.push(e);}move(){let e=new t;return e.callbacks=this.callbacks,this.callbacks=[],e}dispose(){return this[ri.DisposableSymbols.dispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e){try{e();}catch(r){this._error=this._error?new Qm(r,this._error):r;}return this._iterateCallbacks()}}[ri.DisposableSymbols.dispose](){if(this._iterateCallbacks(),this._error){let e=this._error;throw this._error=void 0,e}}[Symbol.toStringTag]="DisposableStack"};Zr.PonyfillDisposableStack=ni;});var Pc=chunkBUNLC3II_cjs.c(Ie=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Ie,"__esModule",{value:true});Ie.SuppressedError=Ie.AsyncDisposableStack=Ie.DisposableStack=void 0;var Zm=(it(),chunkBUNLC3II_cjs.f(st)),Jm=Sc(),Ym=Ec(),Xm=Vr();Ie.DisposableStack=globalThis.DisposableStack||Ym.PonyfillDisposableStack;Ie.AsyncDisposableStack=globalThis.AsyncDisposableStack||Jm.PonyfillAsyncDisposableStack;Ie.SuppressedError=globalThis.SuppressedError||Xm.PonyfillSuppressedError;Zm.__exportStar(Wt(),Ie);});var Yr=chunkBUNLC3II_cjs.c(Jr=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Jr,"__esModule",{value:true});Jr.PonyfillIteratorObject=void 0;var vc=chunkBUNLC3II_cjs.a("util"),eb=Pc(),tb=me(),si=class{iterableIterator;[Symbol.toStringTag]="IteratorObject";constructor(e,r){this.iterableIterator=e,this[Symbol.toStringTag]=r;}*map(e){let r=0;for(let n of this.iterableIterator)yield e(n,r++);}*filter(e){let r=0;for(let n of this.iterableIterator)e(n,r++)&&(yield n);}reduce(e,r){let n=0,s=r;for(let i of this.iterableIterator)s=e(s,i,n++);return s}forEach(e){let r=0;for(let n of this.iterableIterator)e(n,r++);}*take(e){let r=0;for(let n of this.iterableIterator){if(r>=e)break;yield n,r++;}}*drop(e){let r=0;for(let n of this.iterableIterator)r>=e&&(yield n),r++;}*flatMap(e){let r=0;for(let n of this.iterableIterator){let s=e(n,r++);if((0, tb.isIterable)(s))for(let i of s)yield i;else for(let i of {[Symbol.iterator]:()=>s})yield i;}}some(e){let r=0;for(let n of this.iterableIterator)if(e(n,r++))return true;return false}every(e){let r=0;for(let n of this.iterableIterator)if(!e(n,r++))return false;return true}find(e){let r=0;for(let n of this.iterableIterator)if(e(n,r++))return n}toArray(){return Array.from(this.iterableIterator)}[eb.DisposableSymbols.dispose](){this.iterableIterator.return?.();}next(...[e]){return this.iterableIterator.next(e)}[Symbol.iterator](){return this}[Symbol.for("nodejs.util.inspect.custom")](){let e={};return this.forEach((r,n)=>{let s=(0, vc.inspect)(r);e[n]=s.includes(",")?s.split(",").map(i=>i.trim()):s;}),`${this[Symbol.toStringTag]} ${(0, vc.inspect)(e)}`}};Jr.PonyfillIteratorObject=si;});var ai=chunkBUNLC3II_cjs.c(Kt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Kt,"__esModule",{value:true});Kt.PonyfillFormData=void 0;Kt.getStreamFromFormData=nb;var ot=chunkBUNLC3II_cjs.a("buffer"),ii=Yr(),rb=vt(),oi=class{map=new Map;append(e,r,n){let s=this.map.get(e);s||(s=[],this.map.set(e,s));let i=kc(r)?Tc(e,r,n):r;s.push(i);}delete(e){this.map.delete(e);}get(e){let r=this.map.get(e);return r?r[0]:null}getAll(e){return this.map.get(e)||[]}has(e){return this.map.has(e)}set(e,r,n){let s=kc(r)?Tc(e,r,n):r;this.map.set(e,[s]);}[Symbol.iterator](){return this._entries()}*_entries(){for(let[e,r]of this.map)for(let n of r)yield [e,n];}entries(){return new ii.PonyfillIteratorObject(this._entries(),"FormDataIterator")}_keys(){return this.map.keys()}keys(){return new ii.PonyfillIteratorObject(this._keys(),"FormDataIterator")}*_values(){for(let e of this.map.values())for(let r of e)yield r;}values(){return new ii.PonyfillIteratorObject(this._values(),"FormDataIterator")}forEach(e){for(let[r,n]of this)e(n,r,this);}};Kt.PonyfillFormData=oi;function nb(t,e="---"){let r,n=false,s,i=false;function o(a){let{done:c,value:l}=r.next();if(c)return a.enqueue(ot.Buffer.from(`\r
|
|
8
8
|
--${e}--\r
|
|
9
9
|
`)),a.close();if(i&&a.enqueue(ot.Buffer.from(`\r
|
|
10
10
|
--${e}\r
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
`)),a.enqueue(ot.Buffer.from(`Content-Type: ${h.type||"application/octet-stream"}\r
|
|
15
15
|
\r
|
|
16
16
|
`)),s=h.stream()[Symbol.asyncIterator]();}i=true;}}return new rb.PonyfillReadableStream({start:()=>{r=t.entries();},pull:a=>n?s?s.next().then(({done:c,value:l})=>(c&&(s=void 0),l?a.enqueue(l):o(a))):o(a):(n=true,a.enqueue(ot.Buffer.from(`--${e}\r
|
|
17
|
-
`))),cancel:a=>{r?.return?.(a),s?.return?.(a);}})}function Tc(t,e,r){return Object.defineProperty(e,"name",{configurable:true,enumerable:true,value:r||e.name||t}),e}function kc(t){return t?.arrayBuffer!=null}});var tn=chunkBUNLC3II_cjs.c(en=>{chunkBUNLC3II_cjs.h();Object.defineProperty(en,"__esModule",{value:true});en.PonyfillBody=void 0;var ke=chunkBUNLC3II_cjs.a("buffer"),je=chunkBUNLC3II_cjs.a("stream"),sb=jl(),Xr=ze(),Tt=Gr(),ib=Ys(),Cc=ai(),De=vt(),ne=me(),J;(function(t){t.ReadableStream="ReadableStream",t.Blob="Blob",t.FormData="FormData",t.String="String",t.Readable="Readable",t.Buffer="Buffer",t.AsyncIterable="AsyncIterable";})(J||(J={}));var li=class{bodyInit;options;bodyUsed=false;contentType=null;contentLength=null;constructor(e,r={}){this.bodyInit=e,this.options=r;let{bodyFactory:n,contentType:s,contentLength:i,bodyType:o,buffer:a}=ob(e);this._bodyFactory=n,this.contentType=s,this.contentLength=i,this.bodyType=o,this._buffer=a,this._signal=r.signal;}bodyType;_bodyFactory=()=>null;_generatedBody=null;_buffer;_signal;generateBody(){if(this._generatedBody?.readable?.destroyed&&this._buffer&&(this._generatedBody.readable=je.Readable.from(this._buffer)),this._generatedBody)return this._generatedBody;let e=this._bodyFactory();return this._generatedBody=e,e}handleContentLengthHeader(e=false){let r=this.headers.get("content-type");r?this.contentType=r:this.contentType&&this.headers.set("content-type",this.contentType);let n=this.headers.get("content-length");e&&this.bodyInit==null&&!n&&(this.contentLength=0,this.headers.set("content-length","0")),n?this.contentLength=parseInt(n,10):this.contentLength&&this.headers.set("content-length",this.contentLength.toString());}get body(){let e=this.generateBody();if(e!=null){let r=e,n=e.readable;return new Proxy(e.readable,{get(s,i){if(i in r){let o=r[i];return typeof o=="function"?o.bind(r):o}if(i in n){let o=n[i];return typeof o=="function"?o.bind(n):o}}})}return null}_chunks=null;_doCollectChunksFromReadableJob(){if(this.bodyType===J.AsyncIterable){if(Array.fromAsync)return (0, Xr.handleMaybePromise)(()=>Array.fromAsync(this.bodyInit),o=>(this._chunks=o,this._chunks));let n=this.bodyInit[Symbol.asyncIterator](),s=[],i=()=>(0, Xr.handleMaybePromise)(()=>n.next(),({value:o,done:a})=>(o&&s.push(o),a?(this._chunks=s,this._chunks):i()));return i()}let e=this.generateBody();if(!e)return this._chunks=[],(0, ne.fakePromise)(this._chunks);if(e.readable.destroyed)return (0, ne.fakePromise)(this._chunks=[]);let r=[];return new Promise((n,s)=>{e.readable.on("data",i=>{r.push(i);}),e.readable.once("error",s),e.readable.once("end",()=>{n(this._chunks=r);});})}_collectChunksFromReadable(){return this._chunks?(0, ne.fakePromise)(this._chunks):(this._chunks||=this._doCollectChunksFromReadableJob(),this._chunks)}_blob=null;blob(){return this._blob?(0, ne.fakePromise)(this._blob):(this.bodyType===J.String&&(this._text=this.bodyInit,this._blob=new Tt.PonyfillBlob([this._text],{type:this.contentType||"text/plain;charset=UTF-8",size:this.contentLength})),this.bodyType===J.Blob?(this._blob=this.bodyInit,(0, ne.fakePromise)(this._blob)):this._buffer?(this._blob=new Tt.PonyfillBlob([this._buffer],{type:this.contentType||"",size:this.contentLength}),(0, ne.fakePromise)(this._blob)):(0, ne.fakePromise)((0, Xr.handleMaybePromise)(()=>this._collectChunksFromReadable(),e=>(this._blob=new Tt.PonyfillBlob(e,{type:this.contentType||"",size:this.contentLength}),this._blob))))}_formData=null;formData(e){if(this._formData)return (0, ne.fakePromise)(this._formData);if(this.bodyType===J.FormData)return this._formData=this.bodyInit,(0, ne.fakePromise)(this._formData);if(this._formData=new Cc.PonyfillFormData,this.generateBody()==null)return (0, ne.fakePromise)(this._formData);let n={...this.options.formDataLimits,...e?.formDataLimits};return new Promise((s,i)=>{let o=this.body?.readable;if(!o)return i(new Error("No stream available"));let a=null,c=new sb.Busboy({headers:{"content-length":typeof this.contentLength=="number"?this.contentLength.toString():this.contentLength||"","content-type":this.contentType||""},limits:n,defCharset:"utf-8"});this._signal&&(0, je.addAbortSignal)(this._signal,c);let l=false,u=h=>{l||(l=true,o.unpipe(c),c.destroy(),a&&(a.destroy(),a=null),h?i(h):s(this._formData));};o.on("error",u),c.on("field",(h,d,p,x)=>{if(p)return u(new Error(`Field name size exceeded: ${n?.fieldNameSize} bytes`));if(x)return u(new Error(`Field value size exceeded: ${n?.fieldSize} bytes`));this._formData.set(h,d);}),c.on("file",(h,d,p,x,S)=>{a=d;let R=[];d.on("data",C=>{R.push(C);}),d.on("error",u),d.on("limit",()=>{u(new Error(`File size limit exceeded: ${n?.fileSize} bytes`));}),d.on("close",()=>{d.truncated&&u(new Error(`File size limit exceeded: ${n?.fileSize} bytes`)),a=null;let C=new ib.PonyfillFile(R,p,{type:S});this._formData.set(h,C);});}),c.on("fieldsLimit",()=>{u(new Error(`Fields limit exceeded: ${n?.fields}`));}),c.on("filesLimit",()=>{u(new Error(`Files limit exceeded: ${n?.files}`));}),c.on("partsLimit",()=>{u(new Error(`Parts limit exceeded: ${n?.parts}`));}),c.on("end",u),c.on("finish",u),c.on("close",u),c.on("error",u),o.pipe(c);})}buffer(){if(this._buffer)return (0, ne.fakePromise)(this._buffer);if(this._text)return this._buffer=ke.Buffer.from(this._text,"utf-8"),(0, ne.fakePromise)(this._buffer);if(this.bodyType===J.String)return this.text().then(e=>(this._text=e,this._buffer=ke.Buffer.from(e,"utf-8"),this._buffer));if(this.bodyType===J.Blob){if((0, Tt.hasBufferMethod)(this.bodyInit))return this.bodyInit.buffer().then(e=>(this._buffer=e,this._buffer));if((0, Tt.hasBytesMethod)(this.bodyInit))return this.bodyInit.bytes().then(e=>(this._buffer=ke.Buffer.from(e),this._buffer));if((0, Tt.hasArrayBufferMethod)(this.bodyInit))return this.bodyInit.arrayBuffer().then(e=>(this._buffer=ke.Buffer.from(e,void 0,e.byteLength),this._buffer))}return (0, ne.fakePromise)((0, Xr.handleMaybePromise)(()=>this._collectChunksFromReadable(),e=>e.length===1?(this._buffer=e[0],this._buffer):(this._buffer=ke.Buffer.concat(e),this._buffer)))}bytes(){return this.buffer()}arrayBuffer(){return this.buffer()}_json=null;json(){return this._json?(0, ne.fakePromise)(this._json):this.text().then(e=>{try{this._json=JSON.parse(e);}catch(r){throw r instanceof SyntaxError&&(r.message+=`, "${e}" is not valid JSON`),r}return this._json})}_text=null;text(){return this._text?(0, ne.fakePromise)(this._text):this.bodyType===J.String?(this._text=this.bodyInit,(0, ne.fakePromise)(this._text)):this.buffer().then(e=>(this._text=e.toString("utf-8"),this._text))}};en.PonyfillBody=li;function ob(t){if(t==null)return {bodyFactory:()=>null,contentType:null,contentLength:null};if(typeof t=="string"){let e=ke.Buffer.byteLength(t);return {bodyType:J.String,contentType:"text/plain;charset=UTF-8",contentLength:e,bodyFactory(){let r=je.Readable.from(ke.Buffer.from(t,"utf-8"));return new De.PonyfillReadableStream(r)}}}if(ke.Buffer.isBuffer(t)){let e=t;return {bodyType:J.Buffer,contentType:null,contentLength:t.length,buffer:t,bodyFactory(){let r=je.Readable.from(e);return new De.PonyfillReadableStream(r)}}}if((0, ne.isArrayBufferView)(t)){let e=ke.Buffer.from(t.buffer,t.byteOffset,t.byteLength);return {bodyType:J.Buffer,contentLength:t.byteLength,contentType:null,buffer:e,bodyFactory(){let r=je.Readable.from(e);return new De.PonyfillReadableStream(r)}}}if(t instanceof De.PonyfillReadableStream&&t.readable!=null){let e=t;return {bodyType:J.ReadableStream,bodyFactory:()=>e,contentType:null,contentLength:null}}if(lb(t)){let e=t;return {bodyType:J.Blob,contentType:t.type,contentLength:t.size,bodyFactory(){return e.stream()}}}if(t instanceof ArrayBuffer){let e=t.byteLength,r=ke.Buffer.from(t,void 0,t.byteLength);return {bodyType:J.Buffer,contentType:null,contentLength:e,buffer:r,bodyFactory(){let n=je.Readable.from(r);return new De.PonyfillReadableStream(n)}}}if(t instanceof je.Readable)return {bodyType:J.Readable,contentType:null,contentLength:null,bodyFactory(){return new De.PonyfillReadableStream(t)}};if(cb(t))return {bodyType:J.String,contentType:"application/x-www-form-urlencoded;charset=UTF-8",contentLength:null,bodyFactory(){return new De.PonyfillReadableStream(je.Readable.from(t.toString()))}};if(ab(t)){let e=Math.random().toString(36).substr(2),r=`multipart/form-data; boundary=${e}`;return {bodyType:J.FormData,contentType:r,contentLength:null,bodyFactory(){return (0, Cc.getStreamFromFormData)(t,e)}}}if(ub(t))return {contentType:null,contentLength:null,bodyFactory(){return new De.PonyfillReadableStream(t)}};if(t[Symbol.iterator]||t[Symbol.asyncIterator])return {contentType:null,contentLength:null,bodyType:J.AsyncIterable,bodyFactory(){let e=je.Readable.from(t);return new De.PonyfillReadableStream(e)}};throw new Error("Unknown body type")}function ab(t){return t?.forEach!=null}function lb(t){return t?.stream!=null&&typeof t.stream=="function"}function cb(t){return t?.sort!=null}function ub(t){return t?.getReader!=null}});var rn=chunkBUNLC3II_cjs.c(Qt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Qt,"__esModule",{value:true});Qt.PonyfillHeaders=void 0;Qt.isHeadersLike=Ve;var fb=chunkBUNLC3II_cjs.a("util"),ci=Yr();function Ve(t){return t?.get&&t?.forEach}var ui=class{headersInit;_map;objectNormalizedKeysOfHeadersInit=[];objectOriginalKeysOfHeadersInit=[];_setCookies;constructor(e){this.headersInit=e;}_get(e){let r=e.toLowerCase();if(r==="set-cookie"&&this._setCookies?.length)return this._setCookies.join(", ");if(this._map)return this._map.get(r)||null;if(this.headersInit==null)return null;if(Array.isArray(this.headersInit)){let n=this.headersInit.filter(([s])=>s.toLowerCase()===r);return n.length===0?null:n.length===1?n[0][1]:n.map(([,s])=>s).join(", ")}else {if(Ve(this.headersInit))return this.headersInit.get(r);{let n=this.headersInit[e]||this.headersInit[r];if(n!=null)return n;this.objectNormalizedKeysOfHeadersInit.length||Object.keys(this.headersInit).forEach(o=>{this.objectOriginalKeysOfHeadersInit.push(o),this.objectNormalizedKeysOfHeadersInit.push(o.toLowerCase());});let s=this.objectNormalizedKeysOfHeadersInit.indexOf(r);if(s===-1)return null;let i=this.objectOriginalKeysOfHeadersInit[s];return this.headersInit[i]}}}getMap(){if(!this._map)if(this._setCookies||=[],this.headersInit!=null)if(Array.isArray(this.headersInit)){this._map=new Map;for(let[e,r]of this.headersInit){let n=e.toLowerCase();if(n==="set-cookie"){Array.isArray(r)?this._setCookies.push(...r):r!=null&&this._setCookies.push(r);continue}this._map.set(n,r);}}else if(Ve(this.headersInit))this._map=new Map,this.headersInit.forEach((e,r)=>{if(r==="set-cookie"){this._setCookies||=[],Array.isArray(e)?this._setCookies.push(...e):e!=null&&this._setCookies.push(e);return}this._map.set(r,e);});else {this._map=new Map;for(let e in this.headersInit){let r=this.headersInit[e];if(r!=null){let n=e.toLowerCase();if(n==="set-cookie"){if(this._setCookies||=[],Array.isArray(r)){this._setCookies.push(...r);continue}this._setCookies.push(r);continue}this._map.set(n,r);}}}else this._map=new Map;return this._map}append(e,r){let n=e.toLowerCase();if(n==="set-cookie"){this._setCookies||=[],this._setCookies.push(r);return}let s=this.getMap().get(n),i=s?`${s}, ${r}`:r;this.getMap().set(n,i);}get(e){let r=this._get(e);return r==null?null:r.toString()}has(e){return e.toLowerCase()==="set-cookie"?!!this._setCookies?.length:!!this._get(e)}set(e,r){let n=e.toLowerCase();if(n==="set-cookie"){this._setCookies=[r];return}if(!this._map&&this.headersInit!=null)if(Array.isArray(this.headersInit)){let s=this.headersInit.find(([i])=>i.toLowerCase()===n);s?s[1]=r:this.headersInit.push([n,r]);return}else if(Ve(this.headersInit)){this.headersInit.set(n,r);return}else {this.headersInit[n]=r;return}this.getMap().set(n,r);}delete(e){let r=e.toLowerCase();if(r==="set-cookie"){this._setCookies=[];return}this.getMap().delete(r);}forEach(e){if(this._setCookies?.forEach(r=>{e(r,"set-cookie",this);}),!this._map){if(this.headersInit){if(Array.isArray(this.headersInit)){this.headersInit.forEach(([r,n])=>{e(n,r,this);});return}if(Ve(this.headersInit)){this.headersInit.forEach(e);return}Object.entries(this.headersInit).forEach(([r,n])=>{n!=null&&e(n,r,this);});}return}this.getMap().forEach((r,n)=>{e(r,n,this);});}*_keys(){if(this._setCookies?.length&&(yield "set-cookie"),!this._map&&this.headersInit){if(Array.isArray(this.headersInit)){yield*this.headersInit.map(([e])=>e)[Symbol.iterator]();return}if(Ve(this.headersInit)){yield*this.headersInit.keys();return}yield*Object.keys(this.headersInit)[Symbol.iterator]();return}yield*this.getMap().keys();}keys(){return new ci.PonyfillIteratorObject(this._keys(),"HeadersIterator")}*_values(){if(this._setCookies?.length&&(yield*this._setCookies),!this._map&&this.headersInit){if(Array.isArray(this.headersInit)){yield*this.headersInit.map(([,e])=>e)[Symbol.iterator]();return}if(Ve(this.headersInit)){yield*this.headersInit.values();return}yield*Object.values(this.headersInit)[Symbol.iterator]();return}yield*this.getMap().values();}values(){return new ci.PonyfillIteratorObject(this._values(),"HeadersIterator")}*_entries(){if(this._setCookies?.length&&(yield*this._setCookies.map(e=>["set-cookie",e])),!this._map&&this.headersInit){if(Array.isArray(this.headersInit)){yield*this.headersInit;return}if(Ve(this.headersInit)){yield*this.headersInit.entries();return}yield*Object.entries(this.headersInit);return}yield*this.getMap().entries();}entries(){return new ci.PonyfillIteratorObject(this._entries(),"HeadersIterator")}getSetCookie(){return this._setCookies||this.getMap(),this._setCookies}[Symbol.iterator](){return this.entries()}[Symbol.for("nodejs.util.inspect.custom")](){let e={};return this.forEach((r,n)=>{n==="set-cookie"?e["set-cookie"]=this._setCookies||[]:e[n]=r?.includes(",")?r.split(",").map(s=>s.trim()):r;}),`Headers ${(0, fb.inspect)(e)}`}};Qt.PonyfillHeaders=ui;});var Jt=chunkBUNLC3II_cjs.c(nn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(nn,"__esModule",{value:true});nn.PonyfillResponse=void 0;var hb=chunkBUNLC3II_cjs.a("http"),db=tn(),fi=rn(),Zt="application/json; charset=utf-8",hi=class t extends db.PonyfillBody{headers;constructor(e,r){super(e||null,r),this.headers=r?.headers&&(0, fi.isHeadersLike)(r.headers)?r.headers:new fi.PonyfillHeaders(r?.headers),this.status=r?.status||200,this.statusText=r?.statusText||hb.STATUS_CODES[this.status]||"OK",this.url=r?.url||"",this.redirected=r?.redirected||false,this.type=r?.type||"default",this.handleContentLengthHeader();}get ok(){return this.status>=200&&this.status<300}status;statusText;url;redirected;type;clone(){return this}static error(){return new t(null,{status:500,statusText:"Internal Server Error"})}static redirect(e,r=302){if(r<300||r>399)throw new RangeError("Invalid status code");return new t(null,{headers:{location:e},status:r})}static json(e,r){let n=JSON.stringify(e);if(!r)r={headers:{"content-type":Zt,"content-length":Buffer.byteLength(n).toString()}};else if(!r.headers)r.headers={"content-type":Zt,"content-length":Buffer.byteLength(n).toString()};else if((0, fi.isHeadersLike)(r.headers))r.headers.has("content-type")||r.headers.set("content-type",Zt),r.headers.has("content-length")||r.headers.set("content-length",Buffer.byteLength(n).toString());else if(Array.isArray(r.headers)){let s=false,i=false;for(let[o]of r.headers){if(i&&s)break;!s&&o.toLowerCase()==="content-type"?s=true:!i&&o.toLowerCase()==="content-length"&&(i=true);}s||r.headers.push(["content-type",Zt]),i||r.headers.push(["content-length",Buffer.byteLength(n).toString()]);}else typeof r.headers=="object"&&(r.headers?.["content-type"]==null&&(r.headers["content-type"]=Zt),r.headers?.["content-length"]==null&&(r.headers["content-length"]=Buffer.byteLength(n).toString()));return new t(n,r)}[Symbol.toStringTag]="Response"};nn.PonyfillResponse=hi;});var Ac=chunkBUNLC3II_cjs.c(pi=>{chunkBUNLC3II_cjs.h();Object.defineProperty(pi,"__esModule",{value:true});pi.fetchCurl=yb;var Rc=chunkBUNLC3II_cjs.a("stream"),pb=chunkBUNLC3II_cjs.a("tls"),mb=ze(),bb=Jt(),di=me();function yb(t){let{Curl:e,CurlFeature:r,CurlPause:n,CurlProgressFunc:s}=globalThis.libcurl,i=new e;i.enable(r.NoDataParsing),i.setOpt("URL",t.url),process.env.NODE_TLS_REJECT_UNAUTHORIZED==="0"&&i.setOpt("SSL_VERIFYPEER",false),process.env.NODE_EXTRA_CA_CERTS?i.setOpt("CAINFO",process.env.NODE_EXTRA_CA_CERTS):i.setOpt("CAINFO_BLOB",pb.rootCertificates.join(`
|
|
18
|
-
`)),i.enable(r.StreamResponse);let o;if(t._signal===null?o=void 0:t._signal&&(o=t._signal),i.setStreamProgressCallback(function(){return o?.aborted?process.env.DEBUG?s.Continue:1:0}),t.bodyType==="String")i.setOpt("POSTFIELDS",t.bodyInit);else {let p=t.body!=null?(0, di.isNodeReadable)(t.body)?t.body:Rc.Readable.from(t.body):null;p&&(i.setOpt("UPLOAD",true),i.setUploadStream(p));}process.env.DEBUG&&i.setOpt("VERBOSE",true),i.setOpt("TRANSFER_ENCODING",false),i.setOpt("HTTP_TRANSFER_DECODING",true),i.setOpt("FOLLOWLOCATION",t.redirect==="follow"),i.setOpt("MAXREDIRS",20),i.setOpt("ACCEPT_ENCODING",""),i.setOpt("CUSTOMREQUEST",t.method);let a=t.headersSerializer||di.defaultHeadersSerializer,c,l=a(t.headers,p=>{c=Number(p);});c!=null&&i.setOpt("INFILESIZE",c),i.setOpt("HTTPHEADER",l),i.enable(r.NoHeaderParsing);let u=(0, mb.createDeferredPromise)(),h;function d(){if(i.isOpen)try{i.pause(n.Recv);}catch(p){u.reject(p);}}return o?.addEventListener("abort",d,{once:true}),i.once("end",function(){try{i.close();}catch(x){u.reject(x);}o?.removeEventListener("abort",d);}),i.once("error",function(x){h&&!h.closed&&!h.destroyed?h.destroy(x):(x.message==="Operation was aborted by an application callback"&&(x.message="The operation was aborted."),u.reject(x));try{i.close();}catch(S){u.reject(S);}}),i.once("stream",function(x,S,R){let C=x.pipe(new Rc.PassThrough,{end:true}),E=R.toString("utf8").split(/\r?\n|\r/g).filter(w=>w&&!w.startsWith("HTTP/")?(t.redirect==="error"&&w.toLowerCase().includes("location")&&(0, di.shouldRedirect)(S)&&(x.destroyed||x.resume(),C.destroy(),u.reject(new Error("redirect is not allowed"))),true):false).map(w=>w.split(/:\s(.+)/).slice(0,2)),T=new bb.PonyfillResponse(C,{status:S,headers:E,url:i.getInfo(e.info.REDIRECT_URL)?.toString()||t.url,redirected:Number(i.getInfo(e.info.REDIRECT_COUNT))>0});u.resolve(T),h=C;}),setImmediate(()=>{i.perform();}),u.promise}});var Yt=chunkBUNLC3II_cjs.c(sn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(sn,"__esModule",{value:true});sn.PonyfillURL=void 0;var gb=(it(),chunkBUNLC3II_cjs.f(st)),xb=gb.__importDefault(chunkBUNLC3II_cjs.a("buffer")),_b=chunkBUNLC3II_cjs.a("crypto"),Lc=globalThis.URL,mi=class extends Lc{static blobRegistry=new Map;static createObjectURL(e){let r=`blob:whatwgnode:${(0, _b.randomUUID)()}`;return this.blobRegistry.set(r,e),r}static revokeObjectURL(e){this.blobRegistry.has(e)?this.blobRegistry.delete(e):Lc.revokeObjectURL(e);}static getBlobFromURL(e){return this.blobRegistry.get(e)||xb.default?.resolveObjectURL?.(e)}};sn.PonyfillURL=mi;});var an=chunkBUNLC3II_cjs.c(on=>{chunkBUNLC3II_cjs.h();Object.defineProperty(on,"__esModule",{value:true});on.PonyfillRequest=void 0;var wb=chunkBUNLC3II_cjs.a("http"),Sb=chunkBUNLC3II_cjs.a("https"),Eb=tn(),Oc=rn(),Pb=Yt();function vb(t){return t[Symbol.toStringTag]==="Request"}function Tb(t){return t?.href!=null}var bi=class extends Eb.PonyfillBody{constructor(e,r){let n,s,i=null,o;if(typeof e=="string"?n=e:Tb(e)?s=e:vb(e)&&(e._parsedUrl?s=e._parsedUrl:e._url?n=e._url:n=e.url,i=e.body,o=e),r!=null&&(i=r.body||null,o=r),super(i,o),this._url=n,this._parsedUrl=s,this.cache=o?.cache||"default",this.credentials=o?.credentials||"same-origin",this.headers=o?.headers&&(0, Oc.isHeadersLike)(o.headers)?o.headers:new Oc.PonyfillHeaders(o?.headers),this.integrity=o?.integrity||"",this.keepalive=o?.keepalive!=null?o?.keepalive:false,this.method=o?.method?.toUpperCase()||"GET",this.mode=o?.mode||"cors",this.redirect=o?.redirect||"follow",this.referrer=o?.referrer||"about:client",this.referrerPolicy=o?.referrerPolicy||"no-referrer",this.headersSerializer=o?.headersSerializer,this.duplex=o?.duplex||"half",this.destination="document",this.priority="auto",this.method!=="GET"&&this.method!=="HEAD"&&this.handleContentLengthHeader(true),o?.agent!=null){let a=s?.protocol||n||this.url;o.agent===false?this.agent=false:a.startsWith("http:")&&o.agent instanceof wb.Agent?this.agent=o.agent:a.startsWith("https:")&&o.agent instanceof Sb.Agent&&(this.agent=o.agent);}}headersSerializer;cache;credentials;destination;headers;integrity;keepalive;method;mode;priority;redirect;referrer;referrerPolicy;_url;get signal(){return this._signal||=new AbortController().signal,this._signal}get url(){if(this._url==null)if(this._parsedUrl)this._url=this._parsedUrl.toString();else throw new TypeError("Invalid URL");return this._url}_parsedUrl;get parsedUrl(){if(this._parsedUrl==null)if(this._url!=null)this._parsedUrl=new Pb.PonyfillURL(this._url,"http://localhost");else throw new TypeError("Invalid URL");return this._parsedUrl}duplex;agent;clone(){return this}[Symbol.toStringTag]="Request"};on.PonyfillRequest=bi;});var qc=chunkBUNLC3II_cjs.c(yi=>{chunkBUNLC3II_cjs.h();Object.defineProperty(yi,"__esModule",{value:true});yi.fetchNodeHttp=jc;var kb=(it(),chunkBUNLC3II_cjs.f(st)),Dc=chunkBUNLC3II_cjs.a("http"),Cb=chunkBUNLC3II_cjs.a("https"),Fc=chunkBUNLC3II_cjs.a("stream"),kt=kb.__importDefault(chunkBUNLC3II_cjs.a("zlib")),Ic=ze(),Rb=an(),Ab=Jt(),Lb=Yt(),Ce=me();function Ob(t){if(t.startsWith("http:"))return Dc.request;if(t.startsWith("https:"))return Cb.request;throw new Error(`Unsupported protocol: ${t.split(":")[0]||t}`)}function jc(t){return new Promise((e,r)=>{try{let n=Ob(t.parsedUrl?.protocol||t.url),i=(t.headersSerializer||Ce.getHeadersObj)(t.headers);i["accept-encoding"]||=Ce.DEFAULT_ACCEPT_ENCODING,i["user-agent"]==null&&i["User-Agent"]==null&&(i["user-agent"]="node");let o;t._signal==null?o=void 0:t._signal&&(o=t._signal);let a;if(t.parsedUrl?a=n(t.parsedUrl,{method:t.method,headers:i,signal:o,agent:t.agent}):a=n(t.url,{method:t.method,headers:i,signal:o,agent:t.agent}),a.once("error",r),a.once("response",c=>{let l;switch(c.headers["content-encoding"]){case "x-gzip":case "gzip":l=kt.default.createGunzip();break;case "x-deflate":case "deflate":l=kt.default.createInflate();break;case "x-deflate-raw":case "deflate-raw":l=kt.default.createInflateRaw();break;case "br":l=kt.default.createBrotliDecompress();break;case "zstd":kt.default.createZstdDecompress!=null&&(l=kt.default.createZstdDecompress());break}if(c.headers.location&&(0,Ce.shouldRedirect)(c.statusCode)){if(t.redirect==="error"){let x=new Error("Redirects are not allowed");r(x),c.resume();return}if(t.redirect==="follow"){let x=new Lb.PonyfillURL(c.headers.location,t.parsedUrl||t.url),S=jc(new Rb.PonyfillRequest(x,t));e(S.then(R=>(R.redirected=!0,R))),c.resume();return}}l||=new Fc.PassThrough,(0,Ce.pipeThrough)({src:c,dest:l,signal:o,onError:x=>{c.destroyed||c.destroy(x),l.destroyed||l.destroy(x),r(x);}});let h=c.statusCode||200,d=c.statusMessage||Dc.STATUS_CODES[h];d==null&&(d="");let p=new Ab.PonyfillResponse(l||c,{status:h,statusText:d,headers:c.headers,url:t.url,signal:o});e(p);}),t._buffer!=null)(0,Ic.handleMaybePromise)(()=>(0,Ce.safeWrite)(t._buffer,a),()=>(0,Ce.endStream)(a),r);else if(t.bodyType==="String")(0,Ic.handleMaybePromise)(()=>(0,Ce.safeWrite)(t.bodyInit,a),()=>(0,Ce.endStream)(a),r);else {let c=t.body!=null?(0,Ce.isNodeReadable)(t.body)?t.body:Fc.Readable.from(t.body):null;c?c.pipe(a):(0,Ce.endStream)(a);}}catch(n){r(n);}})}});var $c=chunkBUNLC3II_cjs.c(gi=>{chunkBUNLC3II_cjs.h();Object.defineProperty(gi,"__esModule",{value:true});gi.fetchPonyfill=Bc;var Fb=chunkBUNLC3II_cjs.a("buffer"),ln=chunkBUNLC3II_cjs.a("fs"),Ib=chunkBUNLC3II_cjs.a("url"),Db=Ac(),jb=qc(),qb=an(),Ct=Jt(),Ub=Yt(),Uc=me(),Mc=";base64";async function Mb(t){let e=(0, Ib.fileURLToPath)(t);try{await ln.promises.access(e,ln.promises.constants.R_OK);let r=await ln.promises.stat(e,{bigint:!0}),n=(0,ln.createReadStream)(e);return new Ct.PonyfillResponse(n,{status:200,statusText:"OK",headers:{"content-type":"application/octet-stream","last-modified":r.mtime.toUTCString()}})}catch(r){if(r.code==="ENOENT")return new Ct.PonyfillResponse(null,{status:404,statusText:"Not Found"});if(r.code==="EACCES")return new Ct.PonyfillResponse(null,{status:403,statusText:"Forbidden"});throw r}}function Bb(t){let[e="text/plain",...r]=t.substring(5).split(","),n=decodeURIComponent(r.join(","));if(e.endsWith(Mc)){let s=Fb.Buffer.from(n,"base64url"),i=e.slice(0,-Mc.length);return new Ct.PonyfillResponse(s,{status:200,statusText:"OK",headers:{"content-type":i}})}return new Ct.PonyfillResponse(n,{status:200,statusText:"OK",headers:{"content-type":e}})}function $b(t){let e=Ub.PonyfillURL.getBlobFromURL(t);if(!e)throw new TypeError("Invalid Blob URL");return new Ct.PonyfillResponse(e,{status:200,headers:{"content-type":e.type,"content-length":e.size.toString()}})}function Nb(t){return t!=null&&t.href!=null}function Bc(t,e){if(typeof t=="string"||Nb(t)){let n=new qb.PonyfillRequest(t,e);return Bc(n)}let r=t;if(r.url.startsWith("data:")){let n=Bb(r.url);return (0, Uc.fakePromise)(n)}if(r.url.startsWith("file:"))return Mb(r.url);if(r.url.startsWith("blob:")){let n=$b(r.url);return (0, Uc.fakePromise)(n)}return globalThis.libcurl&&!r.agent?(0, Db.fetchCurl)(r):(0, jb.fetchNodeHttp)(r)}});var wi=chunkBUNLC3II_cjs.c(at=>{chunkBUNLC3II_cjs.h();Object.defineProperty(at,"__esModule",{value:true});at.PonyfillTextDecoder=at.PonyfillTextEncoder=void 0;at.PonyfillBtoa=Hb;var Xt=chunkBUNLC3II_cjs.a("buffer"),Gb=me(),xi=class{encoding;constructor(e="utf-8"){this.encoding=e;}encode(e){return Xt.Buffer.from(e,this.encoding)}encodeInto(e,r){let s=this.encode(e).copy(r);return {read:s,written:s}}};at.PonyfillTextEncoder=xi;var _i=class{encoding;fatal=false;ignoreBOM=false;constructor(e="utf-8",r){this.encoding=e,r&&(this.fatal=r.fatal||false,this.ignoreBOM=r.ignoreBOM||false);}decode(e){return Xt.Buffer.isBuffer(e)?e.toString(this.encoding):(0, Gb.isArrayBufferView)(e)?Xt.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(this.encoding):Xt.Buffer.from(e).toString(this.encoding)}};at.PonyfillTextDecoder=_i;function Hb(t){return Xt.Buffer.from(t,"binary").toString("base64")}});var Nc=chunkBUNLC3II_cjs.c(cn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(cn,"__esModule",{value:true});cn.PonyfillURLSearchParams=void 0;cn.PonyfillURLSearchParams=globalThis.URLSearchParams;});var Pi=chunkBUNLC3II_cjs.c(fn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(fn,"__esModule",{value:true});fn.PonyfillWritableStream=void 0;var un=chunkBUNLC3II_cjs.a("events"),Si=chunkBUNLC3II_cjs.a("stream"),Gc=ze(),We=me(),Ei=class{writable;constructor(e){if(e instanceof Si.Writable)this.writable=e;else if(e){let r=new Si.Writable({write(i,o,a){try{let c=e.write?.(i,s);c instanceof Promise?c.then(()=>{a();},l=>{a(l);}):a();}catch(c){a(c);}},final(i){let o=e.close?.();o instanceof Promise?o.then(()=>{i();},a=>{i(a);}):i();}});this.writable=r;let n=new AbortController,s={signal:n.signal,error(i){r.destroy(i);}};r.once("error",i=>n.abort(i)),r.once("close",()=>n.abort());}else this.writable=new Si.Writable;}getWriter(){let e=this.writable;return {get closed(){return (0, un.once)(e,"close")},get desiredSize(){return e.writableLength},get ready(){return (0, un.once)(e,"drain")},releaseLock(){},write(r){let n=(0, We.fakePromise)();return r==null?n:n.then(()=>(0, We.safeWrite)(r,e))},close(){return !e.errored&&e.closed?(0, We.fakePromise)():e.errored?(0, Gc.fakeRejectPromise)(e.errored):(0, We.fakePromise)().then(()=>(0, We.endStream)(e))},abort(r){return e.destroy(r),(0, un.once)(e,"close")}}}close(){return !this.writable.errored&&this.writable.closed?(0, We.fakePromise)():this.writable.errored?(0, Gc.fakeRejectPromise)(this.writable.errored):(0, We.fakePromise)().then(()=>(0, We.endStream)(this.writable))}abort(e){return this.writable.destroy(e),(0, un.once)(this.writable,"close")}locked=false};fn.PonyfillWritableStream=Ei;});var er=chunkBUNLC3II_cjs.c(hn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(hn,"__esModule",{value:true});hn.PonyfillTransformStream=void 0;var vi=chunkBUNLC3II_cjs.a("stream"),zb=vt(),Vb=me(),Wb=Pi(),Ti=class{transform;writable;readable;constructor(e){if(e instanceof vi.Transform)this.transform=e;else if(e){let r={enqueue(s){n.push(s);},error(s){n.destroy(s);},terminate(){(0, Vb.endStream)(n);},get desiredSize(){return n.writableLength}},n=new vi.Transform({read(){},write(s,i,o){try{let a=e.transform?.(s,r);a instanceof Promise?a.then(()=>{o();},c=>{o(c);}):o();}catch(a){o(a);}},final(s){try{let i=e.flush?.(r);i instanceof Promise?i.then(()=>{s();},o=>{s(o);}):s();}catch(i){s(i);}}});this.transform=n;}else this.transform=new vi.Transform;this.writable=new Wb.PonyfillWritableStream(this.transform),this.readable=new zb.PonyfillReadableStream(this.transform);}};hn.PonyfillTransformStream=Ti;});var Hc=chunkBUNLC3II_cjs.c(dn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(dn,"__esModule",{value:true});dn.PonyfillCompressionStream=void 0;var Kb=(it(),chunkBUNLC3II_cjs.f(st)),tr=Kb.__importDefault(chunkBUNLC3II_cjs.a("zlib")),Qb=er(),Zb=me(),ki=class extends Qb.PonyfillTransformStream{static supportedFormats=(0, Zb.getSupportedFormats)();constructor(e){switch(e){case "x-gzip":case "gzip":super(tr.default.createGzip());break;case "x-deflate":case "deflate":super(tr.default.createDeflate());break;case "deflate-raw":super(tr.default.createDeflateRaw());break;case "br":super(tr.default.createBrotliCompress());break;case "zstd":super(tr.default.createZstdCompress());break;default:throw new Error(`Unsupported compression format: ${e}`)}}};dn.PonyfillCompressionStream=ki;});var zc=chunkBUNLC3II_cjs.c(pn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(pn,"__esModule",{value:true});pn.PonyfillDecompressionStream=void 0;var Jb=(it(),chunkBUNLC3II_cjs.f(st)),rr=Jb.__importDefault(chunkBUNLC3II_cjs.a("zlib")),Yb=er(),Xb=me(),Ci=class extends Yb.PonyfillTransformStream{static supportedFormats=(0, Xb.getSupportedFormats)();constructor(e){switch(e){case "x-gzip":case "gzip":super(rr.default.createGunzip());break;case "x-deflate":case "deflate":super(rr.default.createInflate());break;case "deflate-raw":super(rr.default.createInflateRaw());break;case "br":super(rr.default.createBrotliDecompress());break;case "zstd":super(rr.default.createZstdDecompress());break;default:throw new TypeError(`Unsupported compression format: '${e}'`)}}};pn.PonyfillDecompressionStream=Ci;});var Kc=chunkBUNLC3II_cjs.c(Rt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Rt,"__esModule",{value:true});Rt.PonyfillTextEncoderStream=Rt.PonyfillTextDecoderStream=void 0;var Vc=wi(),Wc=er(),Ri=class extends Wc.PonyfillTransformStream{textDecoder;constructor(e,r){super({transform:(n,s)=>s.enqueue(this.textDecoder.decode(n,{stream:true}))}),this.textDecoder=new Vc.PonyfillTextDecoder(e,r);}get encoding(){return this.textDecoder.encoding}get fatal(){return this.textDecoder.fatal}get ignoreBOM(){return this.textDecoder.ignoreBOM}};Rt.PonyfillTextDecoderStream=Ri;var Ai=class extends Wc.PonyfillTransformStream{textEncoder;constructor(e){super({transform:(r,n)=>n.enqueue(this.textEncoder.encode(r))}),this.textEncoder=new Vc.PonyfillTextEncoder(e);}get encoding(){return this.textEncoder.encoding}encode(e){return this.textEncoder.encode(e)}};Rt.PonyfillTextEncoderStream=Ai;});var Zc=chunkBUNLC3II_cjs.c(q=>{chunkBUNLC3II_cjs.h();Object.defineProperty(q,"__esModule",{value:true});q.TextEncoderStream=q.TextDecoderStream=q.IteratorObject=q.DecompressionStream=q.CompressionStream=q.TransformStream=q.WritableStream=q.URLSearchParams=q.URL=q.btoa=q.TextDecoder=q.TextEncoder=q.Blob=q.FormData=q.File=q.ReadableStream=q.Response=q.Request=q.Body=q.Headers=q.fetch=void 0;var ey=$c();Object.defineProperty(q,"fetch",{enumerable:true,get:function(){return ey.fetchPonyfill}});var ty=rn();Object.defineProperty(q,"Headers",{enumerable:true,get:function(){return ty.PonyfillHeaders}});var ry=tn();Object.defineProperty(q,"Body",{enumerable:true,get:function(){return ry.PonyfillBody}});var ny=an();Object.defineProperty(q,"Request",{enumerable:true,get:function(){return ny.PonyfillRequest}});var sy=Jt();Object.defineProperty(q,"Response",{enumerable:true,get:function(){return sy.PonyfillResponse}});var iy=vt();Object.defineProperty(q,"ReadableStream",{enumerable:true,get:function(){return iy.PonyfillReadableStream}});var oy=Ys();Object.defineProperty(q,"File",{enumerable:true,get:function(){return oy.PonyfillFile}});var ay=ai();Object.defineProperty(q,"FormData",{enumerable:true,get:function(){return ay.PonyfillFormData}});var ly=Gr();Object.defineProperty(q,"Blob",{enumerable:true,get:function(){return ly.PonyfillBlob}});var Li=wi();Object.defineProperty(q,"TextEncoder",{enumerable:true,get:function(){return Li.PonyfillTextEncoder}});Object.defineProperty(q,"TextDecoder",{enumerable:true,get:function(){return Li.PonyfillTextDecoder}});Object.defineProperty(q,"btoa",{enumerable:true,get:function(){return Li.PonyfillBtoa}});var cy=Yt();Object.defineProperty(q,"URL",{enumerable:true,get:function(){return cy.PonyfillURL}});var uy=Nc();Object.defineProperty(q,"URLSearchParams",{enumerable:true,get:function(){return uy.PonyfillURLSearchParams}});var fy=Pi();Object.defineProperty(q,"WritableStream",{enumerable:true,get:function(){return fy.PonyfillWritableStream}});var hy=er();Object.defineProperty(q,"TransformStream",{enumerable:true,get:function(){return hy.PonyfillTransformStream}});var dy=Hc();Object.defineProperty(q,"CompressionStream",{enumerable:true,get:function(){return dy.PonyfillCompressionStream}});var py=zc();Object.defineProperty(q,"DecompressionStream",{enumerable:true,get:function(){return py.PonyfillDecompressionStream}});var my=Yr();Object.defineProperty(q,"IteratorObject",{enumerable:true,get:function(){return my.PonyfillIteratorObject}});var Qc=Kc();Object.defineProperty(q,"TextDecoderStream",{enumerable:true,get:function(){return Qc.PonyfillTextDecoderStream}});Object.defineProperty(q,"TextEncoderStream",{enumerable:true,get:function(){return Qc.PonyfillTextEncoderStream}});});var Yc=chunkBUNLC3II_cjs.c((JS,Jc)=>{chunkBUNLC3II_cjs.h();var by=ps(),z;Jc.exports=function(e={}){let r={};if(r.URLPattern=globalThis.URLPattern,!r.URLPattern){let n=(Xa(),chunkBUNLC3II_cjs.f(Ya));r.URLPattern=n.URLPattern;}if(e.skipPonyfill||by())return {fetch:globalThis.fetch,Headers:globalThis.Headers,Request:globalThis.Request,Response:globalThis.Response,FormData:globalThis.FormData,ReadableStream:globalThis.ReadableStream,WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,CompressionStream:globalThis.CompressionStream,DecompressionStream:globalThis.DecompressionStream,TextDecoderStream:globalThis.TextDecoderStream,TextEncoderStream:globalThis.TextEncoderStream,Blob:globalThis.Blob,File:globalThis.File,crypto:globalThis.crypto,btoa:globalThis.btoa,TextEncoder:globalThis.TextEncoder,TextDecoder:globalThis.TextDecoder,URLPattern:r.URLPattern,URL:globalThis.URL,URLSearchParams:globalThis.URLSearchParams};if(z||=Zc(),r.fetch=z.fetch,r.Request=z.Request,r.Response=z.Response,r.Headers=z.Headers,r.FormData=z.FormData,r.ReadableStream=z.ReadableStream,r.URL=z.URL,r.URLSearchParams=z.URLSearchParams,r.WritableStream=z.WritableStream,r.TransformStream=z.TransformStream,r.CompressionStream=z.CompressionStream,r.DecompressionStream=z.DecompressionStream,r.TextDecoderStream=z.TextDecoderStream,r.TextEncoderStream=z.TextEncoderStream,r.Blob=z.Blob,r.File=z.File,r.crypto=globalThis.crypto,r.btoa=z.btoa,r.TextEncoder=z.TextEncoder,r.TextDecoder=z.TextDecoder,e.formDataLimits&&(r.Body=class extends z.Body{constructor(s,i){super(s,{formDataLimits:e.formDataLimits,...i});}},r.Request=class extends z.Request{constructor(s,i){super(s,{formDataLimits:e.formDataLimits,...i});}},r.Response=class extends z.Response{constructor(s,i){super(s,{formDataLimits:e.formDataLimits,...i});}}),!r.crypto){let n=chunkBUNLC3II_cjs.a("crypto");r.crypto=n.webcrypto;}return r};});var nr=chunkBUNLC3II_cjs.c((eu,W)=>{chunkBUNLC3II_cjs.h();var Xc=Yc(),yy=ps(),Q=Xc();if(!yy())try{let t="node-libcurl";globalThis.libcurl=globalThis.libcurl||chunkBUNLC3II_cjs.a(t);}catch{}W.exports.fetch=Q.fetch;W.exports.Headers=Q.Headers;W.exports.Request=Q.Request;W.exports.Response=Q.Response;W.exports.FormData=Q.FormData;W.exports.ReadableStream=Q.ReadableStream;W.exports.WritableStream=Q.WritableStream;W.exports.TransformStream=Q.TransformStream;W.exports.CompressionStream=Q.CompressionStream;W.exports.DecompressionStream=Q.DecompressionStream;W.exports.TextDecoderStream=Q.TextDecoderStream;W.exports.TextEncoderStream=Q.TextEncoderStream;W.exports.Blob=Q.Blob;W.exports.File=Q.File;W.exports.crypto=Q.crypto;W.exports.btoa=Q.btoa;W.exports.TextEncoder=Q.TextEncoder;W.exports.TextDecoder=Q.TextDecoder;W.exports.URLPattern=Q.URLPattern;W.exports.URL=Q.URL;W.exports.URLSearchParams=Q.URLSearchParams;eu.createFetch=Xc;});chunkBUNLC3II_cjs.h();function pr(t,e){for(let r of t){if(r.name===e)return true;if("tabs"in r&&r.tabs){for(let n of r.tabs)if(pr(n.fields,e))return true}if("fields"in r&&r.fields&&pr(r.fields,e))return true}return false}var Gn=class extends Error{errors;constructor(e){super(`Configuration validation failed:
|
|
17
|
+
`))),cancel:a=>{r?.return?.(a),s?.return?.(a);}})}function Tc(t,e,r){return Object.defineProperty(e,"name",{configurable:true,enumerable:true,value:r||e.name||t}),e}function kc(t){return t?.arrayBuffer!=null}});var tn=chunkBUNLC3II_cjs.c(en=>{chunkBUNLC3II_cjs.h();Object.defineProperty(en,"__esModule",{value:true});en.PonyfillBody=void 0;var ke=chunkBUNLC3II_cjs.a("buffer"),je=chunkBUNLC3II_cjs.a("stream"),sb=jl(),Xr=He(),Tt=Gr(),ib=Ys(),Cc=ai(),De=vt(),ne=me(),J;(function(t){t.ReadableStream="ReadableStream",t.Blob="Blob",t.FormData="FormData",t.String="String",t.Readable="Readable",t.Buffer="Buffer",t.AsyncIterable="AsyncIterable";})(J||(J={}));var li=class{bodyInit;options;bodyUsed=false;contentType=null;contentLength=null;constructor(e,r={}){this.bodyInit=e,this.options=r;let{bodyFactory:n,contentType:s,contentLength:i,bodyType:o,buffer:a}=ob(e);this._bodyFactory=n,this.contentType=s,this.contentLength=i,this.bodyType=o,this._buffer=a,this._signal=r.signal;}bodyType;_bodyFactory=()=>null;_generatedBody=null;_buffer;_signal;generateBody(){if(this._generatedBody?.readable?.destroyed&&this._buffer&&(this._generatedBody.readable=je.Readable.from(this._buffer)),this._generatedBody)return this._generatedBody;let e=this._bodyFactory();return this._generatedBody=e,e}handleContentLengthHeader(e=false){let r=this.headers.get("content-type");r?this.contentType=r:this.contentType&&this.headers.set("content-type",this.contentType);let n=this.headers.get("content-length");e&&this.bodyInit==null&&!n&&(this.contentLength=0,this.headers.set("content-length","0")),n?this.contentLength=parseInt(n,10):this.contentLength&&this.headers.set("content-length",this.contentLength.toString());}get body(){let e=this.generateBody();if(e!=null){let r=e,n=e.readable;return new Proxy(e.readable,{get(s,i){if(i in r){let o=r[i];return typeof o=="function"?o.bind(r):o}if(i in n){let o=n[i];return typeof o=="function"?o.bind(n):o}}})}return null}_chunks=null;_doCollectChunksFromReadableJob(){if(this.bodyType===J.AsyncIterable){if(Array.fromAsync)return (0, Xr.handleMaybePromise)(()=>Array.fromAsync(this.bodyInit),o=>(this._chunks=o,this._chunks));let n=this.bodyInit[Symbol.asyncIterator](),s=[],i=()=>(0, Xr.handleMaybePromise)(()=>n.next(),({value:o,done:a})=>(o&&s.push(o),a?(this._chunks=s,this._chunks):i()));return i()}let e=this.generateBody();if(!e)return this._chunks=[],(0, ne.fakePromise)(this._chunks);if(e.readable.destroyed)return (0, ne.fakePromise)(this._chunks=[]);let r=[];return new Promise((n,s)=>{e.readable.on("data",i=>{r.push(i);}),e.readable.once("error",s),e.readable.once("end",()=>{n(this._chunks=r);});})}_collectChunksFromReadable(){return this._chunks?(0, ne.fakePromise)(this._chunks):(this._chunks||=this._doCollectChunksFromReadableJob(),this._chunks)}_blob=null;blob(){return this._blob?(0, ne.fakePromise)(this._blob):(this.bodyType===J.String&&(this._text=this.bodyInit,this._blob=new Tt.PonyfillBlob([this._text],{type:this.contentType||"text/plain;charset=UTF-8",size:this.contentLength})),this.bodyType===J.Blob?(this._blob=this.bodyInit,(0, ne.fakePromise)(this._blob)):this._buffer?(this._blob=new Tt.PonyfillBlob([this._buffer],{type:this.contentType||"",size:this.contentLength}),(0, ne.fakePromise)(this._blob)):(0, ne.fakePromise)((0, Xr.handleMaybePromise)(()=>this._collectChunksFromReadable(),e=>(this._blob=new Tt.PonyfillBlob(e,{type:this.contentType||"",size:this.contentLength}),this._blob))))}_formData=null;formData(e){if(this._formData)return (0, ne.fakePromise)(this._formData);if(this.bodyType===J.FormData)return this._formData=this.bodyInit,(0, ne.fakePromise)(this._formData);if(this._formData=new Cc.PonyfillFormData,this.generateBody()==null)return (0, ne.fakePromise)(this._formData);let n={...this.options.formDataLimits,...e?.formDataLimits};return new Promise((s,i)=>{let o=this.body?.readable;if(!o)return i(new Error("No stream available"));let a=null,c=new sb.Busboy({headers:{"content-length":typeof this.contentLength=="number"?this.contentLength.toString():this.contentLength||"","content-type":this.contentType||""},limits:n,defCharset:"utf-8"});this._signal&&(0, je.addAbortSignal)(this._signal,c);let l=false,u=h=>{l||(l=true,o.unpipe(c),c.destroy(),a&&(a.destroy(),a=null),h?i(h):s(this._formData));};o.on("error",u),c.on("field",(h,d,p,x)=>{if(p)return u(new Error(`Field name size exceeded: ${n?.fieldNameSize} bytes`));if(x)return u(new Error(`Field value size exceeded: ${n?.fieldSize} bytes`));this._formData.set(h,d);}),c.on("file",(h,d,p,x,S)=>{a=d;let R=[];d.on("data",C=>{R.push(C);}),d.on("error",u),d.on("limit",()=>{u(new Error(`File size limit exceeded: ${n?.fileSize} bytes`));}),d.on("close",()=>{d.truncated&&u(new Error(`File size limit exceeded: ${n?.fileSize} bytes`)),a=null;let C=new ib.PonyfillFile(R,p,{type:S});this._formData.set(h,C);});}),c.on("fieldsLimit",()=>{u(new Error(`Fields limit exceeded: ${n?.fields}`));}),c.on("filesLimit",()=>{u(new Error(`Files limit exceeded: ${n?.files}`));}),c.on("partsLimit",()=>{u(new Error(`Parts limit exceeded: ${n?.parts}`));}),c.on("end",u),c.on("finish",u),c.on("close",u),c.on("error",u),o.pipe(c);})}buffer(){if(this._buffer)return (0, ne.fakePromise)(this._buffer);if(this._text)return this._buffer=ke.Buffer.from(this._text,"utf-8"),(0, ne.fakePromise)(this._buffer);if(this.bodyType===J.String)return this.text().then(e=>(this._text=e,this._buffer=ke.Buffer.from(e,"utf-8"),this._buffer));if(this.bodyType===J.Blob){if((0, Tt.hasBufferMethod)(this.bodyInit))return this.bodyInit.buffer().then(e=>(this._buffer=e,this._buffer));if((0, Tt.hasBytesMethod)(this.bodyInit))return this.bodyInit.bytes().then(e=>(this._buffer=ke.Buffer.from(e),this._buffer));if((0, Tt.hasArrayBufferMethod)(this.bodyInit))return this.bodyInit.arrayBuffer().then(e=>(this._buffer=ke.Buffer.from(e,void 0,e.byteLength),this._buffer))}return (0, ne.fakePromise)((0, Xr.handleMaybePromise)(()=>this._collectChunksFromReadable(),e=>e.length===1?(this._buffer=e[0],this._buffer):(this._buffer=ke.Buffer.concat(e),this._buffer)))}bytes(){return this.buffer()}arrayBuffer(){return this.buffer()}_json=null;json(){return this._json?(0, ne.fakePromise)(this._json):this.text().then(e=>{try{this._json=JSON.parse(e);}catch(r){throw r instanceof SyntaxError&&(r.message+=`, "${e}" is not valid JSON`),r}return this._json})}_text=null;text(){return this._text?(0, ne.fakePromise)(this._text):this.bodyType===J.String?(this._text=this.bodyInit,(0, ne.fakePromise)(this._text)):this.buffer().then(e=>(this._text=e.toString("utf-8"),this._text))}};en.PonyfillBody=li;function ob(t){if(t==null)return {bodyFactory:()=>null,contentType:null,contentLength:null};if(typeof t=="string"){let e=ke.Buffer.byteLength(t);return {bodyType:J.String,contentType:"text/plain;charset=UTF-8",contentLength:e,bodyFactory(){let r=je.Readable.from(ke.Buffer.from(t,"utf-8"));return new De.PonyfillReadableStream(r)}}}if(ke.Buffer.isBuffer(t)){let e=t;return {bodyType:J.Buffer,contentType:null,contentLength:t.length,buffer:t,bodyFactory(){let r=je.Readable.from(e);return new De.PonyfillReadableStream(r)}}}if((0, ne.isArrayBufferView)(t)){let e=ke.Buffer.from(t.buffer,t.byteOffset,t.byteLength);return {bodyType:J.Buffer,contentLength:t.byteLength,contentType:null,buffer:e,bodyFactory(){let r=je.Readable.from(e);return new De.PonyfillReadableStream(r)}}}if(t instanceof De.PonyfillReadableStream&&t.readable!=null){let e=t;return {bodyType:J.ReadableStream,bodyFactory:()=>e,contentType:null,contentLength:null}}if(lb(t)){let e=t;return {bodyType:J.Blob,contentType:t.type,contentLength:t.size,bodyFactory(){return e.stream()}}}if(t instanceof ArrayBuffer){let e=t.byteLength,r=ke.Buffer.from(t,void 0,t.byteLength);return {bodyType:J.Buffer,contentType:null,contentLength:e,buffer:r,bodyFactory(){let n=je.Readable.from(r);return new De.PonyfillReadableStream(n)}}}if(t instanceof je.Readable)return {bodyType:J.Readable,contentType:null,contentLength:null,bodyFactory(){return new De.PonyfillReadableStream(t)}};if(cb(t))return {bodyType:J.String,contentType:"application/x-www-form-urlencoded;charset=UTF-8",contentLength:null,bodyFactory(){return new De.PonyfillReadableStream(je.Readable.from(t.toString()))}};if(ab(t)){let e=Math.random().toString(36).substr(2),r=`multipart/form-data; boundary=${e}`;return {bodyType:J.FormData,contentType:r,contentLength:null,bodyFactory(){return (0, Cc.getStreamFromFormData)(t,e)}}}if(ub(t))return {contentType:null,contentLength:null,bodyFactory(){return new De.PonyfillReadableStream(t)}};if(t[Symbol.iterator]||t[Symbol.asyncIterator])return {contentType:null,contentLength:null,bodyType:J.AsyncIterable,bodyFactory(){let e=je.Readable.from(t);return new De.PonyfillReadableStream(e)}};throw new Error("Unknown body type")}function ab(t){return t?.forEach!=null}function lb(t){return t?.stream!=null&&typeof t.stream=="function"}function cb(t){return t?.sort!=null}function ub(t){return t?.getReader!=null}});var rn=chunkBUNLC3II_cjs.c(Qt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Qt,"__esModule",{value:true});Qt.PonyfillHeaders=void 0;Qt.isHeadersLike=Ve;var fb=chunkBUNLC3II_cjs.a("util"),ci=Yr();function Ve(t){return t?.get&&t?.forEach}var ui=class{headersInit;_map;objectNormalizedKeysOfHeadersInit=[];objectOriginalKeysOfHeadersInit=[];_setCookies;constructor(e){this.headersInit=e;}_get(e){let r=e.toLowerCase();if(r==="set-cookie"&&this._setCookies?.length)return this._setCookies.join(", ");if(this._map)return this._map.get(r)||null;if(this.headersInit==null)return null;if(Array.isArray(this.headersInit)){let n=this.headersInit.filter(([s])=>s.toLowerCase()===r);return n.length===0?null:n.length===1?n[0][1]:n.map(([,s])=>s).join(", ")}else {if(Ve(this.headersInit))return this.headersInit.get(r);{let n=this.headersInit[e]||this.headersInit[r];if(n!=null)return n;this.objectNormalizedKeysOfHeadersInit.length||Object.keys(this.headersInit).forEach(o=>{this.objectOriginalKeysOfHeadersInit.push(o),this.objectNormalizedKeysOfHeadersInit.push(o.toLowerCase());});let s=this.objectNormalizedKeysOfHeadersInit.indexOf(r);if(s===-1)return null;let i=this.objectOriginalKeysOfHeadersInit[s];return this.headersInit[i]}}}getMap(){if(!this._map)if(this._setCookies||=[],this.headersInit!=null)if(Array.isArray(this.headersInit)){this._map=new Map;for(let[e,r]of this.headersInit){let n=e.toLowerCase();if(n==="set-cookie"){Array.isArray(r)?this._setCookies.push(...r):r!=null&&this._setCookies.push(r);continue}this._map.set(n,r);}}else if(Ve(this.headersInit))this._map=new Map,this.headersInit.forEach((e,r)=>{if(r==="set-cookie"){this._setCookies||=[],Array.isArray(e)?this._setCookies.push(...e):e!=null&&this._setCookies.push(e);return}this._map.set(r,e);});else {this._map=new Map;for(let e in this.headersInit){let r=this.headersInit[e];if(r!=null){let n=e.toLowerCase();if(n==="set-cookie"){if(this._setCookies||=[],Array.isArray(r)){this._setCookies.push(...r);continue}this._setCookies.push(r);continue}this._map.set(n,r);}}}else this._map=new Map;return this._map}append(e,r){let n=e.toLowerCase();if(n==="set-cookie"){this._setCookies||=[],this._setCookies.push(r);return}let s=this.getMap().get(n),i=s?`${s}, ${r}`:r;this.getMap().set(n,i);}get(e){let r=this._get(e);return r==null?null:r.toString()}has(e){return e.toLowerCase()==="set-cookie"?!!this._setCookies?.length:!!this._get(e)}set(e,r){let n=e.toLowerCase();if(n==="set-cookie"){this._setCookies=[r];return}if(!this._map&&this.headersInit!=null)if(Array.isArray(this.headersInit)){let s=this.headersInit.find(([i])=>i.toLowerCase()===n);s?s[1]=r:this.headersInit.push([n,r]);return}else if(Ve(this.headersInit)){this.headersInit.set(n,r);return}else {this.headersInit[n]=r;return}this.getMap().set(n,r);}delete(e){let r=e.toLowerCase();if(r==="set-cookie"){this._setCookies=[];return}this.getMap().delete(r);}forEach(e){if(this._setCookies?.forEach(r=>{e(r,"set-cookie",this);}),!this._map){if(this.headersInit){if(Array.isArray(this.headersInit)){this.headersInit.forEach(([r,n])=>{e(n,r,this);});return}if(Ve(this.headersInit)){this.headersInit.forEach(e);return}Object.entries(this.headersInit).forEach(([r,n])=>{n!=null&&e(n,r,this);});}return}this.getMap().forEach((r,n)=>{e(r,n,this);});}*_keys(){if(this._setCookies?.length&&(yield "set-cookie"),!this._map&&this.headersInit){if(Array.isArray(this.headersInit)){yield*this.headersInit.map(([e])=>e)[Symbol.iterator]();return}if(Ve(this.headersInit)){yield*this.headersInit.keys();return}yield*Object.keys(this.headersInit)[Symbol.iterator]();return}yield*this.getMap().keys();}keys(){return new ci.PonyfillIteratorObject(this._keys(),"HeadersIterator")}*_values(){if(this._setCookies?.length&&(yield*this._setCookies),!this._map&&this.headersInit){if(Array.isArray(this.headersInit)){yield*this.headersInit.map(([,e])=>e)[Symbol.iterator]();return}if(Ve(this.headersInit)){yield*this.headersInit.values();return}yield*Object.values(this.headersInit)[Symbol.iterator]();return}yield*this.getMap().values();}values(){return new ci.PonyfillIteratorObject(this._values(),"HeadersIterator")}*_entries(){if(this._setCookies?.length&&(yield*this._setCookies.map(e=>["set-cookie",e])),!this._map&&this.headersInit){if(Array.isArray(this.headersInit)){yield*this.headersInit;return}if(Ve(this.headersInit)){yield*this.headersInit.entries();return}yield*Object.entries(this.headersInit);return}yield*this.getMap().entries();}entries(){return new ci.PonyfillIteratorObject(this._entries(),"HeadersIterator")}getSetCookie(){return this._setCookies||this.getMap(),this._setCookies}[Symbol.iterator](){return this.entries()}[Symbol.for("nodejs.util.inspect.custom")](){let e={};return this.forEach((r,n)=>{n==="set-cookie"?e["set-cookie"]=this._setCookies||[]:e[n]=r?.includes(",")?r.split(",").map(s=>s.trim()):r;}),`Headers ${(0, fb.inspect)(e)}`}};Qt.PonyfillHeaders=ui;});var Jt=chunkBUNLC3II_cjs.c(nn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(nn,"__esModule",{value:true});nn.PonyfillResponse=void 0;var hb=chunkBUNLC3II_cjs.a("http"),db=tn(),fi=rn(),Zt="application/json; charset=utf-8",hi=class t extends db.PonyfillBody{headers;constructor(e,r){super(e||null,r),this.headers=r?.headers&&(0, fi.isHeadersLike)(r.headers)?r.headers:new fi.PonyfillHeaders(r?.headers),this.status=r?.status||200,this.statusText=r?.statusText||hb.STATUS_CODES[this.status]||"OK",this.url=r?.url||"",this.redirected=r?.redirected||false,this.type=r?.type||"default",this.handleContentLengthHeader();}get ok(){return this.status>=200&&this.status<300}status;statusText;url;redirected;type;clone(){return this}static error(){return new t(null,{status:500,statusText:"Internal Server Error"})}static redirect(e,r=302){if(r<300||r>399)throw new RangeError("Invalid status code");return new t(null,{headers:{location:e},status:r})}static json(e,r){let n=JSON.stringify(e);if(!r)r={headers:{"content-type":Zt,"content-length":Buffer.byteLength(n).toString()}};else if(!r.headers)r.headers={"content-type":Zt,"content-length":Buffer.byteLength(n).toString()};else if((0, fi.isHeadersLike)(r.headers))r.headers.has("content-type")||r.headers.set("content-type",Zt),r.headers.has("content-length")||r.headers.set("content-length",Buffer.byteLength(n).toString());else if(Array.isArray(r.headers)){let s=false,i=false;for(let[o]of r.headers){if(i&&s)break;!s&&o.toLowerCase()==="content-type"?s=true:!i&&o.toLowerCase()==="content-length"&&(i=true);}s||r.headers.push(["content-type",Zt]),i||r.headers.push(["content-length",Buffer.byteLength(n).toString()]);}else typeof r.headers=="object"&&(r.headers?.["content-type"]==null&&(r.headers["content-type"]=Zt),r.headers?.["content-length"]==null&&(r.headers["content-length"]=Buffer.byteLength(n).toString()));return new t(n,r)}[Symbol.toStringTag]="Response"};nn.PonyfillResponse=hi;});var Ac=chunkBUNLC3II_cjs.c(pi=>{chunkBUNLC3II_cjs.h();Object.defineProperty(pi,"__esModule",{value:true});pi.fetchCurl=yb;var Rc=chunkBUNLC3II_cjs.a("stream"),pb=chunkBUNLC3II_cjs.a("tls"),mb=He(),bb=Jt(),di=me();function yb(t){let{Curl:e,CurlFeature:r,CurlPause:n,CurlProgressFunc:s}=globalThis.libcurl,i=new e;i.enable(r.NoDataParsing),i.setOpt("URL",t.url),process.env.NODE_TLS_REJECT_UNAUTHORIZED==="0"&&i.setOpt("SSL_VERIFYPEER",false),process.env.NODE_EXTRA_CA_CERTS?i.setOpt("CAINFO",process.env.NODE_EXTRA_CA_CERTS):i.setOpt("CAINFO_BLOB",pb.rootCertificates.join(`
|
|
18
|
+
`)),i.enable(r.StreamResponse);let o;if(t._signal===null?o=void 0:t._signal&&(o=t._signal),i.setStreamProgressCallback(function(){return o?.aborted?process.env.DEBUG?s.Continue:1:0}),t.bodyType==="String")i.setOpt("POSTFIELDS",t.bodyInit);else {let p=t.body!=null?(0, di.isNodeReadable)(t.body)?t.body:Rc.Readable.from(t.body):null;p&&(i.setOpt("UPLOAD",true),i.setUploadStream(p));}process.env.DEBUG&&i.setOpt("VERBOSE",true),i.setOpt("TRANSFER_ENCODING",false),i.setOpt("HTTP_TRANSFER_DECODING",true),i.setOpt("FOLLOWLOCATION",t.redirect==="follow"),i.setOpt("MAXREDIRS",20),i.setOpt("ACCEPT_ENCODING",""),i.setOpt("CUSTOMREQUEST",t.method);let a=t.headersSerializer||di.defaultHeadersSerializer,c,l=a(t.headers,p=>{c=Number(p);});c!=null&&i.setOpt("INFILESIZE",c),i.setOpt("HTTPHEADER",l),i.enable(r.NoHeaderParsing);let u=(0, mb.createDeferredPromise)(),h;function d(){if(i.isOpen)try{i.pause(n.Recv);}catch(p){u.reject(p);}}return o?.addEventListener("abort",d,{once:true}),i.once("end",function(){try{i.close();}catch(x){u.reject(x);}o?.removeEventListener("abort",d);}),i.once("error",function(x){h&&!h.closed&&!h.destroyed?h.destroy(x):(x.message==="Operation was aborted by an application callback"&&(x.message="The operation was aborted."),u.reject(x));try{i.close();}catch(S){u.reject(S);}}),i.once("stream",function(x,S,R){let C=x.pipe(new Rc.PassThrough,{end:true}),E=R.toString("utf8").split(/\r?\n|\r/g).filter(w=>w&&!w.startsWith("HTTP/")?(t.redirect==="error"&&w.toLowerCase().includes("location")&&(0, di.shouldRedirect)(S)&&(x.destroyed||x.resume(),C.destroy(),u.reject(new Error("redirect is not allowed"))),true):false).map(w=>w.split(/:\s(.+)/).slice(0,2)),T=new bb.PonyfillResponse(C,{status:S,headers:E,url:i.getInfo(e.info.REDIRECT_URL)?.toString()||t.url,redirected:Number(i.getInfo(e.info.REDIRECT_COUNT))>0});u.resolve(T),h=C;}),setImmediate(()=>{i.perform();}),u.promise}});var Yt=chunkBUNLC3II_cjs.c(sn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(sn,"__esModule",{value:true});sn.PonyfillURL=void 0;var gb=(it(),chunkBUNLC3II_cjs.f(st)),xb=gb.__importDefault(chunkBUNLC3II_cjs.a("buffer")),_b=chunkBUNLC3II_cjs.a("crypto"),Lc=globalThis.URL,mi=class extends Lc{static blobRegistry=new Map;static createObjectURL(e){let r=`blob:whatwgnode:${(0, _b.randomUUID)()}`;return this.blobRegistry.set(r,e),r}static revokeObjectURL(e){this.blobRegistry.has(e)?this.blobRegistry.delete(e):Lc.revokeObjectURL(e);}static getBlobFromURL(e){return this.blobRegistry.get(e)||xb.default?.resolveObjectURL?.(e)}};sn.PonyfillURL=mi;});var an=chunkBUNLC3II_cjs.c(on=>{chunkBUNLC3II_cjs.h();Object.defineProperty(on,"__esModule",{value:true});on.PonyfillRequest=void 0;var wb=chunkBUNLC3II_cjs.a("http"),Sb=chunkBUNLC3II_cjs.a("https"),Eb=tn(),Oc=rn(),Pb=Yt();function vb(t){return t[Symbol.toStringTag]==="Request"}function Tb(t){return t?.href!=null}var bi=class extends Eb.PonyfillBody{constructor(e,r){let n,s,i=null,o;if(typeof e=="string"?n=e:Tb(e)?s=e:vb(e)&&(e._parsedUrl?s=e._parsedUrl:e._url?n=e._url:n=e.url,i=e.body,o=e),r!=null&&(i=r.body||null,o=r),super(i,o),this._url=n,this._parsedUrl=s,this.cache=o?.cache||"default",this.credentials=o?.credentials||"same-origin",this.headers=o?.headers&&(0, Oc.isHeadersLike)(o.headers)?o.headers:new Oc.PonyfillHeaders(o?.headers),this.integrity=o?.integrity||"",this.keepalive=o?.keepalive!=null?o?.keepalive:false,this.method=o?.method?.toUpperCase()||"GET",this.mode=o?.mode||"cors",this.redirect=o?.redirect||"follow",this.referrer=o?.referrer||"about:client",this.referrerPolicy=o?.referrerPolicy||"no-referrer",this.headersSerializer=o?.headersSerializer,this.duplex=o?.duplex||"half",this.destination="document",this.priority="auto",this.method!=="GET"&&this.method!=="HEAD"&&this.handleContentLengthHeader(true),o?.agent!=null){let a=s?.protocol||n||this.url;o.agent===false?this.agent=false:a.startsWith("http:")&&o.agent instanceof wb.Agent?this.agent=o.agent:a.startsWith("https:")&&o.agent instanceof Sb.Agent&&(this.agent=o.agent);}}headersSerializer;cache;credentials;destination;headers;integrity;keepalive;method;mode;priority;redirect;referrer;referrerPolicy;_url;get signal(){return this._signal||=new AbortController().signal,this._signal}get url(){if(this._url==null)if(this._parsedUrl)this._url=this._parsedUrl.toString();else throw new TypeError("Invalid URL");return this._url}_parsedUrl;get parsedUrl(){if(this._parsedUrl==null)if(this._url!=null)this._parsedUrl=new Pb.PonyfillURL(this._url,"http://localhost");else throw new TypeError("Invalid URL");return this._parsedUrl}duplex;agent;clone(){return this}[Symbol.toStringTag]="Request"};on.PonyfillRequest=bi;});var qc=chunkBUNLC3II_cjs.c(yi=>{chunkBUNLC3II_cjs.h();Object.defineProperty(yi,"__esModule",{value:true});yi.fetchNodeHttp=jc;var kb=(it(),chunkBUNLC3II_cjs.f(st)),Dc=chunkBUNLC3II_cjs.a("http"),Cb=chunkBUNLC3II_cjs.a("https"),Fc=chunkBUNLC3II_cjs.a("stream"),kt=kb.__importDefault(chunkBUNLC3II_cjs.a("zlib")),Ic=He(),Rb=an(),Ab=Jt(),Lb=Yt(),Ce=me();function Ob(t){if(t.startsWith("http:"))return Dc.request;if(t.startsWith("https:"))return Cb.request;throw new Error(`Unsupported protocol: ${t.split(":")[0]||t}`)}function jc(t){return new Promise((e,r)=>{try{let n=Ob(t.parsedUrl?.protocol||t.url),i=(t.headersSerializer||Ce.getHeadersObj)(t.headers);i["accept-encoding"]||=Ce.DEFAULT_ACCEPT_ENCODING,i["user-agent"]==null&&i["User-Agent"]==null&&(i["user-agent"]="node");let o;t._signal==null?o=void 0:t._signal&&(o=t._signal);let a;if(t.parsedUrl?a=n(t.parsedUrl,{method:t.method,headers:i,signal:o,agent:t.agent}):a=n(t.url,{method:t.method,headers:i,signal:o,agent:t.agent}),a.once("error",r),a.once("response",c=>{let l;switch(c.headers["content-encoding"]){case "x-gzip":case "gzip":l=kt.default.createGunzip();break;case "x-deflate":case "deflate":l=kt.default.createInflate();break;case "x-deflate-raw":case "deflate-raw":l=kt.default.createInflateRaw();break;case "br":l=kt.default.createBrotliDecompress();break;case "zstd":kt.default.createZstdDecompress!=null&&(l=kt.default.createZstdDecompress());break}if(c.headers.location&&(0,Ce.shouldRedirect)(c.statusCode)){if(t.redirect==="error"){let x=new Error("Redirects are not allowed");r(x),c.resume();return}if(t.redirect==="follow"){let x=new Lb.PonyfillURL(c.headers.location,t.parsedUrl||t.url),S=jc(new Rb.PonyfillRequest(x,t));e(S.then(R=>(R.redirected=!0,R))),c.resume();return}}l||=new Fc.PassThrough,(0,Ce.pipeThrough)({src:c,dest:l,signal:o,onError:x=>{c.destroyed||c.destroy(x),l.destroyed||l.destroy(x),r(x);}});let h=c.statusCode||200,d=c.statusMessage||Dc.STATUS_CODES[h];d==null&&(d="");let p=new Ab.PonyfillResponse(l||c,{status:h,statusText:d,headers:c.headers,url:t.url,signal:o});e(p);}),t._buffer!=null)(0,Ic.handleMaybePromise)(()=>(0,Ce.safeWrite)(t._buffer,a),()=>(0,Ce.endStream)(a),r);else if(t.bodyType==="String")(0,Ic.handleMaybePromise)(()=>(0,Ce.safeWrite)(t.bodyInit,a),()=>(0,Ce.endStream)(a),r);else {let c=t.body!=null?(0,Ce.isNodeReadable)(t.body)?t.body:Fc.Readable.from(t.body):null;c?c.pipe(a):(0,Ce.endStream)(a);}}catch(n){r(n);}})}});var $c=chunkBUNLC3II_cjs.c(gi=>{chunkBUNLC3II_cjs.h();Object.defineProperty(gi,"__esModule",{value:true});gi.fetchPonyfill=Bc;var Fb=chunkBUNLC3II_cjs.a("buffer"),ln=chunkBUNLC3II_cjs.a("fs"),Ib=chunkBUNLC3II_cjs.a("url"),Db=Ac(),jb=qc(),qb=an(),Ct=Jt(),Ub=Yt(),Uc=me(),Mc=";base64";async function Mb(t){let e=(0, Ib.fileURLToPath)(t);try{await ln.promises.access(e,ln.promises.constants.R_OK);let r=await ln.promises.stat(e,{bigint:!0}),n=(0,ln.createReadStream)(e);return new Ct.PonyfillResponse(n,{status:200,statusText:"OK",headers:{"content-type":"application/octet-stream","last-modified":r.mtime.toUTCString()}})}catch(r){if(r.code==="ENOENT")return new Ct.PonyfillResponse(null,{status:404,statusText:"Not Found"});if(r.code==="EACCES")return new Ct.PonyfillResponse(null,{status:403,statusText:"Forbidden"});throw r}}function Bb(t){let[e="text/plain",...r]=t.substring(5).split(","),n=decodeURIComponent(r.join(","));if(e.endsWith(Mc)){let s=Fb.Buffer.from(n,"base64url"),i=e.slice(0,-Mc.length);return new Ct.PonyfillResponse(s,{status:200,statusText:"OK",headers:{"content-type":i}})}return new Ct.PonyfillResponse(n,{status:200,statusText:"OK",headers:{"content-type":e}})}function $b(t){let e=Ub.PonyfillURL.getBlobFromURL(t);if(!e)throw new TypeError("Invalid Blob URL");return new Ct.PonyfillResponse(e,{status:200,headers:{"content-type":e.type,"content-length":e.size.toString()}})}function Nb(t){return t!=null&&t.href!=null}function Bc(t,e){if(typeof t=="string"||Nb(t)){let n=new qb.PonyfillRequest(t,e);return Bc(n)}let r=t;if(r.url.startsWith("data:")){let n=Bb(r.url);return (0, Uc.fakePromise)(n)}if(r.url.startsWith("file:"))return Mb(r.url);if(r.url.startsWith("blob:")){let n=$b(r.url);return (0, Uc.fakePromise)(n)}return globalThis.libcurl&&!r.agent?(0, Db.fetchCurl)(r):(0, jb.fetchNodeHttp)(r)}});var wi=chunkBUNLC3II_cjs.c(at=>{chunkBUNLC3II_cjs.h();Object.defineProperty(at,"__esModule",{value:true});at.PonyfillTextDecoder=at.PonyfillTextEncoder=void 0;at.PonyfillBtoa=zb;var Xt=chunkBUNLC3II_cjs.a("buffer"),Gb=me(),xi=class{encoding;constructor(e="utf-8"){this.encoding=e;}encode(e){return Xt.Buffer.from(e,this.encoding)}encodeInto(e,r){let s=this.encode(e).copy(r);return {read:s,written:s}}};at.PonyfillTextEncoder=xi;var _i=class{encoding;fatal=false;ignoreBOM=false;constructor(e="utf-8",r){this.encoding=e,r&&(this.fatal=r.fatal||false,this.ignoreBOM=r.ignoreBOM||false);}decode(e){return Xt.Buffer.isBuffer(e)?e.toString(this.encoding):(0, Gb.isArrayBufferView)(e)?Xt.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(this.encoding):Xt.Buffer.from(e).toString(this.encoding)}};at.PonyfillTextDecoder=_i;function zb(t){return Xt.Buffer.from(t,"binary").toString("base64")}});var Nc=chunkBUNLC3II_cjs.c(cn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(cn,"__esModule",{value:true});cn.PonyfillURLSearchParams=void 0;cn.PonyfillURLSearchParams=globalThis.URLSearchParams;});var Pi=chunkBUNLC3II_cjs.c(fn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(fn,"__esModule",{value:true});fn.PonyfillWritableStream=void 0;var un=chunkBUNLC3II_cjs.a("events"),Si=chunkBUNLC3II_cjs.a("stream"),Gc=He(),We=me(),Ei=class{writable;constructor(e){if(e instanceof Si.Writable)this.writable=e;else if(e){let r=new Si.Writable({write(i,o,a){try{let c=e.write?.(i,s);c instanceof Promise?c.then(()=>{a();},l=>{a(l);}):a();}catch(c){a(c);}},final(i){let o=e.close?.();o instanceof Promise?o.then(()=>{i();},a=>{i(a);}):i();}});this.writable=r;let n=new AbortController,s={signal:n.signal,error(i){r.destroy(i);}};r.once("error",i=>n.abort(i)),r.once("close",()=>n.abort());}else this.writable=new Si.Writable;}getWriter(){let e=this.writable;return {get closed(){return (0, un.once)(e,"close")},get desiredSize(){return e.writableLength},get ready(){return (0, un.once)(e,"drain")},releaseLock(){},write(r){let n=(0, We.fakePromise)();return r==null?n:n.then(()=>(0, We.safeWrite)(r,e))},close(){return !e.errored&&e.closed?(0, We.fakePromise)():e.errored?(0, Gc.fakeRejectPromise)(e.errored):(0, We.fakePromise)().then(()=>(0, We.endStream)(e))},abort(r){return e.destroy(r),(0, un.once)(e,"close")}}}close(){return !this.writable.errored&&this.writable.closed?(0, We.fakePromise)():this.writable.errored?(0, Gc.fakeRejectPromise)(this.writable.errored):(0, We.fakePromise)().then(()=>(0, We.endStream)(this.writable))}abort(e){return this.writable.destroy(e),(0, un.once)(this.writable,"close")}locked=false};fn.PonyfillWritableStream=Ei;});var er=chunkBUNLC3II_cjs.c(hn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(hn,"__esModule",{value:true});hn.PonyfillTransformStream=void 0;var vi=chunkBUNLC3II_cjs.a("stream"),Hb=vt(),Vb=me(),Wb=Pi(),Ti=class{transform;writable;readable;constructor(e){if(e instanceof vi.Transform)this.transform=e;else if(e){let r={enqueue(s){n.push(s);},error(s){n.destroy(s);},terminate(){(0, Vb.endStream)(n);},get desiredSize(){return n.writableLength}},n=new vi.Transform({read(){},write(s,i,o){try{let a=e.transform?.(s,r);a instanceof Promise?a.then(()=>{o();},c=>{o(c);}):o();}catch(a){o(a);}},final(s){try{let i=e.flush?.(r);i instanceof Promise?i.then(()=>{s();},o=>{s(o);}):s();}catch(i){s(i);}}});this.transform=n;}else this.transform=new vi.Transform;this.writable=new Wb.PonyfillWritableStream(this.transform),this.readable=new Hb.PonyfillReadableStream(this.transform);}};hn.PonyfillTransformStream=Ti;});var zc=chunkBUNLC3II_cjs.c(dn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(dn,"__esModule",{value:true});dn.PonyfillCompressionStream=void 0;var Kb=(it(),chunkBUNLC3II_cjs.f(st)),tr=Kb.__importDefault(chunkBUNLC3II_cjs.a("zlib")),Qb=er(),Zb=me(),ki=class extends Qb.PonyfillTransformStream{static supportedFormats=(0, Zb.getSupportedFormats)();constructor(e){switch(e){case "x-gzip":case "gzip":super(tr.default.createGzip());break;case "x-deflate":case "deflate":super(tr.default.createDeflate());break;case "deflate-raw":super(tr.default.createDeflateRaw());break;case "br":super(tr.default.createBrotliCompress());break;case "zstd":super(tr.default.createZstdCompress());break;default:throw new Error(`Unsupported compression format: ${e}`)}}};dn.PonyfillCompressionStream=ki;});var Hc=chunkBUNLC3II_cjs.c(pn=>{chunkBUNLC3II_cjs.h();Object.defineProperty(pn,"__esModule",{value:true});pn.PonyfillDecompressionStream=void 0;var Jb=(it(),chunkBUNLC3II_cjs.f(st)),rr=Jb.__importDefault(chunkBUNLC3II_cjs.a("zlib")),Yb=er(),Xb=me(),Ci=class extends Yb.PonyfillTransformStream{static supportedFormats=(0, Xb.getSupportedFormats)();constructor(e){switch(e){case "x-gzip":case "gzip":super(rr.default.createGunzip());break;case "x-deflate":case "deflate":super(rr.default.createInflate());break;case "deflate-raw":super(rr.default.createInflateRaw());break;case "br":super(rr.default.createBrotliDecompress());break;case "zstd":super(rr.default.createZstdDecompress());break;default:throw new TypeError(`Unsupported compression format: '${e}'`)}}};pn.PonyfillDecompressionStream=Ci;});var Kc=chunkBUNLC3II_cjs.c(Rt=>{chunkBUNLC3II_cjs.h();Object.defineProperty(Rt,"__esModule",{value:true});Rt.PonyfillTextEncoderStream=Rt.PonyfillTextDecoderStream=void 0;var Vc=wi(),Wc=er(),Ri=class extends Wc.PonyfillTransformStream{textDecoder;constructor(e,r){super({transform:(n,s)=>s.enqueue(this.textDecoder.decode(n,{stream:true}))}),this.textDecoder=new Vc.PonyfillTextDecoder(e,r);}get encoding(){return this.textDecoder.encoding}get fatal(){return this.textDecoder.fatal}get ignoreBOM(){return this.textDecoder.ignoreBOM}};Rt.PonyfillTextDecoderStream=Ri;var Ai=class extends Wc.PonyfillTransformStream{textEncoder;constructor(e){super({transform:(r,n)=>n.enqueue(this.textEncoder.encode(r))}),this.textEncoder=new Vc.PonyfillTextEncoder(e);}get encoding(){return this.textEncoder.encoding}encode(e){return this.textEncoder.encode(e)}};Rt.PonyfillTextEncoderStream=Ai;});var Zc=chunkBUNLC3II_cjs.c(q=>{chunkBUNLC3II_cjs.h();Object.defineProperty(q,"__esModule",{value:true});q.TextEncoderStream=q.TextDecoderStream=q.IteratorObject=q.DecompressionStream=q.CompressionStream=q.TransformStream=q.WritableStream=q.URLSearchParams=q.URL=q.btoa=q.TextDecoder=q.TextEncoder=q.Blob=q.FormData=q.File=q.ReadableStream=q.Response=q.Request=q.Body=q.Headers=q.fetch=void 0;var ey=$c();Object.defineProperty(q,"fetch",{enumerable:true,get:function(){return ey.fetchPonyfill}});var ty=rn();Object.defineProperty(q,"Headers",{enumerable:true,get:function(){return ty.PonyfillHeaders}});var ry=tn();Object.defineProperty(q,"Body",{enumerable:true,get:function(){return ry.PonyfillBody}});var ny=an();Object.defineProperty(q,"Request",{enumerable:true,get:function(){return ny.PonyfillRequest}});var sy=Jt();Object.defineProperty(q,"Response",{enumerable:true,get:function(){return sy.PonyfillResponse}});var iy=vt();Object.defineProperty(q,"ReadableStream",{enumerable:true,get:function(){return iy.PonyfillReadableStream}});var oy=Ys();Object.defineProperty(q,"File",{enumerable:true,get:function(){return oy.PonyfillFile}});var ay=ai();Object.defineProperty(q,"FormData",{enumerable:true,get:function(){return ay.PonyfillFormData}});var ly=Gr();Object.defineProperty(q,"Blob",{enumerable:true,get:function(){return ly.PonyfillBlob}});var Li=wi();Object.defineProperty(q,"TextEncoder",{enumerable:true,get:function(){return Li.PonyfillTextEncoder}});Object.defineProperty(q,"TextDecoder",{enumerable:true,get:function(){return Li.PonyfillTextDecoder}});Object.defineProperty(q,"btoa",{enumerable:true,get:function(){return Li.PonyfillBtoa}});var cy=Yt();Object.defineProperty(q,"URL",{enumerable:true,get:function(){return cy.PonyfillURL}});var uy=Nc();Object.defineProperty(q,"URLSearchParams",{enumerable:true,get:function(){return uy.PonyfillURLSearchParams}});var fy=Pi();Object.defineProperty(q,"WritableStream",{enumerable:true,get:function(){return fy.PonyfillWritableStream}});var hy=er();Object.defineProperty(q,"TransformStream",{enumerable:true,get:function(){return hy.PonyfillTransformStream}});var dy=zc();Object.defineProperty(q,"CompressionStream",{enumerable:true,get:function(){return dy.PonyfillCompressionStream}});var py=Hc();Object.defineProperty(q,"DecompressionStream",{enumerable:true,get:function(){return py.PonyfillDecompressionStream}});var my=Yr();Object.defineProperty(q,"IteratorObject",{enumerable:true,get:function(){return my.PonyfillIteratorObject}});var Qc=Kc();Object.defineProperty(q,"TextDecoderStream",{enumerable:true,get:function(){return Qc.PonyfillTextDecoderStream}});Object.defineProperty(q,"TextEncoderStream",{enumerable:true,get:function(){return Qc.PonyfillTextEncoderStream}});});var Yc=chunkBUNLC3II_cjs.c((JS,Jc)=>{chunkBUNLC3II_cjs.h();var by=ps(),H;Jc.exports=function(e={}){let r={};if(r.URLPattern=globalThis.URLPattern,!r.URLPattern){let n=(Xa(),chunkBUNLC3II_cjs.f(Ya));r.URLPattern=n.URLPattern;}if(e.skipPonyfill||by())return {fetch:globalThis.fetch,Headers:globalThis.Headers,Request:globalThis.Request,Response:globalThis.Response,FormData:globalThis.FormData,ReadableStream:globalThis.ReadableStream,WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,CompressionStream:globalThis.CompressionStream,DecompressionStream:globalThis.DecompressionStream,TextDecoderStream:globalThis.TextDecoderStream,TextEncoderStream:globalThis.TextEncoderStream,Blob:globalThis.Blob,File:globalThis.File,crypto:globalThis.crypto,btoa:globalThis.btoa,TextEncoder:globalThis.TextEncoder,TextDecoder:globalThis.TextDecoder,URLPattern:r.URLPattern,URL:globalThis.URL,URLSearchParams:globalThis.URLSearchParams};if(H||=Zc(),r.fetch=H.fetch,r.Request=H.Request,r.Response=H.Response,r.Headers=H.Headers,r.FormData=H.FormData,r.ReadableStream=H.ReadableStream,r.URL=H.URL,r.URLSearchParams=H.URLSearchParams,r.WritableStream=H.WritableStream,r.TransformStream=H.TransformStream,r.CompressionStream=H.CompressionStream,r.DecompressionStream=H.DecompressionStream,r.TextDecoderStream=H.TextDecoderStream,r.TextEncoderStream=H.TextEncoderStream,r.Blob=H.Blob,r.File=H.File,r.crypto=globalThis.crypto,r.btoa=H.btoa,r.TextEncoder=H.TextEncoder,r.TextDecoder=H.TextDecoder,e.formDataLimits&&(r.Body=class extends H.Body{constructor(s,i){super(s,{formDataLimits:e.formDataLimits,...i});}},r.Request=class extends H.Request{constructor(s,i){super(s,{formDataLimits:e.formDataLimits,...i});}},r.Response=class extends H.Response{constructor(s,i){super(s,{formDataLimits:e.formDataLimits,...i});}}),!r.crypto){let n=chunkBUNLC3II_cjs.a("crypto");r.crypto=n.webcrypto;}return r};});var nr=chunkBUNLC3II_cjs.c((eu,W)=>{chunkBUNLC3II_cjs.h();var Xc=Yc(),yy=ps(),Q=Xc();if(!yy())try{let t="node-libcurl";globalThis.libcurl=globalThis.libcurl||chunkBUNLC3II_cjs.a(t);}catch{}W.exports.fetch=Q.fetch;W.exports.Headers=Q.Headers;W.exports.Request=Q.Request;W.exports.Response=Q.Response;W.exports.FormData=Q.FormData;W.exports.ReadableStream=Q.ReadableStream;W.exports.WritableStream=Q.WritableStream;W.exports.TransformStream=Q.TransformStream;W.exports.CompressionStream=Q.CompressionStream;W.exports.DecompressionStream=Q.DecompressionStream;W.exports.TextDecoderStream=Q.TextDecoderStream;W.exports.TextEncoderStream=Q.TextEncoderStream;W.exports.Blob=Q.Blob;W.exports.File=Q.File;W.exports.crypto=Q.crypto;W.exports.btoa=Q.btoa;W.exports.TextEncoder=Q.TextEncoder;W.exports.TextDecoder=Q.TextDecoder;W.exports.URLPattern=Q.URLPattern;W.exports.URL=Q.URL;W.exports.URLSearchParams=Q.URLSearchParams;eu.createFetch=Xc;});chunkBUNLC3II_cjs.h();function pr(t,e){for(let r of t){if(r.name===e)return true;if("tabs"in r&&r.tabs){for(let n of r.tabs)if(pr(n.fields,e))return true}if("fields"in r&&r.fields&&pr(r.fields,e))return true}return false}var Gn=class extends Error{errors;constructor(e){super(`Configuration validation failed:
|
|
19
19
|
${e.join(`
|
|
20
|
-
`)}`),this.name="ConfigValidationError",this.errors=e;}};function Hn(t){let e=[];if(t.slug?/^[a-z][a-z0-9_-]*$/.test(t.slug)||e.push(`Collection slug "${t.slug}" must be lowercase alphanumeric with dashes`):e.push('Collection is missing a "slug" property'),!t.fields||t.fields.length===0)e.push(`Collection "${t.slug}" has no fields defined`);else {let r=Ze(t.fields,t.slug);e.push(...r);}if(t.access)for(let[r,n]of Object.entries(t.access))typeof n!="boolean"&&typeof n!="function"&&e.push(`Collection "${t.slug}" has invalid access.${r} (must be boolean or function)`);if(t.admin?.useAsTitle&&(pr(t.fields,t.admin.useAsTitle)||e.push(`Collection "${t.slug}" admin.useAsTitle references unknown field "${t.admin.useAsTitle}"`)),t.admin?.defaultColumns)for(let r of t.admin.defaultColumns)pr(t.fields,r)||e.push(`Collection "${t.slug}" admin.defaultColumns references unknown field "${r}"`);if(t.upload&&t.upload.fileSize&&t.upload.fileSize<=0&&e.push(`Collection "${t.slug}" upload.fileSize must be positive`),t.versions&&t.versions.maxPerDoc&&t.versions.maxPerDoc<=0&&e.push(`Collection "${t.slug}" versions.maxPerDoc must be positive`),t.auth){let r=t.fields.some(s=>s.name==="email"),n=t.fields.some(s=>s.name==="password");r||e.push(`Collection "${t.slug}" with auth enabled requires an "email" field`),n||e.push(`Collection "${t.slug}" with auth enabled requires a "password" field`);}return e}function zn(t){let e=[];if(t.slug?/^[a-z][a-z0-9_-]*$/.test(t.slug)||e.push(`Global slug "${t.slug}" must be lowercase alphanumeric with dashes`):e.push('Global is missing a "slug" property'),!t.fields||t.fields.length===0)e.push(`Global "${t.slug}" has no fields defined`);else {let r=Ze(t.fields,`global:${t.slug}`);e.push(...r);}return e}function Ze(t,e){let r=[],n=new Set;for(let s=0;s<t.length;s++){let i=t[s];if(i.type==="row"||i.type==="collapsible"||i.type==="tabs"){if("fields"in i&&i.fields){let a=Ze(i.fields,e);r.push(...a);}else if("tabs"in i)for(let a of i.tabs){let c=Ze(a.fields,e);r.push(...c);}continue}let o=i.name;if(!o){r.push(`${e}: Field at index ${s} is missing a "name" property`);continue}if(n.has(o)&&r.push(`${e}: Duplicate field name "${o}"`),n.add(o),/^[a-zA-Z][a-zA-Z0-9_]*$/.test(o)||r.push(`${e}: Field name "${o}" must be alphanumeric with underscores`),!i.type){r.push(`${e}: Field "${o}" is missing a "type" property`);continue}switch(i.type){case "relationship":i.relationTo||r.push(`${e}: Relationship field "${o}" is missing "relationTo"`);break;case "array":if(!i.fields||i.fields.length===0)r.push(`${e}: Array field "${o}" has no fields defined`);else {let a=Ze(i.fields,`${e}.${o}`);r.push(...a);}break;case "group":if(!i.fields||i.fields.length===0)r.push(`${e}: Group field "${o}" has no fields defined`);else {let a=Ze(i.fields,`${e}.${o}`);r.push(...a);}break;case "blocks":if(!i.blocks||i.blocks.length===0)r.push(`${e}: Blocks field "${o}" has no blocks defined`);else {let a=ld(i.blocks,`${e}.${o}`);r.push(...a);}break;case "select":case "radio":if(typeof i.options=="function")break;if((!i.options||i.options.length===0)&&!i.dynamicOptions)r.push(`${e}: ${i.type} field "${o}" has no options defined`);else if(Array.isArray(i.options)){let a=i.options.map(l=>l.value),c=new Set(a);a.length!==c.size&&r.push(`${e}: ${i.type} field "${o}" has duplicate option values`);}break;case "upload":i.relationTo||r.push(`${e}: Upload field "${o}" is missing "relationTo"`);break}"min"in i&&"max"in i&&i.min>i.max&&r.push(`${e}: Field "${o}" has min greater than max`),"minLength"in i&&"maxLength"in i&&i.minLength>i.maxLength&&r.push(`${e}: Field "${o}" has minLength greater than maxLength`),"minRows"in i&&"maxRows"in i&&i.minRows>i.maxRows&&r.push(`${e}: Field "${o}" has minRows greater than maxRows`);}return r}function ld(t,e){let r=[],n=new Set;for(let s of t){if(!s.slug){r.push(`${e}: Block is missing a "slug" property`);continue}if(n.has(s.slug)&&r.push(`${e}: Duplicate block slug "${s.slug}"`),n.add(s.slug),s.label||r.push(`${e}: Block "${s.slug}" is missing a "label" property`),!s.fields||s.fields.length===0)r.push(`${e}: Block "${s.slug}" has no fields defined`);else {let i=Ze(s.fields,`${e}.${s.slug}`);r.push(...i);}}return r}function _o(t,e=[]){let r=[],n=new Set;for(let s of t)n.has(s.slug)&&r.push(`Duplicate collection slug "${s.slug}"`),n.add(s.slug);for(let s of e)n.has(s.slug)&&r.push(`Duplicate global slug "${s.slug}"`),n.add(s.slug);for(let s of t){let i=Hn(s);r.push(...i);}for(let s of e){let i=zn(s);r.push(...i);}for(let s of t){let i=dr(s.fields,t);r.push(...i);}if(r.length>0)throw new Gn(r)}function dr(t,e){let r=[],n=new Set(e.map(s=>s.slug));for(let s of t){if(s.type==="relationship"){let i=Array.isArray(s.relationTo)?s.relationTo:[s.relationTo];for(let o of i)o!=="*"&&!n.has(o)&&console.warn(`[Kyro Config Warning]: Relationship field "${s.name}" references unknown collection "${o}". Select options will not be available until this collection is registered.`);}if(s.type==="upload"){let i=Array.isArray(s.relationTo)?s.relationTo:[s.relationTo];for(let o of i)n.has(o)||r.push(`Upload field "${s.name}" references unknown collection "${o}"`);}if("fields"in s&&s.fields){let i=dr(s.fields,e);r.push(...i);}if("tabs"in s)for(let i of s.tabs){let o=dr(i.fields,e);r.push(...o);}if("blocks"in s)for(let i of s.blocks){let o=dr(i.fields,e);r.push(...o);}}return r}var b={};chunkBUNLC3II_cjs.d(b,{BRAND:()=>chunkOUMUIICN_cjs.ca,DIRTY:()=>chunkOUMUIICN_cjs.p,EMPTY_PATH:()=>chunkOUMUIICN_cjs.l,INVALID:()=>chunkOUMUIICN_cjs.o,NEVER:()=>chunkOUMUIICN_cjs.Wa,OK:()=>chunkOUMUIICN_cjs.q,ParseStatus:()=>chunkOUMUIICN_cjs.n,Schema:()=>chunkOUMUIICN_cjs.v,ZodAny:()=>chunkOUMUIICN_cjs.F,ZodArray:()=>chunkOUMUIICN_cjs.J,ZodBigInt:()=>chunkOUMUIICN_cjs.z,ZodBoolean:()=>chunkOUMUIICN_cjs.A,ZodBranded:()=>chunkOUMUIICN_cjs.da,ZodCatch:()=>chunkOUMUIICN_cjs.aa,ZodDate:()=>chunkOUMUIICN_cjs.B,ZodDefault:()=>chunkOUMUIICN_cjs.$,ZodDiscriminatedUnion:()=>chunkOUMUIICN_cjs.M,ZodEffects:()=>chunkOUMUIICN_cjs.Y,ZodEnum:()=>chunkOUMUIICN_cjs.V,ZodError:()=>chunkOUMUIICN_cjs.g,ZodFirstPartyTypeKind:()=>chunkOUMUIICN_cjs.ia,ZodFunction:()=>chunkOUMUIICN_cjs.S,ZodIntersection:()=>chunkOUMUIICN_cjs.N,ZodIssueCode:()=>chunkOUMUIICN_cjs.e,ZodLazy:()=>chunkOUMUIICN_cjs.T,ZodLiteral:()=>chunkOUMUIICN_cjs.U,ZodMap:()=>chunkOUMUIICN_cjs.Q,ZodNaN:()=>chunkOUMUIICN_cjs.ba,ZodNativeEnum:()=>chunkOUMUIICN_cjs.W,ZodNever:()=>chunkOUMUIICN_cjs.H,ZodNull:()=>chunkOUMUIICN_cjs.E,ZodNullable:()=>chunkOUMUIICN_cjs._,ZodNumber:()=>chunkOUMUIICN_cjs.y,ZodObject:()=>chunkOUMUIICN_cjs.K,ZodOptional:()=>chunkOUMUIICN_cjs.Z,ZodParsedType:()=>chunkOUMUIICN_cjs.c,ZodPipeline:()=>chunkOUMUIICN_cjs.ea,ZodPromise:()=>chunkOUMUIICN_cjs.X,ZodReadonly:()=>chunkOUMUIICN_cjs.fa,ZodRecord:()=>chunkOUMUIICN_cjs.P,ZodSchema:()=>chunkOUMUIICN_cjs.v,ZodSet:()=>chunkOUMUIICN_cjs.R,ZodString:()=>chunkOUMUIICN_cjs.x,ZodSymbol:()=>chunkOUMUIICN_cjs.C,ZodTransformer:()=>chunkOUMUIICN_cjs.Y,ZodTuple:()=>chunkOUMUIICN_cjs.O,ZodType:()=>chunkOUMUIICN_cjs.v,ZodUndefined:()=>chunkOUMUIICN_cjs.D,ZodUnion:()=>chunkOUMUIICN_cjs.L,ZodUnknown:()=>chunkOUMUIICN_cjs.G,ZodVoid:()=>chunkOUMUIICN_cjs.I,addIssueToContext:()=>chunkOUMUIICN_cjs.m,any:()=>chunkOUMUIICN_cjs.ta,array:()=>chunkOUMUIICN_cjs.xa,bigint:()=>chunkOUMUIICN_cjs.na,boolean:()=>chunkOUMUIICN_cjs.oa,coerce:()=>chunkOUMUIICN_cjs.Va,custom:()=>chunkOUMUIICN_cjs.ga,date:()=>chunkOUMUIICN_cjs.pa,datetimeRegex:()=>chunkOUMUIICN_cjs.w,defaultErrorMap:()=>chunkOUMUIICN_cjs.h,discriminatedUnion:()=>chunkOUMUIICN_cjs.Ba,effect:()=>chunkOUMUIICN_cjs.Na,enum:()=>chunkOUMUIICN_cjs.Ka,function:()=>chunkOUMUIICN_cjs.Ha,getErrorMap:()=>chunkOUMUIICN_cjs.j,getParsedType:()=>chunkOUMUIICN_cjs.d,instanceof:()=>chunkOUMUIICN_cjs.ja,intersection:()=>chunkOUMUIICN_cjs.Ca,isAborted:()=>chunkOUMUIICN_cjs.r,isAsync:()=>chunkOUMUIICN_cjs.u,isDirty:()=>chunkOUMUIICN_cjs.s,isValid:()=>chunkOUMUIICN_cjs.t,late:()=>chunkOUMUIICN_cjs.ha,lazy:()=>chunkOUMUIICN_cjs.Ia,literal:()=>chunkOUMUIICN_cjs.Ja,makeIssue:()=>chunkOUMUIICN_cjs.k,map:()=>chunkOUMUIICN_cjs.Fa,nan:()=>chunkOUMUIICN_cjs.ma,nativeEnum:()=>chunkOUMUIICN_cjs.La,never:()=>chunkOUMUIICN_cjs.va,null:()=>chunkOUMUIICN_cjs.sa,nullable:()=>chunkOUMUIICN_cjs.Pa,number:()=>chunkOUMUIICN_cjs.la,object:()=>chunkOUMUIICN_cjs.ya,objectUtil:()=>chunkOUMUIICN_cjs.b,oboolean:()=>chunkOUMUIICN_cjs.Ua,onumber:()=>chunkOUMUIICN_cjs.Ta,optional:()=>chunkOUMUIICN_cjs.Oa,ostring:()=>chunkOUMUIICN_cjs.Sa,pipeline:()=>chunkOUMUIICN_cjs.Ra,preprocess:()=>chunkOUMUIICN_cjs.Qa,promise:()=>chunkOUMUIICN_cjs.Ma,quotelessJson:()=>chunkOUMUIICN_cjs.f,record:()=>chunkOUMUIICN_cjs.Ea,set:()=>chunkOUMUIICN_cjs.Ga,setErrorMap:()=>chunkOUMUIICN_cjs.i,strictObject:()=>chunkOUMUIICN_cjs.za,string:()=>chunkOUMUIICN_cjs.ka,symbol:()=>chunkOUMUIICN_cjs.qa,transformer:()=>chunkOUMUIICN_cjs.Na,tuple:()=>chunkOUMUIICN_cjs.Da,undefined:()=>chunkOUMUIICN_cjs.ra,union:()=>chunkOUMUIICN_cjs.Aa,unknown:()=>chunkOUMUIICN_cjs.ua,util:()=>chunkOUMUIICN_cjs.a,void:()=>chunkOUMUIICN_cjs.wa});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function oe(t){switch(t.type){case "text":return cd(t);case "number":return ud(t);case "checkbox":return fd(t);case "date":return hd(t);case "email":return dd(t);case "password":return pd(t);case "textarea":return md(t);case "select":return bd(t);case "radio":return yd(t);case "color":return gd(t);case "richtext":return xd(t);case "json":return _d(t);case "code":return wd(t);case "upload":return wo(t);case "image":return wo(t);case "markdown":return Sd(t);case "relationship":return So(t);case "relationship-block":return So(t);case "array":return Ed(t);case "list":return Pd(t);case "group":return vd(t);case "blocks":return Td(t);case "row":return kd(t);case "collapsible":return Cd(t);case "tabs":return Rd(t);default:return b.any()}}function cd(t){let e=b.string();return t.minLength&&(e=e.min(t.minLength)),t.maxLength&&(e=e.max(t.maxLength)),t.pattern&&(e=e.regex(new RegExp(t.pattern))),t.variant==="email"&&(e=e.email()),t.variant==="url"&&(e=e.url()),t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function ud(t){let e=t.integer?b.coerce.number().int():b.coerce.number();return t.min!==void 0&&(e=e.min(t.min)),t.max!==void 0&&(e=e.max(t.max)),t.step&&(e=e.refine(r=>Number.isInteger(r/t.step),`Value must be divisible by ${t.step}`)),t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function fd(t){let e=b.boolean();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function hd(t){let e=b.string().refine(r=>!isNaN(Date.parse(r)),"Invalid date format");return t.minDate&&(e=e.refine(r=>new Date(r)>=new Date(t.minDate),`Date must be after ${t.minDate}`)),t.maxDate&&(e=e.refine(r=>new Date(r)<=new Date(t.maxDate),`Date must be before ${t.maxDate}`)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function dd(t){let e=b.string().email("Invalid email");return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function pd(t){let e=b.string().min(6,"Password must be at least 6 characters");return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function md(t){let e=b.string();return t.minLength&&(e=e.min(t.minLength)),t.maxLength&&(e=e.max(t.maxLength)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function bd(t){let e;if(Array.isArray(t.options)&&t.options.length>0){let r=t.options.map(n=>n.value);t.hasMany?e=b.array(b.enum(r)):e=b.enum(r);}else e=t.hasMany?b.array(b.string()):b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function yd(t){let e;if(Array.isArray(t.options)&&t.options.length>0){let r=t.options.map(n=>n.value);e=b.enum(r);}else e=b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function gd(t){let e=b.string();return t.format==="hex"&&(e=e.regex(/^#[0-9A-Fa-f]{6}$/)),t.format==="rgb"&&(e=e.regex(/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/)),t.format==="hsl"&&(e=e.regex(/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function xd(t){let e=b.array(b.record(b.any()));return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function _d(t){let e=b.union([b.record(b.any()),b.array(b.any())]);return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function wd(t){let e=b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function wo(t){let e;if(t.relationTo){let r=b.object({id:b.string(),url:b.string().optional(),filename:b.string().optional(),mimeType:b.string().optional()});e=b.union([b.string(),r]);}else e=b.string();return t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function Sd(t){let e=b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function So(t){let e;return Array.isArray(t.relationTo)?e=b.object({relationTo:b.enum(t.relationTo),value:b.string()}):e=b.union([b.string(),b.object({relationTo:b.string(),value:b.string()})]),t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function Ed(t){let e=b.object(Object.fromEntries(t.fields.filter(n=>n.name).map(n=>[n.name,oe(n)]))).passthrough(),r=b.array(e);return t.minRows&&(r=r.min(t.minRows)),t.maxRows&&(r=r.max(t.maxRows)),t.required||(r=r.optional().nullable()),t.validate&&(r=X(r,t.validate)),r}function Pd(t){let e=b.array(b.string());return t.required||(e=e.optional().nullable()),e}function vd(t){let e=b.object(Object.fromEntries(t.fields.filter(r=>r.name).map(r=>[r.name,oe(r)])));return t.required?e:e.optional().nullable()}function Td(t){let e=t.blocks||[];e.map(i=>b.object({blockType:b.literal(i.slug),...Object.fromEntries(i.fields.filter(o=>o.name).map(o=>[o.name,oe(o)]))}));let n=e.map(i=>i.slug),s;if(n.length>0){let i=b.object({blockType:b.enum(n)}).catchall(b.any()),o=b.object({blockType:b.string()}).catchall(b.any());s=b.array(b.union([i,o,b.record(b.any())]));}else s=b.array(b.union([b.object({blockType:b.string()}).catchall(b.any()),b.record(b.any())]));return t.minRows&&(s=s.min(t.minRows)),t.maxRows&&(s=s.max(t.maxRows)),t.required||(s=s.optional().nullable()),t.validate&&(s=X(s,t.validate)),s}function kd(t){return b.object(Object.fromEntries(t.fields.filter(r=>r.name).map(r=>[r.name,oe(r)])))}function Cd(t){return b.object(Object.fromEntries(t.fields.filter(r=>r.name).map(r=>[r.name,oe(r)])))}function Rd(t){let e={};for(let r of t.tabs)for(let n of r.fields)n.name&&(e[n.name]=oe(n));return b.object(e).passthrough().optional()}function X(t,e){return t.refine(async r=>await e(r,{required:false})===true,{message:"Custom validation failed"})}function dt(t){let e={};for(let r of t)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs){let i=dt(s.fields);Object.assign(n,i);}r.name?e[r.name]=b.object(n).passthrough().optional():Object.assign(e,n);}else if(r.type==="row"&&"fields"in r){let n=dt(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional():Object.assign(e,n);}else if(r.type==="collapsible"&&"fields"in r){let n=dt(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional():Object.assign(e,n);}else {if(!r.name)continue;e[r.name]=oe(r);}return e}function Le(t){let e={};for(let r of t)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs){let i=Le(s.fields);Object.assign(n,i);}r.name?e[r.name]=b.object(n).passthrough().optional().nullable():Object.assign(e,n);}else if(r.type==="row"&&"fields"in r){let n=Le(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional().nullable():Object.assign(e,n);}else if(r.type==="collapsible"&&"fields"in r){let n=Le(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional().nullable():Object.assign(e,n);}else if(r.type==="group"&&"fields"in r)r.name?e[r.name]=b.object(Le(r.fields)).passthrough().optional().nullable():Object.assign(e,Le(r.fields));else {if(!r.name)continue;e[r.name]=oe(r).optional().nullable();}return e}function Eo(t){let e=dt(t.fields);return t.timestamps&&(e.createdAt=b.string().optional(),e.updatedAt=b.string().optional()),t.tenantScoped&&(e.tenantId=b.string().optional()),e.id=b.string().optional(),b.object(e).passthrough()}function Po(t){let e=dt(t.fields);return b.object(e).passthrough()}function vo(t){let e={};for(let r of t.fields)if(r.name)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs)for(let i of s.fields)i.name&&(n[i.name]=oe(i).optional().nullable());e[r.name]=b.object(n).optional().nullable();}else if(r.type==="row"&&"fields"in r){let n={};for(let s of r.fields)s.name&&(n[s.name]=oe(s).optional().nullable());Object.assign(e,n);}else r.type==="collapsible"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():r.type==="group"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():e[r.name]=oe(r).optional().nullable();return b.object(e).passthrough()}function To(t){let e={};for(let r of t.fields)r.name&&(e[r.name]=b.object({equals:b.any().optional(),not_equals:b.any().optional(),in:b.array(b.any()).optional(),not_in:b.array(b.any()).optional(),greater_than:b.number().optional(),greater_than_equal:b.number().optional(),less_than:b.number().optional(),less_than_equal:b.number().optional(),like:b.string().optional(),not_like:b.string().optional(),contains:b.string().optional(),exists:b.boolean().optional()}).optional());return e.AND=b.array(b.lazy(()=>b.object(e))).optional(),e.OR=b.array(b.lazy(()=>b.object(e))).optional(),b.object(e).optional()}function ko(t){let e=dt(t.fields);return e.id=b.string().optional(),b.object(e).passthrough()}function Co(t){let e={};for(let r of t.fields)if(r.name)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs)for(let i of s.fields)i.name&&(n[i.name]=oe(i).optional().nullable());e[r.name]=b.object(n).optional().nullable();}else r.type==="collapsible"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():r.type==="group"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():e[r.name]=oe(r).optional().nullable();return b.object(e).passthrough()}chunkBUNLC3II_cjs.h();var jt=class{storageProviders=chunkOUMUIICN_cjs.$a();collections=new Map;globals=new Map;plugins=[];schemaCache=new Map;initialized=false;addCollection(e){if(this.initialized)throw new Error("Cannot add collections after Registry has been initialized");if(this.collections.has(e.slug)){console.warn(`[Registry] Duplicate collection slug "${e.slug}" \u2014 skipping`);return}let r={...e,fields:[...e.fields]};for(let s of this.plugins){let i=s.extensions?.collections?.find(o=>o.slug===r.slug);i&&(r={...r,...i.config,fields:[...r.fields,...i.config.fields||[]]});}if(r.seo){let s=chunk5LPNEYK5_cjs.a(),i=r.fields.findIndex(o=>o.type==="tabs");if(i!==-1){let o=r.fields[i];r.fields[i]={...o,tabs:[...o.tabs,{label:"SEO Settings",fields:s.fields}]};}else r.fields.push(s);}r.fields=this.applyFieldDefaults(r);let n=Hn(r);if(n.length>0)throw new Error(`Invalid collection config: ${n.join(", ")}`);this.collections.set(r.slug,r),this.clearSchemaCache(r.slug);}addCollections(e){for(let r of e)this.addCollection(r);}getCollection(e){return this.collections.get(e)}getCollections(){return Array.from(this.collections.values())}getCollectionSlugs(){return Array.from(this.collections.keys())}hasCollection(e){return this.collections.has(e)}removeCollection(e){if(this.initialized)throw new Error("Cannot remove collections after Registry has been initialized");return this.clearSchemaCache(e),this.collections.delete(e)}addGlobal(e){if(this.initialized)throw new Error("Cannot add globals after Registry has been initialized");this._addGlobalUnsafe(e);}addGlobalPostInit(e){this.globals.has(e.slug)&&this.globals.delete(e.slug),this._addGlobalUnsafe(e);}_addGlobalUnsafe(e){if(this.globals.has(e.slug)){console.warn(`[Registry] Duplicate global slug "${e.slug}" \u2014 skipping`);return}let r=zn(e);if(r.length>0)throw new Error(`Invalid global config: ${r.join(", ")}`);let n={...e};for(let s of this.plugins){let i=s.extensions?.globals?.find(o=>o.slug===n.slug);i&&(n={...n,...i.config,fields:[...n.fields||[],...i.config.fields||[]]});}this.globals.set(n.slug,n),this.clearSchemaCache(`global:${n.slug}`);}addGlobals(e){for(let r of e)this.addGlobal(r);}getGlobal(e){return this.globals.get(e)}getGlobals(){return Array.from(this.globals.values())}getGlobalSlugs(){return Array.from(this.globals.keys())}hasGlobal(e){return this.globals.has(e)}removeGlobal(e){if(this.initialized)throw new Error("Cannot remove globals after Registry has been initialized");return this.clearSchemaCache(`global:${e}`),this.globals.delete(e)}addPlugin(e){if(this.initialized)throw new Error("Cannot add plugins after Registry has been initialized");this.plugins.push(e);}getPlugins(){return [...this.plugins]}getZodSchema(e){let r=this.schemaCache.get(e);if(r)return r;let n=this.collections.get(e);if(n){let i=Eo(n);return this.schemaCache.set(e,i),i}let s=this.globals.get(e);if(s){let i=ko(s);return this.schemaCache.set(`global:${e}`,i),i}throw new Error(`No collection or global found with slug "${e}"`)}getCreateZodSchema(e){let r=`${e}:create`,n=this.schemaCache.get(r);if(n)return n;let s=this.collections.get(e);if(s){let i=Po(s);return this.schemaCache.set(r,i),i}throw new Error(`No collection found with slug "${e}"`)}getUpdateZodSchema(e){let r=`${e}:update`,n=this.schemaCache.get(r);if(n)return n;let s=this.collections.get(e);if(s){let o=vo(s);return this.schemaCache.set(r,o),o}let i=this.globals.get(e);if(i){let o=Co(i);return this.schemaCache.set(`global:${e}:update`,o),o}throw new Error(`No collection or global found with slug "${e}"`)}getWhereZodSchema(e){let r=`${e}:where`,n=this.schemaCache.get(r);if(n)return n;let s=this.collections.get(e);if(s){let i=To(s);return this.schemaCache.set(r,i),i}throw new Error(`No collection found with slug "${e}"`)}getFieldZodSchema(e){return oe(e)}clearSchemaCache(e){this.schemaCache.delete(e),this.schemaCache.delete(`${e}:create`),this.schemaCache.delete(`${e}:update`),this.schemaCache.delete(`${e}:where`);}applyFieldDefaults(e){let r=[...e.fields];return r.some(n=>n.name==="id")||r.unshift({name:"id",type:"text",admin:{readOnly:true,hidden:true}}),e.tenantScoped&&!r.some(n=>n.name==="tenantId")&&r.push({name:"tenantId",type:"text",required:true,admin:{readOnly:true,hidden:true}}),e.timestamps&&!r.some(n=>n.name==="createdAt")&&(r.push({name:"createdAt",type:"date",admin:{readOnly:true,hidden:true}}),r.push({name:"updatedAt",type:"date",admin:{readOnly:true,hidden:true}})),e.versions?.drafts&&!r.some(n=>n.name==="status")&&r.push({name:"status",type:"select",options:[{value:"draft",label:"Draft"},{value:"published",label:"Published"}],admin:{readOnly:true,hidden:true}}),e.auth&&!r.some(n=>n.name==="password")&&r.push({name:"password",type:"password",required:true,admin:{hidden:true}}),r}getFields(e){let r=this.collections.get(e);if(r)return r.fields;let n=this.globals.get(e);if(n)return n.fields;throw new Error(`No collection or global found with slug "${e}"`)}getFieldMap(e){let r=this.getFields(e),n=new Map,s=i=>{for(let o of i){if(o.name&&n.set(o.name,o),"fields"in o&&o.fields&&s(o.fields),"tabs"in o)for(let a of o.tabs)s(a.fields);if("blocks"in o)for(let a of o.blocks)s(a.fields);}};return s(r),n}getVisibleFields(e){return this.getFields(e).filter(n=>!n.admin?.hidden)}validate(){let e=this.getCollections(),r=this.getGlobals();_o(e,r);}async init(e){this.validate();for(let r of this.plugins){r.init&&await r.init(e||this);let n=r.collections||[];for(let i of n)i.slug&&!this.hasCollection(i.slug)&&this.addCollection(i);let s=r.globals||[];for(let i of s)i.slug&&!this.hasGlobal(i.slug)&&this.addGlobal(i);}this.initialized=true;}isInitialized(){return this.initialized}getPaginationDefaults(e){let r=this.collections.get(e);return {defaultLimit:r?.admin?.pagination?.defaultLimit||10,limits:r?.admin?.pagination?.limits||[10,25,50,100]}}getDefaultSort(e){let n=this.collections.get(e)?.admin?.useAsTitle;return n||"createdAt"}getDefaultColumns(e){let r=this.collections.get(e);return r?.admin?.defaultColumns?r.admin.defaultColumns:this.getVisibleFields(e).slice(0,4).map(s=>s.name)}getAdminTitle(e){let r=this.collections.get(e);return r?.label||r?.admin?.description||e}getAdminLabel(e){let r=this.collections.get(e);return r?.singularLabel||r?.label||e}getAdminGroup(e){return this.collections.get(e)?.admin?.group}getStats(){let e=0;for(let r of this.collections.values())e+=r.fields.length;for(let r of this.globals.values())e+=r.fields.length;return {collections:this.collections.size,globals:this.globals.size,plugins:this.plugins.length,fields:e}}toJSON(){return {collections:this.getCollections(),globals:this.getGlobals()}}},pt=null;function Ad(){return pt||(pt=new jt),pt}function Ld(){pt=null;}function Vn(){return pt=new jt,pt}chunkBUNLC3II_cjs.h();var ge=class{name;displayName;adminEntry;version;description;hooks={};collections=[];globals=[];fields=[];extensions={collections:[],globals:[]};adminComponents={};adminStyles=[];serverMiddleware;clientMiddleware;constructor(e){this.name=e;}async init(e){}async beforeInit(e){}async afterInit(e){}getCollections(){return this.collections}getGlobals(){return this.globals}getHooks(){return this.hooks}},mr=class{plugins=new Map;hooks=new Map;register(e){if(this.plugins.has(e.name))throw new Error(`Plugin "${e.name}" is already registered`);this.plugins.set(e.name,e);let r=e.getHooks?.()||{};for(let[n,s]of Object.entries(r))if(Array.isArray(s))for(let i of s)this.registerHook(n,i);}unregister(e){let r=this.plugins.get(e);if(!r)return;let n=r.getHooks?.()||{};for(let[s,i]of Object.entries(n))if(Array.isArray(i))for(let o of i)this.unregisterHook(s,o);this.plugins.delete(e);}get(e){return this.plugins.get(e)}getAll(){return Array.from(this.plugins.values())}has(e){return this.plugins.has(e)}registerHook(e,r){this.hooks.has(e)||this.hooks.set(e,[]),this.hooks.get(e).push(r);}unregisterHook(e,r){let n=this.hooks.get(e);if(n){let s=n.indexOf(r);s>-1&&n.splice(s,1);}}async executeHook(e,r){let n=this.hooks.get(e)||[],s=r;for(let i of n)try{let o=await i({...r,data:s});o!==void 0&&(s=o);}catch(o){console.error(`[PluginManager] Error in hook "${e}":`,o);}return s}getAllCollections(){let e=[];for(let r of this.plugins.values()){let n=r.getCollections?.()||[];e.push(...n);}return e}getAllGlobals(){let e=[];for(let r of this.plugins.values()){let n=r.getGlobals?.()||[];e.push(...n);}return e}getAllFields(){let e=[];for(let r of this.plugins.values())e.push(...r.fields);return e}getAdminComponents(){let e={};for(let r of this.plugins.values())Object.assign(e,r.adminComponents);return e}getAdminStyles(){let e=[];for(let r of this.plugins.values())e.push(...r.adminStyles);return e}},Wn=class extends ge{constructor(){super("seo"),this.displayName="Core SEO",this.description="Advanced SEO features including sitemaps, robots.txt, and structured data",this.adminEntry="@kyro-cms/admin/plugins/seo-admin",this.collections.push({slug:"seo-settings",label:"SEO Settings",fields:[{name:"sitemap",type:"checkbox",label:"Enable Sitemap",defaultValue:true},{name:"robotsTxt",type:"richtext",label:"robots.txt Content"},{name:"canonicalUrl",type:"text",variant:"url",label:"Canonical URL"},{name:"ogImage",type:"text",label:"Default OG Image URL"}]});}},Kn=class extends ge{constructor(){super("analytics"),this.displayName="Core Analytics",this.description="Built-in privacy-friendly analytics and dashboards",this.collections.push({slug:"analytics-events",label:"Analytics Events",fields:[{name:"name",type:"text",required:true},{name:"properties",type:"json",label:"Event Properties"},{name:"timestamp",type:"date",required:true},{name:"userId",type:"text",label:"User ID"},{name:"sessionId",type:"text",label:"Session ID"}]}),this.adminComponents.AnalyticsDashboard={};}},Qn=class extends ge{constructor(){super("comments"),this.description="Commenting system for products and posts",this.collections.push({slug:"comments",label:"Comments",fields:[{name:"content",type:"richtext",required:true},{name:"author",type:"text",required:true},{name:"email",type:"email"},{name:"approved",type:"checkbox",defaultValue:false},{name:"parent",type:"text",label:"Parent Comment ID"},{name:"resourceType",type:"text",required:true},{name:"resourceId",type:"text",required:true}]}),this.adminComponents.CommentModeration={};}},Zn=class extends ge{constructor(){super("reviews"),this.description="Product reviews and ratings",this.collections.push({slug:"reviews",label:"Reviews",fields:[{name:"rating",type:"number",required:true,min:1,max:5},{name:"title",type:"text"},{name:"content",type:"richtext",required:true},{name:"author",type:"relationship",relationTo:"customers"},{name:"product",type:"relationship",relationTo:"products",required:true},{name:"approved",type:"checkbox",defaultValue:false},{name:"verified",type:"checkbox",label:"Verified Purchase"},{name:"helpful",type:"number",label:"Helpful Count",defaultValue:0}]}),this.adminComponents.ReviewModeration={};}},Jn=class extends ge{constructor(){super("wishlist"),this.description="Customer wishlists",this.collections.push({slug:"wishlists",label:"Wishlists",fields:[{name:"customer",type:"relationship",relationTo:"customers",required:true},{name:"name",type:"text",label:"Wishlist Name",defaultValue:"My Wishlist"},{name:"items",type:"blocks",label:"Items",blocks:[{slug:"wishlist-item",label:"Item",fields:[{name:"product",type:"relationship",relationTo:"products"},{name:"quantity",type:"number",defaultValue:1},{name:"addedAt",type:"date"},{name:"priority",type:"select",options:[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"}]}]}]}]});}},Cg={SEO:Wn,Analytics:Kn,Comments:Qn,Reviews:Zn,Wishlist:Jn};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ue={red:"\x1B[31m",yellow:"\x1B[33m",magenta:"\x1B[35m",cyan:"\x1B[36m",reset:"\x1B[0m"},Ro=Ue.yellow+"WARN"+Ue.reset,Ao=Ue.cyan+"INFO"+Ue.reset,Lo=Ue.red+"ERR"+Ue.reset,Oo=Ue.magenta+"DEBUG"+Ue.reset,qt={debug:0,info:1,warn:2,error:3,silent:4},br=()=>{},yr=t=>(...e)=>console.log(t,...e),Od=console.debug?(...t)=>console.debug(Oo,...t):yr(Oo),Fd=console.info?(...t)=>console.info(Ao,...t):yr(Ao),Id=console.warn?(...t)=>console.warn(Ro,...t):yr(Ro),Dd=console.error?(...t)=>console.error(Lo,...t):yr(Lo),gr=(t=globalThis.process?.env.DEBUG==="1"?"debug":"info")=>{let e=qt[t];return {debug:e>qt.debug?br:Od,info:e>qt.info?br:Fd,warn:e>qt.warn?br:Id,error:e>qt.error?br:Dd}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var xr=Symbol.for("@whatwg-node/promise-helpers/FakePromise");function N(t){return t?.then!=null}function jd(t){let e=t;return e&&e.then&&e.catch&&e.finally}function k(t,e,r,n){let s=$().then(t).then(e,r);return Mt(s)}function $(t){return t&&jd(t)?t:N(t)?{then:(e,r)=>$(t.then(e,r)),catch:e=>$(t.then(r=>r,e)),finally:e=>$(e?Md(t,e):t),[Symbol.toStringTag]:"Promise"}:{then(e){if(e)try{return $(e(t))}catch(r){return mt(r)}return this},catch(){return this},finally(e){if(e)try{return $(e()).then(()=>t,()=>t)}catch(r){return mt(r)}return this},[Symbol.toStringTag]:"Promise",__fakePromiseValue:t,[xr]:"resolved"}}function Ut(){if(Promise.withResolvers)return Promise.withResolvers();let t,e;return {promise:new Promise(function(s,i){t=s,e=i;}),get resolve(){return t},get reject(){return e}}}function K(t,e,r){if(t?.length===0)return;let n=t[Symbol.iterator](),s=0;function i(){let{done:o,value:a}=n.next();if(o)return;let c=false;function l(){c=true;}return k(function(){return e(a,l,s++)},function(h){if(h&&r?.push(h),!c)return i()})}return i()}function mt(t){return {then(e,r){if(r)try{return $(r(t))}catch(n){return mt(n)}return this},catch(e){if(e)try{return $(e(t))}catch(r){return mt(r)}return this},finally(e){if(e)try{e();}catch(r){return mt(r)}return this},__fakeRejectError:t,[Symbol.toStringTag]:"Promise",[xr]:"rejected"}}function Oe(t,e,r,n){Symbol.asyncIterator in t&&(t=t[Symbol.asyncIterator]());let s,i,o;typeof t.return=="function"&&(s=t.return,i=l=>{let u=()=>{throw l};return s.call(t).then(u,u)});function a(l){return l.done?l:k(()=>l.value,u=>k(()=>e(u),Fo,i))}let c;if(r){let l,u=r;c=h=>(l||=k(()=>h,d=>k(()=>u(d),Fo,i)),l);}return {next(){return t.next().then(a,c)},return(){let l=s?s.call(t).then(a,c):$({value:void 0,done:true});return o?l.then(o):l},throw(l){return typeof t.throw=="function"?t.throw(l).then(a,c):i?i(l):mt(l)},[Symbol.asyncIterator](){return this}}}function Fo(t){return {value:t,done:false}}function qd(t){return t?.[xr]==="resolved"}function Ud(t){return t?.[xr]==="rejected"}function Md(t,e){return "finally"in t?t.finally(e):t.then(r=>{let n=e();return N(n)?n.then(()=>r):r},r=>{let n=e();if(N(n))return n.then(()=>{throw r});throw r})}function Mt(t){if(qd(t))return t.__fakePromiseValue;if(Ud(t))throw t.__fakeRejectError;return t}chunkBUNLC3II_cjs.h();var Io='<!doctype html><html lang=en><head><meta charset=utf-8><title>__TITLE__</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><link crossorigin rel=stylesheet href=https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/graphiql.css></head><body id=body class=no-focus-outline><noscript>You need to enable JavaScript to run this app.</noscript><div id=root>Loading __TITLE__...</div><script>function prepareBlob(r){const o=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(o)}const workers={},workerUrls={editorWorkerService:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/editor.worker.bundle.js",json:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/json.worker.bundle.js",graphql:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/graphql.worker..bundle.js"};function prepareWorkers(){return Promise.all(Object.entries(workerUrls).map(async([r,o])=>{const e=await fetch(o),t=await e.text();workers[r]=prepareBlob(t)}))}self.MonacoEnvironment={globalAPI:!1,getWorkerUrl:function(r,o){return workers[o]}}</script><script src=https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/yoga-graphiql.umd.js></script><script>prepareWorkers().finally(()=>{YogaGraphiQL.renderYogaGraphiQL(root,__OPTS__)})</script></body></html>';function Bd({headers:t,method:e}){return e==="GET"&&!!t?.get("accept")?.includes("text/html")}var $d=t=>Io.replace("__TITLE__",t?.title||"Yoga GraphiQL").replace("__OPTS__",JSON.stringify(t??{}));function Do(t){let e=t.logger??console,r;typeof t?.options=="function"?r=t?.options:typeof t?.options=="object"?r=()=>t?.options:t?.options===false?r=()=>false:r=()=>({});let n=t?.render??$d;return {onRequest({request:s,serverContext:i,fetchAPI:o,endResponse:a,url:c}){let l=t.getGraphQLEndpoint();if(Bd(s)&&(s.url.endsWith(l)||s.url.endsWith(`${l}/`)||c.pathname===l||c.pathname===`${l}/`||t.getGraphQLEndpointURLPattern().test(c)))return e.debug("Rendering GraphiQL"),k(()=>r(s,i),u=>{if(u)return k(()=>n({...u===true?{}:u}),h=>{let d=new o.Response(h,{headers:{"Content-Type":"text/html"},status:200});a(d);})})}}}chunkBUNLC3II_cjs.h();function Yn(t){return t?.[Symbol.toStringTag]==="GraphQLSchema"}var jo=t=>{if(t==null)return {};if(Yn(t))return {onPluginInit({setSchema:e}){e(t);}};if("then"in t){let e;return {onRequestParse(){return {onRequestParseDone(){if(!e)return k(()=>t,r=>{e=r;})}}},onEnveloped({setSchema:r}){if(e==null)throw new Error("You provide a promise of a schema but it hasn't been resolved yet. Make sure you use this plugin with GraphQL Yoga.");if(!Yn(e))throw new Error("The resolved schema is not a valid GraphQLSchema instance.");r(e);}}}if(typeof t=="function"){let e=new WeakMap;return {onRequestParse({request:r,serverContext:n}){return {onRequestParseDone(){return k(()=>t({...n,request:r}),s=>{if(!Yn(s))throw new Error("The factory function did not return a valid GraphQLSchema.");e.set(r,s);})}}},onEnveloped({setSchema:r,context:n}){if(n?.request==null)throw new Error("Request object is not available in the context. Make sure you use this plugin with GraphQL Yoga.");let s=e.get(n.request);if(s==null)throw new Error("No schema found for this request. Make sure you use this plugin with GraphQL Yoga.");r(s);}}}throw new Error("Invalid schema definition provided, expected a schema, promise or function.")};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function ee(t){return _r(t,[])}function _r(t,e){switch(typeof t){case "string":return JSON.stringify(t);case "function":return t.name?`[function ${t.name}]`:"[function]";case "object":return Nd(t,e);default:return String(t)}}function qo(t){return (t.name="GraphQLError")?t.toString():`${t.name}: ${t.message};
|
|
20
|
+
`)}`),this.name="ConfigValidationError",this.errors=e;}};function zn(t){let e=[];if(t.slug?/^[a-z][a-z0-9_-]*$/.test(t.slug)||e.push(`Collection slug "${t.slug}" must be lowercase alphanumeric with dashes`):e.push('Collection is missing a "slug" property'),!t.fields||t.fields.length===0)e.push(`Collection "${t.slug}" has no fields defined`);else {let r=Ze(t.fields,t.slug);e.push(...r);}if(t.access)for(let[r,n]of Object.entries(t.access))typeof n!="boolean"&&typeof n!="function"&&e.push(`Collection "${t.slug}" has invalid access.${r} (must be boolean or function)`);if(t.admin?.useAsTitle&&(pr(t.fields,t.admin.useAsTitle)||e.push(`Collection "${t.slug}" admin.useAsTitle references unknown field "${t.admin.useAsTitle}"`)),t.admin?.defaultColumns)for(let r of t.admin.defaultColumns)pr(t.fields,r)||e.push(`Collection "${t.slug}" admin.defaultColumns references unknown field "${r}"`);if(t.upload&&t.upload.fileSize&&t.upload.fileSize<=0&&e.push(`Collection "${t.slug}" upload.fileSize must be positive`),t.versions&&t.versions.maxPerDoc&&t.versions.maxPerDoc<=0&&e.push(`Collection "${t.slug}" versions.maxPerDoc must be positive`),t.auth){let r=t.fields.some(s=>s.name==="email"),n=t.fields.some(s=>s.name==="password");r||e.push(`Collection "${t.slug}" with auth enabled requires an "email" field`),n||e.push(`Collection "${t.slug}" with auth enabled requires a "password" field`);}return e}function Hn(t){let e=[];if(t.slug?/^[a-z][a-z0-9_-]*$/.test(t.slug)||e.push(`Global slug "${t.slug}" must be lowercase alphanumeric with dashes`):e.push('Global is missing a "slug" property'),!t.fields||t.fields.length===0)e.push(`Global "${t.slug}" has no fields defined`);else {let r=Ze(t.fields,`global:${t.slug}`);e.push(...r);}return e}function Ze(t,e){let r=[],n=new Set;for(let s=0;s<t.length;s++){let i=t[s];if(i.type==="row"||i.type==="collapsible"||i.type==="tabs"){if("fields"in i&&i.fields){let a=Ze(i.fields,e);r.push(...a);}else if("tabs"in i)for(let a of i.tabs){let c=Ze(a.fields,e);r.push(...c);}continue}let o=i.name;if(!o){r.push(`${e}: Field at index ${s} is missing a "name" property`);continue}if(n.has(o)&&r.push(`${e}: Duplicate field name "${o}"`),n.add(o),/^[a-zA-Z][a-zA-Z0-9_]*$/.test(o)||r.push(`${e}: Field name "${o}" must be alphanumeric with underscores`),!i.type){r.push(`${e}: Field "${o}" is missing a "type" property`);continue}switch(i.type){case "relationship":i.relationTo||r.push(`${e}: Relationship field "${o}" is missing "relationTo"`);break;case "array":if(!i.fields||i.fields.length===0)r.push(`${e}: Array field "${o}" has no fields defined`);else {let a=Ze(i.fields,`${e}.${o}`);r.push(...a);}break;case "group":if(!i.fields||i.fields.length===0)r.push(`${e}: Group field "${o}" has no fields defined`);else {let a=Ze(i.fields,`${e}.${o}`);r.push(...a);}break;case "blocks":if(!i.blocks||i.blocks.length===0)r.push(`${e}: Blocks field "${o}" has no blocks defined`);else {let a=ld(i.blocks,`${e}.${o}`);r.push(...a);}break;case "select":case "radio":if(typeof i.options=="function")break;if((!i.options||i.options.length===0)&&!i.dynamicOptions)r.push(`${e}: ${i.type} field "${o}" has no options defined`);else if(Array.isArray(i.options)){let a=i.options.map(l=>l.value),c=new Set(a);a.length!==c.size&&r.push(`${e}: ${i.type} field "${o}" has duplicate option values`);}break;case "upload":i.relationTo||r.push(`${e}: Upload field "${o}" is missing "relationTo"`);break}"min"in i&&"max"in i&&i.min>i.max&&r.push(`${e}: Field "${o}" has min greater than max`),"minLength"in i&&"maxLength"in i&&i.minLength>i.maxLength&&r.push(`${e}: Field "${o}" has minLength greater than maxLength`),"minRows"in i&&"maxRows"in i&&i.minRows>i.maxRows&&r.push(`${e}: Field "${o}" has minRows greater than maxRows`);}return r}function ld(t,e){let r=[],n=new Set;for(let s of t){if(!s.slug){r.push(`${e}: Block is missing a "slug" property`);continue}if(n.has(s.slug)&&r.push(`${e}: Duplicate block slug "${s.slug}"`),n.add(s.slug),s.label||r.push(`${e}: Block "${s.slug}" is missing a "label" property`),!s.fields||s.fields.length===0)r.push(`${e}: Block "${s.slug}" has no fields defined`);else {let i=Ze(s.fields,`${e}.${s.slug}`);r.push(...i);}}return r}function _o(t,e=[]){let r=[],n=new Set;for(let s of t)n.has(s.slug)&&r.push(`Duplicate collection slug "${s.slug}"`),n.add(s.slug);for(let s of e)n.has(s.slug)&&r.push(`Duplicate global slug "${s.slug}"`),n.add(s.slug);for(let s of t){let i=zn(s);r.push(...i);}for(let s of e){let i=Hn(s);r.push(...i);}for(let s of t){let i=dr(s.fields,t);r.push(...i);}if(r.length>0)throw new Gn(r)}function dr(t,e){let r=[],n=new Set(e.map(s=>s.slug));for(let s of t){if(s.type==="relationship"){let i=Array.isArray(s.relationTo)?s.relationTo:[s.relationTo];for(let o of i)o!=="*"&&!n.has(o)&&console.warn(`[Kyro Config Warning]: Relationship field "${s.name}" references unknown collection "${o}". Select options will not be available until this collection is registered.`);}if(s.type==="upload"){let i=Array.isArray(s.relationTo)?s.relationTo:[s.relationTo];for(let o of i)n.has(o)||r.push(`Upload field "${s.name}" references unknown collection "${o}"`);}if("fields"in s&&s.fields){let i=dr(s.fields,e);r.push(...i);}if("tabs"in s)for(let i of s.tabs){let o=dr(i.fields,e);r.push(...o);}if("blocks"in s)for(let i of s.blocks){let o=dr(i.fields,e);r.push(...o);}}return r}var b={};chunkBUNLC3II_cjs.d(b,{BRAND:()=>chunk6QWX3DEB_cjs.ca,DIRTY:()=>chunk6QWX3DEB_cjs.p,EMPTY_PATH:()=>chunk6QWX3DEB_cjs.l,INVALID:()=>chunk6QWX3DEB_cjs.o,NEVER:()=>chunk6QWX3DEB_cjs.Wa,OK:()=>chunk6QWX3DEB_cjs.q,ParseStatus:()=>chunk6QWX3DEB_cjs.n,Schema:()=>chunk6QWX3DEB_cjs.v,ZodAny:()=>chunk6QWX3DEB_cjs.F,ZodArray:()=>chunk6QWX3DEB_cjs.J,ZodBigInt:()=>chunk6QWX3DEB_cjs.z,ZodBoolean:()=>chunk6QWX3DEB_cjs.A,ZodBranded:()=>chunk6QWX3DEB_cjs.da,ZodCatch:()=>chunk6QWX3DEB_cjs.aa,ZodDate:()=>chunk6QWX3DEB_cjs.B,ZodDefault:()=>chunk6QWX3DEB_cjs.$,ZodDiscriminatedUnion:()=>chunk6QWX3DEB_cjs.M,ZodEffects:()=>chunk6QWX3DEB_cjs.Y,ZodEnum:()=>chunk6QWX3DEB_cjs.V,ZodError:()=>chunk6QWX3DEB_cjs.g,ZodFirstPartyTypeKind:()=>chunk6QWX3DEB_cjs.ia,ZodFunction:()=>chunk6QWX3DEB_cjs.S,ZodIntersection:()=>chunk6QWX3DEB_cjs.N,ZodIssueCode:()=>chunk6QWX3DEB_cjs.e,ZodLazy:()=>chunk6QWX3DEB_cjs.T,ZodLiteral:()=>chunk6QWX3DEB_cjs.U,ZodMap:()=>chunk6QWX3DEB_cjs.Q,ZodNaN:()=>chunk6QWX3DEB_cjs.ba,ZodNativeEnum:()=>chunk6QWX3DEB_cjs.W,ZodNever:()=>chunk6QWX3DEB_cjs.H,ZodNull:()=>chunk6QWX3DEB_cjs.E,ZodNullable:()=>chunk6QWX3DEB_cjs._,ZodNumber:()=>chunk6QWX3DEB_cjs.y,ZodObject:()=>chunk6QWX3DEB_cjs.K,ZodOptional:()=>chunk6QWX3DEB_cjs.Z,ZodParsedType:()=>chunk6QWX3DEB_cjs.c,ZodPipeline:()=>chunk6QWX3DEB_cjs.ea,ZodPromise:()=>chunk6QWX3DEB_cjs.X,ZodReadonly:()=>chunk6QWX3DEB_cjs.fa,ZodRecord:()=>chunk6QWX3DEB_cjs.P,ZodSchema:()=>chunk6QWX3DEB_cjs.v,ZodSet:()=>chunk6QWX3DEB_cjs.R,ZodString:()=>chunk6QWX3DEB_cjs.x,ZodSymbol:()=>chunk6QWX3DEB_cjs.C,ZodTransformer:()=>chunk6QWX3DEB_cjs.Y,ZodTuple:()=>chunk6QWX3DEB_cjs.O,ZodType:()=>chunk6QWX3DEB_cjs.v,ZodUndefined:()=>chunk6QWX3DEB_cjs.D,ZodUnion:()=>chunk6QWX3DEB_cjs.L,ZodUnknown:()=>chunk6QWX3DEB_cjs.G,ZodVoid:()=>chunk6QWX3DEB_cjs.I,addIssueToContext:()=>chunk6QWX3DEB_cjs.m,any:()=>chunk6QWX3DEB_cjs.ta,array:()=>chunk6QWX3DEB_cjs.xa,bigint:()=>chunk6QWX3DEB_cjs.na,boolean:()=>chunk6QWX3DEB_cjs.oa,coerce:()=>chunk6QWX3DEB_cjs.Va,custom:()=>chunk6QWX3DEB_cjs.ga,date:()=>chunk6QWX3DEB_cjs.pa,datetimeRegex:()=>chunk6QWX3DEB_cjs.w,defaultErrorMap:()=>chunk6QWX3DEB_cjs.h,discriminatedUnion:()=>chunk6QWX3DEB_cjs.Ba,effect:()=>chunk6QWX3DEB_cjs.Na,enum:()=>chunk6QWX3DEB_cjs.Ka,function:()=>chunk6QWX3DEB_cjs.Ha,getErrorMap:()=>chunk6QWX3DEB_cjs.j,getParsedType:()=>chunk6QWX3DEB_cjs.d,instanceof:()=>chunk6QWX3DEB_cjs.ja,intersection:()=>chunk6QWX3DEB_cjs.Ca,isAborted:()=>chunk6QWX3DEB_cjs.r,isAsync:()=>chunk6QWX3DEB_cjs.u,isDirty:()=>chunk6QWX3DEB_cjs.s,isValid:()=>chunk6QWX3DEB_cjs.t,late:()=>chunk6QWX3DEB_cjs.ha,lazy:()=>chunk6QWX3DEB_cjs.Ia,literal:()=>chunk6QWX3DEB_cjs.Ja,makeIssue:()=>chunk6QWX3DEB_cjs.k,map:()=>chunk6QWX3DEB_cjs.Fa,nan:()=>chunk6QWX3DEB_cjs.ma,nativeEnum:()=>chunk6QWX3DEB_cjs.La,never:()=>chunk6QWX3DEB_cjs.va,null:()=>chunk6QWX3DEB_cjs.sa,nullable:()=>chunk6QWX3DEB_cjs.Pa,number:()=>chunk6QWX3DEB_cjs.la,object:()=>chunk6QWX3DEB_cjs.ya,objectUtil:()=>chunk6QWX3DEB_cjs.b,oboolean:()=>chunk6QWX3DEB_cjs.Ua,onumber:()=>chunk6QWX3DEB_cjs.Ta,optional:()=>chunk6QWX3DEB_cjs.Oa,ostring:()=>chunk6QWX3DEB_cjs.Sa,pipeline:()=>chunk6QWX3DEB_cjs.Ra,preprocess:()=>chunk6QWX3DEB_cjs.Qa,promise:()=>chunk6QWX3DEB_cjs.Ma,quotelessJson:()=>chunk6QWX3DEB_cjs.f,record:()=>chunk6QWX3DEB_cjs.Ea,set:()=>chunk6QWX3DEB_cjs.Ga,setErrorMap:()=>chunk6QWX3DEB_cjs.i,strictObject:()=>chunk6QWX3DEB_cjs.za,string:()=>chunk6QWX3DEB_cjs.ka,symbol:()=>chunk6QWX3DEB_cjs.qa,transformer:()=>chunk6QWX3DEB_cjs.Na,tuple:()=>chunk6QWX3DEB_cjs.Da,undefined:()=>chunk6QWX3DEB_cjs.ra,union:()=>chunk6QWX3DEB_cjs.Aa,unknown:()=>chunk6QWX3DEB_cjs.ua,util:()=>chunk6QWX3DEB_cjs.a,void:()=>chunk6QWX3DEB_cjs.wa});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function oe(t){switch(t.type){case "text":return cd(t);case "number":return ud(t);case "checkbox":return fd(t);case "date":return hd(t);case "email":return dd(t);case "password":return pd(t);case "textarea":return md(t);case "select":return bd(t);case "radio":return yd(t);case "color":return gd(t);case "richtext":return xd(t);case "json":return _d(t);case "code":return wd(t);case "upload":return wo(t);case "image":return wo(t);case "markdown":return Sd(t);case "relationship":return So(t);case "relationship-block":return So(t);case "array":return Ed(t);case "list":return Pd(t);case "group":return vd(t);case "blocks":return Td(t);case "row":return kd(t);case "collapsible":return Cd(t);case "tabs":return Rd(t);default:return b.any()}}function cd(t){let e=b.string();return t.minLength&&(e=e.min(t.minLength)),t.maxLength&&(e=e.max(t.maxLength)),t.pattern&&(e=e.regex(new RegExp(t.pattern))),t.variant==="email"&&(e=e.email()),t.variant==="url"&&(e=e.url()),t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function ud(t){let e=t.integer?b.coerce.number().int():b.coerce.number();return t.min!==void 0&&(e=e.min(t.min)),t.max!==void 0&&(e=e.max(t.max)),t.step&&(e=e.refine(r=>Number.isInteger(r/t.step),`Value must be divisible by ${t.step}`)),t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function fd(t){let e=b.boolean();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function hd(t){let e=b.string().refine(r=>!isNaN(Date.parse(r)),"Invalid date format");return t.minDate&&(e=e.refine(r=>new Date(r)>=new Date(t.minDate),`Date must be after ${t.minDate}`)),t.maxDate&&(e=e.refine(r=>new Date(r)<=new Date(t.maxDate),`Date must be before ${t.maxDate}`)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function dd(t){let e=b.string().email("Invalid email");return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function pd(t){let e=b.string().min(6,"Password must be at least 6 characters");return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function md(t){let e=b.string();return t.minLength&&(e=e.min(t.minLength)),t.maxLength&&(e=e.max(t.maxLength)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function bd(t){let e;if(Array.isArray(t.options)&&t.options.length>0){let r=t.options.map(n=>n.value);t.hasMany?e=b.array(b.enum(r)):e=b.enum(r);}else e=t.hasMany?b.array(b.string()):b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function yd(t){let e;if(Array.isArray(t.options)&&t.options.length>0){let r=t.options.map(n=>n.value);e=b.enum(r);}else e=b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function gd(t){let e=b.string();return t.format==="hex"&&(e=e.regex(/^#[0-9A-Fa-f]{6}$/)),t.format==="rgb"&&(e=e.regex(/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/)),t.format==="hsl"&&(e=e.regex(/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function xd(t){let e=b.array(b.record(b.any()));return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function _d(t){let e=b.union([b.record(b.any()),b.array(b.any())]);return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function wd(t){let e=b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function wo(t){let e;if(t.relationTo){let r=b.object({id:b.string(),url:b.string().optional(),filename:b.string().optional(),mimeType:b.string().optional()});e=b.union([b.string(),r]);}else e=b.string();return t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function Sd(t){let e=b.string();return t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function So(t){let e;return Array.isArray(t.relationTo)?e=b.object({relationTo:b.enum(t.relationTo),value:b.string()}):e=b.union([b.string(),b.object({relationTo:b.string(),value:b.string()})]),t.hasMany&&(e=b.array(e)),t.required||(e=e.optional().nullable()),t.validate&&(e=X(e,t.validate)),e}function Ed(t){let e=b.object(Object.fromEntries(t.fields.filter(n=>n.name).map(n=>[n.name,oe(n)]))).passthrough(),r=b.array(e);return t.minRows&&(r=r.min(t.minRows)),t.maxRows&&(r=r.max(t.maxRows)),t.required||(r=r.optional().nullable()),t.validate&&(r=X(r,t.validate)),r}function Pd(t){let e=b.array(b.string());return t.required||(e=e.optional().nullable()),e}function vd(t){let e=b.object(Object.fromEntries(t.fields.filter(r=>r.name).map(r=>[r.name,oe(r)])));return t.required?e:e.optional().nullable()}function Td(t){let e=t.blocks||[];e.map(i=>b.object({blockType:b.literal(i.slug),...Object.fromEntries(i.fields.filter(o=>o.name).map(o=>[o.name,oe(o)]))}));let n=e.map(i=>i.slug),s;if(n.length>0){let i=b.object({blockType:b.enum(n)}).catchall(b.any()),o=b.object({blockType:b.string()}).catchall(b.any());s=b.array(b.union([i,o,b.record(b.any())]));}else s=b.array(b.union([b.object({blockType:b.string()}).catchall(b.any()),b.record(b.any())]));return t.minRows&&(s=s.min(t.minRows)),t.maxRows&&(s=s.max(t.maxRows)),t.required||(s=s.optional().nullable()),t.validate&&(s=X(s,t.validate)),s}function kd(t){return b.object(Object.fromEntries(t.fields.filter(r=>r.name).map(r=>[r.name,oe(r)])))}function Cd(t){return b.object(Object.fromEntries(t.fields.filter(r=>r.name).map(r=>[r.name,oe(r)])))}function Rd(t){let e={};for(let r of t.tabs)for(let n of r.fields)n.name&&(e[n.name]=oe(n));return b.object(e).passthrough().optional()}function X(t,e){return t.refine(async r=>await e(r,{required:false})===true,{message:"Custom validation failed"})}function dt(t){let e={};for(let r of t)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs){let i=dt(s.fields);Object.assign(n,i);}r.name?e[r.name]=b.object(n).passthrough().optional():Object.assign(e,n);}else if(r.type==="row"&&"fields"in r){let n=dt(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional():Object.assign(e,n);}else if(r.type==="collapsible"&&"fields"in r){let n=dt(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional():Object.assign(e,n);}else {if(!r.name)continue;e[r.name]=oe(r);}return e}function Le(t){let e={};for(let r of t)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs){let i=Le(s.fields);Object.assign(n,i);}r.name?e[r.name]=b.object(n).passthrough().optional().nullable():Object.assign(e,n);}else if(r.type==="row"&&"fields"in r){let n=Le(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional().nullable():Object.assign(e,n);}else if(r.type==="collapsible"&&"fields"in r){let n=Le(r.fields);r.name?e[r.name]=b.object(n).passthrough().optional().nullable():Object.assign(e,n);}else if(r.type==="group"&&"fields"in r)r.name?e[r.name]=b.object(Le(r.fields)).passthrough().optional().nullable():Object.assign(e,Le(r.fields));else {if(!r.name)continue;e[r.name]=oe(r).optional().nullable();}return e}function Eo(t){let e=dt(t.fields);return t.timestamps&&(e.createdAt=b.string().optional(),e.updatedAt=b.string().optional()),t.tenantScoped&&(e.tenantId=b.string().optional()),e.id=b.string().optional(),b.object(e).passthrough()}function Po(t){let e=dt(t.fields);return b.object(e).passthrough()}function vo(t){let e={};for(let r of t.fields)if(r.name)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs)for(let i of s.fields)i.name&&(n[i.name]=oe(i).optional().nullable());e[r.name]=b.object(n).optional().nullable();}else if(r.type==="row"&&"fields"in r){let n={};for(let s of r.fields)s.name&&(n[s.name]=oe(s).optional().nullable());Object.assign(e,n);}else r.type==="collapsible"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():r.type==="group"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():e[r.name]=oe(r).optional().nullable();return b.object(e).passthrough()}function To(t){let e={};for(let r of t.fields)r.name&&(e[r.name]=b.object({equals:b.any().optional(),not_equals:b.any().optional(),in:b.array(b.any()).optional(),not_in:b.array(b.any()).optional(),greater_than:b.number().optional(),greater_than_equal:b.number().optional(),less_than:b.number().optional(),less_than_equal:b.number().optional(),like:b.string().optional(),not_like:b.string().optional(),contains:b.string().optional(),exists:b.boolean().optional()}).optional());return e.AND=b.array(b.lazy(()=>b.object(e))).optional(),e.OR=b.array(b.lazy(()=>b.object(e))).optional(),b.object(e).optional()}function ko(t){let e=dt(t.fields);return e.id=b.string().optional(),b.object(e).passthrough()}function Co(t){let e={};for(let r of t.fields)if(r.name)if(r.type==="tabs"&&"tabs"in r){let n={};for(let s of r.tabs)for(let i of s.fields)i.name&&(n[i.name]=oe(i).optional().nullable());e[r.name]=b.object(n).optional().nullable();}else r.type==="collapsible"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():r.type==="group"&&"fields"in r?e[r.name]=b.object(Le(r.fields)).optional().nullable():e[r.name]=oe(r).optional().nullable();return b.object(e).passthrough()}chunkBUNLC3II_cjs.h();var jt=class{storageProviders=chunk6QWX3DEB_cjs.$a();collections=new Map;globals=new Map;plugins=[];schemaCache=new Map;initialized=false;addCollection(e){if(this.initialized)throw new Error("Cannot add collections after Registry has been initialized");if(this.collections.has(e.slug)){console.warn(`[Registry] Duplicate collection slug "${e.slug}" \u2014 skipping`);return}let r={...e,fields:[...e.fields]};for(let s of this.plugins){let i=s.extensions?.collections?.find(o=>o.slug===r.slug);i&&(r={...r,...i.config,fields:[...r.fields,...i.config.fields||[]]});}if(r.seo){let s=chunkKMFLHGD5_cjs.a(),i=r.fields.findIndex(o=>o.type==="tabs");if(i!==-1){let o=r.fields[i];r.fields[i]={...o,tabs:[...o.tabs,{label:"SEO Settings",fields:s.fields}]};}else r.fields.push(s);}r.fields=this.applyFieldDefaults(r);let n=zn(r);if(n.length>0)throw new Error(`Invalid collection config: ${n.join(", ")}`);this.collections.set(r.slug,r),this.clearSchemaCache(r.slug);}addCollections(e){for(let r of e)this.addCollection(r);}getCollection(e){return this.collections.get(e)}getCollections(){return Array.from(this.collections.values())}getCollectionSlugs(){return Array.from(this.collections.keys())}hasCollection(e){return this.collections.has(e)}removeCollection(e){if(this.initialized)throw new Error("Cannot remove collections after Registry has been initialized");return this.clearSchemaCache(e),this.collections.delete(e)}addGlobal(e){if(this.initialized)throw new Error("Cannot add globals after Registry has been initialized");this._addGlobalUnsafe(e);}addGlobalPostInit(e){this.globals.has(e.slug)&&this.globals.delete(e.slug),this._addGlobalUnsafe(e);}_addGlobalUnsafe(e){if(this.globals.has(e.slug)){console.warn(`[Registry] Duplicate global slug "${e.slug}" \u2014 skipping`);return}let r=Hn(e);if(r.length>0)throw new Error(`Invalid global config: ${r.join(", ")}`);let n={...e};for(let s of this.plugins){let i=s.extensions?.globals?.find(o=>o.slug===n.slug);i&&(n={...n,...i.config,fields:[...n.fields||[],...i.config.fields||[]]});}this.globals.set(n.slug,n),this.clearSchemaCache(`global:${n.slug}`);}addGlobals(e){for(let r of e)this.addGlobal(r);}getGlobal(e){return this.globals.get(e)}getGlobals(){return Array.from(this.globals.values())}getGlobalSlugs(){return Array.from(this.globals.keys())}hasGlobal(e){return this.globals.has(e)}removeGlobal(e){if(this.initialized)throw new Error("Cannot remove globals after Registry has been initialized");return this.clearSchemaCache(`global:${e}`),this.globals.delete(e)}addPlugin(e){if(this.initialized)throw new Error("Cannot add plugins after Registry has been initialized");this.plugins.push(e);}getPlugins(){return [...this.plugins]}getZodSchema(e){let r=this.schemaCache.get(e);if(r)return r;let n=this.collections.get(e);if(n){let i=Eo(n);return this.schemaCache.set(e,i),i}let s=this.globals.get(e);if(s){let i=ko(s);return this.schemaCache.set(`global:${e}`,i),i}throw new Error(`No collection or global found with slug "${e}"`)}getCreateZodSchema(e){let r=`${e}:create`,n=this.schemaCache.get(r);if(n)return n;let s=this.collections.get(e);if(s){let i=Po(s);return this.schemaCache.set(r,i),i}throw new Error(`No collection found with slug "${e}"`)}getUpdateZodSchema(e){let r=`${e}:update`,n=this.schemaCache.get(r);if(n)return n;let s=this.collections.get(e);if(s){let o=vo(s);return this.schemaCache.set(r,o),o}let i=this.globals.get(e);if(i){let o=Co(i);return this.schemaCache.set(`global:${e}:update`,o),o}throw new Error(`No collection or global found with slug "${e}"`)}getWhereZodSchema(e){let r=`${e}:where`,n=this.schemaCache.get(r);if(n)return n;let s=this.collections.get(e);if(s){let i=To(s);return this.schemaCache.set(r,i),i}throw new Error(`No collection found with slug "${e}"`)}getFieldZodSchema(e){return oe(e)}clearSchemaCache(e){this.schemaCache.delete(e),this.schemaCache.delete(`${e}:create`),this.schemaCache.delete(`${e}:update`),this.schemaCache.delete(`${e}:where`);}applyFieldDefaults(e){let r=[...e.fields];return r.some(n=>n.name==="id")||r.unshift({name:"id",type:"text",admin:{readOnly:true,hidden:true}}),e.tenantScoped&&!r.some(n=>n.name==="tenantId")&&r.push({name:"tenantId",type:"text",required:true,admin:{readOnly:true,hidden:true}}),e.timestamps&&!r.some(n=>n.name==="createdAt")&&(r.push({name:"createdAt",type:"date",admin:{readOnly:true,hidden:true}}),r.push({name:"updatedAt",type:"date",admin:{readOnly:true,hidden:true}})),e.versions?.drafts&&!r.some(n=>n.name==="status")&&r.push({name:"status",type:"select",options:[{value:"draft",label:"Draft"},{value:"published",label:"Published"}],admin:{readOnly:true,hidden:true}}),e.auth&&!r.some(n=>n.name==="password")&&r.push({name:"password",type:"password",required:true,admin:{hidden:true}}),r}getFields(e){let r=this.collections.get(e);if(r)return r.fields;let n=this.globals.get(e);if(n)return n.fields;throw new Error(`No collection or global found with slug "${e}"`)}getFieldMap(e){let r=this.getFields(e),n=new Map,s=i=>{for(let o of i){if(o.name&&n.set(o.name,o),"fields"in o&&o.fields&&s(o.fields),"tabs"in o)for(let a of o.tabs)s(a.fields);if("blocks"in o)for(let a of o.blocks)s(a.fields);}};return s(r),n}getVisibleFields(e){return this.getFields(e).filter(n=>!n.admin?.hidden)}validate(){let e=this.getCollections(),r=this.getGlobals();_o(e,r);}async init(e){this.validate();for(let r of this.plugins){r.init&&await r.init(e||this);let n=r.collections||[];for(let i of n)i.slug&&!this.hasCollection(i.slug)&&this.addCollection(i);let s=r.globals||[];for(let i of s)i.slug&&!this.hasGlobal(i.slug)&&this.addGlobal(i);}this.initialized=true;}isInitialized(){return this.initialized}getPaginationDefaults(e){let r=this.collections.get(e);return {defaultLimit:r?.admin?.pagination?.defaultLimit||10,limits:r?.admin?.pagination?.limits||[10,25,50,100]}}getDefaultSort(e){let n=this.collections.get(e)?.admin?.useAsTitle;return n||"createdAt"}getDefaultColumns(e){let r=this.collections.get(e);return r?.admin?.defaultColumns?r.admin.defaultColumns:this.getVisibleFields(e).slice(0,4).map(s=>s.name)}getAdminTitle(e){let r=this.collections.get(e);return r?.label||r?.admin?.description||e}getAdminLabel(e){let r=this.collections.get(e);return r?.singularLabel||r?.label||e}getAdminGroup(e){return this.collections.get(e)?.admin?.group}getStats(){let e=0;for(let r of this.collections.values())e+=r.fields.length;for(let r of this.globals.values())e+=r.fields.length;return {collections:this.collections.size,globals:this.globals.size,plugins:this.plugins.length,fields:e}}toJSON(){return {collections:this.getCollections(),globals:this.getGlobals()}}},pt=null;function Ad(){return pt||(pt=new jt),pt}function Ld(){pt=null;}function Vn(){return pt=new jt,pt}chunkBUNLC3II_cjs.h();var ge=class{name;displayName;adminEntry;version;description;hooks={};collections=[];globals=[];fields=[];extensions={collections:[],globals:[]};adminComponents={};adminStyles=[];serverMiddleware;clientMiddleware;constructor(e){this.name=e;}async init(e){}async beforeInit(e){}async afterInit(e){}getCollections(){return this.collections}getGlobals(){return this.globals}getHooks(){return this.hooks}},mr=class{plugins=new Map;hooks=new Map;register(e){if(this.plugins.has(e.name))throw new Error(`Plugin "${e.name}" is already registered`);this.plugins.set(e.name,e);let r=e.getHooks?.()||{};for(let[n,s]of Object.entries(r))if(Array.isArray(s))for(let i of s)this.registerHook(n,i);}unregister(e){let r=this.plugins.get(e);if(!r)return;let n=r.getHooks?.()||{};for(let[s,i]of Object.entries(n))if(Array.isArray(i))for(let o of i)this.unregisterHook(s,o);this.plugins.delete(e);}get(e){return this.plugins.get(e)}getAll(){return Array.from(this.plugins.values())}has(e){return this.plugins.has(e)}registerHook(e,r){this.hooks.has(e)||this.hooks.set(e,[]),this.hooks.get(e).push(r);}unregisterHook(e,r){let n=this.hooks.get(e);if(n){let s=n.indexOf(r);s>-1&&n.splice(s,1);}}async executeHook(e,r){let n=this.hooks.get(e)||[],s=r;for(let i of n)try{let o=await i({...r,data:s});o!==void 0&&(s=o);}catch(o){console.error(`[PluginManager] Error in hook "${e}":`,o);}return s}getAllCollections(){let e=[];for(let r of this.plugins.values()){let n=r.getCollections?.()||[];e.push(...n);}return e}getAllGlobals(){let e=[];for(let r of this.plugins.values()){let n=r.getGlobals?.()||[];e.push(...n);}return e}getAllFields(){let e=[];for(let r of this.plugins.values())e.push(...r.fields);return e}getAdminComponents(){let e={};for(let r of this.plugins.values())Object.assign(e,r.adminComponents);return e}getAdminStyles(){let e=[];for(let r of this.plugins.values())e.push(...r.adminStyles);return e}},Wn=class extends ge{constructor(){super("seo"),this.displayName="Core SEO",this.description="Advanced SEO features including sitemaps, robots.txt, and structured data",this.adminEntry="@kyro-cms/admin/plugins/seo-admin",this.collections.push({slug:"seo-settings",label:"SEO Settings",fields:[{name:"sitemap",type:"checkbox",label:"Enable Sitemap",defaultValue:true},{name:"robotsTxt",type:"richtext",label:"robots.txt Content"},{name:"canonicalUrl",type:"text",variant:"url",label:"Canonical URL"},{name:"ogImage",type:"text",label:"Default OG Image URL"}]});}},Kn=class extends ge{constructor(){super("analytics"),this.displayName="Core Analytics",this.description="Built-in privacy-friendly analytics and dashboards",this.collections.push({slug:"analytics-events",label:"Analytics Events",fields:[{name:"name",type:"text",required:true},{name:"properties",type:"json",label:"Event Properties"},{name:"timestamp",type:"date",required:true},{name:"userId",type:"text",label:"User ID"},{name:"sessionId",type:"text",label:"Session ID"}]}),this.adminComponents.AnalyticsDashboard={};}},Qn=class extends ge{constructor(){super("comments"),this.description="Commenting system for products and posts",this.collections.push({slug:"comments",label:"Comments",fields:[{name:"content",type:"richtext",required:true},{name:"author",type:"text",required:true},{name:"email",type:"email"},{name:"approved",type:"checkbox",defaultValue:false},{name:"parent",type:"text",label:"Parent Comment ID"},{name:"resourceType",type:"text",required:true},{name:"resourceId",type:"text",required:true}]}),this.adminComponents.CommentModeration={};}},Zn=class extends ge{constructor(){super("reviews"),this.description="Product reviews and ratings",this.collections.push({slug:"reviews",label:"Reviews",fields:[{name:"rating",type:"number",required:true,min:1,max:5},{name:"title",type:"text"},{name:"content",type:"richtext",required:true},{name:"author",type:"relationship",relationTo:"customers"},{name:"product",type:"relationship",relationTo:"products",required:true},{name:"approved",type:"checkbox",defaultValue:false},{name:"verified",type:"checkbox",label:"Verified Purchase"},{name:"helpful",type:"number",label:"Helpful Count",defaultValue:0}]}),this.adminComponents.ReviewModeration={};}},Jn=class extends ge{constructor(){super("wishlist"),this.description="Customer wishlists",this.collections.push({slug:"wishlists",label:"Wishlists",fields:[{name:"customer",type:"relationship",relationTo:"customers",required:true},{name:"name",type:"text",label:"Wishlist Name",defaultValue:"My Wishlist"},{name:"items",type:"blocks",label:"Items",blocks:[{slug:"wishlist-item",label:"Item",fields:[{name:"product",type:"relationship",relationTo:"products"},{name:"quantity",type:"number",defaultValue:1},{name:"addedAt",type:"date"},{name:"priority",type:"select",options:[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"}]}]}]}]});}},Cg={SEO:Wn,Analytics:Kn,Comments:Qn,Reviews:Zn,Wishlist:Jn};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ue={red:"\x1B[31m",yellow:"\x1B[33m",magenta:"\x1B[35m",cyan:"\x1B[36m",reset:"\x1B[0m"},Ro=Ue.yellow+"WARN"+Ue.reset,Ao=Ue.cyan+"INFO"+Ue.reset,Lo=Ue.red+"ERR"+Ue.reset,Oo=Ue.magenta+"DEBUG"+Ue.reset,qt={debug:0,info:1,warn:2,error:3,silent:4},br=()=>{},yr=t=>(...e)=>console.log(t,...e),Od=console.debug?(...t)=>console.debug(Oo,...t):yr(Oo),Fd=console.info?(...t)=>console.info(Ao,...t):yr(Ao),Id=console.warn?(...t)=>console.warn(Ro,...t):yr(Ro),Dd=console.error?(...t)=>console.error(Lo,...t):yr(Lo),gr=(t=globalThis.process?.env.DEBUG==="1"?"debug":"info")=>{let e=qt[t];return {debug:e>qt.debug?br:Od,info:e>qt.info?br:Fd,warn:e>qt.warn?br:Id,error:e>qt.error?br:Dd}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var xr=Symbol.for("@whatwg-node/promise-helpers/FakePromise");function N(t){return t?.then!=null}function jd(t){let e=t;return e&&e.then&&e.catch&&e.finally}function k(t,e,r,n){let s=$().then(t).then(e,r);return Mt(s)}function $(t){return t&&jd(t)?t:N(t)?{then:(e,r)=>$(t.then(e,r)),catch:e=>$(t.then(r=>r,e)),finally:e=>$(e?Md(t,e):t),[Symbol.toStringTag]:"Promise"}:{then(e){if(e)try{return $(e(t))}catch(r){return mt(r)}return this},catch(){return this},finally(e){if(e)try{return $(e()).then(()=>t,()=>t)}catch(r){return mt(r)}return this},[Symbol.toStringTag]:"Promise",__fakePromiseValue:t,[xr]:"resolved"}}function Ut(){if(Promise.withResolvers)return Promise.withResolvers();let t,e;return {promise:new Promise(function(s,i){t=s,e=i;}),get resolve(){return t},get reject(){return e}}}function K(t,e,r){if(t?.length===0)return;let n=t[Symbol.iterator](),s=0;function i(){let{done:o,value:a}=n.next();if(o)return;let c=false;function l(){c=true;}return k(function(){return e(a,l,s++)},function(h){if(h&&r?.push(h),!c)return i()})}return i()}function mt(t){return {then(e,r){if(r)try{return $(r(t))}catch(n){return mt(n)}return this},catch(e){if(e)try{return $(e(t))}catch(r){return mt(r)}return this},finally(e){if(e)try{e();}catch(r){return mt(r)}return this},__fakeRejectError:t,[Symbol.toStringTag]:"Promise",[xr]:"rejected"}}function Oe(t,e,r,n){Symbol.asyncIterator in t&&(t=t[Symbol.asyncIterator]());let s,i,o;typeof t.return=="function"&&(s=t.return,i=l=>{let u=()=>{throw l};return s.call(t).then(u,u)});function a(l){return l.done?l:k(()=>l.value,u=>k(()=>e(u),Fo,i))}let c;if(r){let l,u=r;c=h=>(l||=k(()=>h,d=>k(()=>u(d),Fo,i)),l);}return {next(){return t.next().then(a,c)},return(){let l=s?s.call(t).then(a,c):$({value:void 0,done:true});return o?l.then(o):l},throw(l){return typeof t.throw=="function"?t.throw(l).then(a,c):i?i(l):mt(l)},[Symbol.asyncIterator](){return this}}}function Fo(t){return {value:t,done:false}}function qd(t){return t?.[xr]==="resolved"}function Ud(t){return t?.[xr]==="rejected"}function Md(t,e){return "finally"in t?t.finally(e):t.then(r=>{let n=e();return N(n)?n.then(()=>r):r},r=>{let n=e();if(N(n))return n.then(()=>{throw r});throw r})}function Mt(t){if(qd(t))return t.__fakePromiseValue;if(Ud(t))throw t.__fakeRejectError;return t}chunkBUNLC3II_cjs.h();var Io='<!doctype html><html lang=en><head><meta charset=utf-8><title>__TITLE__</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><link crossorigin rel=stylesheet href=https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/graphiql.css></head><body id=body class=no-focus-outline><noscript>You need to enable JavaScript to run this app.</noscript><div id=root>Loading __TITLE__...</div><script>function prepareBlob(r){const o=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(o)}const workers={},workerUrls={editorWorkerService:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/editor.worker.bundle.js",json:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/json.worker.bundle.js",graphql:"https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/monacoeditorwork/graphql.worker..bundle.js"};function prepareWorkers(){return Promise.all(Object.entries(workerUrls).map(async([r,o])=>{const e=await fetch(o),t=await e.text();workers[r]=prepareBlob(t)}))}self.MonacoEnvironment={globalAPI:!1,getWorkerUrl:function(r,o){return workers[o]}}</script><script src=https://unpkg.com/@graphql-yoga/graphiql@4.4.4/dist/yoga-graphiql.umd.js></script><script>prepareWorkers().finally(()=>{YogaGraphiQL.renderYogaGraphiQL(root,__OPTS__)})</script></body></html>';function Bd({headers:t,method:e}){return e==="GET"&&!!t?.get("accept")?.includes("text/html")}var $d=t=>Io.replace("__TITLE__",t?.title||"Yoga GraphiQL").replace("__OPTS__",JSON.stringify(t??{}));function Do(t){let e=t.logger??console,r;typeof t?.options=="function"?r=t?.options:typeof t?.options=="object"?r=()=>t?.options:t?.options===false?r=()=>false:r=()=>({});let n=t?.render??$d;return {onRequest({request:s,serverContext:i,fetchAPI:o,endResponse:a,url:c}){let l=t.getGraphQLEndpoint();if(Bd(s)&&(s.url.endsWith(l)||s.url.endsWith(`${l}/`)||c.pathname===l||c.pathname===`${l}/`||t.getGraphQLEndpointURLPattern().test(c)))return e.debug("Rendering GraphiQL"),k(()=>r(s,i),u=>{if(u)return k(()=>n({...u===true?{}:u}),h=>{let d=new o.Response(h,{headers:{"Content-Type":"text/html"},status:200});a(d);})})}}}chunkBUNLC3II_cjs.h();function Yn(t){return t?.[Symbol.toStringTag]==="GraphQLSchema"}var jo=t=>{if(t==null)return {};if(Yn(t))return {onPluginInit({setSchema:e}){e(t);}};if("then"in t){let e;return {onRequestParse(){return {onRequestParseDone(){if(!e)return k(()=>t,r=>{e=r;})}}},onEnveloped({setSchema:r}){if(e==null)throw new Error("You provide a promise of a schema but it hasn't been resolved yet. Make sure you use this plugin with GraphQL Yoga.");if(!Yn(e))throw new Error("The resolved schema is not a valid GraphQLSchema instance.");r(e);}}}if(typeof t=="function"){let e=new WeakMap;return {onRequestParse({request:r,serverContext:n}){return {onRequestParseDone(){return k(()=>t({...n,request:r}),s=>{if(!Yn(s))throw new Error("The factory function did not return a valid GraphQLSchema.");e.set(r,s);})}}},onEnveloped({setSchema:r,context:n}){if(n?.request==null)throw new Error("Request object is not available in the context. Make sure you use this plugin with GraphQL Yoga.");let s=e.get(n.request);if(s==null)throw new Error("No schema found for this request. Make sure you use this plugin with GraphQL Yoga.");r(s);}}}throw new Error("Invalid schema definition provided, expected a schema, promise or function.")};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function ee(t){return _r(t,[])}function _r(t,e){switch(typeof t){case "string":return JSON.stringify(t);case "function":return t.name?`[function ${t.name}]`:"[function]";case "object":return Nd(t,e);default:return String(t)}}function qo(t){return (t.name="GraphQLError")?t.toString():`${t.name}: ${t.message};
|
|
21
21
|
${t.stack}`}function Nd(t,e){if(t===null)return "null";if(t instanceof Error)return t.name==="AggregateError"?qo(t)+`
|
|
22
|
-
`+Uo(t.errors,e):qo(t);if(e.includes(t))return "[Circular]";let r=[...e,t];if(Gd(t)){let n=t.toJSON();if(n!==t)return typeof n=="string"?n:_r(n,r)}else if(Array.isArray(t))return Uo(t,r);return Hd(t,r)}function Gd(t){return typeof t.toJSON=="function"}function Hd(t,e){let r=Object.entries(t);return r.length===0?"{}":e.length>3?"["+zd(t)+"]":"{ "+r.map(([s,i])=>s+": "+_r(i,e)).join(", ")+" }"}function Uo(t,e){if(t.length===0)return "[]";if(e.length>3)return "[Array]";let r=t.length,n=[];for(let s=0;s<r;++s)n.push(_r(t[s],e));return "["+n.join(", ")+"]"}function zd(t){let e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){let r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}chunkBUNLC3II_cjs.h();var Vd=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions","coordinate"];function Wd(t){return t!=null&&typeof t=="object"&&Object.keys(t).every(e=>Vd.includes(e))}function G(t,e){e?.originalError&&!(e.originalError instanceof Error)&&Wd(e.originalError)&&(e.originalError=G(e.originalError.message,e.originalError));let r=chunkVOQUO2EZ_cjs.b,n=chunkVOQUO2EZ_cjs.a.major>=16?new r(t,e):new r(t,e?.nodes,e?.source,e?.positions,e?.path,e?.originalError,e?.extensions);return e?.coordinate&&n.coordinate==null&&Object.defineProperties(n,{coordinate:{value:e.coordinate,enumerable:true,configurable:true}}),n}function ae(t,e,r,n){let s=chunkVOQUO2EZ_cjs.E(t,e,r);if(!s.coordinate&&n&&s.coordinate==null){let i=`${n.parentType.name}.${n.fieldName}`;Object.defineProperties(s,{coordinate:{value:i,enumerable:true,configurable:true}});}return s}chunkBUNLC3II_cjs.h();function Mo(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t}function Xn(t){return typeof t=="object"&&t!==null}function Bo(t,e,r){let n=r;for(let s of t)n=k(()=>n,i=>e(i,s));return n}function wr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function es(t,e,r={}){let n={},i=(e.arguments??[]).reduce((o,a)=>({...o,[a.name.value]:a}),{});for(let o of t.args){let a=i[o.name];if(!a){if("default"in o&&o.default)n[o.name]="value"in o.default?o.default.value:chunkVOQUO2EZ_cjs.g(o.default.literal);else if(o.defaultValue!==void 0)n[o.name]=o.defaultValue;else if(chunkVOQUO2EZ_cjs.j(o.type))throw G(`Argument "${o.name}" of required type "${ee(o.type)}" was not provided.`,{nodes:[e]});continue}let c=a.value,l=c.kind===chunkVOQUO2EZ_cjs.d.NULL;if(c.kind===chunkVOQUO2EZ_cjs.d.VARIABLE){let h=c.name.value;if(r==null||!wr(r,h)){if(o.defaultValue!==void 0)n[o.name]=o.defaultValue;else if(chunkVOQUO2EZ_cjs.j(o.type))throw G(`Argument "${o.name}" of required type "${ee(o.type)}" was provided the variable "$${h}" which was not provided a runtime value.`,{nodes:[c]});continue}l=r[h]==null;}if(l&&chunkVOQUO2EZ_cjs.j(o.type))throw G(`Argument "${o.name}" of non-null type "${ee(o.type)}" must not be null.`,{nodes:[c]});let u=chunkVOQUO2EZ_cjs.A(c,o.type,r);if(u===void 0)throw G(`Argument "${o.name}" has invalid value ${chunkVOQUO2EZ_cjs.f(c)}.`,{nodes:[c]});n[o.name]=u;}return n}chunkBUNLC3II_cjs.h();function Me(t){let e=new WeakMap;return function(n){let s=e.get(n);if(s===void 0){let i=t(n);return e.set(n,i),i}return s}}function $o(t){let e=new WeakMap;return function(n,s,i){let o=e.get(n);if(!o){o=new WeakMap,e.set(n,o);let l=new WeakMap;o.set(s,l);let u=t(n,s,i);return l.set(i,u),u}let a=o.get(s);if(!a){a=new WeakMap,o.set(s,a);let l=t(n,s,i);return a.set(i,l),l}let c=a.get(i);if(c===void 0){let l=t(n,s,i);return a.set(i,l),l}return c}}function No(t){let e=new WeakMap;return function(n,s,i,o,a){let c=e.get(n);if(!c){c=new WeakMap,e.set(n,c);let p=new WeakMap;c.set(s,p);let x=new WeakMap;p.set(i,x);let S=new WeakMap;x.set(o,S);let R=t(n,s,i,o,a);return S.set(a,R),R}let l=c.get(s);if(!l){l=new WeakMap,c.set(s,l);let p=new WeakMap;l.set(i,p);let x=new WeakMap;p.set(o,x);let S=t(n,s,i,o,a);return x.set(a,S),S}let u=l.get(i);if(!u){u=new WeakMap,l.set(i,u);let p=new WeakMap;u.set(o,p);let x=t(n,s,i,o,a);return p.set(a,x),x}let h=u.get(o);if(!h){h=new WeakMap,u.set(o,h);let p=t(n,s,i,o,a);return h.set(a,p),p}let d=h.get(a);if(d===void 0){let p=t(n,s,i,o,a);return h.set(a,p),p}return d}}chunkBUNLC3II_cjs.h();function Go(t,e,r){let s=Ho(t).get(e);if(s==null)throw G(`Schema is not configured to execute ${e} operation.`,{nodes:r});return s}var Ho=Me(function(e){let r=new Map,n=e.getQueryType();n&&r.set("query",n);let s=e.getMutationType();s&&r.set("mutation",s);let i=e.getSubscriptionType();return i&&r.set("subscription",i),r});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Je=class extends Map{get[Symbol.toStringTag](){return "AccumulatorMap"}add(e,r){let n=this.get(e);n===void 0?this.set(e,[r]):n.push(r);}};chunkBUNLC3II_cjs.h();var zo=new chunkVOQUO2EZ_cjs.r({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[chunkVOQUO2EZ_cjs.c.FRAGMENT_SPREAD,chunkVOQUO2EZ_cjs.c.INLINE_FRAGMENT],args:{if:{type:new chunkVOQUO2EZ_cjs.n(chunkVOQUO2EZ_cjs.q),description:"Deferred when true or undefined.",defaultValue:true},label:{type:chunkVOQUO2EZ_cjs.p,description:"Unique name"}}}),Vo=new chunkVOQUO2EZ_cjs.r({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[chunkVOQUO2EZ_cjs.c.FIELD],args:{if:{type:new chunkVOQUO2EZ_cjs.n(chunkVOQUO2EZ_cjs.q),description:"Stream when true or undefined.",defaultValue:true},label:{type:chunkVOQUO2EZ_cjs.p,description:"Unique name"},initialCount:{defaultValue:0,type:chunkVOQUO2EZ_cjs.o,description:"Number of items to return immediately"}}});function bt(t,e,r,n,s,i,o,a){for(let c of s.selections)switch(c.kind){case chunkVOQUO2EZ_cjs.d.FIELD:{if(!ts(r,c))continue;i.add(Qd(c),c);break}case chunkVOQUO2EZ_cjs.d.INLINE_FRAGMENT:{if(!ts(r,c)||!Wo(t,c,n))continue;let l=Ko(r,c);if(l){let u=new Je;bt(t,e,r,n,c.selectionSet,u,o,a),o.push({label:l.label,fields:u});}else bt(t,e,r,n,c.selectionSet,i,o,a);break}case chunkVOQUO2EZ_cjs.d.FRAGMENT_SPREAD:{let l=c.name.value;if(!ts(r,c))continue;let u=Ko(r,c);if(a.has(l)&&!u)continue;let h=e[l];if(!h||!Wo(t,h,n))continue;if(u||a.add(l),u){let d=new Je;bt(t,e,r,n,h.selectionSet,d,o,a),o.push({label:u.label,fields:d});}else bt(t,e,r,n,h.selectionSet,i,o,a);break}}}function rs(t,e,r,n,s){let i=new Je,o=[];return bt(t,e,r,n,s,i,o,new Set),{fields:i,patches:o}}function ts(t,e){return !(chunkVOQUO2EZ_cjs.B(chunkVOQUO2EZ_cjs.t,e,t)?.if===true||chunkVOQUO2EZ_cjs.B(chunkVOQUO2EZ_cjs.s,e,t)?.if===false)}function Wo(t,e,r){let n=e.typeCondition;if(!n)return true;let s=chunkVOQUO2EZ_cjs.y(t,n);return s===r?true:chunkVOQUO2EZ_cjs.m(s)?t.getPossibleTypes(s).includes(r):false}function Qd(t){return t.alias?t.alias.value:t.name.value}function Ko(t,e){let r=chunkVOQUO2EZ_cjs.B(zo,e,t);if(r&&r.if!==false)return {label:typeof r.label=="string"?r.label:void 0}}var Qo=No(function(e,r,n,s,i){let o=new Je,a=new Set,c=[],l={fields:o,patches:c};for(let u of i)u.selectionSet&&bt(e,r,n,s,u.selectionSet,o,c,a);return l});chunkBUNLC3II_cjs.h();function Sr(t){return t?.[Symbol.asyncIterator]!=null}chunkBUNLC3II_cjs.h();function Ye(t,e,r){return {prev:t,key:e,typename:r}}function te(t){let e=[],r=t;for(;r;)e.push(r.key),r=r.prev;return e.reverse()}function Zo(t){return t.map(e=>typeof e=="number"?"["+e.toString()+"]":"."+e).join("")}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function yt(t,e){let r={...e,...t};for(let n of Object.keys(r))n in t&&n in e&&(r[n]=(s,i)=>t[n](s,()=>e[n](s,i)));return r}var Xe=t=>({fn(e,r){return e?(...n)=>{let s;return e(t,()=>{s=r(...n);}),s}:r},asyncFn(e,r){return e?(...n)=>{let s;return k(()=>e(t,()=>(s=r(...n),N(s)?s.then(()=>{}):void 0)),()=>s)}:r}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Jo=new WeakMap;chunkBUNLC3II_cjs.h();function Zd(t){return t.length===1?t[0]:{schema:t[0],document:t[1],rootValue:t[2],contextValue:t[3],variableValues:t[4],operationName:t[5],fieldResolver:t[6],subscribeFieldResolver:t[7]}}var ns=t=>((...e)=>t(Zd(e)));function Jd(t){return t.length===1?t[0]:{schema:t[0],document:t[1],rootValue:t[2],contextValue:t[3],variableValues:t[4],operationName:t[5],fieldResolver:t[6],typeResolver:t[7]}}var ss=t=>((...e)=>t(Jd(e)));function le(t){return typeof t=="object"&&t!=null&&typeof t[Symbol.asyncIterator]=="function"}function is(t,e){if(le(t.result))return {onNext:e};e({args:t.args,result:t.result,setResult:t.setResult});}function os(t,e){let r;function n(){return r||(r=t[Symbol.asyncIterator]()),r}let s=false;return {[Symbol.asyncIterator](){return this},next(){return n().next().then(i=>(i.done&&s===false&&(s=true,e()),i))},return(){let i=n().return?.();return s===false&&(s=true,e()),i||$({done:true,value:void 0})},throw(i){let o=n().throw?.();if(o)return o;throw i},[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")](){return $()}}}function Yo(t,e){let r;function n(){return r||(r=t[Symbol.asyncIterator]()),r}return {[Symbol.asyncIterator](){return this},next(){return n().next().catch(s=>(e(s),{done:true,value:void 0}))},return(){return n().return?.()||$({done:true,value:void 0})},throw(s){let i=n().throw?.();if(i)return i;throw s},[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")](){return $()}}}function Er(t){throw Error(`No \`${t}\` function found! Register it using "useEngine" plugin.`)}function Xo({plugins:t}){let e=null,r=false,n=()=>Er("parse"),s=()=>Er("validate"),i=()=>Er("execute"),o=()=>Er("subscribe"),a,c=(E,T=-1)=>{if(e!==E&&(e=E,r))for(let[w,P]of t.entries())w!==T&&P.onSchemaChange&&P.onSchemaChange({schema:e,replaceSchema:L=>{c(L,w);}});},l=[];for(let E=0;E<t.length;E++){let T=t[E],w=[];T.onPluginInit?.({plugins:t,addPlugin:P=>{w.push(P);},setSchema:P=>c(P,E),registerContextErrorHandler:P=>l.push(P)}),w.length&&t.splice(E+1,0,...w);}let u={init:[],parse:[],validate:[],subscribe:[],execute:[],context:[]};for(let{onContextBuilding:E,onExecute:T,onParse:w,onSubscribe:P,onValidate:L,onEnveloped:y,instrumentation:g}of t)y&&u.init.push(y),E&&u.context.push(E),T&&u.execute.push(T),w&&u.parse.push(w),P&&u.subscribe.push(P),L&&u.validate.push(L),g&&(a=a?yt(a,g):g);let h=E=>{for(let[T,w]of u.init.entries())w({context:E,extendContext:P=>{E&&Object.assign(E,P);},setSchema:P=>c(P,T)});},d=u.parse.length?E=>(T,w)=>{let P=null,L=n,y=E,g=[];for(let _ of u.parse){let v=_({context:y,extendContext:A=>{Object.assign(y,A);},params:{source:T,options:w},parseFn:L,setParseFn:A=>{L=A;},setParsedDocument:A=>{P=A;}});v&&g.push(v);}if(P===null)try{P=L(T,w);}catch(_){P=_;}for(let _ of g)_({context:y,extendContext:v=>{Object.assign(y,v);},replaceParseResult:v=>{P=v;},result:P});if(P===null)throw new Error("Failed to parse document.");if(P instanceof Error)throw P;return Jo.set(P,T.toString()),P}:()=>n,p=u.validate.length?E=>(T,w,P,L,y)=>{let g=P?[...P]:void 0,_=s,v=null,A=E,I=[];for(let V of u.validate){let B=V({context:A,extendContext:Z=>{Object.assign(A,Z);},params:{schema:T,documentAST:w,rules:g,typeInfo:L,options:y},validateFn:_,addValidationRule:Z=>{g||(g=[]),g.push(Z);},setValidationFn:Z=>{_=Z;},setResult:Z=>{v=Z;}});B&&I.push(B);}if(v||(v=_(T,w,g,L,y)),!v)return;let M=v.length===0;for(let V of I)V({valid:M,result:v,context:A,extendContext:B=>{Object.assign(A,B);},setResult:B=>{v=B;}});return v}:()=>s,x=u.context.length?E=>T=>{let w=[],P=E;T&&Object.assign(P,T);let L=false;return k(()=>K(u.context,(y,g)=>y({context:P,extendContext:_=>{Object.assign(P,_);},breakContextBuilding:()=>{L=true,g();}}),w),()=>L?P:k(()=>K(w,y=>y({context:P,extendContext(g){Object.assign(P,g);}})),()=>P),y=>{let g=y;for(let _ of l)_({context:P,error:g,setError:v=>{g=v;}});throw g})}:E=>T=>(T&&Object.assign(E,T),E),R=u.subscribe.length?ns(E=>{let T=o,w=[],P=E.contextValue||{},L;return k(()=>K(u.subscribe,(y,g)=>y({subscribeFn:T,setSubscribeFn:_=>{T=_;},context:P,extendContext:_=>{Object.assign(P,_);},args:E,setResultAndStopExecution:_=>{L=_,g();}}),w),()=>{let y=[],g=[];for(let{onSubscribeResult:_,onSubscribeError:v}of w)_&&y.push(_),v&&g.push(v);return k(()=>L||T(E),_=>{let v=[],A=[];for(let I of y){let M=I({args:E,result:_,setResult:V=>{_=V;}});M&&(M.onNext&&v.push(M.onNext),M.onEnd&&A.push(M.onEnd));}return v.length&&le(_)&&(_=Oe(_,I=>k(()=>K(v,M=>M({args:E,result:I,setResult:V=>I=V})),()=>I))),A.length&&le(_)&&(_=os(_,()=>{for(let I of A)I();})),g.length&&le(_)&&(_=Yo(_,I=>{let M=I;for(let V of g)V({error:M,setError:B=>{M=B;}});throw M})),_})})}):ns(o),D=u.execute.length?ss(E=>{let T=i,w,P=[],L=[],y=E.contextValue||{};return k(()=>K(u.execute,(g,_)=>g({executeFn:T,setExecuteFn:v=>{T=v;},setResultAndStopExecution:v=>{w=v,_();},context:y,extendContext:v=>{if(typeof v=="object")Object.assign(y,v);else throw new Error(`Invalid context extension provided! Expected "object", got: "${JSON.stringify(v)}" (${typeof v})`)},args:E}),P),()=>k(()=>w||T({...E,contextValue:y}),g=>k(()=>K(P,_=>_.onExecuteDone?.({args:E,result:g,setResult:v=>{g=v;}}),L),()=>{let _=[],v=[];for(let{onNext:A,onEnd:I}of L)A&&_.push(A),I&&v.push(I);return _.length&&le(g)&&(g=Oe(g,A=>k(()=>K(_,I=>I({args:E,result:A,setResult:M=>{A=M;}})),()=>A))),v.length&&le(g)&&(g=os(g,()=>{for(let A of v)A();})),g})))}):ss(i);if(r=true,e)for(let[E,T]of t.entries())T.onSchemaChange?.({schema:e,replaceSchema:w=>c(w,E)});return {getCurrentSchema(){return e},init:h,parse:d,validate:p,execute:D,subscribe:R,contextFactory:x,instrumentation:a}}function Yd(t){return t!=null}function ea(t){let e=t.plugins.filter(Yd),r=Xo({plugins:e}),n=r.instrumentation,s=(i={})=>{let o=Xe({context:i}),a=r;return o.fn(n?.init,r.init)(i),{parse:o.fn(n?.parse,a.parse(i)),validate:o.fn(n?.validate,a.validate(i)),contextFactory:o.fn(n?.context,a.contextFactory(i)),execute:o.asyncFn(n?.execute,a.execute),subscribe:o.asyncFn(n?.subscribe,a.subscribe),schema:a.getCurrentSchema()}};return s._plugins=e,s}chunkBUNLC3II_cjs.h();var Xd="Unexpected error.";function ep(t){return t instanceof Error&&t.name==="GraphQLError"}function ta(t){return ep(t)?t.originalError!=null?ta(t.originalError):true:false}function tp(t,e,r){let n=new Error(t);if(n.name="GraphQLError",r){let s=e instanceof Error?{message:e.message,stack:e.stack}:{message:String(e)};Object.defineProperty(n,"extensions",{get(){return s}});}return Object.defineProperty(n,"toJSON",{value(){return {message:n.message,extensions:n.extensions}}}),n}var rp=t=>(e,r)=>ta(e)?e:tp(r,e,t),np=globalThis.process?.env?.NODE_ENV==="development",sp=rp(np),ip=(t,e)=>({result:r,setResult:n})=>{r.errors!=null&&n({...r,errors:r.errors.map(s=>t(s,e))});};function ra(t){let e=t?.maskError??sp,r=t?.errorMessage||Xd,n=ip(e,r);return {onPluginInit(s){s.registerContextErrorHandler(({error:i,setError:o})=>{o(e(i,r));});},onExecute(){return {onExecuteDone(s){return is(s,n)}}},onSubscribe(){return {onSubscribeResult(s){return is(s,n)},onSubscribeError({error:s,setError:i}){i(e(s,r));}}}}}chunkBUNLC3II_cjs.h();var na=t=>({onContextBuilding({context:e,extendContext:r}){return k(()=>t(e),n=>r(n))}});chunkBUNLC3II_cjs.h();var sa=t=>({onExecute:({setExecuteFn:e})=>{t.execute&&e(t.execute);},onParse:({setParseFn:e})=>{t.parse&&e(t.parse);},onValidate:({setValidationFn:e,addValidationRule:r})=>{t.validate&&e(t.validate),t.specifiedRules?.map(r);},onSubscribe:({setSubscribeFn:e})=>{t.subscribe&&e(t.subscribe);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Be=class extends Error{error;suppressed;constructor(e,r,n){super(n),this.error=e,this.suppressed=r,this.name="SuppressedError",Error.captureStackTrace(this,this.constructor);}};chunkBUNLC3II_cjs.h();var H={get dispose(){return Symbol.dispose||Symbol.for("dispose")},get asyncDispose(){return Symbol.asyncDispose||Symbol.for("asyncDispose")}};chunkBUNLC3II_cjs.h();function Pr(t){return t?.[H.dispose]!=null}function ia(t){return t?.[H.asyncDispose]!=null}var op=globalThis.SuppressedError||Be,vr=class t{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return ia(e)?this.callbacks.push(()=>e[H.asyncDispose]()):Pr(e)&&this.callbacks.push(()=>e[H.dispose]()),e}adopt(e,r){return r&&this.callbacks.push(()=>r(e)),e}defer(e){e&&this.callbacks.push(e);}move(){let e=new t;return e.callbacks=this.callbacks,this.callbacks=[],e}disposeAsync(){return this[H.asyncDispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e)return k(e,()=>this._iterateCallbacks(),r=>(this._error=this._error?new op(r,this._error):r,this._iterateCallbacks()))}[H.asyncDispose](){let e=this._iterateCallbacks();if(e?.then)return e.then(()=>{if(this._error){let r=this._error;throw this._error=void 0,r}});if(this._error){let r=this._error;throw this._error=void 0,r}}[Symbol.toStringTag]="AsyncDisposableStack"};chunkBUNLC3II_cjs.h();var oa=globalThis.AsyncDisposableStack||vr;chunkBUNLC3II_cjs.h();function xe(t){if(t instanceof Error)return t;if(typeof t=="object"&&t!=null&&"message"in t&&typeof t.message=="string"){let e;"cause"in t&&(e={cause:t.cause});let r=new Error(t.message,e);return "stack"in t&&typeof t.stack=="string"&&(r.stack=t.stack),"name"in t&&typeof t.name=="string"&&(r.name=t.name),r}return new Error(String(t))}chunkBUNLC3II_cjs.h();function aa(t){let e=t[Symbol.asyncIterator](),r,n,s=false;async function i(){if(s)return {value:void 0,done:true};try{if(!r){if(n)return await n,await i();let c;n=new Promise(u=>{c=u;});let l=await e.next();return l.done?(s=!0,await i()):(r=l.value[Symbol.asyncIterator](),n=void 0,c(),await i())}let o=r,a=await r.next();return a.done?(r===o&&(r=void 0),await i()):a}catch(o){throw s=true,o}}return {next:i,async return(){return s=true,await Promise.all([r?.return?.(),e.return?.()]),{value:void 0,done:true}},async throw(o){throw s=true,await Promise.all([r?.throw?.(o),e.throw?.(o)]),o},[Symbol.asyncIterator](){return this},async[H.asyncDispose](){s=true,await Promise.all([r?.[H.asyncDispose]?.(),e?.[H.asyncDispose]?.()]);}}}chunkBUNLC3II_cjs.h();function as(t,e){if(!t)throw new Error(e??"Unexpected invariant triggered.")}chunkBUNLC3II_cjs.h();function ls(t,e,r){e?.throwIfAborted();let n=Object.create(null),s=[];for(let o in t){let a=k(()=>t[o],c=>{n[o]=c;});N(a)&&s.push(a);}if(!s.length)return n;let i=s.length===1?s[0]:Promise.all(s);return r?Promise.race([r,i]).then(()=>n):i.then(()=>n)}chunkBUNLC3II_cjs.h();function la(t,e,r,n){let s=[],i=n?.maxErrors;try{let o=lp(t,e,r,a=>{if(i!=null&&s.length>=i)throw G("Too many errors processing variables, error limit reached. Execution aborted.");s.push(a);});if(s.length===0)return {coerced:o}}catch(o){s.push(o);}return {errors:s}}function lp(t,e,r,n){let s={};for(let i of e){let o=i.variable.name.value,a=chunkVOQUO2EZ_cjs.y(t,i.type);if(!chunkVOQUO2EZ_cjs.k(a)){let l=chunkVOQUO2EZ_cjs.f(i.type);n(G(`Variable "$${o}" expected value of type "${l}" which cannot be used as an input type.`,{nodes:i.type}));continue}if(!wr(r,o)){if(i.defaultValue)s[o]=chunkVOQUO2EZ_cjs.A(i.defaultValue,a);else if(chunkVOQUO2EZ_cjs.j(a)){let l=ee(a);n(G(`Variable "$${o}" of required type "${l}" was not provided.`,{nodes:i}));}continue}let c=r[o];if(c===null&&chunkVOQUO2EZ_cjs.j(a)){let l=ee(a);n(G(`Variable "$${o}" of non-null type "${l}" must not be null.`,{nodes:i}));continue}s[o]=chunkVOQUO2EZ_cjs.z(c,a,(l,u,h)=>{let d=`Variable "$${o}" got invalid value `+ee(u);l.length>0&&(d+=` at "${o}${Zo(l)}"`),n(G(d+"; "+h.message,{nodes:i,originalError:h}));});}return s}var cp=$o((t,e,r)=>Qo(t.schema,t.fragments,t.variableValues,e,r));function ya(t){let e=xa(t);return "schema"in e?ga(e):{errors:e.map(r=>(Object.defineProperty(r,"extensions",{value:{...r.extensions,http:{...r.extensions?.http||{},status:400}}}),r))}}function ga(t){return t.signal?.throwIfAborted(),k(()=>hp(t),e=>{let r=ca(e,t.errors);return t.subsequentPayloads.size>0?{initialResult:{...r,hasNext:true},subsequentResults:kp(t)}:r},e=>(t.signal?.throwIfAborted(),e.errors?t.errors.push(...e.errors):t.errors.push(e),ca(null,t.errors)))}function ca(t,e){return e.length===0?{data:t}:{errors:e,data:t}}var up=Me(function(e){let r=Object.create(null);for(let n of e.definitions)n.kind===chunkVOQUO2EZ_cjs.d.FRAGMENT_DEFINITION&&(r[n.name.value]=n);return r});function xa(t){let{schema:e,document:r,rootValue:n,contextValue:s,variableValues:i,operationName:o,fieldResolver:a,typeResolver:c,subscribeFieldResolver:l,signal:u,schemaCoordinateInErrors:h}=t;u?.throwIfAborted(),chunkVOQUO2EZ_cjs.x(e);let d=up(r),p;for(let D of r.definitions)switch(D.kind){case chunkVOQUO2EZ_cjs.d.OPERATION_DEFINITION:if(o==null){if(p!==void 0)return [G("Must provide operation name if query contains multiple operations.",{extensions:{code:"OPERATION_RESOLUTION_FAILURE"}})];p=D;}else D.name?.value===o&&(p=D);break;}if(p==null)return o!=null?[G(`Unknown operation named "${o}".`,{extensions:{code:"OPERATION_RESOLUTION_FAILURE"}})]:[G("Must provide an operation.",{extensions:{code:"OPERATION_RESOLUTION_FAILURE"}})];let x=p.variableDefinitions??[],S=la(e,x,i??{},{maxErrors:50});if(S.errors)return S.errors;u?.throwIfAborted();let R,C;if(u){let D=new Set,E=Ut();C=E.promise;let T=()=>{E.reject(u.reason),u.removeEventListener("abort",T);};u.addEventListener("abort",T,{once:true}),C.catch(()=>{for(let w of D)w();D.clear();}),R=w=>{D.add(w);};}return {schema:e,fragments:d,rootValue:n,contextValue:s,operation:p,variableValues:S.coerced,fieldResolver:a??da,typeResolver:c??xp,subscribeFieldResolver:l??da,subsequentPayloads:new Set,errors:[],signal:u,onSignalAbort:R,signalPromise:C,schemaCoordinateInErrors:h}}function fp(t,e){return {...t,rootValue:e,subsequentPayloads:new Set,errors:[]}}function hp(t){let{operation:e,schema:r,fragments:n,variableValues:s,rootValue:i}=t,o=Go(r,e.operation,[e]);o==null&&G(`Schema is not configured to execute ${e.operation} operation.`,{nodes:e});let{fields:a,patches:c}=rs(r,n,s,o,e.selectionSet),l=void 0,u;e.operation==="mutation"?u=dp(t,o,i,l,a):u=fs(t,o,i,l,a);for(let h of c){let{label:d,fields:p}=h;Ta(t,o,i,p,d,l);}return u}function dp(t,e,r,n,s){return Bo(s,(i,[o,a])=>{let c=Ye(n,o,e.name);return t.signal?.throwIfAborted(),k(()=>_a(t,e,r,a,c),l=>(l===void 0||(i[o]=l),i))},Object.create(null))}function fs(t,e,r,n,s,i){let o=Object.create(null),a=false;try{for(let[c,l]of s){t.signal?.throwIfAborted();let u=Ye(n,c,e.name),h=_a(t,e,r,l,u,i);h!==void 0&&(o[c]=h,N(h)&&(a=!0));}}catch(c){if(c!==t.signal?.reason&&a)return k(()=>ls(o,t.signal),()=>{throw c},()=>{throw c});throw c}return a?ls(o,t.signal,t.signalPromise):o}function _a(t,e,r,n,s,i){let o=i?.errors??t.errors,a=ka(t.schema,e,n[0]);if(!a)return;let c=a.type,l=a.resolve??t.fieldResolver,u=wa(t,a,n,e,s);try{t.signal?.throwIfAborted();let h=es(a,n[0],t.variableValues),d=t.contextValue,p=l(r,h,d,u),x;return N(p)?x=p.then(S=>$e(t,c,n,u,s,S,i)):x=$e(t,c,n,u,s,p,i),N(x)?x.then(void 0,S=>{if(S instanceof AggregateError){let D;for(let E of S.errors){E=xe(E);let T=ae(E,n,te(s),t.schemaCoordinateInErrors&&u);D=be(T,c,o),fe(t,s,i);}return D}S=xe(S);let R=ae(S,n,te(s),t.schemaCoordinateInErrors&&u),C=be(R,c,o);return fe(t,s,i),C}):x}catch(h){if(h instanceof AggregateError){let S;for(let R of h.errors){R=xe(R);let C=ae(R,n,te(s),t.schemaCoordinateInErrors&&u);S=be(C,c,o),fe(t,s,i);}return S}let d=xe(h),p=ae(d,n,te(s),t.schemaCoordinateInErrors&&u),x=be(p,c,o);return fe(t,s,i),x}}function wa(t,e,r,n,s){return {fieldName:e.name,fieldNodes:r,returnType:e.type,parentType:n,path:s,schema:t.schema,fragments:t.fragments,rootValue:t.rootValue,operation:t.operation,variableValues:t.variableValues,signal:t.signal}}var pp="CRITICAL_ERROR";function be(t,e,r){if(chunkVOQUO2EZ_cjs.j(e)||t.extensions?.[pp])throw t;return r.push(t),null}function $e(t,e,r,n,s,i,o){if(i instanceof Error)throw i;if(chunkVOQUO2EZ_cjs.j(e)){let a=$e(t,e.ofType,r,n,s,i,o);if(a===null)throw new Error(`Cannot return null for non-nullable field ${n.parentType.name}.${n.fieldName}.`);return a}if(i==null)return null;if(chunkVOQUO2EZ_cjs.i(e))return bp(t,e,r,n,s,i,o);if(chunkVOQUO2EZ_cjs.l(e))return yp(e,i);if(chunkVOQUO2EZ_cjs.m(e))return gp(t,e,r,n,s,i,o);if(chunkVOQUO2EZ_cjs.h(e))return cs(t,e,r,n,s,i,o);console.assert(false,"Cannot complete value of unexpected output type: "+ee(e));}function Sa(t,e,r){if(typeof r.key=="number")return;let n=chunkVOQUO2EZ_cjs.B(Vo,e[0],t.variableValues);if(n&&n.if!==false)return as(typeof n.initialCount=="number","initialCount must be a number"),as(n.initialCount>=0,"initialCount must be a positive integer"),{initialCount:n.initialCount,label:typeof n.label=="string"?n.label:void 0}}async function mp(t,e,r,n,s,i,o){t.signal?.throwIfAborted(),i.return&&t.onSignalAbort?.(()=>{i.return?.();});let a=o?.errors??t.errors,c=Sa(t,r,s),l=false,u=[],h=0;for(;;){if(c&&typeof c.initialCount=="number"&&h>=c.initialCount){vp(h,i,t,r,n,e,s,c.label,o);break}let d=Ye(s,h,void 0),p;try{if(p=await i.next(),p.done)break}catch(x){let S=xe(x),R=ae(S,r,te(d),t.schemaCoordinateInErrors&&n);u.push(be(R,e,a));break}Ea(p.value,u,a,t,e,r,n,d,o)&&(l=true),h+=1;}return l?Promise.all(u):u}function bp(t,e,r,n,s,i,o){let a=e.ofType,c=o?.errors??t.errors;if(Sr(i)){let x=i[Symbol.asyncIterator]();return mp(t,a,r,n,s,x,o)}if(!Mo(i))throw G(`Expected Iterable, but did not find one for field "${n.parentType.name}.${n.fieldName}".`);let l=Sa(t,r,s),u=false,h=o,d=[],p=0;for(let x of i){let S=Ye(s,p,void 0);if(l&&typeof l.initialCount=="number"&&p>=l.initialCount){h=Ep(s,S,x,t,r,n,a,l.label,h),p++;continue}Ea(x,d,c,t,a,r,n,S,o)&&(u=true),p++;}return u?Promise.all(d):d}function Ea(t,e,r,n,s,i,o,a,c){try{let l;if(N(t)?l=t.then(u=>$e(n,s,i,o,a,u,c)):l=$e(n,s,i,o,a,t,c),N(l))return e.push(l.then(void 0,u=>{u=xe(u);let h=ae(u,i,te(a),n.schemaCoordinateInErrors&&o),d=be(h,s,r);return fe(n,a,c),d})),!0;e.push(l);}catch(l){let u=xe(l),h=ae(u,i,te(a),n.schemaCoordinateInErrors&&o),d=be(h,s,r);fe(n,a,c),e.push(d);}return false}function yp(t,e){let r;try{r=t.serialize(e);}catch(n){throw n instanceof chunkVOQUO2EZ_cjs.b?new Error(n.message):n}if(r==null)throw new Error(`Expected \`${ee(t)}.serialize(${ee(e)})\` to return non-nullable value, returned: ${ee(r)}`);return r}function gp(t,e,r,n,s,i,o){let a=e.resolveType??t.typeResolver,c=t.contextValue,l=a(i,c,n,e);return N(l)?l.then(u=>cs(t,ua(u,t,e,r,n,i),r,n,s,i,o)):cs(t,ua(l,t,e,r,n,i),r,n,s,i,o)}function ua(t,e,r,n,s,i){if(t==null)throw G(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${s.parentType.name}.${s.fieldName}". Either the "${r.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,{nodes:n});if(chunkVOQUO2EZ_cjs.h(t)){if(chunkVOQUO2EZ_cjs.a.major>=16)throw G("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");t=t.name;}if(typeof t!="string")throw G(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${s.parentType.name}.${s.fieldName}" with value ${ee(i)}, received "${ee(t)}".`);let o=e.schema.getType(t);if(o==null)throw G(`Abstract type "${r.name}" was resolved to a type "${t}" that does not exist inside the schema.`,{nodes:n});if(!chunkVOQUO2EZ_cjs.h(o))throw G(`Abstract type "${r.name}" was resolved to a non-object type "${t}".`,{nodes:n});if(!e.schema.isSubType(r,o))throw G(`Runtime Object type "${o.name}" is not a possible type for "${r.name}".`,{nodes:n});return o}function cs(t,e,r,n,s,i,o){if(e.isTypeOf){let a=e.isTypeOf(i,t.contextValue,n);if(N(a))return a.then(c=>{if(!c)throw fa(e,i,r);return ha(t,e,r,s,i,o)});if(!a)throw fa(e,i,r)}return ha(t,e,r,s,i,o)}function fa(t,e,r){return G(`Expected value of type "${t.name}" but got: ${ee(e)}.`,{nodes:r})}function ha(t,e,r,n,s,i){let{fields:o,patches:a}=cp(t,e,r),c=fs(t,e,s,n,o,i);for(let l of a){let{label:u,fields:h}=l;Ta(t,e,s,h,u,n,i);}return c}var xp=function(t,e,r,n){if(Xn(t)&&typeof t.__typename=="string")return t.__typename;let s=r.schema.getPossibleTypes(n),i=[];for(let o=0;o<s.length;o++){let a=s[o];if(a.isTypeOf){let c=a.isTypeOf(t,e,r);if(N(c))i[o]=c;else if(c)return a.name}}if(i.length)return Promise.all(i).then(o=>{for(let a=0;a<o.length;a++)if(o[a])return s[a].name})},da=function(t,e,r,n){if(Xn(t)||typeof t=="function"){let s=t[n.fieldName];return typeof s=="function"?t[n.fieldName](e,r,n):s}};function Pa(t){let e=xa(t);if(!("schema"in e)){for(let n of e){let s=n.extensions||={},i=s.http||={};i.status=400,n.extensions.code="BAD_USER_INPUT";}return {errors:e}}let r=wp(e);return N(r)?r.then(n=>pa(e,n)):pa(e,r)}function va(t){return t?.initialResult}function hs(t){let e=t.subsequentResults,r=false,n=false;return {[Symbol.asyncIterator](){return this},next(){return n?$({value:void 0,done:n}):r?e.next():(r=true,$({value:t.initialResult,done:n}))},return(){return n=true,e.return()},throw(s){return n=true,e.throw(s)},[H.asyncDispose](){return n=true,e?.[H.asyncDispose]?.()}}}async function*_p(t){"initialResult"in t?yield*hs(t):yield t;}function pa(t,e){return Sr(e)?aa(Oe(e,r=>k(()=>ga(fp(t,r)),_p),r=>{throw r instanceof AggregateError?new AggregateError(r.errors.map(n=>ma(n,t.operation)),r.message):ma(r,t.operation)})):e}function ma(t,e){return G(t.message,{originalError:t,nodes:[e]})}function wp(t){try{let e=Sp(t);return N(e)?e.then(void 0,r=>({errors:[r]})):e}catch(e){return {errors:[e]}}}function Sp(t){let{schema:e,fragments:r,operation:n,variableValues:s,rootValue:i}=t,o=e.getSubscriptionType();if(o==null)throw G("Schema is not configured to execute subscription operation.",{nodes:n});let{fields:a}=rs(e,r,s,o,n.selectionSet),[c,l]=[...a.entries()][0],u=l[0].name.value,h=ka(e,o,l[0]);if(!h)throw G(`The subscription field "${u}" is not defined.`,{nodes:l});let d=Ye(void 0,c,o.name),p=wa(t,h,l,o,d);try{let x=es(h,l[0],s),S=t.contextValue,C=(h.subscribe??t.subscribeFieldResolver)(i,x,S,p);return N(C)?C.then(D=>ba(D,t.signal,t.onSignalAbort)).then(void 0,D=>{throw ae(D,l,te(d),t.schemaCoordinateInErrors&&p)}):ba(C,t.signal,t.onSignalAbort)}catch(x){throw ae(x,l,te(d),t.schemaCoordinateInErrors&&p)}}function ba(t,e,r){if(e?.throwIfAborted(),t instanceof Error)throw t;if(!Sr(t))throw G(`Subscription field must return Async Iterable. Received: ${ee(t)}.`);return r?{[Symbol.asyncIterator](){let n=t[Symbol.asyncIterator]();return n.return&&r?.(()=>{n.return?.();}),n}}:t}function Ta(t,e,r,n,s,i,o){let a=new us({label:s,path:i,parentContext:o,exeContext:t}),c;try{c=fs(t,e,r,i,n,a),N(c)&&(c=c.then(null,l=>(a.errors.push(l),null)));}catch(l){a.errors.push(l),c=null;}a.addData(c);}function Ep(t,e,r,n,s,i,o,a,c){let l=new kr({label:a,path:e,parentContext:c,exeContext:n}),u;try{try{N(r)?u=r.then(d=>$e(n,o,s,i,e,d,l)):u=$e(n,o,s,i,e,r,l),N(u)&&(u=u.then(void 0,d=>{d=xe(d);let p=ae(d,s,te(e),n.schemaCoordinateInErrors&&i),x=be(p,o,l.errors);return fe(n,e,l),x}));}catch(d){let p=xe(d),x=ae(p,s,te(e),n.schemaCoordinateInErrors&&i);u=be(x,o,l.errors),fe(n,e,l);}}catch(d){return l.errors.push(d),fe(n,t,l),l.addItems(null),l}let h;return N(u)?h=u.then(d=>[d],d=>(l.errors.push(d),fe(n,t,l),null)):h=[u],l.addItems(h),l}async function Pp(t,e,r,n,s,i,o){let a;try{let{value:l,done:u}=await t.next();if(u)return i.setIsCompletedIterator(),{done:u,value:void 0};a=l;}catch(l){let u=xe(l),h=ae(u,r,te(o),e.schemaCoordinateInErrors&&n);return {done:true,value:be(h,s,i.errors)}}let c;try{return c=$e(e,s,r,n,o,a,i),N(c)&&(c=c.then(void 0,l=>{let u=ae(l,r,te(o),e.schemaCoordinateInErrors&&n),h=be(u,s,i.errors);return fe(e,o,i),h})),{done:!1,value:c}}catch(l){let u=ae(l,r,te(o),e.schemaCoordinateInErrors&&n),h=be(u,s,i.errors);return fe(e,o,i),{done:false,value:h}}}async function vp(t,e,r,n,s,i,o,a,c){let l=t,u=c??void 0;for(;;){let h=Ye(o,l,void 0),d=new kr({label:a,path:h,parentContext:u,iterator:e,exeContext:r}),p;try{p=await Pp(e,r,n,s,i,d,h);}catch(C){d.errors.push(C),fe(r,o,d),d.addItems(null),e?.return&&e.return().catch(()=>{});return}let{done:x,value:S}=p,R;if(N(S)?R=S.then(C=>[C],C=>(d.errors.push(C),fe(r,o,d),null)):R=[S],d.addItems(R),x)break;u=d,l++;}}function fe(t,e,r){let n=te(e);t.subsequentPayloads.forEach(s=>{if(s!==r){for(let i=0;i<n.length;i++)if(s.path[i]!==n[i])return;ds(s)&&s.iterator?.return&&s.iterator.return().catch(()=>{}),t.subsequentPayloads.delete(s);}});}function Tp(t){let e=[];for(let r of t.subsequentPayloads){let n={};if(r.isCompleted){if(t.subsequentPayloads.delete(r),ds(r)){let s=r.items;if(r.isCompletedIterator)continue;n.items=s;}else {let s=r.data;n.data=s??null;}n.path=r.path,r.label&&(n.label=r.label),r.errors.length>0&&(n.errors=r.errors),e.push(n);}}return e}function kp(t){let e=false;async function r(){if(e)return {value:void 0,done:true};let s=Array.from(t.subsequentPayloads).map(a=>a.promise);if(t.signalPromise?await Promise.race([t.signalPromise,...s]):await Promise.race(s),e)return {value:void 0,done:true};let i=Tp(t),o=t.subsequentPayloads.size>0;return !i.length&&o?r():(o||(e=true),{value:i.length?{incremental:i,hasNext:o}:{hasNext:o},done:false})}function n(){let s=[];return t.subsequentPayloads.forEach(i=>{ds(i)&&i.iterator?.return&&s.push(i.iterator.return());}),Promise.all(s)}return {[Symbol.asyncIterator](){return this},next:r,async return(){return await n(),e=true,{value:void 0,done:true}},async throw(s){throw await n(),e=true,s},async[H.asyncDispose](){await n(),e=true;}}}var us=class{type;errors;label;path;promise;data;parentContext;isCompleted;_exeContext;_resolve;constructor(e){this.type="defer",this.label=e.label,this.path=te(e.path),this.parentContext=e.parentContext,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=false,this.data=null,this.promise=new Promise(r=>{this._resolve=n=>{r(n);};}).then(r=>{this.data=r,this.isCompleted=true;});}addData(e){let r=this.parentContext?.promise;if(r){this._resolve?.(r.then(()=>e));return}this._resolve?.(e);}},kr=class{type;errors;label;path;items;promise;parentContext;iterator;isCompletedIterator;isCompleted;_exeContext;_resolve;constructor(e){this.type="stream",this.items=null,this.label=e.label,this.path=te(e.path),this.parentContext=e.parentContext,this.iterator=e.iterator,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=false,this.items=null,this.promise=new Promise(r=>{this._resolve=n=>{r(n);};}).then(r=>{this.items=r,this.isCompleted=true;});}addItems(e){let r=this.parentContext?.promise;if(r){this._resolve?.(r.then(()=>e));return}this._resolve?.(e);}setIsCompletedIterator(){this.isCompletedIterator=true;}};function ds(t){return t.type==="stream"}function ka(t,e,r){let n=r.name.value;return n===chunkVOQUO2EZ_cjs.u.name&&t.getQueryType()===e?chunkVOQUO2EZ_cjs.u:n===chunkVOQUO2EZ_cjs.v.name&&t.getQueryType()===e?chunkVOQUO2EZ_cjs.v:n===chunkVOQUO2EZ_cjs.w.name?chunkVOQUO2EZ_cjs.w:e.getFields()[n]}chunkBUNLC3II_cjs.h();function Cr(t){let e=chunkVOQUO2EZ_cjs.F(t.document,t.operationName);if(e==null)throw new Error("Must provide an operation.");return e.operation==="subscription"?Pa(t):k(()=>ya(t),r=>va(r)?hs(r):r)}var Xy=chunkBUNLC3II_cjs.e(nr(),1);chunkBUNLC3II_cjs.h();var Ay=chunkBUNLC3II_cjs.e(nr(),1);chunkBUNLC3II_cjs.h();function nu(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function gy(t){if(t.socket?.localPort)return t.socket?.localPort;let r=(t.headers?.[":authority"]||t.headers?.host)?.split(":")?.[1];return r||80}function xy(t){if(t.headers?.[":authority"])return t.headers?.[":authority"];if(t.headers?.host)return t.headers?.host;let e=gy(t);if(t.hostname)return t.hostname+":"+e;let r=t.socket?.localAddress;return r&&!r?.includes("::")&&!r?.includes("ffff")?`${r}:${e}`:"localhost"}function _y(t){let e=xy(t),r=t.protocol||(t.socket?.encrypted?"https":"http"),n=t.originalUrl||t.url||"/graphql";return `${r}://${e}${n}`}function wy(t){let e=t[Symbol.toStringTag];return !!(typeof t=="string"||e==="Uint8Array"||e==="Blob"||e==="FormData"||e==="URLSearchParams"||nu(t))}function Fi(t,e,r,n){let s=t.raw||t.req||t,i=_y(s);if(t.query){let l=new e.URL(i);for(let u in t.query)l.searchParams.set(u,t.query[u]);i=l.toString();}let o=t.headers;if(t.headers?.[":method"]){o={};for(let l in t.headers)l.startsWith(":")||(o[l]=t.headers[l]);}let a=n?Ui():new AbortController;if(r?.once){let l=()=>{a.signal.aborted||(Object.defineProperty(s,"aborted",{value:true}),a.abort(r.errored??void 0));};r.once("error",l),r.once("close",l),r.once("finish",()=>{r.removeListener("close",l);});}if(t.method==="GET"||t.method==="HEAD")return new e.Request(i,{method:t.method,headers:o,signal:a.signal});let c=t.body;if(c!=null&&Object.keys(c).length>0){if(wy(c))return new e.Request(i,{method:t.method||"GET",headers:o,body:c,signal:a.signal});let l=new e.Request(i,{method:t.method||"GET",headers:o,signal:a.signal});return l.headers.get("content-type")?.includes("json")||l.headers.set("content-type","application/json; charset=utf-8"),new Proxy(l,{get(u,h,d){switch(h){case "json":return ()=>$(c);case "text":return ()=>$(JSON.stringify(c));default:{let p=Reflect.get(l,h,l);return typeof p=="function"?function(...S){return p.apply(this===d?l:this,S)}:p}}}})}return new e.Request(i,{method:t.method,headers:o,signal:a.signal,body:s,duplex:"half"})}function su(t){return t.read!=null}function iu(t){return su(t)}function Ii(t){return t!=null&&t.setHeader!=null&&t.end!=null&&t.once!=null&&t.write!=null}function Sy(t){return t!=null&&t.getReader!=null}function ou(t){return t!=null&&t.request!=null&&t.respondWith!=null}function Ey(t){t?.socket?.setTimeout?.(0),t?.socket?.setNoDelay?.(true),t?.socket?.setKeepAlive?.(true);}function sr(t){t.end(null,null,null);}function Py(t,e){let r=false,n=()=>{r=true;};t.once("error",n),t.once("close",n),t.once("finish",()=>{t.removeListener("close",n),t.removeListener("error",n);});let s=e[Symbol.asyncIterator]();return au(()=>s.next(),t,()=>r)}function tu(t){t.end(null,null,null);}function au(t,e,r){let n=()=>k(t,s=>r?.()||s.done?tu(e):k(()=>mn(s.value,e),()=>r?.()?tu(e):n()));return n()}function mn(t,e){if(!e.write(t))return new Promise(n=>e.once("drain",n))}var vy=globalThis.process?.versions?.node?.startsWith("1");function lu(t,e,r,n){if(e.closed||e.destroyed||e.writableEnded)return;if(!t){e.statusCode=404,sr(e);return}if(n&&t.headers?.headersInit&&!Array.isArray(t.headers.headersInit)&&!t.headers.headersInit.get&&!t.headers._map&&!t.headers._setCookies?.length)e.writeHead(t.status,t.statusText,t.headers.headersInit);else {if(e.setHeaders&&!vy)e.setHeaders(t.headers);else {let o=false;t.headers.forEach((a,c)=>{if(c==="set-cookie"){if(o)return;o=true;let l=t.headers.getSetCookie?.();if(l){e.setHeader("set-cookie",l);return}}e.setHeader(c,a);});}e.writeHead(t.status,t.statusText);}if(t.bodyType==="String"){let o=t.bodyInit;return k(()=>mn(o,e),()=>sr(e))}let s=t._buffer;if(s)return k(()=>mn(s,e),()=>sr(e));let i=t.body;if(i==null){sr(e);return}if(i[Symbol.toStringTag]==="Uint8Array")return k(()=>mn(i,e),()=>sr(e));if(Ey(r),su(i)){e.once("close",()=>{i.destroy();}),i.pipe(e,{end:true});return}if(Sy(i))return Ty(r,e,i);if(nu(i))return Py(e,i)}function Ty(t,e,r){let n=r.getReader();return t?.once?.("error",s=>{n.cancel(s);}),au(()=>n.read(),e)}function cu(t){return t!=null&&typeof t=="object"&&("body"in t||"cache"in t||"credentials"in t||"headers"in t||"integrity"in t||"keepalive"in t||"method"in t||"mode"in t||"redirect"in t||"referrer"in t||"referrerPolicy"in t||"signal"in t||"window"in t)}function lt(...t){let[e,...r]=t.filter(n=>n!=null&&typeof n=="object");return r.forEach(n=>{let s=Object.getOwnPropertyNames(n).reduce((i,o)=>(Object.getOwnPropertyDescriptor(n,o)&&(i[o]=Object.getOwnPropertyDescriptor(n,o)),i),{});Object.getOwnPropertySymbols(n).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n,i);o?.enumerable&&(s[i]=o);}),Object.defineProperties(e,s);}),e}function Di(t,e){return new e(t.stack||t.message||t.toString(),{status:t.status||500})}function ji(t,e){return t==null?e==null?{}:{waitUntil:e}:lt(Object.create(t),{waitUntil:e},t)}function qi(t,e){if(e?.aborted)throw e.reason;if(N(t)&&e){let s=function(){n.reject(e.reason);};let n=Ut();return e.addEventListener("abort",s,{once:true}),t.then(function(o){n.resolve(o);}).catch(function(o){n.reject(o);}).finally(()=>{e.removeEventListener("abort",s);}),n.promise}return t}var ky=["SIGINT","exit","SIGTERM"],bn=new Set,ru=false;function Cy(){if(!ru){ru=true;for(let t of ky)globalThis.process.once(t,function(){return Promise.allSettled([...bn].map(r=>!r.disposed&&r.disposeAsync()))});}}function uu(t){globalThis.process&&(Cy(),bn.has(t)||(bn.add(t),t.defer(()=>{bn.delete(t);})));}var Oi=class extends EventTarget{aborted=false;_onabort=null;_reason;constructor(){super();let e=globalThis.process?.getBuiltinModule?.("node:events");e?.kMaxEventTargetListeners&&(this[e.kMaxEventTargetListeners]=0);}throwIfAborted(){if(this._nativeCtrl?.signal?.throwIfAborted)return this._nativeCtrl.signal.throwIfAborted();if(this.aborted)throw this._reason}_nativeCtrl;ensureNativeCtrl(){if(!this._nativeCtrl){let e=this.aborted;this._nativeCtrl=new AbortController,e&&this._nativeCtrl.abort(this._reason);}return this._nativeCtrl}abort(e){if(this._nativeCtrl?.abort)return this._nativeCtrl?.abort(e);this._reason=e||new DOMException("This operation was aborted","AbortError"),this.aborted=true,this.dispatchEvent(new Event("abort"));}get signal(){return this._nativeCtrl?.signal?this._nativeCtrl.signal:this}get reason(){return this._nativeCtrl?.signal?this._nativeCtrl.signal.reason:this._reason}get onabort(){return this._onabort?this._onabort:this._onabort}set onabort(e){if(this._nativeCtrl?.signal){this._nativeCtrl.signal.onabort=e;return}this._onabort&&this.removeEventListener("abort",this._onabort),this._onabort=e,e&&this.addEventListener("abort",e);}};function Ui(){return globalThis.Bun||globalThis.Deno?new AbortController:new Proxy(new Oi,{get(t,e,r){if(e.toString().includes("kDependantSignals")){let n=t.ensureNativeCtrl();return Reflect.get(n.signal,e,n.signal)}return Reflect.get(t,e,r)},set(t,e,r,n){if(e.toString().includes("kDependantSignals")){let s=t.ensureNativeCtrl();return Reflect.set(s.signal,e,r,s.signal)}return Reflect.set(t,e,r,n)},getPrototypeOf(){return AbortSignal.prototype}})}chunkBUNLC3II_cjs.h();function fu(t){return !!t.onData}function hu({req:t,res:e,fetchAPI:r,controller:n}){let s=t.getMethod(),i,o=[],a=[w=>{o.push(w);}],c=w=>{for(let P of a)P(w);},l=false,u=[()=>{l=true;}],h=()=>{for(let w of u)w();};e.onData(function(w,P){c(Buffer.from(Buffer.from(w,0,w.byteLength))),P&&h();});let d;if(s!=="get"&&s!=="head"){i="half",n.signal.addEventListener("abort",()=>{h();},{once:true});let w;d=()=>(w||(w=new r.ReadableStream({start(P){for(let L of o)P.enqueue(L);if(l){P.close();return}a.push(L=>{P.enqueue(L);}),u.push(()=>{if(n.signal.reason){P.error(n.signal.reason);return}P.desiredSize&&P.close();});}})),w);}let p=new r.Headers;t.forEach((w,P)=>{p.append(w,P);});let x=`http://localhost${t.getUrl()}`,S=t.getQuery();S&&(x+=`?${S}`);let R;function C(){return d?l?E():d():null}let D=new r.Request(x,{method:s,headers:p,get body(){return C()},signal:n.signal,duplex:i});function E(){return R||(R=o.length===1?o[0]:Buffer.concat(o)),R}function T(){return l?$(E()):new Promise((w,P)=>{try{u.push(()=>{w(E());});}catch(L){P(L);}})}return Object.defineProperties(D,{body:{get(){return C()},configurable:true,enumerable:true},json:{value(){return T().then(w=>w.toString("utf8")).then(w=>JSON.parse(w))},configurable:true,enumerable:true},text:{value(){return T().then(w=>w.toString("utf8"))},configurable:true,enumerable:true},arrayBuffer:{value(){return T()},configurable:true,enumerable:true}}),D}function Ry(t,e){return new e.WritableStream({write(r){t.cork(()=>{t.write(r);});},close(){t.cork(()=>{t.end();});}})}function du(t,e,r,n){if(!e){t.writeStatus("404 Not Found"),t.end();return}let s=e._buffer,i=e.bodyType==="String"?e.bodyInit:void 0;if(!r.signal.aborted&&(t.cork(()=>{t.writeStatus(`${e.status} ${e.statusText}`);let o=false;for(let[a,c]of e.headers)if(a!=="content-length"&&a!=="transfer-encoding"){if(a==="set-cookie"){if(o)continue;o=true;let l=e.headers.getSetCookie?.();if(l){for(let u of l)t.writeHeader(a,u);continue}}t.writeHeader(a,c);}i?t.end(i):s?t.end(s):e.body||t.end();}),!(i||s||!e.body)))return r.signal.addEventListener("abort",()=>{e.body?.locked||e.body?.cancel(r.signal.reason);},{once:true}),e.body.pipeTo(Ry(t,n),{signal:r.signal}).catch(o=>{if(!r.signal.aborted)throw o})}function Ly(t){try{return !!t?.request}catch{return false}}var Oy={};function pu(t,e){let r=e?.__useSingleWriteHead==null?true:e.__useSingleWriteHead,n={...Ay,...e?.fetchAPI},s=e?.__useCustomAbortCtrl==null?n.Request!==globalThis.Request:e.__useCustomAbortCtrl,i=typeof t=="function"?t:t.handle,o=[],a=[],c,l=new Set,u;function h(){return u||(u=new oa,e?.disposeOnProcessTerminate&&uu(u),u.defer(()=>{if(l.size>0)return Promise.allSettled(l).then(()=>{l.clear();},()=>{l.clear();})})),u}function d(y){N(y)&&(h(),l.add(y),y.then(()=>{l.delete(y);},g=>{console.error(`Unexpected error while waiting: ${g.message||g}`),l.delete(y);}));}if(e?.plugins!=null)for(let y of e.plugins){y.instrumentation&&(c=c?yt(c,y.instrumentation):y.instrumentation),y.onRequest&&o.push(y.onRequest),y.onResponse&&a.push(y.onResponse);let g=y[H.dispose];g&&h().defer(g);let _=y[H.asyncDispose];_&&h().defer(_),y.onDispose&&h().defer(y.onDispose);}let p=o.length>0||a.length>0?function(g,_){let v=i,A;if(o.length===0)return V();let I=g.parsedUrl||new Proxy(Oy,{get(B,Z,se){return I=new n.URL(g.url,"http://localhost"),Reflect.get(I,Z,I)}});function M(B){return a.length===0?B:k(()=>K(a,Z=>Z({request:g,response:B,serverContext:_,setResponse(se){B=se;},fetchAPI:n})),()=>B)}function V(){return A?M(A):k(()=>v(g,_),M)}return k(()=>K(o,(B,Z)=>B({request:g,setRequest(se){g=se;},serverContext:_,fetchAPI:n,url:I,requestHandler:v,setRequestHandler(se){v=se;},endResponse(se){A=se,se&&Z();}})),V)}:i;if(c?.request){let y=p;p=(g,_)=>Xe({request:g}).asyncFn(c.request,y)(g,_);}function x(y,...g){let _=g.length>1?lt(...g):g[0]||{};_.waitUntil||(_.waitUntil=d);let v=Fi(y,n,void 0,s);return p(v,_)}function S(y,g,..._){let v=g.raw||g,A=_.length>1?lt(..._):_[0]||{};A.waitUntil||(A.waitUntil=d);let I=Fi(y,n,v,s);return p(I,A)}function R(y,g,..._){let v={req:y,res:g,waitUntil:d};return Mt($().then(()=>S(y,g,v,..._)).catch(A=>Di(A,n.Response)).then(A=>lu(A,g,y,r)).catch(A=>console.error(`Unexpected error while handling request: ${A.message||A}`)))}function C(y,g,..._){let v={res:y,req:g,waitUntil:d},I=_.filter(re=>re!=null).length>0?lt(v,..._):v,M=s?Ui():new AbortController,V=y.end.bind(y),B=false;y.end=function(re){return B=true,V(re)},y.onAborted.bind(y)(function(){M.abort();}),y.onAborted=function(re){M.signal.addEventListener("abort",re,{once:true});};let se=hu({req:g,res:y,fetchAPI:n,controller:M});return k(()=>k(()=>p(se,I),re=>re,re=>Di(re,n.Response)),re=>{if(!M.signal.aborted&&!B)return k(()=>du(y,re,M,n),we=>we,we=>{console.error(`Unexpected error while handling request: ${we.message||we}`);})})}function D(y,...g){if(!y.respondWith||!y.request)throw new TypeError(`Expected FetchEvent, got ${y}`);let _=g.filter(I=>I!=null),v=_.length>0?lt({},y,..._):ji(y),A=p(y.request,v);y.respondWith(A);}function E(y,...g){let _=g.filter(A=>A!=null),v=_.length>1?lt({},..._):ji(_[0],_[0]==null||_[0].waitUntil==null?d:void 0);return p(y,v)}let T=(y,...g)=>{if(typeof y=="string"||"href"in y){let[v,...A]=g;if(cu(v)){let M=new n.Request(y,v),V=E(M,...A),B=v.signal;return B?qi(V,B):V}let I=new n.Request(y);return E(I,...g)}let _=E(y,...g);return qi(_,y.signal)},w=(y,...g)=>{let[_,...v]=g;if(iu(y)){if(!Ii(_))throw new TypeError(`Expected ServerResponse, got ${_}`);return R(y,_,...v)}if(fu(y))return C(y,_,...v);if(Ii(_))throw new TypeError("Got Node response without Node request");return Ly(y)?ou(y)?D(y,...g):E(y.request,y,...g):T(y,...g)},P={handleRequest:E,fetch:T,handleNodeRequest:x,handleNodeRequestAndResponse:S,requestListener:R,handleEvent:D,handleUWS:C,handle:w,get disposableStack(){return h()},[H.asyncDispose](){return u&&!u.disposed?u.disposeAsync():$()},dispose(){return u&&!u.disposed?u.disposeAsync():$()},waitUntil:d},L=new Proxy(w,{has:(y,g)=>g in P||g in w||t&&g in t,get:(y,g)=>{if(globalThis.Deno||g===Symbol.asyncDispose||g===Symbol.dispose){let A=Reflect.get(P,g,P);if(A)return A}let _=P[g];if(_)return _.bind?_.bind(P):_;let v=w[g];if(v)return v.bind?v.bind(w):v;if(t){let A=t[g];if(A)return A.bind?function(...I){let M=t[g](...I);return M===t?L:M}:A}},apply(y,g,_){return w(..._)}});return L}chunkBUNLC3II_cjs.h();function Fy(t,e){let r=t.headers.get("origin");if(e===false||r==null)return null;let n={};if(e.origin==null||e.origin.length===0||e.origin.includes("*")?(n["Access-Control-Allow-Origin"]=r,n.Vary="Origin"):typeof e.origin=="string"?n["Access-Control-Allow-Origin"]=e.origin:Array.isArray(e.origin)&&(e.origin.length===1?n["Access-Control-Allow-Origin"]=e.origin[0]:e.origin.includes(r)?(n["Access-Control-Allow-Origin"]=r,n.Vary="Origin"):n["Access-Control-Allow-Origin"]="null"),e.methods?.length)n["Access-Control-Allow-Methods"]=e.methods.join(", ");else {let s=t.headers.get("access-control-request-method");s&&(n["Access-Control-Allow-Methods"]=s);}if(e.allowedHeaders?.length)n["Access-Control-Allow-Headers"]=e.allowedHeaders.join(", ");else {let s=t.headers.get("access-control-request-headers");s&&(n["Access-Control-Allow-Headers"]=s,n.Vary?n.Vary+=", Access-Control-Request-Headers":n.Vary="Access-Control-Request-Headers");}return e.credentials!=null?e.credentials===true&&(n["Access-Control-Allow-Credentials"]="true"):n["Access-Control-Allow-Origin"]!=="*"&&(n["Access-Control-Allow-Credentials"]="true"),e.exposedHeaders&&(n["Access-Control-Expose-Headers"]=e.exposedHeaders.join(", ")),e.maxAge&&(n["Access-Control-Max-Age"]=e.maxAge.toString()),n}function Iy(t,e,r){return k(()=>e(t,r),n=>Fy(t,n))}function mu(t){let e=()=>({});if(t!=null)if(typeof t=="function")e=t;else if(typeof t=="object"){let r={...t};e=()=>r;}else t===false&&(e=()=>false);return {onRequest({request:r,fetchAPI:n,endResponse:s}){if(r.method.toUpperCase()==="OPTIONS"){let i=new n.Response(null,{status:204,headers:{"Content-Length":"0"}});s(i);}},onResponse({request:r,serverContext:n,response:s}){return k(()=>Iy(r,e,n),i=>{if(i!=null)for(let o in i)s.headers.set(o,i[o]);})}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Dy=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions","coordinate"];function jy(t){return t!=null&&typeof t=="object"&&Object.keys(t).every(e=>Dy.includes(e))}function U(t,e){e?.originalError&&!(e.originalError instanceof Error)&&jy(e.originalError)&&(e.originalError=U(e.originalError.message,e.originalError));let r=chunkVOQUO2EZ_cjs.b,n=chunkVOQUO2EZ_cjs.a.major>=16?new r(t,e):new r(t,e?.nodes,e?.source,e?.positions,e?.path,e?.originalError,e?.extensions);return e?.coordinate&&n.coordinate==null&&Object.defineProperties(n,{coordinate:{value:e.coordinate,enumerable:true,configurable:true}}),n}function yn(t){return t.coordinate}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function bu(t){return t?.[Symbol.asyncIterator]!=null}function qy(t){return t!=null&&typeof t=="object"&&"errors"in t}function Uy(t){return t!=null&&typeof t.toString=="function"}function Re(t){return t instanceof chunkVOQUO2EZ_cjs.b}function gn(t){return t instanceof chunkVOQUO2EZ_cjs.b?t.originalError!=null?gn(t.originalError):true:false}function Mi(t){return typeof t=="object"&&t?.constructor?.name==="DOMException"&&(t.name==="AbortError"||t.name==="TimeoutError")}function At(t,e,r){let n=new Set;if(qy(t))for(let s of t.errors){let i=At(s,e,r);for(let o of i)n.add(o);}else if(Mi(t))r.debug("Request aborted");else if(e){let s=e.maskError(t,e.errorMessage,e.isDev);s!==t&&r.error(t),n.add(Re(s)?s:U(s.message,{originalError:s}));}else Re(t)?n.add(t):t instanceof Error?n.add(U(t.message,{originalError:t})):typeof t=="string"?n.add(U(t,{extensions:{code:"INTERNAL_SERVER_ERROR",unexpected:true}})):Uy(t)?n.add(U(t.toString(),{extensions:{code:"INTERNAL_SERVER_ERROR",unexpected:true}})):(r.error(t),n.add(U("Unexpected error.",{extensions:{unexpected:true}})));return Array.from(n)}function Lt(t,e={},r=false){let n,s=false;if("extensions"in t&&t.extensions?.http&&(t.extensions.http.headers&&Object.assign(e,t.extensions.http.headers),t.extensions.http.status&&(n=t.extensions.http.status)),"errors"in t&&t.errors?.length)for(let i of t.errors)if(i.extensions?.http){if(i.extensions.http.headers&&Object.assign(e,i.extensions.http.headers),r&&i.extensions.http.spec)continue;i.extensions.http.status&&(!n||i.extensions.http.status>n)&&(n=i.extensions.http.status);}else (!gn(i)||i.extensions?.unexpected)&&(s=true);else n||=200;return n||(s&&!("data"in t)?n=500:n=200),{status:n,headers:e}}function yu(t){return Array.isArray(t)&&t.length>0&&t.some(Re)}chunkBUNLC3II_cjs.h();function gu(t){return {onResponse({response:e}){_u(e.headers,t);}}}function xu(t){return {onRequest({request:e}){_u(e.headers,t);}}}function _u(t,e){for(let r of t.keys())e.includes(r)||t.delete(r);}chunkBUNLC3II_cjs.h();var Eu=chunkBUNLC3II_cjs.e(nr(),1);chunkBUNLC3II_cjs.h();var wu=chunkBUNLC3II_cjs.e(nr(),1);function Bi(t){let e=t.get("operationName")||void 0,r=t.get("query")||void 0,n=t.get("variables")||void 0,s=t.get("extensions")||void 0;return {operationName:e,query:r,variables:n?JSON.parse(n):void 0,extensions:s?JSON.parse(s):void 0}}function Su(t){let e=new wu.URLSearchParams(t);return Bi(e)}function qe(t,e){let r=t.headers.get("content-type");return r=r?.split(",")[0]||null,r===e||!!r?.startsWith(`${e};`)}function Pu(t){return t.method==="GET"}function vu(t){let e=t.url.substring(t.url.indexOf("?")+1),r=new Eu.URLSearchParams(e);return Bi(r)}chunkBUNLC3II_cjs.h();function Tu(t){return t.method==="POST"&&qe(t,"application/x-www-form-urlencoded")}function ku(t){return t.text().then(Su)}chunkBUNLC3II_cjs.h();function Cu(t){return t.method==="POST"&&qe(t,"application/graphql")}function Ru(t){return t.text().then(e=>({query:e}))}chunkBUNLC3II_cjs.h();function Au(t){return t.method==="POST"&&(qe(t,"application/json")||qe(t,"application/graphql+json"))}function Lu(t){return k(()=>t.json(),e=>{if(e==null)throw U(`POST body is expected to be object but received ${e}`,{extensions:{http:{status:400},code:"BAD_REQUEST"}});let r=typeof e;if(r!=="object")throw U(`POST body is expected to be object but received ${r}`,{extensions:{http:{status:400},code:"BAD_REQUEST"}});return e},e=>{if(e instanceof chunkVOQUO2EZ_cjs.b)throw e;let r={http:{spec:true,status:400},code:"BAD_REQUEST"};throw e instanceof Error&&(r.originalError={name:e.name,message:e.message}),U("POST body sent invalid JSON.",{extensions:r})})}chunkBUNLC3II_cjs.h();function Ou(t){return t.method==="POST"&&qe(t,"multipart/form-data")}function Fu(t){return k(()=>t.formData(),e=>{let r=e.get("operations");if(!r)throw U('Missing multipart form field "operations"');if(typeof r!="string")throw U('Multipart form field "operations" must be a string');let n;try{n=JSON.parse(r);}catch{throw U('Multipart form field "operations" must be a valid JSON string')}let s=e.get("map");if(s!=null){if(typeof s!="string")throw U('Multipart form field "map" must be a string');let i;try{i=JSON.parse(s);}catch{throw U('Multipart form field "map" must be a valid JSON string')}for(let o in i){let a=e.get(o),c=i[o];for(let l of c)My(n,l,a);}}return n},e=>{throw e instanceof Error&&e.message.startsWith("File size limit exceeded: ")?U(e.message,{extensions:{http:{status:413}}}):e})}function My(t,e,r){let n=e.split("."),s=t;for(let i=0;i<n.length;i++){let o=n[i];if(o==="__proto__"||o==="constructor"||o==="prototype")return;i===n.length-1?s[o]=r:(o in s||(s[o]={}),s=s[o]);}}chunkBUNLC3II_cjs.h();var By=new Set(["query","variables","operationName","extensions"]);function $y(t,e){if(t==null||typeof t!="object")throw U('Invalid "params" in the request body',{extensions:{http:{spec:true,status:400},code:"BAD_REQUEST"}});for(let r in t)if(t[r]!=null&&!By.has(r)){if(e?.includes(r))continue;throw U(`Unexpected parameter "${r}" in the request body.`,{extensions:{http:{status:400},code:"BAD_REQUEST"}})}}function Ny(t,e){if(!Gy(t))throw U(`Expected params to be an object but given ${ir(t)}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});if($y(t,e),t.query==null)throw U("Must provide query string.",{extensions:{http:{spec:true,status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});let r=ir(t.query);if(r!=="string")throw U(`Expected "query" param to be a string, but given ${r}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});let n=ir(t.variables);if(!["object","null","undefined"].includes(n))throw U(`Expected "variables" param to be empty or an object, but given ${n}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});let s=ir(t.extensions);if(!["object","null","undefined"].includes(s))throw U(`Expected "extensions" param to be empty or an object, but given ${s}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});return t}function Iu(t){return {onParams({params:e}){Ny(e,t);}}}function ir(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Gy(t){return ir(t)==="object"}chunkBUNLC3II_cjs.h();function Hy(t){return t==="GET"||t==="POST"}function Du(){return {onRequestParse({request:t}){if(!Hy(t.method))throw U("GraphQL only supports GET and POST requests.",{extensions:{http:{status:405,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}})}}}chunkBUNLC3II_cjs.h();function ju(){return {onValidate(){return ({valid:t,result:e})=>{if(!t)for(let r of e)r.extensions||={},r.extensions.code||="GRAPHQL_VALIDATION_FAILED",r.extensions.http||={},r.extensions.http.spec=r.extensions.http.spec==null?true:r.extensions.http.spec,r.extensions.http.status||=400;}}}}chunkBUNLC3II_cjs.h();function qu(t){return {onRequestParse(){return {onRequestParseDone({requestParserResult:e}){if(Array.isArray(e)){if(!t)throw U("Batching is not supported.",{extensions:{http:{status:400},code:"BAD_REQUEST"}});if(e.length>t)throw U(`Batching is limited to ${t} operations per request.`,{extensions:{http:{status:413},code:"BAD_REQUEST"}})}}}}}}chunkBUNLC3II_cjs.h();function zy(t,e,r){let n=e?chunkVOQUO2EZ_cjs.F(e,r)??void 0:void 0;if(!n)throw U("Could not determine what operation to execute.",{extensions:{code:"OPERATION_RESOLUTION_FAILURE",http:{status:400}}});if(n.operation==="mutation"&&t==="GET")throw U("Can only perform a mutation operation from a POST request.",{extensions:{http:{status:405,headers:{Allow:"POST"}},code:"BAD_REQUEST"}})}function Uu(){return {onParse(){return ({result:t,context:{request:e,params:{operationName:r}={}}})=>{if(e)if(t instanceof Error){if(t instanceof chunkVOQUO2EZ_cjs.b){let n=t.extensions||={};n.code||="GRAPHQL_PARSE_FAILED";let s=n.http||={};s.spec||=true,s.status||=400;}}else zy(e.method,t,r);}}}}chunkBUNLC3II_cjs.h();function Mu({id:t=Date.now().toString(),logger:e=console,endpoint:r="/health"}={}){return {onRequest({endResponse:n,fetchAPI:s,request:i}){if(i.url.endsWith(r)){e.debug("Responding Health Check");let o=new s.Response(null,{status:200,headers:{"x-yoga-id":t}});n(o);}}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ot=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$u=new Set,$i=typeof process=="object"&&process?process:{},Nu=(t,e,r,n)=>{typeof $i.emitWarning=="function"?$i.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},xn=globalThis.AbortController,Bu=globalThis.AbortSignal;if(typeof xn>"u"){Bu=class{onabort;_onabort=[];reason;aborted=false;addEventListener(n,s){this._onabort.push(s);}},xn=class{constructor(){e();}signal=new Bu;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=true;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=$i.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,Nu("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var Vy=t=>!$u.has(t);var Ke=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Gu=t=>Ke(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ft:null:null,Ft=class extends Array{constructor(e){super(e),this.fill(0);}},Ni=class t{heap;length;static#o=false;static create(e){let r=Gu(e);if(!r)return [];t.#o=true;let n=new t(e,r);return t.#o=false,n}constructor(e,r){if(!t.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},_n=class t{#o;#r;#n;#t;#p;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#y;#l;#i;#e;#m;#b;#f;#u;#c;#h;#E;#g;#x;#P;#v;#d;static unsafeExposeInternals(e){return {starts:e.#g,ttls:e.#x,sizes:e.#E,keyMap:e.#l,keyList:e.#i,valList:e.#e,next:e.#m,prev:e.#b,get head(){return e.#f},get tail(){return e.#u},free:e.#c,isBackgroundFetch:r=>e.#a(r),backgroundFetch:(r,n,s,i)=>e.#q(r,n,s,i),moveToTail:r=>e.#I(r),indexes:r=>e.#C(r),rindexes:r=>e.#R(r),isStale:r=>e.#_(r)}}get max(){return this.#o}get maxSize(){return this.#r}get calculatedSize(){return this.#y}get size(){return this.#s}get fetchMethod(){return this.#p}get memoMethod(){return this.#w}get dispose(){return this.#n}get disposeAfter(){return this.#t}constructor(e){let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:h,noUpdateTTL:d,maxSize:p=0,maxEntrySize:x=0,sizeCalculation:S,fetchMethod:R,memoMethod:C,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:P}=e;if(r!==0&&!Ke(r))throw new TypeError("max option must be a nonnegative integer");let L=r?Gu(r):Array;if(!L)throw new Error("invalid max value: "+r);if(this.#o=r,this.#r=p,this.maxEntrySize=x||this.#r,this.sizeCalculation=S,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=C,R!==void 0&&typeof R!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#p=R,this.#v=!!R,this.#l=new Map,this.#i=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#m=new L(r),this.#b=new L(r),this.#f=0,this.#u=0,this.#c=Ni.create(r),this.#s=0,this.#y=0,typeof l=="function"&&(this.#n=l),typeof u=="function"?(this.#t=u,this.#h=[]):(this.#t=void 0,this.#h=void 0),this.#P=!!this.#n,this.#d=!!this.#t,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!D,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#r!==0&&!Ke(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Ke(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#S();}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ke(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Ke(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T();}if(this.#o===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#r){let y="LRU_CACHE_UNBOUNDED";Vy(y)&&($u.add(y),Nu("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",y,t));}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#T(){let e=new Ft(this.#o),r=new Ft(this.#o);this.#x=e,this.#g=r,this.#F=(i,o,a=Ot.now())=>{if(r[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#_(i)&&this.#A(this.#i[i],"expire");},o+1);c.unref&&c.unref();}},this.#L=i=>{r[i]=e[i]!==0?Ot.now():0;},this.#k=(i,o)=>{if(e[o]){let a=e[o],c=r[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=n||s();let l=i.now-c;i.remainingTTL=a-l;}};let n=0,s=()=>{let i=Ot.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=this.#l.get(i);if(o===void 0)return 0;let a=e[o],c=r[o];if(!a||!c)return 1/0;let l=(n||s())-c;return a-l},this.#_=i=>{let o=r[i],a=e[i];return !!a&&!!o&&(n||s())-o>a};}#L=()=>{};#k=()=>{};#F=()=>{};#_=()=>false;#S(){let e=new Ft(this.#o);this.#y=0,this.#E=e,this.#O=r=>{this.#y-=e[r],e[r]=0;},this.#U=(r,n,s,i)=>{if(this.#a(n))return 0;if(!Ke(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!Ke(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#D=(r,n,s)=>{if(e[r]=n,this.#r){let i=this.#r-e[r];for(;this.#y>i;)this.#j(true);}this.#y+=e[r],s&&(s.entrySize=n,s.totalCalculatedSize=this.#y);};}#O=e=>{};#D=(e,r,n)=>{};#U=(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#u;!(!this.#M(r)||((e||!this.#_(r))&&(yield r),r===this.#f));)r=this.#b[r];}*#R({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#f;!(!this.#M(r)||((e||!this.#_(r))&&(yield r),r===this.#u));)r=this.#m[r];}#M(e){return e!==void 0&&this.#l.get(this.#i[e])===e}*entries(){for(let e of this.#C())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#a(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*rentries(){for(let e of this.#R())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#a(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*keys(){for(let e of this.#C()){let r=this.#i[e];r!==void 0&&!this.#a(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#R()){let r=this.#i[e];r!==void 0&&!this.#a(this.#e[e])&&(yield r);}}*values(){for(let e of this.#C())this.#e[e]!==void 0&&!this.#a(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#R())this.#e[e]!==void 0&&!this.#a(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#C()){let s=this.#e[n],i=this.#a(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#i[n],this))return this.get(this.#i[n],r)}}forEach(e,r=this){for(let n of this.#C()){let s=this.#e[n],i=this.#a(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#i[n],this);}}rforEach(e,r=this){for(let n of this.#R()){let s=this.#e[n],i=this.#a(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#i[n],this);}}purgeStale(){let e=false;for(let r of this.#R({allowStale:true}))this.#_(r)&&(this.#A(this.#i[r],"expire"),e=true);return e}info(e){let r=this.#l.get(e);if(r===void 0)return;let n=this.#e[r],s=this.#a(n)?n.__staleWhileFetching:n;if(s===void 0)return;let i={value:s};if(this.#x&&this.#g){let o=this.#x[r],a=this.#g[r];if(o&&a){let c=o-(Ot.now()-a);i.ttl=c,i.start=Date.now();}}return this.#E&&(i.size=this.#E[r]),i}dump(){let e=[];for(let r of this.#C({allowStale:true})){let n=this.#i[r],s=this.#e[r],i=this.#a(s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#x&&this.#g){o.ttl=this.#x[r];let a=Ot.now()-this.#g[r];o.start=Math.floor(Date.now()-a);}this.#E&&(o.size=this.#E[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=Ot.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#U(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),this.#A(e,"set"),this;let h=this.#s===0?void 0:this.#l.get(e);if(h===void 0)h=this.#s===0?this.#u:this.#c.length!==0?this.#c.pop():this.#s===this.#o?this.#j(false):this.#s,this.#i[h]=e,this.#e[h]=r,this.#l.set(e,h),this.#m[this.#u]=h,this.#b[h]=this.#u,this.#u=h,this.#s++,this.#D(h,u,c),c&&(c.set="add"),l=false;else {this.#I(h);let d=this.#e[h];if(r!==d){if(this.#v&&this.#a(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!o&&(this.#P&&this.#n?.(p,e,"set"),this.#d&&this.#h?.push([p,e,"set"]));}else o||(this.#P&&this.#n?.(d,e,"set"),this.#d&&this.#h?.push([d,e,"set"]));if(this.#O(h),this.#D(h,u,c),this.#e[h]=r,c){c.set="replace";let p=d&&this.#a(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");}if(s!==0&&!this.#x&&this.#T(),this.#x&&(l||this.#F(h,s,i),c&&this.#k(c,h)),!o&&this.#d&&this.#h){let d=this.#h,p;for(;p=d?.shift();)this.#t?.(...p);}return this}pop(){try{for(;this.#s;){let e=this.#e[this.#f];if(this.#j(!0),this.#a(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#d&&this.#h){let e=this.#h,r;for(;r=e?.shift();)this.#t?.(...r);}}}#j(e){let r=this.#f,n=this.#i[r],s=this.#e[r];return this.#v&&this.#a(s)?s.__abortController.abort(new Error("evicted")):(this.#P||this.#d)&&(this.#P&&this.#n?.(s,n,"evict"),this.#d&&this.#h?.push([s,n,"evict"])),this.#O(r),e&&(this.#i[r]=void 0,this.#e[r]=void 0,this.#c.push(r)),this.#s===1?(this.#f=this.#u=0,this.#c.length=0):this.#f=this.#m[r],this.#l.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=this.#l.get(e);if(i!==void 0){let o=this.#e[i];if(this.#a(o)&&o.__staleWhileFetching===void 0)return false;if(this.#_(i))s&&(s.has="stale",this.#k(s,i));else return n&&this.#L(i),s&&(s.has="hit",this.#k(s,i)),true}else s&&(s.has="miss");return false}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=this.#l.get(e);if(s===void 0||!n&&this.#_(s))return;let i=this.#e[s];return this.#a(i)?i.__staleWhileFetching:i}#q(e,r,n,s){let i=r===void 0?void 0:this.#e[r];if(this.#a(i))return i;let o=new xn,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(S,R=false)=>{let{aborted:C}=o.signal,D=n.ignoreFetchAbort&&S!==void 0;if(n.status&&(C&&!R?(n.status.fetchAborted=true,n.status.fetchError=o.signal.reason,D&&(n.status.fetchAbortIgnored=true)):n.status.fetchResolved=true),C&&!D&&!R)return h(o.signal.reason);let E=p;return this.#e[r]===p&&(S===void 0?E.__staleWhileFetching?this.#e[r]=E.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=true),this.set(e,S,c.options))),S},u=S=>(n.status&&(n.status.fetchRejected=true,n.status.fetchError=S),h(S)),h=S=>{let{aborted:R}=o.signal,C=R&&n.allowStaleOnFetchAbort,D=C||n.allowStaleOnFetchRejection,E=D||n.noDeleteOnFetchRejection,T=p;if(this.#e[r]===p&&(!E||T.__staleWhileFetching===void 0?this.#A(e,"fetch"):C||(this.#e[r]=T.__staleWhileFetching)),D)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=true),T.__staleWhileFetching;if(T.__returned===T)throw S},d=(S,R)=>{let C=this.#p?.(e,i,c);C&&C instanceof Promise&&C.then(D=>S(D===void 0?void 0:D),R),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(S(void 0),n.allowStaleOnFetchAbort&&(S=D=>l(D,true)));});};n.status&&(n.status.fetchDispatched=true);let p=new Promise(d).then(l,u),x=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,x,{...c.options,status:void 0}),r=this.#l.get(e)):this.#e[r]=x,x}#a(e){if(!this.#v)return false;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof xn}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:S,forceRefresh:R=false,status:C,signal:D}=r;if(!this.#v)return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:C});let E={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:x,ignoreFetchAbort:p,status:C,signal:D},T=this.#l.get(e);if(T===void 0){C&&(C.fetch="miss");let w=this.#q(e,T,E,S);return w.__returned=w}else {let w=this.#e[T];if(this.#a(w)){let _=n&&w.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",_&&(C.returnedStale=true)),_?w.__staleWhileFetching:w.__returned=w}let P=this.#_(T);if(!R&&!P)return C&&(C.fetch="hit"),this.#I(T),s&&this.#L(T),C&&this.#k(C,T),w;let L=this.#q(e,T,E,S),g=L.__staleWhileFetching!==void 0&&n;return C&&(C.fetch=P?"stale":"refresh",g&&P&&(C.returnedStale=true)),g?L.__staleWhileFetching:L.__returned=L}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#w;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=r,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,a=this.#l.get(e);if(a!==void 0){let c=this.#e[a],l=this.#a(c);return o&&this.#k(o,a),this.#_(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),n?c.__staleWhileFetching:void 0):(i||this.#A(e,"expire"),o&&n&&(o.returnedStale=true),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#I(a),s&&this.#L(a),c))}else o&&(o.get="miss");}#B(e,r){this.#b[r]=e,this.#m[e]=r;}#I(e){e!==this.#u&&(e===this.#f?this.#f=this.#m[e]:this.#B(this.#b[e],this.#m[e]),this.#B(this.#u,e),this.#u=e);}delete(e){return this.#A(e,"delete")}#A(e,r){let n=false;if(this.#s!==0){let s=this.#l.get(e);if(s!==void 0)if(n=true,this.#s===1)this.#$(r);else {this.#O(s);let i=this.#e[s];if(this.#a(i)?i.__abortController.abort(new Error("deleted")):(this.#P||this.#d)&&(this.#P&&this.#n?.(i,e,r),this.#d&&this.#h?.push([i,e,r])),this.#l.delete(e),this.#i[s]=void 0,this.#e[s]=void 0,s===this.#u)this.#u=this.#b[s];else if(s===this.#f)this.#f=this.#m[s];else {let o=this.#b[s];this.#m[o]=this.#m[s];let a=this.#m[s];this.#b[a]=this.#b[s];}this.#s--,this.#c.push(s);}}if(this.#d&&this.#h?.length){let s=this.#h,i;for(;i=s?.shift();)this.#t?.(...i);}return n}clear(){return this.#$("delete")}#$(e){for(let r of this.#R({allowStale:true})){let n=this.#e[r];if(this.#a(n))n.__abortController.abort(new Error("deleted"));else {let s=this.#i[r];this.#P&&this.#n?.(n,s,e),this.#d&&this.#h?.push([n,s,e]);}}if(this.#l.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#x&&this.#g&&(this.#x.fill(0),this.#g.fill(0)),this.#E&&this.#E.fill(0),this.#f=0,this.#u=0,this.#c.length=0,this.#y=0,this.#s=0,this.#d&&this.#h){let r=this.#h,n;for(;n=r?.shift();)this.#t?.(...n);}}};var Wy=1024,Ky=36e5;function wn({max:t=Wy,ttl:e=Ky}={}){return new _n({max:t,ttl:e})}function Hu({documentCache:t=wn(),errorCache:e=wn(),validationCache:r=true}){let n=wn();return {onParse({params:s,setParsedDocument:i}){let o=s.source.toString(),a=t.get(o);if(a){i(a);return}let c=e.get(o);if(c)throw c;return ({result:l})=>{l!=null&&(l instanceof Error?e.set(o,l):t.set(o,l));}},onValidate({params:{schema:s,documentAST:i,rules:o},setResult:a}){if(s!=null&&r!==false){let c=o?.map(d=>d.name).join(",")||"",l=n.get(c);l||(l=new WeakMap,n.set(c,l));let u=l.get(s);u||(u=new WeakMap,l.set(s,u));let h=u.get(i);if(h){a(h);return}return ({result:d})=>{d!=null&&u?.set(i,d);}}}}}chunkBUNLC3II_cjs.h();var Qy=()=>true;function It(t){let e=t.match||Qy;return {onRequestParse({request:r,setRequestParser:n}){e(r)&&n(t.parse);}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function zu(t){let e=(t.headers.get("accept")||"*/*").replace(/\s/g,"").toLowerCase().split(","),r=[];for(let n of e){let[s,...i]=n.split(";");s===void 0||(i?.find(a=>a.includes("charset="))||"charset=utf-8")!=="charset=utf-8"||r.push(s);}return r.reverse()}function Vu(t,e){let[r,n]=t.split("/"),[s,i]=e.split("/");return (s==="*"||s===r)&&(i==="*"||i===n)}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function Dt(t){if(Array.isArray(t))return `[${t.map(n=>{let s=Wu(n);return (n.stringify||JSON.stringify)(s)}).join(",")}]`;let e=Wu(t);return (t.stringify||JSON.stringify)(e)}function Wu(t){if(t.errors?.length||t.extensions?.http){let e={...t};if(e.errors&&=e.errors.map(Ku),e.extensions){let{http:r,...n}=t.extensions;e.extensions=Object.keys(n).length?n:void 0;}return e}return t}function Ku(t){if(Re(t)){let e="toJSON"in t&&typeof t.toJSON=="function"?t.toJSON():Object(t),{http:r,unexpected:n,...s}=e.extensions||{};return U(t.message,{nodes:t.nodes,source:t.source,positions:t.positions,path:t.path,originalError:Ku(t.originalError||void 0),extensions:Object.keys(s).length?s:void 0,coordinate:yn(t)})}return t}function Qu(t,e){let n=Lt(t,{Connection:"keep-alive","Content-Type":'multipart/mixed; boundary="-"',"Transfer-Encoding":"chunked"}),s,i=new e.TextEncoder,o=new e.ReadableStream({start(a){if(le(t))s=t[Symbol.asyncIterator]();else {let c=false;s={next:()=>c?$({done:true,value:null}):(c=true,$({done:false,value:t}))};}a.enqueue(i.encode(`\r
|
|
22
|
+
`+Uo(t.errors,e):qo(t);if(e.includes(t))return "[Circular]";let r=[...e,t];if(Gd(t)){let n=t.toJSON();if(n!==t)return typeof n=="string"?n:_r(n,r)}else if(Array.isArray(t))return Uo(t,r);return zd(t,r)}function Gd(t){return typeof t.toJSON=="function"}function zd(t,e){let r=Object.entries(t);return r.length===0?"{}":e.length>3?"["+Hd(t)+"]":"{ "+r.map(([s,i])=>s+": "+_r(i,e)).join(", ")+" }"}function Uo(t,e){if(t.length===0)return "[]";if(e.length>3)return "[Array]";let r=t.length,n=[];for(let s=0;s<r;++s)n.push(_r(t[s],e));return "["+n.join(", ")+"]"}function Hd(t){let e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){let r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}chunkBUNLC3II_cjs.h();var Vd=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions","coordinate"];function Wd(t){return t!=null&&typeof t=="object"&&Object.keys(t).every(e=>Vd.includes(e))}function G(t,e){e?.originalError&&!(e.originalError instanceof Error)&&Wd(e.originalError)&&(e.originalError=G(e.originalError.message,e.originalError));let r=chunk5DWQGEM2_cjs.b,n=chunk5DWQGEM2_cjs.a.major>=16?new r(t,e):new r(t,e?.nodes,e?.source,e?.positions,e?.path,e?.originalError,e?.extensions);return e?.coordinate&&n.coordinate==null&&Object.defineProperties(n,{coordinate:{value:e.coordinate,enumerable:true,configurable:true}}),n}function ae(t,e,r,n){let s=chunk5DWQGEM2_cjs.E(t,e,r);if(!s.coordinate&&n&&s.coordinate==null){let i=`${n.parentType.name}.${n.fieldName}`;Object.defineProperties(s,{coordinate:{value:i,enumerable:true,configurable:true}});}return s}chunkBUNLC3II_cjs.h();function Mo(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t}function Xn(t){return typeof t=="object"&&t!==null}function Bo(t,e,r){let n=r;for(let s of t)n=k(()=>n,i=>e(i,s));return n}function wr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function es(t,e,r={}){let n={},i=(e.arguments??[]).reduce((o,a)=>({...o,[a.name.value]:a}),{});for(let o of t.args){let a=i[o.name];if(!a){if("default"in o&&o.default)n[o.name]="value"in o.default?o.default.value:chunk5DWQGEM2_cjs.g(o.default.literal);else if(o.defaultValue!==void 0)n[o.name]=o.defaultValue;else if(chunk5DWQGEM2_cjs.j(o.type))throw G(`Argument "${o.name}" of required type "${ee(o.type)}" was not provided.`,{nodes:[e]});continue}let c=a.value,l=c.kind===chunk5DWQGEM2_cjs.d.NULL;if(c.kind===chunk5DWQGEM2_cjs.d.VARIABLE){let h=c.name.value;if(r==null||!wr(r,h)){if(o.defaultValue!==void 0)n[o.name]=o.defaultValue;else if(chunk5DWQGEM2_cjs.j(o.type))throw G(`Argument "${o.name}" of required type "${ee(o.type)}" was provided the variable "$${h}" which was not provided a runtime value.`,{nodes:[c]});continue}l=r[h]==null;}if(l&&chunk5DWQGEM2_cjs.j(o.type))throw G(`Argument "${o.name}" of non-null type "${ee(o.type)}" must not be null.`,{nodes:[c]});let u=chunk5DWQGEM2_cjs.A(c,o.type,r);if(u===void 0)throw G(`Argument "${o.name}" has invalid value ${chunk5DWQGEM2_cjs.f(c)}.`,{nodes:[c]});n[o.name]=u;}return n}chunkBUNLC3II_cjs.h();function Me(t){let e=new WeakMap;return function(n){let s=e.get(n);if(s===void 0){let i=t(n);return e.set(n,i),i}return s}}function $o(t){let e=new WeakMap;return function(n,s,i){let o=e.get(n);if(!o){o=new WeakMap,e.set(n,o);let l=new WeakMap;o.set(s,l);let u=t(n,s,i);return l.set(i,u),u}let a=o.get(s);if(!a){a=new WeakMap,o.set(s,a);let l=t(n,s,i);return a.set(i,l),l}let c=a.get(i);if(c===void 0){let l=t(n,s,i);return a.set(i,l),l}return c}}function No(t){let e=new WeakMap;return function(n,s,i,o,a){let c=e.get(n);if(!c){c=new WeakMap,e.set(n,c);let p=new WeakMap;c.set(s,p);let x=new WeakMap;p.set(i,x);let S=new WeakMap;x.set(o,S);let R=t(n,s,i,o,a);return S.set(a,R),R}let l=c.get(s);if(!l){l=new WeakMap,c.set(s,l);let p=new WeakMap;l.set(i,p);let x=new WeakMap;p.set(o,x);let S=t(n,s,i,o,a);return x.set(a,S),S}let u=l.get(i);if(!u){u=new WeakMap,l.set(i,u);let p=new WeakMap;u.set(o,p);let x=t(n,s,i,o,a);return p.set(a,x),x}let h=u.get(o);if(!h){h=new WeakMap,u.set(o,h);let p=t(n,s,i,o,a);return h.set(a,p),p}let d=h.get(a);if(d===void 0){let p=t(n,s,i,o,a);return h.set(a,p),p}return d}}chunkBUNLC3II_cjs.h();function Go(t,e,r){let s=zo(t).get(e);if(s==null)throw G(`Schema is not configured to execute ${e} operation.`,{nodes:r});return s}var zo=Me(function(e){let r=new Map,n=e.getQueryType();n&&r.set("query",n);let s=e.getMutationType();s&&r.set("mutation",s);let i=e.getSubscriptionType();return i&&r.set("subscription",i),r});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Je=class extends Map{get[Symbol.toStringTag](){return "AccumulatorMap"}add(e,r){let n=this.get(e);n===void 0?this.set(e,[r]):n.push(r);}};chunkBUNLC3II_cjs.h();var Ho=new chunk5DWQGEM2_cjs.r({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[chunk5DWQGEM2_cjs.c.FRAGMENT_SPREAD,chunk5DWQGEM2_cjs.c.INLINE_FRAGMENT],args:{if:{type:new chunk5DWQGEM2_cjs.n(chunk5DWQGEM2_cjs.q),description:"Deferred when true or undefined.",defaultValue:true},label:{type:chunk5DWQGEM2_cjs.p,description:"Unique name"}}}),Vo=new chunk5DWQGEM2_cjs.r({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[chunk5DWQGEM2_cjs.c.FIELD],args:{if:{type:new chunk5DWQGEM2_cjs.n(chunk5DWQGEM2_cjs.q),description:"Stream when true or undefined.",defaultValue:true},label:{type:chunk5DWQGEM2_cjs.p,description:"Unique name"},initialCount:{defaultValue:0,type:chunk5DWQGEM2_cjs.o,description:"Number of items to return immediately"}}});function bt(t,e,r,n,s,i,o,a){for(let c of s.selections)switch(c.kind){case chunk5DWQGEM2_cjs.d.FIELD:{if(!ts(r,c))continue;i.add(Qd(c),c);break}case chunk5DWQGEM2_cjs.d.INLINE_FRAGMENT:{if(!ts(r,c)||!Wo(t,c,n))continue;let l=Ko(r,c);if(l){let u=new Je;bt(t,e,r,n,c.selectionSet,u,o,a),o.push({label:l.label,fields:u});}else bt(t,e,r,n,c.selectionSet,i,o,a);break}case chunk5DWQGEM2_cjs.d.FRAGMENT_SPREAD:{let l=c.name.value;if(!ts(r,c))continue;let u=Ko(r,c);if(a.has(l)&&!u)continue;let h=e[l];if(!h||!Wo(t,h,n))continue;if(u||a.add(l),u){let d=new Je;bt(t,e,r,n,h.selectionSet,d,o,a),o.push({label:u.label,fields:d});}else bt(t,e,r,n,h.selectionSet,i,o,a);break}}}function rs(t,e,r,n,s){let i=new Je,o=[];return bt(t,e,r,n,s,i,o,new Set),{fields:i,patches:o}}function ts(t,e){return !(chunk5DWQGEM2_cjs.B(chunk5DWQGEM2_cjs.t,e,t)?.if===true||chunk5DWQGEM2_cjs.B(chunk5DWQGEM2_cjs.s,e,t)?.if===false)}function Wo(t,e,r){let n=e.typeCondition;if(!n)return true;let s=chunk5DWQGEM2_cjs.y(t,n);return s===r?true:chunk5DWQGEM2_cjs.m(s)?t.getPossibleTypes(s).includes(r):false}function Qd(t){return t.alias?t.alias.value:t.name.value}function Ko(t,e){let r=chunk5DWQGEM2_cjs.B(Ho,e,t);if(r&&r.if!==false)return {label:typeof r.label=="string"?r.label:void 0}}var Qo=No(function(e,r,n,s,i){let o=new Je,a=new Set,c=[],l={fields:o,patches:c};for(let u of i)u.selectionSet&&bt(e,r,n,s,u.selectionSet,o,c,a);return l});chunkBUNLC3II_cjs.h();function Sr(t){return t?.[Symbol.asyncIterator]!=null}chunkBUNLC3II_cjs.h();function Ye(t,e,r){return {prev:t,key:e,typename:r}}function te(t){let e=[],r=t;for(;r;)e.push(r.key),r=r.prev;return e.reverse()}function Zo(t){return t.map(e=>typeof e=="number"?"["+e.toString()+"]":"."+e).join("")}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function yt(t,e){let r={...e,...t};for(let n of Object.keys(r))n in t&&n in e&&(r[n]=(s,i)=>t[n](s,()=>e[n](s,i)));return r}var Xe=t=>({fn(e,r){return e?(...n)=>{let s;return e(t,()=>{s=r(...n);}),s}:r},asyncFn(e,r){return e?(...n)=>{let s;return k(()=>e(t,()=>(s=r(...n),N(s)?s.then(()=>{}):void 0)),()=>s)}:r}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Jo=new WeakMap;chunkBUNLC3II_cjs.h();function Zd(t){return t.length===1?t[0]:{schema:t[0],document:t[1],rootValue:t[2],contextValue:t[3],variableValues:t[4],operationName:t[5],fieldResolver:t[6],subscribeFieldResolver:t[7]}}var ns=t=>((...e)=>t(Zd(e)));function Jd(t){return t.length===1?t[0]:{schema:t[0],document:t[1],rootValue:t[2],contextValue:t[3],variableValues:t[4],operationName:t[5],fieldResolver:t[6],typeResolver:t[7]}}var ss=t=>((...e)=>t(Jd(e)));function le(t){return typeof t=="object"&&t!=null&&typeof t[Symbol.asyncIterator]=="function"}function is(t,e){if(le(t.result))return {onNext:e};e({args:t.args,result:t.result,setResult:t.setResult});}function os(t,e){let r;function n(){return r||(r=t[Symbol.asyncIterator]()),r}let s=false;return {[Symbol.asyncIterator](){return this},next(){return n().next().then(i=>(i.done&&s===false&&(s=true,e()),i))},return(){let i=n().return?.();return s===false&&(s=true,e()),i||$({done:true,value:void 0})},throw(i){let o=n().throw?.();if(o)return o;throw i},[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")](){return $()}}}function Yo(t,e){let r;function n(){return r||(r=t[Symbol.asyncIterator]()),r}return {[Symbol.asyncIterator](){return this},next(){return n().next().catch(s=>(e(s),{done:true,value:void 0}))},return(){return n().return?.()||$({done:true,value:void 0})},throw(s){let i=n().throw?.();if(i)return i;throw s},[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")](){return $()}}}function Er(t){throw Error(`No \`${t}\` function found! Register it using "useEngine" plugin.`)}function Xo({plugins:t}){let e=null,r=false,n=()=>Er("parse"),s=()=>Er("validate"),i=()=>Er("execute"),o=()=>Er("subscribe"),a,c=(E,T=-1)=>{if(e!==E&&(e=E,r))for(let[w,P]of t.entries())w!==T&&P.onSchemaChange&&P.onSchemaChange({schema:e,replaceSchema:L=>{c(L,w);}});},l=[];for(let E=0;E<t.length;E++){let T=t[E],w=[];T.onPluginInit?.({plugins:t,addPlugin:P=>{w.push(P);},setSchema:P=>c(P,E),registerContextErrorHandler:P=>l.push(P)}),w.length&&t.splice(E+1,0,...w);}let u={init:[],parse:[],validate:[],subscribe:[],execute:[],context:[]};for(let{onContextBuilding:E,onExecute:T,onParse:w,onSubscribe:P,onValidate:L,onEnveloped:y,instrumentation:g}of t)y&&u.init.push(y),E&&u.context.push(E),T&&u.execute.push(T),w&&u.parse.push(w),P&&u.subscribe.push(P),L&&u.validate.push(L),g&&(a=a?yt(a,g):g);let h=E=>{for(let[T,w]of u.init.entries())w({context:E,extendContext:P=>{E&&Object.assign(E,P);},setSchema:P=>c(P,T)});},d=u.parse.length?E=>(T,w)=>{let P=null,L=n,y=E,g=[];for(let _ of u.parse){let v=_({context:y,extendContext:A=>{Object.assign(y,A);},params:{source:T,options:w},parseFn:L,setParseFn:A=>{L=A;},setParsedDocument:A=>{P=A;}});v&&g.push(v);}if(P===null)try{P=L(T,w);}catch(_){P=_;}for(let _ of g)_({context:y,extendContext:v=>{Object.assign(y,v);},replaceParseResult:v=>{P=v;},result:P});if(P===null)throw new Error("Failed to parse document.");if(P instanceof Error)throw P;return Jo.set(P,T.toString()),P}:()=>n,p=u.validate.length?E=>(T,w,P,L,y)=>{let g=P?[...P]:void 0,_=s,v=null,A=E,I=[];for(let V of u.validate){let B=V({context:A,extendContext:Z=>{Object.assign(A,Z);},params:{schema:T,documentAST:w,rules:g,typeInfo:L,options:y},validateFn:_,addValidationRule:Z=>{g||(g=[]),g.push(Z);},setValidationFn:Z=>{_=Z;},setResult:Z=>{v=Z;}});B&&I.push(B);}if(v||(v=_(T,w,g,L,y)),!v)return;let M=v.length===0;for(let V of I)V({valid:M,result:v,context:A,extendContext:B=>{Object.assign(A,B);},setResult:B=>{v=B;}});return v}:()=>s,x=u.context.length?E=>T=>{let w=[],P=E;T&&Object.assign(P,T);let L=false;return k(()=>K(u.context,(y,g)=>y({context:P,extendContext:_=>{Object.assign(P,_);},breakContextBuilding:()=>{L=true,g();}}),w),()=>L?P:k(()=>K(w,y=>y({context:P,extendContext(g){Object.assign(P,g);}})),()=>P),y=>{let g=y;for(let _ of l)_({context:P,error:g,setError:v=>{g=v;}});throw g})}:E=>T=>(T&&Object.assign(E,T),E),R=u.subscribe.length?ns(E=>{let T=o,w=[],P=E.contextValue||{},L;return k(()=>K(u.subscribe,(y,g)=>y({subscribeFn:T,setSubscribeFn:_=>{T=_;},context:P,extendContext:_=>{Object.assign(P,_);},args:E,setResultAndStopExecution:_=>{L=_,g();}}),w),()=>{let y=[],g=[];for(let{onSubscribeResult:_,onSubscribeError:v}of w)_&&y.push(_),v&&g.push(v);return k(()=>L||T(E),_=>{let v=[],A=[];for(let I of y){let M=I({args:E,result:_,setResult:V=>{_=V;}});M&&(M.onNext&&v.push(M.onNext),M.onEnd&&A.push(M.onEnd));}return v.length&&le(_)&&(_=Oe(_,I=>k(()=>K(v,M=>M({args:E,result:I,setResult:V=>I=V})),()=>I))),A.length&&le(_)&&(_=os(_,()=>{for(let I of A)I();})),g.length&&le(_)&&(_=Yo(_,I=>{let M=I;for(let V of g)V({error:M,setError:B=>{M=B;}});throw M})),_})})}):ns(o),D=u.execute.length?ss(E=>{let T=i,w,P=[],L=[],y=E.contextValue||{};return k(()=>K(u.execute,(g,_)=>g({executeFn:T,setExecuteFn:v=>{T=v;},setResultAndStopExecution:v=>{w=v,_();},context:y,extendContext:v=>{if(typeof v=="object")Object.assign(y,v);else throw new Error(`Invalid context extension provided! Expected "object", got: "${JSON.stringify(v)}" (${typeof v})`)},args:E}),P),()=>k(()=>w||T({...E,contextValue:y}),g=>k(()=>K(P,_=>_.onExecuteDone?.({args:E,result:g,setResult:v=>{g=v;}}),L),()=>{let _=[],v=[];for(let{onNext:A,onEnd:I}of L)A&&_.push(A),I&&v.push(I);return _.length&&le(g)&&(g=Oe(g,A=>k(()=>K(_,I=>I({args:E,result:A,setResult:M=>{A=M;}})),()=>A))),v.length&&le(g)&&(g=os(g,()=>{for(let A of v)A();})),g})))}):ss(i);if(r=true,e)for(let[E,T]of t.entries())T.onSchemaChange?.({schema:e,replaceSchema:w=>c(w,E)});return {getCurrentSchema(){return e},init:h,parse:d,validate:p,execute:D,subscribe:R,contextFactory:x,instrumentation:a}}function Yd(t){return t!=null}function ea(t){let e=t.plugins.filter(Yd),r=Xo({plugins:e}),n=r.instrumentation,s=(i={})=>{let o=Xe({context:i}),a=r;return o.fn(n?.init,r.init)(i),{parse:o.fn(n?.parse,a.parse(i)),validate:o.fn(n?.validate,a.validate(i)),contextFactory:o.fn(n?.context,a.contextFactory(i)),execute:o.asyncFn(n?.execute,a.execute),subscribe:o.asyncFn(n?.subscribe,a.subscribe),schema:a.getCurrentSchema()}};return s._plugins=e,s}chunkBUNLC3II_cjs.h();var Xd="Unexpected error.";function ep(t){return t instanceof Error&&t.name==="GraphQLError"}function ta(t){return ep(t)?t.originalError!=null?ta(t.originalError):true:false}function tp(t,e,r){let n=new Error(t);if(n.name="GraphQLError",r){let s=e instanceof Error?{message:e.message,stack:e.stack}:{message:String(e)};Object.defineProperty(n,"extensions",{get(){return s}});}return Object.defineProperty(n,"toJSON",{value(){return {message:n.message,extensions:n.extensions}}}),n}var rp=t=>(e,r)=>ta(e)?e:tp(r,e,t),np=globalThis.process?.env?.NODE_ENV==="development",sp=rp(np),ip=(t,e)=>({result:r,setResult:n})=>{r.errors!=null&&n({...r,errors:r.errors.map(s=>t(s,e))});};function ra(t){let e=t?.maskError??sp,r=t?.errorMessage||Xd,n=ip(e,r);return {onPluginInit(s){s.registerContextErrorHandler(({error:i,setError:o})=>{o(e(i,r));});},onExecute(){return {onExecuteDone(s){return is(s,n)}}},onSubscribe(){return {onSubscribeResult(s){return is(s,n)},onSubscribeError({error:s,setError:i}){i(e(s,r));}}}}}chunkBUNLC3II_cjs.h();var na=t=>({onContextBuilding({context:e,extendContext:r}){return k(()=>t(e),n=>r(n))}});chunkBUNLC3II_cjs.h();var sa=t=>({onExecute:({setExecuteFn:e})=>{t.execute&&e(t.execute);},onParse:({setParseFn:e})=>{t.parse&&e(t.parse);},onValidate:({setValidationFn:e,addValidationRule:r})=>{t.validate&&e(t.validate),t.specifiedRules?.map(r);},onSubscribe:({setSubscribeFn:e})=>{t.subscribe&&e(t.subscribe);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Be=class extends Error{error;suppressed;constructor(e,r,n){super(n),this.error=e,this.suppressed=r,this.name="SuppressedError",Error.captureStackTrace(this,this.constructor);}};chunkBUNLC3II_cjs.h();var z={get dispose(){return Symbol.dispose||Symbol.for("dispose")},get asyncDispose(){return Symbol.asyncDispose||Symbol.for("asyncDispose")}};chunkBUNLC3II_cjs.h();function Pr(t){return t?.[z.dispose]!=null}function ia(t){return t?.[z.asyncDispose]!=null}var op=globalThis.SuppressedError||Be,vr=class t{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return ia(e)?this.callbacks.push(()=>e[z.asyncDispose]()):Pr(e)&&this.callbacks.push(()=>e[z.dispose]()),e}adopt(e,r){return r&&this.callbacks.push(()=>r(e)),e}defer(e){e&&this.callbacks.push(e);}move(){let e=new t;return e.callbacks=this.callbacks,this.callbacks=[],e}disposeAsync(){return this[z.asyncDispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e)return k(e,()=>this._iterateCallbacks(),r=>(this._error=this._error?new op(r,this._error):r,this._iterateCallbacks()))}[z.asyncDispose](){let e=this._iterateCallbacks();if(e?.then)return e.then(()=>{if(this._error){let r=this._error;throw this._error=void 0,r}});if(this._error){let r=this._error;throw this._error=void 0,r}}[Symbol.toStringTag]="AsyncDisposableStack"};chunkBUNLC3II_cjs.h();var oa=globalThis.AsyncDisposableStack||vr;chunkBUNLC3II_cjs.h();function xe(t){if(t instanceof Error)return t;if(typeof t=="object"&&t!=null&&"message"in t&&typeof t.message=="string"){let e;"cause"in t&&(e={cause:t.cause});let r=new Error(t.message,e);return "stack"in t&&typeof t.stack=="string"&&(r.stack=t.stack),"name"in t&&typeof t.name=="string"&&(r.name=t.name),r}return new Error(String(t))}chunkBUNLC3II_cjs.h();function aa(t){let e=t[Symbol.asyncIterator](),r,n,s=false;async function i(){if(s)return {value:void 0,done:true};try{if(!r){if(n)return await n,await i();let c;n=new Promise(u=>{c=u;});let l=await e.next();return l.done?(s=!0,await i()):(r=l.value[Symbol.asyncIterator](),n=void 0,c(),await i())}let o=r,a=await r.next();return a.done?(r===o&&(r=void 0),await i()):a}catch(o){throw s=true,o}}return {next:i,async return(){return s=true,await Promise.all([r?.return?.(),e.return?.()]),{value:void 0,done:true}},async throw(o){throw s=true,await Promise.all([r?.throw?.(o),e.throw?.(o)]),o},[Symbol.asyncIterator](){return this},async[z.asyncDispose](){s=true,await Promise.all([r?.[z.asyncDispose]?.(),e?.[z.asyncDispose]?.()]);}}}chunkBUNLC3II_cjs.h();function as(t,e){if(!t)throw new Error(e??"Unexpected invariant triggered.")}chunkBUNLC3II_cjs.h();function ls(t,e,r){e?.throwIfAborted();let n=Object.create(null),s=[];for(let o in t){let a=k(()=>t[o],c=>{n[o]=c;});N(a)&&s.push(a);}if(!s.length)return n;let i=s.length===1?s[0]:Promise.all(s);return r?Promise.race([r,i]).then(()=>n):i.then(()=>n)}chunkBUNLC3II_cjs.h();function la(t,e,r,n){let s=[],i=n?.maxErrors;try{let o=lp(t,e,r,a=>{if(i!=null&&s.length>=i)throw G("Too many errors processing variables, error limit reached. Execution aborted.");s.push(a);});if(s.length===0)return {coerced:o}}catch(o){s.push(o);}return {errors:s}}function lp(t,e,r,n){let s={};for(let i of e){let o=i.variable.name.value,a=chunk5DWQGEM2_cjs.y(t,i.type);if(!chunk5DWQGEM2_cjs.k(a)){let l=chunk5DWQGEM2_cjs.f(i.type);n(G(`Variable "$${o}" expected value of type "${l}" which cannot be used as an input type.`,{nodes:i.type}));continue}if(!wr(r,o)){if(i.defaultValue)s[o]=chunk5DWQGEM2_cjs.A(i.defaultValue,a);else if(chunk5DWQGEM2_cjs.j(a)){let l=ee(a);n(G(`Variable "$${o}" of required type "${l}" was not provided.`,{nodes:i}));}continue}let c=r[o];if(c===null&&chunk5DWQGEM2_cjs.j(a)){let l=ee(a);n(G(`Variable "$${o}" of non-null type "${l}" must not be null.`,{nodes:i}));continue}s[o]=chunk5DWQGEM2_cjs.z(c,a,(l,u,h)=>{let d=`Variable "$${o}" got invalid value `+ee(u);l.length>0&&(d+=` at "${o}${Zo(l)}"`),n(G(d+"; "+h.message,{nodes:i,originalError:h}));});}return s}var cp=$o((t,e,r)=>Qo(t.schema,t.fragments,t.variableValues,e,r));function ya(t){let e=xa(t);return "schema"in e?ga(e):{errors:e.map(r=>(Object.defineProperty(r,"extensions",{value:{...r.extensions,http:{...r.extensions?.http||{},status:400}}}),r))}}function ga(t){return t.signal?.throwIfAborted(),k(()=>hp(t),e=>{let r=ca(e,t.errors);return t.subsequentPayloads.size>0?{initialResult:{...r,hasNext:true},subsequentResults:kp(t)}:r},e=>(t.signal?.throwIfAborted(),e.errors?t.errors.push(...e.errors):t.errors.push(e),ca(null,t.errors)))}function ca(t,e){return e.length===0?{data:t}:{errors:e,data:t}}var up=Me(function(e){let r=Object.create(null);for(let n of e.definitions)n.kind===chunk5DWQGEM2_cjs.d.FRAGMENT_DEFINITION&&(r[n.name.value]=n);return r});function xa(t){let{schema:e,document:r,rootValue:n,contextValue:s,variableValues:i,operationName:o,fieldResolver:a,typeResolver:c,subscribeFieldResolver:l,signal:u,schemaCoordinateInErrors:h}=t;u?.throwIfAborted(),chunk5DWQGEM2_cjs.x(e);let d=up(r),p;for(let D of r.definitions)switch(D.kind){case chunk5DWQGEM2_cjs.d.OPERATION_DEFINITION:if(o==null){if(p!==void 0)return [G("Must provide operation name if query contains multiple operations.",{extensions:{code:"OPERATION_RESOLUTION_FAILURE"}})];p=D;}else D.name?.value===o&&(p=D);break;}if(p==null)return o!=null?[G(`Unknown operation named "${o}".`,{extensions:{code:"OPERATION_RESOLUTION_FAILURE"}})]:[G("Must provide an operation.",{extensions:{code:"OPERATION_RESOLUTION_FAILURE"}})];let x=p.variableDefinitions??[],S=la(e,x,i??{},{maxErrors:50});if(S.errors)return S.errors;u?.throwIfAborted();let R,C;if(u){let D=new Set,E=Ut();C=E.promise;let T=()=>{E.reject(u.reason),u.removeEventListener("abort",T);};u.addEventListener("abort",T,{once:true}),C.catch(()=>{for(let w of D)w();D.clear();}),R=w=>{D.add(w);};}return {schema:e,fragments:d,rootValue:n,contextValue:s,operation:p,variableValues:S.coerced,fieldResolver:a??da,typeResolver:c??xp,subscribeFieldResolver:l??da,subsequentPayloads:new Set,errors:[],signal:u,onSignalAbort:R,signalPromise:C,schemaCoordinateInErrors:h}}function fp(t,e){return {...t,rootValue:e,subsequentPayloads:new Set,errors:[]}}function hp(t){let{operation:e,schema:r,fragments:n,variableValues:s,rootValue:i}=t,o=Go(r,e.operation,[e]);o==null&&G(`Schema is not configured to execute ${e.operation} operation.`,{nodes:e});let{fields:a,patches:c}=rs(r,n,s,o,e.selectionSet),l=void 0,u;e.operation==="mutation"?u=dp(t,o,i,l,a):u=fs(t,o,i,l,a);for(let h of c){let{label:d,fields:p}=h;Ta(t,o,i,p,d,l);}return u}function dp(t,e,r,n,s){return Bo(s,(i,[o,a])=>{let c=Ye(n,o,e.name);return t.signal?.throwIfAborted(),k(()=>_a(t,e,r,a,c),l=>(l===void 0||(i[o]=l),i))},Object.create(null))}function fs(t,e,r,n,s,i){let o=Object.create(null),a=false;try{for(let[c,l]of s){t.signal?.throwIfAborted();let u=Ye(n,c,e.name),h=_a(t,e,r,l,u,i);h!==void 0&&(o[c]=h,N(h)&&(a=!0));}}catch(c){if(c!==t.signal?.reason&&a)return k(()=>ls(o,t.signal),()=>{throw c},()=>{throw c});throw c}return a?ls(o,t.signal,t.signalPromise):o}function _a(t,e,r,n,s,i){let o=i?.errors??t.errors,a=ka(t.schema,e,n[0]);if(!a)return;let c=a.type,l=a.resolve??t.fieldResolver,u=wa(t,a,n,e,s);try{t.signal?.throwIfAborted();let h=es(a,n[0],t.variableValues),d=t.contextValue,p=l(r,h,d,u),x;return N(p)?x=p.then(S=>$e(t,c,n,u,s,S,i)):x=$e(t,c,n,u,s,p,i),N(x)?x.then(void 0,S=>{if(S instanceof AggregateError){let D;for(let E of S.errors){E=xe(E);let T=ae(E,n,te(s),t.schemaCoordinateInErrors&&u);D=be(T,c,o),fe(t,s,i);}return D}S=xe(S);let R=ae(S,n,te(s),t.schemaCoordinateInErrors&&u),C=be(R,c,o);return fe(t,s,i),C}):x}catch(h){if(h instanceof AggregateError){let S;for(let R of h.errors){R=xe(R);let C=ae(R,n,te(s),t.schemaCoordinateInErrors&&u);S=be(C,c,o),fe(t,s,i);}return S}let d=xe(h),p=ae(d,n,te(s),t.schemaCoordinateInErrors&&u),x=be(p,c,o);return fe(t,s,i),x}}function wa(t,e,r,n,s){return {fieldName:e.name,fieldNodes:r,returnType:e.type,parentType:n,path:s,schema:t.schema,fragments:t.fragments,rootValue:t.rootValue,operation:t.operation,variableValues:t.variableValues,signal:t.signal}}var pp="CRITICAL_ERROR";function be(t,e,r){if(chunk5DWQGEM2_cjs.j(e)||t.extensions?.[pp])throw t;return r.push(t),null}function $e(t,e,r,n,s,i,o){if(i instanceof Error)throw i;if(chunk5DWQGEM2_cjs.j(e)){let a=$e(t,e.ofType,r,n,s,i,o);if(a===null)throw new Error(`Cannot return null for non-nullable field ${n.parentType.name}.${n.fieldName}.`);return a}if(i==null)return null;if(chunk5DWQGEM2_cjs.i(e))return bp(t,e,r,n,s,i,o);if(chunk5DWQGEM2_cjs.l(e))return yp(e,i);if(chunk5DWQGEM2_cjs.m(e))return gp(t,e,r,n,s,i,o);if(chunk5DWQGEM2_cjs.h(e))return cs(t,e,r,n,s,i,o);console.assert(false,"Cannot complete value of unexpected output type: "+ee(e));}function Sa(t,e,r){if(typeof r.key=="number")return;let n=chunk5DWQGEM2_cjs.B(Vo,e[0],t.variableValues);if(n&&n.if!==false)return as(typeof n.initialCount=="number","initialCount must be a number"),as(n.initialCount>=0,"initialCount must be a positive integer"),{initialCount:n.initialCount,label:typeof n.label=="string"?n.label:void 0}}async function mp(t,e,r,n,s,i,o){t.signal?.throwIfAborted(),i.return&&t.onSignalAbort?.(()=>{i.return?.();});let a=o?.errors??t.errors,c=Sa(t,r,s),l=false,u=[],h=0;for(;;){if(c&&typeof c.initialCount=="number"&&h>=c.initialCount){vp(h,i,t,r,n,e,s,c.label,o);break}let d=Ye(s,h,void 0),p;try{if(p=await i.next(),p.done)break}catch(x){let S=xe(x),R=ae(S,r,te(d),t.schemaCoordinateInErrors&&n);u.push(be(R,e,a));break}Ea(p.value,u,a,t,e,r,n,d,o)&&(l=true),h+=1;}return l?Promise.all(u):u}function bp(t,e,r,n,s,i,o){let a=e.ofType,c=o?.errors??t.errors;if(Sr(i)){let x=i[Symbol.asyncIterator]();return mp(t,a,r,n,s,x,o)}if(!Mo(i))throw G(`Expected Iterable, but did not find one for field "${n.parentType.name}.${n.fieldName}".`);let l=Sa(t,r,s),u=false,h=o,d=[],p=0;for(let x of i){let S=Ye(s,p,void 0);if(l&&typeof l.initialCount=="number"&&p>=l.initialCount){h=Ep(s,S,x,t,r,n,a,l.label,h),p++;continue}Ea(x,d,c,t,a,r,n,S,o)&&(u=true),p++;}return u?Promise.all(d):d}function Ea(t,e,r,n,s,i,o,a,c){try{let l;if(N(t)?l=t.then(u=>$e(n,s,i,o,a,u,c)):l=$e(n,s,i,o,a,t,c),N(l))return e.push(l.then(void 0,u=>{u=xe(u);let h=ae(u,i,te(a),n.schemaCoordinateInErrors&&o),d=be(h,s,r);return fe(n,a,c),d})),!0;e.push(l);}catch(l){let u=xe(l),h=ae(u,i,te(a),n.schemaCoordinateInErrors&&o),d=be(h,s,r);fe(n,a,c),e.push(d);}return false}function yp(t,e){let r;try{r=t.serialize(e);}catch(n){throw n instanceof chunk5DWQGEM2_cjs.b?new Error(n.message):n}if(r==null)throw new Error(`Expected \`${ee(t)}.serialize(${ee(e)})\` to return non-nullable value, returned: ${ee(r)}`);return r}function gp(t,e,r,n,s,i,o){let a=e.resolveType??t.typeResolver,c=t.contextValue,l=a(i,c,n,e);return N(l)?l.then(u=>cs(t,ua(u,t,e,r,n,i),r,n,s,i,o)):cs(t,ua(l,t,e,r,n,i),r,n,s,i,o)}function ua(t,e,r,n,s,i){if(t==null)throw G(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${s.parentType.name}.${s.fieldName}". Either the "${r.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,{nodes:n});if(chunk5DWQGEM2_cjs.h(t)){if(chunk5DWQGEM2_cjs.a.major>=16)throw G("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");t=t.name;}if(typeof t!="string")throw G(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${s.parentType.name}.${s.fieldName}" with value ${ee(i)}, received "${ee(t)}".`);let o=e.schema.getType(t);if(o==null)throw G(`Abstract type "${r.name}" was resolved to a type "${t}" that does not exist inside the schema.`,{nodes:n});if(!chunk5DWQGEM2_cjs.h(o))throw G(`Abstract type "${r.name}" was resolved to a non-object type "${t}".`,{nodes:n});if(!e.schema.isSubType(r,o))throw G(`Runtime Object type "${o.name}" is not a possible type for "${r.name}".`,{nodes:n});return o}function cs(t,e,r,n,s,i,o){if(e.isTypeOf){let a=e.isTypeOf(i,t.contextValue,n);if(N(a))return a.then(c=>{if(!c)throw fa(e,i,r);return ha(t,e,r,s,i,o)});if(!a)throw fa(e,i,r)}return ha(t,e,r,s,i,o)}function fa(t,e,r){return G(`Expected value of type "${t.name}" but got: ${ee(e)}.`,{nodes:r})}function ha(t,e,r,n,s,i){let{fields:o,patches:a}=cp(t,e,r),c=fs(t,e,s,n,o,i);for(let l of a){let{label:u,fields:h}=l;Ta(t,e,s,h,u,n,i);}return c}var xp=function(t,e,r,n){if(Xn(t)&&typeof t.__typename=="string")return t.__typename;let s=r.schema.getPossibleTypes(n),i=[];for(let o=0;o<s.length;o++){let a=s[o];if(a.isTypeOf){let c=a.isTypeOf(t,e,r);if(N(c))i[o]=c;else if(c)return a.name}}if(i.length)return Promise.all(i).then(o=>{for(let a=0;a<o.length;a++)if(o[a])return s[a].name})},da=function(t,e,r,n){if(Xn(t)||typeof t=="function"){let s=t[n.fieldName];return typeof s=="function"?t[n.fieldName](e,r,n):s}};function Pa(t){let e=xa(t);if(!("schema"in e)){for(let n of e){let s=n.extensions||={},i=s.http||={};i.status=400,n.extensions.code="BAD_USER_INPUT";}return {errors:e}}let r=wp(e);return N(r)?r.then(n=>pa(e,n)):pa(e,r)}function va(t){return t?.initialResult}function hs(t){let e=t.subsequentResults,r=false,n=false;return {[Symbol.asyncIterator](){return this},next(){return n?$({value:void 0,done:n}):r?e.next():(r=true,$({value:t.initialResult,done:n}))},return(){return n=true,e.return()},throw(s){return n=true,e.throw(s)},[z.asyncDispose](){return n=true,e?.[z.asyncDispose]?.()}}}async function*_p(t){"initialResult"in t?yield*hs(t):yield t;}function pa(t,e){return Sr(e)?aa(Oe(e,r=>k(()=>ga(fp(t,r)),_p),r=>{throw r instanceof AggregateError?new AggregateError(r.errors.map(n=>ma(n,t.operation)),r.message):ma(r,t.operation)})):e}function ma(t,e){return G(t.message,{originalError:t,nodes:[e]})}function wp(t){try{let e=Sp(t);return N(e)?e.then(void 0,r=>({errors:[r]})):e}catch(e){return {errors:[e]}}}function Sp(t){let{schema:e,fragments:r,operation:n,variableValues:s,rootValue:i}=t,o=e.getSubscriptionType();if(o==null)throw G("Schema is not configured to execute subscription operation.",{nodes:n});let{fields:a}=rs(e,r,s,o,n.selectionSet),[c,l]=[...a.entries()][0],u=l[0].name.value,h=ka(e,o,l[0]);if(!h)throw G(`The subscription field "${u}" is not defined.`,{nodes:l});let d=Ye(void 0,c,o.name),p=wa(t,h,l,o,d);try{let x=es(h,l[0],s),S=t.contextValue,C=(h.subscribe??t.subscribeFieldResolver)(i,x,S,p);return N(C)?C.then(D=>ba(D,t.signal,t.onSignalAbort)).then(void 0,D=>{throw ae(D,l,te(d),t.schemaCoordinateInErrors&&p)}):ba(C,t.signal,t.onSignalAbort)}catch(x){throw ae(x,l,te(d),t.schemaCoordinateInErrors&&p)}}function ba(t,e,r){if(e?.throwIfAborted(),t instanceof Error)throw t;if(!Sr(t))throw G(`Subscription field must return Async Iterable. Received: ${ee(t)}.`);return r?{[Symbol.asyncIterator](){let n=t[Symbol.asyncIterator]();return n.return&&r?.(()=>{n.return?.();}),n}}:t}function Ta(t,e,r,n,s,i,o){let a=new us({label:s,path:i,parentContext:o,exeContext:t}),c;try{c=fs(t,e,r,i,n,a),N(c)&&(c=c.then(null,l=>(a.errors.push(l),null)));}catch(l){a.errors.push(l),c=null;}a.addData(c);}function Ep(t,e,r,n,s,i,o,a,c){let l=new kr({label:a,path:e,parentContext:c,exeContext:n}),u;try{try{N(r)?u=r.then(d=>$e(n,o,s,i,e,d,l)):u=$e(n,o,s,i,e,r,l),N(u)&&(u=u.then(void 0,d=>{d=xe(d);let p=ae(d,s,te(e),n.schemaCoordinateInErrors&&i),x=be(p,o,l.errors);return fe(n,e,l),x}));}catch(d){let p=xe(d),x=ae(p,s,te(e),n.schemaCoordinateInErrors&&i);u=be(x,o,l.errors),fe(n,e,l);}}catch(d){return l.errors.push(d),fe(n,t,l),l.addItems(null),l}let h;return N(u)?h=u.then(d=>[d],d=>(l.errors.push(d),fe(n,t,l),null)):h=[u],l.addItems(h),l}async function Pp(t,e,r,n,s,i,o){let a;try{let{value:l,done:u}=await t.next();if(u)return i.setIsCompletedIterator(),{done:u,value:void 0};a=l;}catch(l){let u=xe(l),h=ae(u,r,te(o),e.schemaCoordinateInErrors&&n);return {done:true,value:be(h,s,i.errors)}}let c;try{return c=$e(e,s,r,n,o,a,i),N(c)&&(c=c.then(void 0,l=>{let u=ae(l,r,te(o),e.schemaCoordinateInErrors&&n),h=be(u,s,i.errors);return fe(e,o,i),h})),{done:!1,value:c}}catch(l){let u=ae(l,r,te(o),e.schemaCoordinateInErrors&&n),h=be(u,s,i.errors);return fe(e,o,i),{done:false,value:h}}}async function vp(t,e,r,n,s,i,o,a,c){let l=t,u=c??void 0;for(;;){let h=Ye(o,l,void 0),d=new kr({label:a,path:h,parentContext:u,iterator:e,exeContext:r}),p;try{p=await Pp(e,r,n,s,i,d,h);}catch(C){d.errors.push(C),fe(r,o,d),d.addItems(null),e?.return&&e.return().catch(()=>{});return}let{done:x,value:S}=p,R;if(N(S)?R=S.then(C=>[C],C=>(d.errors.push(C),fe(r,o,d),null)):R=[S],d.addItems(R),x)break;u=d,l++;}}function fe(t,e,r){let n=te(e);t.subsequentPayloads.forEach(s=>{if(s!==r){for(let i=0;i<n.length;i++)if(s.path[i]!==n[i])return;ds(s)&&s.iterator?.return&&s.iterator.return().catch(()=>{}),t.subsequentPayloads.delete(s);}});}function Tp(t){let e=[];for(let r of t.subsequentPayloads){let n={};if(r.isCompleted){if(t.subsequentPayloads.delete(r),ds(r)){let s=r.items;if(r.isCompletedIterator)continue;n.items=s;}else {let s=r.data;n.data=s??null;}n.path=r.path,r.label&&(n.label=r.label),r.errors.length>0&&(n.errors=r.errors),e.push(n);}}return e}function kp(t){let e=false;async function r(){if(e)return {value:void 0,done:true};let s=Array.from(t.subsequentPayloads).map(a=>a.promise);if(t.signalPromise?await Promise.race([t.signalPromise,...s]):await Promise.race(s),e)return {value:void 0,done:true};let i=Tp(t),o=t.subsequentPayloads.size>0;return !i.length&&o?r():(o||(e=true),{value:i.length?{incremental:i,hasNext:o}:{hasNext:o},done:false})}function n(){let s=[];return t.subsequentPayloads.forEach(i=>{ds(i)&&i.iterator?.return&&s.push(i.iterator.return());}),Promise.all(s)}return {[Symbol.asyncIterator](){return this},next:r,async return(){return await n(),e=true,{value:void 0,done:true}},async throw(s){throw await n(),e=true,s},async[z.asyncDispose](){await n(),e=true;}}}var us=class{type;errors;label;path;promise;data;parentContext;isCompleted;_exeContext;_resolve;constructor(e){this.type="defer",this.label=e.label,this.path=te(e.path),this.parentContext=e.parentContext,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=false,this.data=null,this.promise=new Promise(r=>{this._resolve=n=>{r(n);};}).then(r=>{this.data=r,this.isCompleted=true;});}addData(e){let r=this.parentContext?.promise;if(r){this._resolve?.(r.then(()=>e));return}this._resolve?.(e);}},kr=class{type;errors;label;path;items;promise;parentContext;iterator;isCompletedIterator;isCompleted;_exeContext;_resolve;constructor(e){this.type="stream",this.items=null,this.label=e.label,this.path=te(e.path),this.parentContext=e.parentContext,this.iterator=e.iterator,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=false,this.items=null,this.promise=new Promise(r=>{this._resolve=n=>{r(n);};}).then(r=>{this.items=r,this.isCompleted=true;});}addItems(e){let r=this.parentContext?.promise;if(r){this._resolve?.(r.then(()=>e));return}this._resolve?.(e);}setIsCompletedIterator(){this.isCompletedIterator=true;}};function ds(t){return t.type==="stream"}function ka(t,e,r){let n=r.name.value;return n===chunk5DWQGEM2_cjs.u.name&&t.getQueryType()===e?chunk5DWQGEM2_cjs.u:n===chunk5DWQGEM2_cjs.v.name&&t.getQueryType()===e?chunk5DWQGEM2_cjs.v:n===chunk5DWQGEM2_cjs.w.name?chunk5DWQGEM2_cjs.w:e.getFields()[n]}chunkBUNLC3II_cjs.h();function Cr(t){let e=chunk5DWQGEM2_cjs.F(t.document,t.operationName);if(e==null)throw new Error("Must provide an operation.");return e.operation==="subscription"?Pa(t):k(()=>ya(t),r=>va(r)?hs(r):r)}var Xy=chunkBUNLC3II_cjs.e(nr(),1);chunkBUNLC3II_cjs.h();var Ay=chunkBUNLC3II_cjs.e(nr(),1);chunkBUNLC3II_cjs.h();function nu(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function gy(t){if(t.socket?.localPort)return t.socket?.localPort;let r=(t.headers?.[":authority"]||t.headers?.host)?.split(":")?.[1];return r||80}function xy(t){if(t.headers?.[":authority"])return t.headers?.[":authority"];if(t.headers?.host)return t.headers?.host;let e=gy(t);if(t.hostname)return t.hostname+":"+e;let r=t.socket?.localAddress;return r&&!r?.includes("::")&&!r?.includes("ffff")?`${r}:${e}`:"localhost"}function _y(t){let e=xy(t),r=t.protocol||(t.socket?.encrypted?"https":"http"),n=t.originalUrl||t.url||"/graphql";return `${r}://${e}${n}`}function wy(t){let e=t[Symbol.toStringTag];return !!(typeof t=="string"||e==="Uint8Array"||e==="Blob"||e==="FormData"||e==="URLSearchParams"||nu(t))}function Fi(t,e,r,n){let s=t.raw||t.req||t,i=_y(s);if(t.query){let l=new e.URL(i);for(let u in t.query)l.searchParams.set(u,t.query[u]);i=l.toString();}let o=t.headers;if(t.headers?.[":method"]){o={};for(let l in t.headers)l.startsWith(":")||(o[l]=t.headers[l]);}let a=n?Ui():new AbortController;if(r?.once){let l=()=>{a.signal.aborted||(Object.defineProperty(s,"aborted",{value:true}),a.abort(r.errored??void 0));};r.once("error",l),r.once("close",l),r.once("finish",()=>{r.removeListener("close",l);});}if(t.method==="GET"||t.method==="HEAD")return new e.Request(i,{method:t.method,headers:o,signal:a.signal});let c=t.body;if(c!=null&&Object.keys(c).length>0){if(wy(c))return new e.Request(i,{method:t.method||"GET",headers:o,body:c,signal:a.signal});let l=new e.Request(i,{method:t.method||"GET",headers:o,signal:a.signal});return l.headers.get("content-type")?.includes("json")||l.headers.set("content-type","application/json; charset=utf-8"),new Proxy(l,{get(u,h,d){switch(h){case "json":return ()=>$(c);case "text":return ()=>$(JSON.stringify(c));default:{let p=Reflect.get(l,h,l);return typeof p=="function"?function(...S){return p.apply(this===d?l:this,S)}:p}}}})}return new e.Request(i,{method:t.method,headers:o,signal:a.signal,body:s,duplex:"half"})}function su(t){return t.read!=null}function iu(t){return su(t)}function Ii(t){return t!=null&&t.setHeader!=null&&t.end!=null&&t.once!=null&&t.write!=null}function Sy(t){return t!=null&&t.getReader!=null}function ou(t){return t!=null&&t.request!=null&&t.respondWith!=null}function Ey(t){t?.socket?.setTimeout?.(0),t?.socket?.setNoDelay?.(true),t?.socket?.setKeepAlive?.(true);}function sr(t){t.end(null,null,null);}function Py(t,e){let r=false,n=()=>{r=true;};t.once("error",n),t.once("close",n),t.once("finish",()=>{t.removeListener("close",n),t.removeListener("error",n);});let s=e[Symbol.asyncIterator]();return au(()=>s.next(),t,()=>r)}function tu(t){t.end(null,null,null);}function au(t,e,r){let n=()=>k(t,s=>r?.()||s.done?tu(e):k(()=>mn(s.value,e),()=>r?.()?tu(e):n()));return n()}function mn(t,e){if(!e.write(t))return new Promise(n=>e.once("drain",n))}var vy=globalThis.process?.versions?.node?.startsWith("1");function lu(t,e,r,n){if(e.closed||e.destroyed||e.writableEnded)return;if(!t){e.statusCode=404,sr(e);return}if(n&&t.headers?.headersInit&&!Array.isArray(t.headers.headersInit)&&!t.headers.headersInit.get&&!t.headers._map&&!t.headers._setCookies?.length)e.writeHead(t.status,t.statusText,t.headers.headersInit);else {if(e.setHeaders&&!vy)e.setHeaders(t.headers);else {let o=false;t.headers.forEach((a,c)=>{if(c==="set-cookie"){if(o)return;o=true;let l=t.headers.getSetCookie?.();if(l){e.setHeader("set-cookie",l);return}}e.setHeader(c,a);});}e.writeHead(t.status,t.statusText);}if(t.bodyType==="String"){let o=t.bodyInit;return k(()=>mn(o,e),()=>sr(e))}let s=t._buffer;if(s)return k(()=>mn(s,e),()=>sr(e));let i=t.body;if(i==null){sr(e);return}if(i[Symbol.toStringTag]==="Uint8Array")return k(()=>mn(i,e),()=>sr(e));if(Ey(r),su(i)){e.once("close",()=>{i.destroy();}),i.pipe(e,{end:true});return}if(Sy(i))return Ty(r,e,i);if(nu(i))return Py(e,i)}function Ty(t,e,r){let n=r.getReader();return t?.once?.("error",s=>{n.cancel(s);}),au(()=>n.read(),e)}function cu(t){return t!=null&&typeof t=="object"&&("body"in t||"cache"in t||"credentials"in t||"headers"in t||"integrity"in t||"keepalive"in t||"method"in t||"mode"in t||"redirect"in t||"referrer"in t||"referrerPolicy"in t||"signal"in t||"window"in t)}function lt(...t){let[e,...r]=t.filter(n=>n!=null&&typeof n=="object");return r.forEach(n=>{let s=Object.getOwnPropertyNames(n).reduce((i,o)=>(Object.getOwnPropertyDescriptor(n,o)&&(i[o]=Object.getOwnPropertyDescriptor(n,o)),i),{});Object.getOwnPropertySymbols(n).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n,i);o?.enumerable&&(s[i]=o);}),Object.defineProperties(e,s);}),e}function Di(t,e){return new e(t.stack||t.message||t.toString(),{status:t.status||500})}function ji(t,e){return t==null?e==null?{}:{waitUntil:e}:lt(Object.create(t),{waitUntil:e},t)}function qi(t,e){if(e?.aborted)throw e.reason;if(N(t)&&e){let s=function(){n.reject(e.reason);};let n=Ut();return e.addEventListener("abort",s,{once:true}),t.then(function(o){n.resolve(o);}).catch(function(o){n.reject(o);}).finally(()=>{e.removeEventListener("abort",s);}),n.promise}return t}var ky=["SIGINT","exit","SIGTERM"],bn=new Set,ru=false;function Cy(){if(!ru){ru=true;for(let t of ky)globalThis.process.once(t,function(){return Promise.allSettled([...bn].map(r=>!r.disposed&&r.disposeAsync()))});}}function uu(t){globalThis.process&&(Cy(),bn.has(t)||(bn.add(t),t.defer(()=>{bn.delete(t);})));}var Oi=class extends EventTarget{aborted=false;_onabort=null;_reason;constructor(){super();let e=globalThis.process?.getBuiltinModule?.("node:events");e?.kMaxEventTargetListeners&&(this[e.kMaxEventTargetListeners]=0);}throwIfAborted(){if(this._nativeCtrl?.signal?.throwIfAborted)return this._nativeCtrl.signal.throwIfAborted();if(this.aborted)throw this._reason}_nativeCtrl;ensureNativeCtrl(){if(!this._nativeCtrl){let e=this.aborted;this._nativeCtrl=new AbortController,e&&this._nativeCtrl.abort(this._reason);}return this._nativeCtrl}abort(e){if(this._nativeCtrl?.abort)return this._nativeCtrl?.abort(e);this._reason=e||new DOMException("This operation was aborted","AbortError"),this.aborted=true,this.dispatchEvent(new Event("abort"));}get signal(){return this._nativeCtrl?.signal?this._nativeCtrl.signal:this}get reason(){return this._nativeCtrl?.signal?this._nativeCtrl.signal.reason:this._reason}get onabort(){return this._onabort?this._onabort:this._onabort}set onabort(e){if(this._nativeCtrl?.signal){this._nativeCtrl.signal.onabort=e;return}this._onabort&&this.removeEventListener("abort",this._onabort),this._onabort=e,e&&this.addEventListener("abort",e);}};function Ui(){return globalThis.Bun||globalThis.Deno?new AbortController:new Proxy(new Oi,{get(t,e,r){if(e.toString().includes("kDependantSignals")){let n=t.ensureNativeCtrl();return Reflect.get(n.signal,e,n.signal)}return Reflect.get(t,e,r)},set(t,e,r,n){if(e.toString().includes("kDependantSignals")){let s=t.ensureNativeCtrl();return Reflect.set(s.signal,e,r,s.signal)}return Reflect.set(t,e,r,n)},getPrototypeOf(){return AbortSignal.prototype}})}chunkBUNLC3II_cjs.h();function fu(t){return !!t.onData}function hu({req:t,res:e,fetchAPI:r,controller:n}){let s=t.getMethod(),i,o=[],a=[w=>{o.push(w);}],c=w=>{for(let P of a)P(w);},l=false,u=[()=>{l=true;}],h=()=>{for(let w of u)w();};e.onData(function(w,P){c(Buffer.from(Buffer.from(w,0,w.byteLength))),P&&h();});let d;if(s!=="get"&&s!=="head"){i="half",n.signal.addEventListener("abort",()=>{h();},{once:true});let w;d=()=>(w||(w=new r.ReadableStream({start(P){for(let L of o)P.enqueue(L);if(l){P.close();return}a.push(L=>{P.enqueue(L);}),u.push(()=>{if(n.signal.reason){P.error(n.signal.reason);return}P.desiredSize&&P.close();});}})),w);}let p=new r.Headers;t.forEach((w,P)=>{p.append(w,P);});let x=`http://localhost${t.getUrl()}`,S=t.getQuery();S&&(x+=`?${S}`);let R;function C(){return d?l?E():d():null}let D=new r.Request(x,{method:s,headers:p,get body(){return C()},signal:n.signal,duplex:i});function E(){return R||(R=o.length===1?o[0]:Buffer.concat(o)),R}function T(){return l?$(E()):new Promise((w,P)=>{try{u.push(()=>{w(E());});}catch(L){P(L);}})}return Object.defineProperties(D,{body:{get(){return C()},configurable:true,enumerable:true},json:{value(){return T().then(w=>w.toString("utf8")).then(w=>JSON.parse(w))},configurable:true,enumerable:true},text:{value(){return T().then(w=>w.toString("utf8"))},configurable:true,enumerable:true},arrayBuffer:{value(){return T()},configurable:true,enumerable:true}}),D}function Ry(t,e){return new e.WritableStream({write(r){t.cork(()=>{t.write(r);});},close(){t.cork(()=>{t.end();});}})}function du(t,e,r,n){if(!e){t.writeStatus("404 Not Found"),t.end();return}let s=e._buffer,i=e.bodyType==="String"?e.bodyInit:void 0;if(!r.signal.aborted&&(t.cork(()=>{t.writeStatus(`${e.status} ${e.statusText}`);let o=false;for(let[a,c]of e.headers)if(a!=="content-length"&&a!=="transfer-encoding"){if(a==="set-cookie"){if(o)continue;o=true;let l=e.headers.getSetCookie?.();if(l){for(let u of l)t.writeHeader(a,u);continue}}t.writeHeader(a,c);}i?t.end(i):s?t.end(s):e.body||t.end();}),!(i||s||!e.body)))return r.signal.addEventListener("abort",()=>{e.body?.locked||e.body?.cancel(r.signal.reason);},{once:true}),e.body.pipeTo(Ry(t,n),{signal:r.signal}).catch(o=>{if(!r.signal.aborted)throw o})}function Ly(t){try{return !!t?.request}catch{return false}}var Oy={};function pu(t,e){let r=e?.__useSingleWriteHead==null?true:e.__useSingleWriteHead,n={...Ay,...e?.fetchAPI},s=e?.__useCustomAbortCtrl==null?n.Request!==globalThis.Request:e.__useCustomAbortCtrl,i=typeof t=="function"?t:t.handle,o=[],a=[],c,l=new Set,u;function h(){return u||(u=new oa,e?.disposeOnProcessTerminate&&uu(u),u.defer(()=>{if(l.size>0)return Promise.allSettled(l).then(()=>{l.clear();},()=>{l.clear();})})),u}function d(y){N(y)&&(h(),l.add(y),y.then(()=>{l.delete(y);},g=>{console.error(`Unexpected error while waiting: ${g.message||g}`),l.delete(y);}));}if(e?.plugins!=null)for(let y of e.plugins){y.instrumentation&&(c=c?yt(c,y.instrumentation):y.instrumentation),y.onRequest&&o.push(y.onRequest),y.onResponse&&a.push(y.onResponse);let g=y[z.dispose];g&&h().defer(g);let _=y[z.asyncDispose];_&&h().defer(_),y.onDispose&&h().defer(y.onDispose);}let p=o.length>0||a.length>0?function(g,_){let v=i,A;if(o.length===0)return V();let I=g.parsedUrl||new Proxy(Oy,{get(B,Z,se){return I=new n.URL(g.url,"http://localhost"),Reflect.get(I,Z,I)}});function M(B){return a.length===0?B:k(()=>K(a,Z=>Z({request:g,response:B,serverContext:_,setResponse(se){B=se;},fetchAPI:n})),()=>B)}function V(){return A?M(A):k(()=>v(g,_),M)}return k(()=>K(o,(B,Z)=>B({request:g,setRequest(se){g=se;},serverContext:_,fetchAPI:n,url:I,requestHandler:v,setRequestHandler(se){v=se;},endResponse(se){A=se,se&&Z();}})),V)}:i;if(c?.request){let y=p;p=(g,_)=>Xe({request:g}).asyncFn(c.request,y)(g,_);}function x(y,...g){let _=g.length>1?lt(...g):g[0]||{};_.waitUntil||(_.waitUntil=d);let v=Fi(y,n,void 0,s);return p(v,_)}function S(y,g,..._){let v=g.raw||g,A=_.length>1?lt(..._):_[0]||{};A.waitUntil||(A.waitUntil=d);let I=Fi(y,n,v,s);return p(I,A)}function R(y,g,..._){let v={req:y,res:g,waitUntil:d};return Mt($().then(()=>S(y,g,v,..._)).catch(A=>Di(A,n.Response)).then(A=>lu(A,g,y,r)).catch(A=>console.error(`Unexpected error while handling request: ${A.message||A}`)))}function C(y,g,..._){let v={res:y,req:g,waitUntil:d},I=_.filter(re=>re!=null).length>0?lt(v,..._):v,M=s?Ui():new AbortController,V=y.end.bind(y),B=false;y.end=function(re){return B=true,V(re)},y.onAborted.bind(y)(function(){M.abort();}),y.onAborted=function(re){M.signal.addEventListener("abort",re,{once:true});};let se=hu({req:g,res:y,fetchAPI:n,controller:M});return k(()=>k(()=>p(se,I),re=>re,re=>Di(re,n.Response)),re=>{if(!M.signal.aborted&&!B)return k(()=>du(y,re,M,n),we=>we,we=>{console.error(`Unexpected error while handling request: ${we.message||we}`);})})}function D(y,...g){if(!y.respondWith||!y.request)throw new TypeError(`Expected FetchEvent, got ${y}`);let _=g.filter(I=>I!=null),v=_.length>0?lt({},y,..._):ji(y),A=p(y.request,v);y.respondWith(A);}function E(y,...g){let _=g.filter(A=>A!=null),v=_.length>1?lt({},..._):ji(_[0],_[0]==null||_[0].waitUntil==null?d:void 0);return p(y,v)}let T=(y,...g)=>{if(typeof y=="string"||"href"in y){let[v,...A]=g;if(cu(v)){let M=new n.Request(y,v),V=E(M,...A),B=v.signal;return B?qi(V,B):V}let I=new n.Request(y);return E(I,...g)}let _=E(y,...g);return qi(_,y.signal)},w=(y,...g)=>{let[_,...v]=g;if(iu(y)){if(!Ii(_))throw new TypeError(`Expected ServerResponse, got ${_}`);return R(y,_,...v)}if(fu(y))return C(y,_,...v);if(Ii(_))throw new TypeError("Got Node response without Node request");return Ly(y)?ou(y)?D(y,...g):E(y.request,y,...g):T(y,...g)},P={handleRequest:E,fetch:T,handleNodeRequest:x,handleNodeRequestAndResponse:S,requestListener:R,handleEvent:D,handleUWS:C,handle:w,get disposableStack(){return h()},[z.asyncDispose](){return u&&!u.disposed?u.disposeAsync():$()},dispose(){return u&&!u.disposed?u.disposeAsync():$()},waitUntil:d},L=new Proxy(w,{has:(y,g)=>g in P||g in w||t&&g in t,get:(y,g)=>{if(globalThis.Deno||g===Symbol.asyncDispose||g===Symbol.dispose){let A=Reflect.get(P,g,P);if(A)return A}let _=P[g];if(_)return _.bind?_.bind(P):_;let v=w[g];if(v)return v.bind?v.bind(w):v;if(t){let A=t[g];if(A)return A.bind?function(...I){let M=t[g](...I);return M===t?L:M}:A}},apply(y,g,_){return w(..._)}});return L}chunkBUNLC3II_cjs.h();function Fy(t,e){let r=t.headers.get("origin");if(e===false||r==null)return null;let n={};if(e.origin==null||e.origin.length===0||e.origin.includes("*")?(n["Access-Control-Allow-Origin"]=r,n.Vary="Origin"):typeof e.origin=="string"?n["Access-Control-Allow-Origin"]=e.origin:Array.isArray(e.origin)&&(e.origin.length===1?n["Access-Control-Allow-Origin"]=e.origin[0]:e.origin.includes(r)?(n["Access-Control-Allow-Origin"]=r,n.Vary="Origin"):n["Access-Control-Allow-Origin"]="null"),e.methods?.length)n["Access-Control-Allow-Methods"]=e.methods.join(", ");else {let s=t.headers.get("access-control-request-method");s&&(n["Access-Control-Allow-Methods"]=s);}if(e.allowedHeaders?.length)n["Access-Control-Allow-Headers"]=e.allowedHeaders.join(", ");else {let s=t.headers.get("access-control-request-headers");s&&(n["Access-Control-Allow-Headers"]=s,n.Vary?n.Vary+=", Access-Control-Request-Headers":n.Vary="Access-Control-Request-Headers");}return e.credentials!=null?e.credentials===true&&(n["Access-Control-Allow-Credentials"]="true"):n["Access-Control-Allow-Origin"]!=="*"&&(n["Access-Control-Allow-Credentials"]="true"),e.exposedHeaders&&(n["Access-Control-Expose-Headers"]=e.exposedHeaders.join(", ")),e.maxAge&&(n["Access-Control-Max-Age"]=e.maxAge.toString()),n}function Iy(t,e,r){return k(()=>e(t,r),n=>Fy(t,n))}function mu(t){let e=()=>({});if(t!=null)if(typeof t=="function")e=t;else if(typeof t=="object"){let r={...t};e=()=>r;}else t===false&&(e=()=>false);return {onRequest({request:r,fetchAPI:n,endResponse:s}){if(r.method.toUpperCase()==="OPTIONS"){let i=new n.Response(null,{status:204,headers:{"Content-Length":"0"}});s(i);}},onResponse({request:r,serverContext:n,response:s}){return k(()=>Iy(r,e,n),i=>{if(i!=null)for(let o in i)s.headers.set(o,i[o]);})}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Dy=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions","coordinate"];function jy(t){return t!=null&&typeof t=="object"&&Object.keys(t).every(e=>Dy.includes(e))}function U(t,e){e?.originalError&&!(e.originalError instanceof Error)&&jy(e.originalError)&&(e.originalError=U(e.originalError.message,e.originalError));let r=chunk5DWQGEM2_cjs.b,n=chunk5DWQGEM2_cjs.a.major>=16?new r(t,e):new r(t,e?.nodes,e?.source,e?.positions,e?.path,e?.originalError,e?.extensions);return e?.coordinate&&n.coordinate==null&&Object.defineProperties(n,{coordinate:{value:e.coordinate,enumerable:true,configurable:true}}),n}function yn(t){return t.coordinate}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function bu(t){return t?.[Symbol.asyncIterator]!=null}function qy(t){return t!=null&&typeof t=="object"&&"errors"in t}function Uy(t){return t!=null&&typeof t.toString=="function"}function Re(t){return t instanceof chunk5DWQGEM2_cjs.b}function gn(t){return t instanceof chunk5DWQGEM2_cjs.b?t.originalError!=null?gn(t.originalError):true:false}function Mi(t){return typeof t=="object"&&t?.constructor?.name==="DOMException"&&(t.name==="AbortError"||t.name==="TimeoutError")}function At(t,e,r){let n=new Set;if(qy(t))for(let s of t.errors){let i=At(s,e,r);for(let o of i)n.add(o);}else if(Mi(t))r.debug("Request aborted");else if(e){let s=e.maskError(t,e.errorMessage,e.isDev);s!==t&&r.error(t),n.add(Re(s)?s:U(s.message,{originalError:s}));}else Re(t)?n.add(t):t instanceof Error?n.add(U(t.message,{originalError:t})):typeof t=="string"?n.add(U(t,{extensions:{code:"INTERNAL_SERVER_ERROR",unexpected:true}})):Uy(t)?n.add(U(t.toString(),{extensions:{code:"INTERNAL_SERVER_ERROR",unexpected:true}})):(r.error(t),n.add(U("Unexpected error.",{extensions:{unexpected:true}})));return Array.from(n)}function Lt(t,e={},r=false){let n,s=false;if("extensions"in t&&t.extensions?.http&&(t.extensions.http.headers&&Object.assign(e,t.extensions.http.headers),t.extensions.http.status&&(n=t.extensions.http.status)),"errors"in t&&t.errors?.length)for(let i of t.errors)if(i.extensions?.http){if(i.extensions.http.headers&&Object.assign(e,i.extensions.http.headers),r&&i.extensions.http.spec)continue;i.extensions.http.status&&(!n||i.extensions.http.status>n)&&(n=i.extensions.http.status);}else (!gn(i)||i.extensions?.unexpected)&&(s=true);else n||=200;return n||(s&&!("data"in t)?n=500:n=200),{status:n,headers:e}}function yu(t){return Array.isArray(t)&&t.length>0&&t.some(Re)}chunkBUNLC3II_cjs.h();function gu(t){return {onResponse({response:e}){_u(e.headers,t);}}}function xu(t){return {onRequest({request:e}){_u(e.headers,t);}}}function _u(t,e){for(let r of t.keys())e.includes(r)||t.delete(r);}chunkBUNLC3II_cjs.h();var Eu=chunkBUNLC3II_cjs.e(nr(),1);chunkBUNLC3II_cjs.h();var wu=chunkBUNLC3II_cjs.e(nr(),1);function Bi(t){let e=t.get("operationName")||void 0,r=t.get("query")||void 0,n=t.get("variables")||void 0,s=t.get("extensions")||void 0;return {operationName:e,query:r,variables:n?JSON.parse(n):void 0,extensions:s?JSON.parse(s):void 0}}function Su(t){let e=new wu.URLSearchParams(t);return Bi(e)}function qe(t,e){let r=t.headers.get("content-type");return r=r?.split(",")[0]||null,r===e||!!r?.startsWith(`${e};`)}function Pu(t){return t.method==="GET"}function vu(t){let e=t.url.substring(t.url.indexOf("?")+1),r=new Eu.URLSearchParams(e);return Bi(r)}chunkBUNLC3II_cjs.h();function Tu(t){return t.method==="POST"&&qe(t,"application/x-www-form-urlencoded")}function ku(t){return t.text().then(Su)}chunkBUNLC3II_cjs.h();function Cu(t){return t.method==="POST"&&qe(t,"application/graphql")}function Ru(t){return t.text().then(e=>({query:e}))}chunkBUNLC3II_cjs.h();function Au(t){return t.method==="POST"&&(qe(t,"application/json")||qe(t,"application/graphql+json"))}function Lu(t){return k(()=>t.json(),e=>{if(e==null)throw U(`POST body is expected to be object but received ${e}`,{extensions:{http:{status:400},code:"BAD_REQUEST"}});let r=typeof e;if(r!=="object")throw U(`POST body is expected to be object but received ${r}`,{extensions:{http:{status:400},code:"BAD_REQUEST"}});return e},e=>{if(e instanceof chunk5DWQGEM2_cjs.b)throw e;let r={http:{spec:true,status:400},code:"BAD_REQUEST"};throw e instanceof Error&&(r.originalError={name:e.name,message:e.message}),U("POST body sent invalid JSON.",{extensions:r})})}chunkBUNLC3II_cjs.h();function Ou(t){return t.method==="POST"&&qe(t,"multipart/form-data")}function Fu(t){return k(()=>t.formData(),e=>{let r=e.get("operations");if(!r)throw U('Missing multipart form field "operations"');if(typeof r!="string")throw U('Multipart form field "operations" must be a string');let n;try{n=JSON.parse(r);}catch{throw U('Multipart form field "operations" must be a valid JSON string')}let s=e.get("map");if(s!=null){if(typeof s!="string")throw U('Multipart form field "map" must be a string');let i;try{i=JSON.parse(s);}catch{throw U('Multipart form field "map" must be a valid JSON string')}for(let o in i){let a=e.get(o),c=i[o];for(let l of c)My(n,l,a);}}return n},e=>{throw e instanceof Error&&e.message.startsWith("File size limit exceeded: ")?U(e.message,{extensions:{http:{status:413}}}):e})}function My(t,e,r){let n=e.split("."),s=t;for(let i=0;i<n.length;i++){let o=n[i];if(o==="__proto__"||o==="constructor"||o==="prototype")return;i===n.length-1?s[o]=r:(o in s||(s[o]={}),s=s[o]);}}chunkBUNLC3II_cjs.h();var By=new Set(["query","variables","operationName","extensions"]);function $y(t,e){if(t==null||typeof t!="object")throw U('Invalid "params" in the request body',{extensions:{http:{spec:true,status:400},code:"BAD_REQUEST"}});for(let r in t)if(t[r]!=null&&!By.has(r)){if(e?.includes(r))continue;throw U(`Unexpected parameter "${r}" in the request body.`,{extensions:{http:{status:400},code:"BAD_REQUEST"}})}}function Ny(t,e){if(!Gy(t))throw U(`Expected params to be an object but given ${ir(t)}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});if($y(t,e),t.query==null)throw U("Must provide query string.",{extensions:{http:{spec:true,status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});let r=ir(t.query);if(r!=="string")throw U(`Expected "query" param to be a string, but given ${r}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});let n=ir(t.variables);if(!["object","null","undefined"].includes(n))throw U(`Expected "variables" param to be empty or an object, but given ${n}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});let s=ir(t.extensions);if(!["object","null","undefined"].includes(s))throw U(`Expected "extensions" param to be empty or an object, but given ${s}.`,{extensions:{http:{status:400,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}});return t}function Iu(t){return {onParams({params:e}){Ny(e,t);}}}function ir(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Gy(t){return ir(t)==="object"}chunkBUNLC3II_cjs.h();function zy(t){return t==="GET"||t==="POST"}function Du(){return {onRequestParse({request:t}){if(!zy(t.method))throw U("GraphQL only supports GET and POST requests.",{extensions:{http:{status:405,headers:{Allow:"GET, POST"}},code:"BAD_REQUEST"}})}}}chunkBUNLC3II_cjs.h();function ju(){return {onValidate(){return ({valid:t,result:e})=>{if(!t)for(let r of e)r.extensions||={},r.extensions.code||="GRAPHQL_VALIDATION_FAILED",r.extensions.http||={},r.extensions.http.spec=r.extensions.http.spec==null?true:r.extensions.http.spec,r.extensions.http.status||=400;}}}}chunkBUNLC3II_cjs.h();function qu(t){return {onRequestParse(){return {onRequestParseDone({requestParserResult:e}){if(Array.isArray(e)){if(!t)throw U("Batching is not supported.",{extensions:{http:{status:400},code:"BAD_REQUEST"}});if(e.length>t)throw U(`Batching is limited to ${t} operations per request.`,{extensions:{http:{status:413},code:"BAD_REQUEST"}})}}}}}}chunkBUNLC3II_cjs.h();function Hy(t,e,r){let n=e?chunk5DWQGEM2_cjs.F(e,r)??void 0:void 0;if(!n)throw U("Could not determine what operation to execute.",{extensions:{code:"OPERATION_RESOLUTION_FAILURE",http:{status:400}}});if(n.operation==="mutation"&&t==="GET")throw U("Can only perform a mutation operation from a POST request.",{extensions:{http:{status:405,headers:{Allow:"POST"}},code:"BAD_REQUEST"}})}function Uu(){return {onParse(){return ({result:t,context:{request:e,params:{operationName:r}={}}})=>{if(e)if(t instanceof Error){if(t instanceof chunk5DWQGEM2_cjs.b){let n=t.extensions||={};n.code||="GRAPHQL_PARSE_FAILED";let s=n.http||={};s.spec||=true,s.status||=400;}}else Hy(e.method,t,r);}}}}chunkBUNLC3II_cjs.h();function Mu({id:t=Date.now().toString(),logger:e=console,endpoint:r="/health"}={}){return {onRequest({endResponse:n,fetchAPI:s,request:i}){if(i.url.endsWith(r)){e.debug("Responding Health Check");let o=new s.Response(null,{status:200,headers:{"x-yoga-id":t}});n(o);}}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ot=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$u=new Set,$i=typeof process=="object"&&process?process:{},Nu=(t,e,r,n)=>{typeof $i.emitWarning=="function"?$i.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},xn=globalThis.AbortController,Bu=globalThis.AbortSignal;if(typeof xn>"u"){Bu=class{onabort;_onabort=[];reason;aborted=false;addEventListener(n,s){this._onabort.push(s);}},xn=class{constructor(){e();}signal=new Bu;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=true;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=$i.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,Nu("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var Vy=t=>!$u.has(t);var Ke=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Gu=t=>Ke(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ft:null:null,Ft=class extends Array{constructor(e){super(e),this.fill(0);}},Ni=class t{heap;length;static#o=false;static create(e){let r=Gu(e);if(!r)return [];t.#o=true;let n=new t(e,r);return t.#o=false,n}constructor(e,r){if(!t.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},_n=class t{#o;#r;#n;#t;#p;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#y;#l;#i;#e;#m;#b;#f;#u;#c;#h;#E;#g;#x;#P;#v;#d;static unsafeExposeInternals(e){return {starts:e.#g,ttls:e.#x,sizes:e.#E,keyMap:e.#l,keyList:e.#i,valList:e.#e,next:e.#m,prev:e.#b,get head(){return e.#f},get tail(){return e.#u},free:e.#c,isBackgroundFetch:r=>e.#a(r),backgroundFetch:(r,n,s,i)=>e.#q(r,n,s,i),moveToTail:r=>e.#I(r),indexes:r=>e.#C(r),rindexes:r=>e.#R(r),isStale:r=>e.#_(r)}}get max(){return this.#o}get maxSize(){return this.#r}get calculatedSize(){return this.#y}get size(){return this.#s}get fetchMethod(){return this.#p}get memoMethod(){return this.#w}get dispose(){return this.#n}get disposeAfter(){return this.#t}constructor(e){let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:h,noUpdateTTL:d,maxSize:p=0,maxEntrySize:x=0,sizeCalculation:S,fetchMethod:R,memoMethod:C,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:P}=e;if(r!==0&&!Ke(r))throw new TypeError("max option must be a nonnegative integer");let L=r?Gu(r):Array;if(!L)throw new Error("invalid max value: "+r);if(this.#o=r,this.#r=p,this.maxEntrySize=x||this.#r,this.sizeCalculation=S,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=C,R!==void 0&&typeof R!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#p=R,this.#v=!!R,this.#l=new Map,this.#i=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#m=new L(r),this.#b=new L(r),this.#f=0,this.#u=0,this.#c=Ni.create(r),this.#s=0,this.#y=0,typeof l=="function"&&(this.#n=l),typeof u=="function"?(this.#t=u,this.#h=[]):(this.#t=void 0,this.#h=void 0),this.#P=!!this.#n,this.#d=!!this.#t,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!D,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#r!==0&&!Ke(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Ke(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#S();}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ke(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Ke(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T();}if(this.#o===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#r){let y="LRU_CACHE_UNBOUNDED";Vy(y)&&($u.add(y),Nu("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",y,t));}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#T(){let e=new Ft(this.#o),r=new Ft(this.#o);this.#x=e,this.#g=r,this.#F=(i,o,a=Ot.now())=>{if(r[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#_(i)&&this.#A(this.#i[i],"expire");},o+1);c.unref&&c.unref();}},this.#L=i=>{r[i]=e[i]!==0?Ot.now():0;},this.#k=(i,o)=>{if(e[o]){let a=e[o],c=r[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=n||s();let l=i.now-c;i.remainingTTL=a-l;}};let n=0,s=()=>{let i=Ot.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=this.#l.get(i);if(o===void 0)return 0;let a=e[o],c=r[o];if(!a||!c)return 1/0;let l=(n||s())-c;return a-l},this.#_=i=>{let o=r[i],a=e[i];return !!a&&!!o&&(n||s())-o>a};}#L=()=>{};#k=()=>{};#F=()=>{};#_=()=>false;#S(){let e=new Ft(this.#o);this.#y=0,this.#E=e,this.#O=r=>{this.#y-=e[r],e[r]=0;},this.#U=(r,n,s,i)=>{if(this.#a(n))return 0;if(!Ke(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!Ke(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#D=(r,n,s)=>{if(e[r]=n,this.#r){let i=this.#r-e[r];for(;this.#y>i;)this.#j(true);}this.#y+=e[r],s&&(s.entrySize=n,s.totalCalculatedSize=this.#y);};}#O=e=>{};#D=(e,r,n)=>{};#U=(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#u;!(!this.#M(r)||((e||!this.#_(r))&&(yield r),r===this.#f));)r=this.#b[r];}*#R({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#f;!(!this.#M(r)||((e||!this.#_(r))&&(yield r),r===this.#u));)r=this.#m[r];}#M(e){return e!==void 0&&this.#l.get(this.#i[e])===e}*entries(){for(let e of this.#C())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#a(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*rentries(){for(let e of this.#R())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#a(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*keys(){for(let e of this.#C()){let r=this.#i[e];r!==void 0&&!this.#a(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#R()){let r=this.#i[e];r!==void 0&&!this.#a(this.#e[e])&&(yield r);}}*values(){for(let e of this.#C())this.#e[e]!==void 0&&!this.#a(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#R())this.#e[e]!==void 0&&!this.#a(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#C()){let s=this.#e[n],i=this.#a(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#i[n],this))return this.get(this.#i[n],r)}}forEach(e,r=this){for(let n of this.#C()){let s=this.#e[n],i=this.#a(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#i[n],this);}}rforEach(e,r=this){for(let n of this.#R()){let s=this.#e[n],i=this.#a(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#i[n],this);}}purgeStale(){let e=false;for(let r of this.#R({allowStale:true}))this.#_(r)&&(this.#A(this.#i[r],"expire"),e=true);return e}info(e){let r=this.#l.get(e);if(r===void 0)return;let n=this.#e[r],s=this.#a(n)?n.__staleWhileFetching:n;if(s===void 0)return;let i={value:s};if(this.#x&&this.#g){let o=this.#x[r],a=this.#g[r];if(o&&a){let c=o-(Ot.now()-a);i.ttl=c,i.start=Date.now();}}return this.#E&&(i.size=this.#E[r]),i}dump(){let e=[];for(let r of this.#C({allowStale:true})){let n=this.#i[r],s=this.#e[r],i=this.#a(s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#x&&this.#g){o.ttl=this.#x[r];let a=Ot.now()-this.#g[r];o.start=Math.floor(Date.now()-a);}this.#E&&(o.size=this.#E[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=Ot.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#U(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),this.#A(e,"set"),this;let h=this.#s===0?void 0:this.#l.get(e);if(h===void 0)h=this.#s===0?this.#u:this.#c.length!==0?this.#c.pop():this.#s===this.#o?this.#j(false):this.#s,this.#i[h]=e,this.#e[h]=r,this.#l.set(e,h),this.#m[this.#u]=h,this.#b[h]=this.#u,this.#u=h,this.#s++,this.#D(h,u,c),c&&(c.set="add"),l=false;else {this.#I(h);let d=this.#e[h];if(r!==d){if(this.#v&&this.#a(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!o&&(this.#P&&this.#n?.(p,e,"set"),this.#d&&this.#h?.push([p,e,"set"]));}else o||(this.#P&&this.#n?.(d,e,"set"),this.#d&&this.#h?.push([d,e,"set"]));if(this.#O(h),this.#D(h,u,c),this.#e[h]=r,c){c.set="replace";let p=d&&this.#a(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");}if(s!==0&&!this.#x&&this.#T(),this.#x&&(l||this.#F(h,s,i),c&&this.#k(c,h)),!o&&this.#d&&this.#h){let d=this.#h,p;for(;p=d?.shift();)this.#t?.(...p);}return this}pop(){try{for(;this.#s;){let e=this.#e[this.#f];if(this.#j(!0),this.#a(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#d&&this.#h){let e=this.#h,r;for(;r=e?.shift();)this.#t?.(...r);}}}#j(e){let r=this.#f,n=this.#i[r],s=this.#e[r];return this.#v&&this.#a(s)?s.__abortController.abort(new Error("evicted")):(this.#P||this.#d)&&(this.#P&&this.#n?.(s,n,"evict"),this.#d&&this.#h?.push([s,n,"evict"])),this.#O(r),e&&(this.#i[r]=void 0,this.#e[r]=void 0,this.#c.push(r)),this.#s===1?(this.#f=this.#u=0,this.#c.length=0):this.#f=this.#m[r],this.#l.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=this.#l.get(e);if(i!==void 0){let o=this.#e[i];if(this.#a(o)&&o.__staleWhileFetching===void 0)return false;if(this.#_(i))s&&(s.has="stale",this.#k(s,i));else return n&&this.#L(i),s&&(s.has="hit",this.#k(s,i)),true}else s&&(s.has="miss");return false}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=this.#l.get(e);if(s===void 0||!n&&this.#_(s))return;let i=this.#e[s];return this.#a(i)?i.__staleWhileFetching:i}#q(e,r,n,s){let i=r===void 0?void 0:this.#e[r];if(this.#a(i))return i;let o=new xn,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(S,R=false)=>{let{aborted:C}=o.signal,D=n.ignoreFetchAbort&&S!==void 0;if(n.status&&(C&&!R?(n.status.fetchAborted=true,n.status.fetchError=o.signal.reason,D&&(n.status.fetchAbortIgnored=true)):n.status.fetchResolved=true),C&&!D&&!R)return h(o.signal.reason);let E=p;return this.#e[r]===p&&(S===void 0?E.__staleWhileFetching?this.#e[r]=E.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=true),this.set(e,S,c.options))),S},u=S=>(n.status&&(n.status.fetchRejected=true,n.status.fetchError=S),h(S)),h=S=>{let{aborted:R}=o.signal,C=R&&n.allowStaleOnFetchAbort,D=C||n.allowStaleOnFetchRejection,E=D||n.noDeleteOnFetchRejection,T=p;if(this.#e[r]===p&&(!E||T.__staleWhileFetching===void 0?this.#A(e,"fetch"):C||(this.#e[r]=T.__staleWhileFetching)),D)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=true),T.__staleWhileFetching;if(T.__returned===T)throw S},d=(S,R)=>{let C=this.#p?.(e,i,c);C&&C instanceof Promise&&C.then(D=>S(D===void 0?void 0:D),R),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(S(void 0),n.allowStaleOnFetchAbort&&(S=D=>l(D,true)));});};n.status&&(n.status.fetchDispatched=true);let p=new Promise(d).then(l,u),x=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,x,{...c.options,status:void 0}),r=this.#l.get(e)):this.#e[r]=x,x}#a(e){if(!this.#v)return false;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof xn}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:S,forceRefresh:R=false,status:C,signal:D}=r;if(!this.#v)return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:C});let E={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:x,ignoreFetchAbort:p,status:C,signal:D},T=this.#l.get(e);if(T===void 0){C&&(C.fetch="miss");let w=this.#q(e,T,E,S);return w.__returned=w}else {let w=this.#e[T];if(this.#a(w)){let _=n&&w.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",_&&(C.returnedStale=true)),_?w.__staleWhileFetching:w.__returned=w}let P=this.#_(T);if(!R&&!P)return C&&(C.fetch="hit"),this.#I(T),s&&this.#L(T),C&&this.#k(C,T),w;let L=this.#q(e,T,E,S),g=L.__staleWhileFetching!==void 0&&n;return C&&(C.fetch=P?"stale":"refresh",g&&P&&(C.returnedStale=true)),g?L.__staleWhileFetching:L.__returned=L}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#w;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=r,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,a=this.#l.get(e);if(a!==void 0){let c=this.#e[a],l=this.#a(c);return o&&this.#k(o,a),this.#_(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),n?c.__staleWhileFetching:void 0):(i||this.#A(e,"expire"),o&&n&&(o.returnedStale=true),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#I(a),s&&this.#L(a),c))}else o&&(o.get="miss");}#B(e,r){this.#b[r]=e,this.#m[e]=r;}#I(e){e!==this.#u&&(e===this.#f?this.#f=this.#m[e]:this.#B(this.#b[e],this.#m[e]),this.#B(this.#u,e),this.#u=e);}delete(e){return this.#A(e,"delete")}#A(e,r){let n=false;if(this.#s!==0){let s=this.#l.get(e);if(s!==void 0)if(n=true,this.#s===1)this.#$(r);else {this.#O(s);let i=this.#e[s];if(this.#a(i)?i.__abortController.abort(new Error("deleted")):(this.#P||this.#d)&&(this.#P&&this.#n?.(i,e,r),this.#d&&this.#h?.push([i,e,r])),this.#l.delete(e),this.#i[s]=void 0,this.#e[s]=void 0,s===this.#u)this.#u=this.#b[s];else if(s===this.#f)this.#f=this.#m[s];else {let o=this.#b[s];this.#m[o]=this.#m[s];let a=this.#m[s];this.#b[a]=this.#b[s];}this.#s--,this.#c.push(s);}}if(this.#d&&this.#h?.length){let s=this.#h,i;for(;i=s?.shift();)this.#t?.(...i);}return n}clear(){return this.#$("delete")}#$(e){for(let r of this.#R({allowStale:true})){let n=this.#e[r];if(this.#a(n))n.__abortController.abort(new Error("deleted"));else {let s=this.#i[r];this.#P&&this.#n?.(n,s,e),this.#d&&this.#h?.push([n,s,e]);}}if(this.#l.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#x&&this.#g&&(this.#x.fill(0),this.#g.fill(0)),this.#E&&this.#E.fill(0),this.#f=0,this.#u=0,this.#c.length=0,this.#y=0,this.#s=0,this.#d&&this.#h){let r=this.#h,n;for(;n=r?.shift();)this.#t?.(...n);}}};var Wy=1024,Ky=36e5;function wn({max:t=Wy,ttl:e=Ky}={}){return new _n({max:t,ttl:e})}function zu({documentCache:t=wn(),errorCache:e=wn(),validationCache:r=true}){let n=wn();return {onParse({params:s,setParsedDocument:i}){let o=s.source.toString(),a=t.get(o);if(a){i(a);return}let c=e.get(o);if(c)throw c;return ({result:l})=>{l!=null&&(l instanceof Error?e.set(o,l):t.set(o,l));}},onValidate({params:{schema:s,documentAST:i,rules:o},setResult:a}){if(s!=null&&r!==false){let c=o?.map(d=>d.name).join(",")||"",l=n.get(c);l||(l=new WeakMap,n.set(c,l));let u=l.get(s);u||(u=new WeakMap,l.set(s,u));let h=u.get(i);if(h){a(h);return}return ({result:d})=>{d!=null&&u?.set(i,d);}}}}}chunkBUNLC3II_cjs.h();var Qy=()=>true;function It(t){let e=t.match||Qy;return {onRequestParse({request:r,setRequestParser:n}){e(r)&&n(t.parse);}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function Hu(t){let e=(t.headers.get("accept")||"*/*").replace(/\s/g,"").toLowerCase().split(","),r=[];for(let n of e){let[s,...i]=n.split(";");s===void 0||(i?.find(a=>a.includes("charset="))||"charset=utf-8")!=="charset=utf-8"||r.push(s);}return r.reverse()}function Vu(t,e){let[r,n]=t.split("/"),[s,i]=e.split("/");return (s==="*"||s===r)&&(i==="*"||i===n)}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function Dt(t){if(Array.isArray(t))return `[${t.map(n=>{let s=Wu(n);return (n.stringify||JSON.stringify)(s)}).join(",")}]`;let e=Wu(t);return (t.stringify||JSON.stringify)(e)}function Wu(t){if(t.errors?.length||t.extensions?.http){let e={...t};if(e.errors&&=e.errors.map(Ku),e.extensions){let{http:r,...n}=t.extensions;e.extensions=Object.keys(n).length?n:void 0;}return e}return t}function Ku(t){if(Re(t)){let e="toJSON"in t&&typeof t.toJSON=="function"?t.toJSON():Object(t),{http:r,unexpected:n,...s}=e.extensions||{};return U(t.message,{nodes:t.nodes,source:t.source,positions:t.positions,path:t.path,originalError:Ku(t.originalError||void 0),extensions:Object.keys(s).length?s:void 0,coordinate:yn(t)})}return t}function Qu(t,e){let n=Lt(t,{Connection:"keep-alive","Content-Type":'multipart/mixed; boundary="-"',"Transfer-Encoding":"chunked"}),s,i=new e.TextEncoder,o=new e.ReadableStream({start(a){if(le(t))s=t[Symbol.asyncIterator]();else {let c=false;s={next:()=>c?$({done:true,value:null}):(c=true,$({done:false,value:t}))};}a.enqueue(i.encode(`\r
|
|
23
23
|
`)),a.enqueue(i.encode("---"));},pull(a){return k(()=>s.next(),({done:c,value:l})=>{if(l!=null){a.enqueue(i.encode(`\r
|
|
24
24
|
`)),a.enqueue(i.encode("Content-Type: application/json; charset=utf-8")),a.enqueue(i.encode(`\r
|
|
25
25
|
`));let u=Dt(l),h=i.encode(u);a.enqueue(i.encode("Content-Length: "+h.byteLength)),a.enqueue(i.encode(`\r
|
|
@@ -36,7 +36,7 @@ ${e.join(`
|
|
|
36
36
|
`));}h.done&&(u.enqueue(c.encode(`event: complete
|
|
37
37
|
`)),u.enqueue(c.encode(`data:
|
|
38
38
|
|
|
39
|
-
`)),clearInterval(a),u.close());},h=>{u.error(h);})},cancel(u){if(clearInterval(a),o.return)return k(()=>o.return?.(u),()=>{})}});return new r.Response(l,i)}}var Zy={mediaTypes:["multipart/mixed"],asyncIterables:true,processResult:Qu};function Jy(){return {mediaTypes:["text/event-stream"],asyncIterables:true,processResult:Ju()}}var Yu={mediaTypes:["application/graphql-response+json","application/json"],asyncIterables:false,processResult:Zu};function Xu(){let t=new WeakMap,e=Jy(),r=[e,Zy,Yu],n=[e,Yu];return {onSubscribe({args:{contextValue:s}}){s.request&&t.set(s.request,true);},onResultProcess({request:s,result:i,acceptableMediaTypes:o,setResultProcessor:a}){let l=t.get(s)?n:r,u=zu(s),h=le(i);for(let d of l)for(let p of u)if(!(h&&!d.asyncIterables))for(let x of d.mediaTypes)o.push(x),Vu(x,p)&&a(d.processResult,x);}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var ef=`<!doctype html><html lang=en><head><meta charset=utf-8><title>Welcome to GraphQL Yoga</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><style>body,html{padding:0;margin:0;height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif;color:#fff;background-color:#000}main>section.hero{display:flex;height:90vh;justify-content:center;align-items:center;flex-direction:column}.logo{display:flex;align-items:center}.buttons{margin-top:24px}h1{font-size:80px}h2{color:#888;max-width:50%;margin-top:0;text-align:center}a{color:#fff;text-decoration:none;margin-left:10px;margin-right:10px;font-weight:700;transition:color .3s ease;padding:4px;overflow:visible}a.graphiql:hover{color:rgba(255,0,255,.7)}a.docs:hover{color:rgba(28,200,238,.7)}a.tutorial:hover{color:rgba(125,85,245,.7)}svg{margin-right:24px}.not-what-your-looking-for{margin-top:5vh}.not-what-your-looking-for>*{margin-left:auto;margin-right:auto}.not-what-your-looking-for>p{text-align:center}.not-what-your-looking-for>h2{color:#464646}.not-what-your-looking-for>p{max-width:600px;line-height:1.3em}.not-what-your-looking-for>pre{max-width:300px}</style></head><body id=body><main><section class=hero><div class=logo><div><svg xmlns=http://www.w3.org/2000/svg viewBox="-0.41 0.445 472.812 499.811" height=150><defs><linearGradient id=paint0_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint1_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint2_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint3_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint4_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint5_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter0_f_1677_11483 x=23 y=-25 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter1_f_1677_11483 x=-24 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><linearGradient id=paint6_linear_1677_11483 x1=30 y1=28 x2=66.1645 y2=44.4363 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter2_f_1677_11483 x=-12 y=-44 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter3_f_1677_11483 x=13 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter></defs><mask id=mask0_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=16 y=14 width=58 height=62><path d="M21 25.3501C21.7279 25.3501 22.4195 25.5056 23.0433 25.7853L42.1439 14.8C43.0439 14.3 44.1439 14 45.1439 14C46.2439 14 47.2439 14.3 48.1439 14.8L64.5439 24.3C63.3439 25.1 62.4439 26.3 61.8439 27.7L45.9438 18.5C45.6439 18.3 45.344 18.3 45.0441 18.3C44.7441 18.3 44.4439 18.4 44.1439 18.5L25.8225 29.0251C25.9382 29.4471 26 29.8914 26 30.3501C26 33.1115 23.7614 35.3501 21 35.3501C18.2386 35.3501 16 33.1115 16 30.3501C16 27.5887 18.2386 25.3501 21 25.3501Z" fill=url(#paint3_linear_1677_11483) /><path d="M67.2438 35.0329C65.3487 34.3219 64 32.4934 64 30.35C64 27.5886 66.2386 25.35 69 25.35C71.7614 25.35 74 27.5886 74 30.35C74 32.1825 73.0142 33.7848 71.5439 34.6554V55.2C71.5439 57.4 70.3439 59.4 68.5439 60.5L52.1439 69.9C52.1439 68.4 51.6438 66.9 50.7438 65.8L66.3439 56.8C66.9439 56.5 67.2438 55.9 67.2438 55.2V35.0329Z" fill=url(#paint4_linear_1677_11483) /><path d="M49.8439 69.1055C49.9458 69.5034 50 69.9204 50 70.3501C50 73.1115 47.7614 75.3501 45 75.3501C42.5102 75.3501 40.4454 73.5302 40.0633 71.1481L21.8439 60.6C19.9439 59.5 18.8439 57.5 18.8439 55.3V36.8C19.5439 37 20.3439 37.2 21.0439 37.2C21.7439 37.2 22.4439 37.1 23.0439 36.9V55.3C23.0439 56 23.4438 56.6 23.9438 56.9L41.3263 66.9583C42.2398 65.9694 43.5476 65.3501 45 65.3501C47.3291 65.3501 49.2862 66.9426 49.8419 69.0981L49.8436 69.0997L49.8439 69.1055Z" fill=url(#paint5_linear_1677_11483) /></mask><mask id=mask1_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=30 y=28 width=30 height=30><path fill-rule=evenodd clip-rule=evenodd d="M49.3945 32.3945C49.3945 34.7088 47.5796 38.5469 45 38.5469C42.4271 38.5469 40.6055 34.7112 40.6055 32.3945C40.6055 29.9714 42.5769 28 45 28C47.4231 28 49.3945 29.9714 49.3945 32.3945ZM35.332 49.0433V48.2148C35.332 42.8117 37.8535 41.0004 39.8796 39.545L39.8801 39.5447C40.3928 39.1767 40.8604 38.8404 41.2488 38.4742C42.3293 39.6642 43.626 40.3047 45 40.3047C46.3752 40.3047 47.6725 39.6642 48.7529 38.4754C49.1408 38.841 49.6078 39.1773 50.1199 39.5447L50.1204 39.545C52.1465 41.0004 54.668 42.8117 54.668 48.2148V49.0433L53.8406 49.092C49.9848 49.3185 46.8646 46.9002 45 43.5777C43.1159 46.935 39.9847 49.318 36.1594 49.092L35.332 49.0433ZM58.1463 51.0747L58.1463 51.0746C57.0179 50.891 50.0128 49.7507 45.0007 55.693C40.0116 49.7553 33.1965 50.8592 31.9095 51.0677L31.9095 51.0677C31.7906 51.087 31.7189 51.0986 31.7002 51.0963C31.7005 51.0969 31.7011 51.1045 31.7023 51.1187C31.726 51.4003 31.9682 54.2745 34.0566 56.2422L30 58H60L55.8956 56.2422C57.8537 54.4764 58.1396 52.2685 58.2508 51.4092V51.4091C58.2697 51.2628 58.2836 51.1556 58.2998 51.0963C58.2881 51.0977 58.2356 51.0892 58.1463 51.0747ZM40.4836 50.104C42.3956 49.3212 43.6746 48.1737 45 46.61C46.332 48.1841 47.6159 49.3259 49.5164 50.104C49.5356 50.1425 49.5557 50.1805 49.5756 50.2182C49.5793 50.2253 49.583 50.2323 49.5867 50.2393C48.0911 50.8127 46.4264 51.825 45.0047 53.1444C43.5906 51.8221 41.9673 50.8196 40.4256 50.2153C40.4455 50.1784 40.4648 50.1415 40.4836 50.104Z" fill=black /></mask><path d="M 40.59 93.095 C 46.517 93.095 52.14 94.365 57.22 96.635 L 212.7 7.22 C 220.025 3.149 228.978 0.706 237.12 0.706 C 246.073 0.706 254.213 3.149 261.54 7.22 L 395.032 84.547 C 385.264 91.059 377.939 100.827 373.055 112.224 L 243.631 37.338 C 241.19 35.71 238.747 35.71 236.305 35.71 C 233.863 35.71 231.42 36.523 228.978 37.338 L 79.84 123.009 C 80.786 126.443 81.29 130.058 81.29 133.793 C 81.29 156.269 63.065 174.493 40.59 174.493 C 18.116 174.493 -0.109 156.269 -0.109 133.793 C -0.109 111.32 18.116 93.095 40.59 93.095 Z" fill=url(#paint0_linear_1677_11483) /><path d="M 417.01 171.913 C 401.585 166.126 390.603 151.238 390.603 133.793 C 390.603 111.32 408.83 93.095 431.303 93.095 C 453.777 93.095 472.001 111.32 472.001 133.793 C 472.001 148.706 463.976 161.755 452.011 168.835 L 452.011 336.07 C 452.011 353.977 442.243 370.258 427.591 379.21 L 294.098 455.726 C 294.098 443.516 290.029 431.306 282.703 422.353 L 409.683 349.093 C 414.568 346.651 417.01 341.767 417.01 336.07 L 417.01 171.913 Z" fill=url(#paint1_linear_1677_11483) /><path d="M 275.376 449.253 C 276.206 452.495 276.646 455.889 276.646 459.389 C 276.646 481.863 258.422 500.087 235.947 500.087 C 215.679 500.087 198.87 485.272 195.761 465.883 L 47.46 380.025 C 31.995 371.071 23.041 354.792 23.041 336.884 L 23.041 186.296 C 28.738 187.923 35.25 189.553 40.948 189.553 C 46.646 189.553 52.345 188.738 57.228 187.111 L 57.228 336.884 C 57.228 342.582 60.485 347.465 64.554 349.908 L 206.042 431.777 C 213.481 423.728 224.127 418.689 235.947 418.689 C 254.905 418.689 270.833 431.656 275.36 449.196 L 275.376 449.214 L 275.376 449.253 Z" fill=url(#paint2_linear_1677_11483) /><g mask=url(#mask0_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter0_f_1677_11483)><circle cx=73 cy=25 r=26 fill=#ED2E7E /></g><g filter=url(#filter1_f_1677_11483)><circle cx=26 cy=69 r=26 fill=#1CC8EE /></g></g><path fill-rule=evenodd clip-rule=evenodd d="M 271.713 150.431 C 271.713 169.275 256.948 200.517 235.947 200.517 C 215.003 200.517 200.172 169.292 200.172 150.431 C 200.172 130.708 216.225 114.666 235.947 114.666 C 255.67 114.666 271.713 130.708 271.713 150.431 Z M 157.251 285.952 L 157.251 279.212 C 157.251 235.233 177.771 220.485 194.27 208.641 C 198.447 205.644 202.247 202.901 205.414 199.923 C 214.204 209.608 224.763 214.826 235.947 214.826 C 247.138 214.826 257.697 209.608 266.496 199.931 C 269.653 202.911 273.456 205.644 277.622 208.641 C 294.114 220.485 314.642 235.233 314.642 279.212 L 314.642 285.952 L 307.912 286.351 C 276.525 288.191 251.128 268.509 235.947 241.468 C 220.611 268.795 195.126 288.191 163.981 286.351 L 157.251 285.952 Z M 342.953 302.492 C 333.771 300.994 276.751 291.715 235.955 340.082 C 195.345 291.749 139.865 300.734 129.389 302.436 C 128.428 302.59 127.841 302.688 127.687 302.665 C 127.687 302.673 127.695 302.729 127.702 302.85 C 127.897 305.138 129.867 328.532 146.872 344.55 L 113.849 358.862 L 358.044 358.862 L 324.639 344.55 C 340.576 330.177 342.905 312.202 343.807 305.212 C 343.962 304.022 344.077 303.153 344.206 302.665 C 344.108 302.68 343.686 302.606 342.953 302.492 Z M 199.188 294.59 C 214.751 288.215 225.161 278.879 235.947 266.15 C 246.788 278.96 257.241 288.255 272.707 294.59 C 272.869 294.898 273.031 295.207 273.196 295.518 C 273.219 295.574 273.252 295.631 273.285 295.688 C 261.107 300.361 247.555 308.598 235.989 319.334 C 224.477 308.573 211.258 300.417 198.715 295.493 C 198.87 295.191 199.033 294.891 199.188 294.59 Z" fill=url(#paint6_linear_1677_11483) /><g mask=url(#mask1_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter2_f_1677_11483)><circle cx=38 cy=6 r=26 fill=#ED2E7E /></g><g filter=url(#filter3_f_1677_11483)><circle cx=63 cy=69 r=26 fill=#1CC8EE /></g></g></svg></div><h1>GraphQL Yoga</h1><p>Version: 5.21.2</p></div><h2>The batteries-included cross-platform GraphQL Server.</h2><div class=buttons><a href=https://www.the-guild.dev/graphql/yoga-server/docs class=docs>Read the Docs</a> <a href=https://www.the-guild.dev/graphql/yoga-server/tutorial/basic class=tutorial>Start the Tutorial </a><a href=__GRAPHIQL_LINK__ class=graphiql>Visit GraphiQL</a></div></section><section class=not-what-your-looking-for><h2>Not the page you are looking for? \u{1F440}</h2><p>This page is shown be default whenever a 404 is hit.<br>You can disable this by behavior via the <code>landingPage</code> option.</p><pre>
|
|
39
|
+
`)),clearInterval(a),u.close());},h=>{u.error(h);})},cancel(u){if(clearInterval(a),o.return)return k(()=>o.return?.(u),()=>{})}});return new r.Response(l,i)}}var Zy={mediaTypes:["multipart/mixed"],asyncIterables:true,processResult:Qu};function Jy(){return {mediaTypes:["text/event-stream"],asyncIterables:true,processResult:Ju()}}var Yu={mediaTypes:["application/graphql-response+json","application/json"],asyncIterables:false,processResult:Zu};function Xu(){let t=new WeakMap,e=Jy(),r=[e,Zy,Yu],n=[e,Yu];return {onSubscribe({args:{contextValue:s}}){s.request&&t.set(s.request,true);},onResultProcess({request:s,result:i,acceptableMediaTypes:o,setResultProcessor:a}){let l=t.get(s)?n:r,u=Hu(s),h=le(i);for(let d of l)for(let p of u)if(!(h&&!d.asyncIterables))for(let x of d.mediaTypes)o.push(x),Vu(x,p)&&a(d.processResult,x);}}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var ef=`<!doctype html><html lang=en><head><meta charset=utf-8><title>Welcome to GraphQL Yoga</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><style>body,html{padding:0;margin:0;height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif;color:#fff;background-color:#000}main>section.hero{display:flex;height:90vh;justify-content:center;align-items:center;flex-direction:column}.logo{display:flex;align-items:center}.buttons{margin-top:24px}h1{font-size:80px}h2{color:#888;max-width:50%;margin-top:0;text-align:center}a{color:#fff;text-decoration:none;margin-left:10px;margin-right:10px;font-weight:700;transition:color .3s ease;padding:4px;overflow:visible}a.graphiql:hover{color:rgba(255,0,255,.7)}a.docs:hover{color:rgba(28,200,238,.7)}a.tutorial:hover{color:rgba(125,85,245,.7)}svg{margin-right:24px}.not-what-your-looking-for{margin-top:5vh}.not-what-your-looking-for>*{margin-left:auto;margin-right:auto}.not-what-your-looking-for>p{text-align:center}.not-what-your-looking-for>h2{color:#464646}.not-what-your-looking-for>p{max-width:600px;line-height:1.3em}.not-what-your-looking-for>pre{max-width:300px}</style></head><body id=body><main><section class=hero><div class=logo><div><svg xmlns=http://www.w3.org/2000/svg viewBox="-0.41 0.445 472.812 499.811" height=150><defs><linearGradient id=paint0_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint1_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint2_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint3_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint4_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint5_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter0_f_1677_11483 x=23 y=-25 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter1_f_1677_11483 x=-24 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><linearGradient id=paint6_linear_1677_11483 x1=30 y1=28 x2=66.1645 y2=44.4363 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter2_f_1677_11483 x=-12 y=-44 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter3_f_1677_11483 x=13 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter></defs><mask id=mask0_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=16 y=14 width=58 height=62><path d="M21 25.3501C21.7279 25.3501 22.4195 25.5056 23.0433 25.7853L42.1439 14.8C43.0439 14.3 44.1439 14 45.1439 14C46.2439 14 47.2439 14.3 48.1439 14.8L64.5439 24.3C63.3439 25.1 62.4439 26.3 61.8439 27.7L45.9438 18.5C45.6439 18.3 45.344 18.3 45.0441 18.3C44.7441 18.3 44.4439 18.4 44.1439 18.5L25.8225 29.0251C25.9382 29.4471 26 29.8914 26 30.3501C26 33.1115 23.7614 35.3501 21 35.3501C18.2386 35.3501 16 33.1115 16 30.3501C16 27.5887 18.2386 25.3501 21 25.3501Z" fill=url(#paint3_linear_1677_11483) /><path d="M67.2438 35.0329C65.3487 34.3219 64 32.4934 64 30.35C64 27.5886 66.2386 25.35 69 25.35C71.7614 25.35 74 27.5886 74 30.35C74 32.1825 73.0142 33.7848 71.5439 34.6554V55.2C71.5439 57.4 70.3439 59.4 68.5439 60.5L52.1439 69.9C52.1439 68.4 51.6438 66.9 50.7438 65.8L66.3439 56.8C66.9439 56.5 67.2438 55.9 67.2438 55.2V35.0329Z" fill=url(#paint4_linear_1677_11483) /><path d="M49.8439 69.1055C49.9458 69.5034 50 69.9204 50 70.3501C50 73.1115 47.7614 75.3501 45 75.3501C42.5102 75.3501 40.4454 73.5302 40.0633 71.1481L21.8439 60.6C19.9439 59.5 18.8439 57.5 18.8439 55.3V36.8C19.5439 37 20.3439 37.2 21.0439 37.2C21.7439 37.2 22.4439 37.1 23.0439 36.9V55.3C23.0439 56 23.4438 56.6 23.9438 56.9L41.3263 66.9583C42.2398 65.9694 43.5476 65.3501 45 65.3501C47.3291 65.3501 49.2862 66.9426 49.8419 69.0981L49.8436 69.0997L49.8439 69.1055Z" fill=url(#paint5_linear_1677_11483) /></mask><mask id=mask1_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=30 y=28 width=30 height=30><path fill-rule=evenodd clip-rule=evenodd d="M49.3945 32.3945C49.3945 34.7088 47.5796 38.5469 45 38.5469C42.4271 38.5469 40.6055 34.7112 40.6055 32.3945C40.6055 29.9714 42.5769 28 45 28C47.4231 28 49.3945 29.9714 49.3945 32.3945ZM35.332 49.0433V48.2148C35.332 42.8117 37.8535 41.0004 39.8796 39.545L39.8801 39.5447C40.3928 39.1767 40.8604 38.8404 41.2488 38.4742C42.3293 39.6642 43.626 40.3047 45 40.3047C46.3752 40.3047 47.6725 39.6642 48.7529 38.4754C49.1408 38.841 49.6078 39.1773 50.1199 39.5447L50.1204 39.545C52.1465 41.0004 54.668 42.8117 54.668 48.2148V49.0433L53.8406 49.092C49.9848 49.3185 46.8646 46.9002 45 43.5777C43.1159 46.935 39.9847 49.318 36.1594 49.092L35.332 49.0433ZM58.1463 51.0747L58.1463 51.0746C57.0179 50.891 50.0128 49.7507 45.0007 55.693C40.0116 49.7553 33.1965 50.8592 31.9095 51.0677L31.9095 51.0677C31.7906 51.087 31.7189 51.0986 31.7002 51.0963C31.7005 51.0969 31.7011 51.1045 31.7023 51.1187C31.726 51.4003 31.9682 54.2745 34.0566 56.2422L30 58H60L55.8956 56.2422C57.8537 54.4764 58.1396 52.2685 58.2508 51.4092V51.4091C58.2697 51.2628 58.2836 51.1556 58.2998 51.0963C58.2881 51.0977 58.2356 51.0892 58.1463 51.0747ZM40.4836 50.104C42.3956 49.3212 43.6746 48.1737 45 46.61C46.332 48.1841 47.6159 49.3259 49.5164 50.104C49.5356 50.1425 49.5557 50.1805 49.5756 50.2182C49.5793 50.2253 49.583 50.2323 49.5867 50.2393C48.0911 50.8127 46.4264 51.825 45.0047 53.1444C43.5906 51.8221 41.9673 50.8196 40.4256 50.2153C40.4455 50.1784 40.4648 50.1415 40.4836 50.104Z" fill=black /></mask><path d="M 40.59 93.095 C 46.517 93.095 52.14 94.365 57.22 96.635 L 212.7 7.22 C 220.025 3.149 228.978 0.706 237.12 0.706 C 246.073 0.706 254.213 3.149 261.54 7.22 L 395.032 84.547 C 385.264 91.059 377.939 100.827 373.055 112.224 L 243.631 37.338 C 241.19 35.71 238.747 35.71 236.305 35.71 C 233.863 35.71 231.42 36.523 228.978 37.338 L 79.84 123.009 C 80.786 126.443 81.29 130.058 81.29 133.793 C 81.29 156.269 63.065 174.493 40.59 174.493 C 18.116 174.493 -0.109 156.269 -0.109 133.793 C -0.109 111.32 18.116 93.095 40.59 93.095 Z" fill=url(#paint0_linear_1677_11483) /><path d="M 417.01 171.913 C 401.585 166.126 390.603 151.238 390.603 133.793 C 390.603 111.32 408.83 93.095 431.303 93.095 C 453.777 93.095 472.001 111.32 472.001 133.793 C 472.001 148.706 463.976 161.755 452.011 168.835 L 452.011 336.07 C 452.011 353.977 442.243 370.258 427.591 379.21 L 294.098 455.726 C 294.098 443.516 290.029 431.306 282.703 422.353 L 409.683 349.093 C 414.568 346.651 417.01 341.767 417.01 336.07 L 417.01 171.913 Z" fill=url(#paint1_linear_1677_11483) /><path d="M 275.376 449.253 C 276.206 452.495 276.646 455.889 276.646 459.389 C 276.646 481.863 258.422 500.087 235.947 500.087 C 215.679 500.087 198.87 485.272 195.761 465.883 L 47.46 380.025 C 31.995 371.071 23.041 354.792 23.041 336.884 L 23.041 186.296 C 28.738 187.923 35.25 189.553 40.948 189.553 C 46.646 189.553 52.345 188.738 57.228 187.111 L 57.228 336.884 C 57.228 342.582 60.485 347.465 64.554 349.908 L 206.042 431.777 C 213.481 423.728 224.127 418.689 235.947 418.689 C 254.905 418.689 270.833 431.656 275.36 449.196 L 275.376 449.214 L 275.376 449.253 Z" fill=url(#paint2_linear_1677_11483) /><g mask=url(#mask0_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter0_f_1677_11483)><circle cx=73 cy=25 r=26 fill=#ED2E7E /></g><g filter=url(#filter1_f_1677_11483)><circle cx=26 cy=69 r=26 fill=#1CC8EE /></g></g><path fill-rule=evenodd clip-rule=evenodd d="M 271.713 150.431 C 271.713 169.275 256.948 200.517 235.947 200.517 C 215.003 200.517 200.172 169.292 200.172 150.431 C 200.172 130.708 216.225 114.666 235.947 114.666 C 255.67 114.666 271.713 130.708 271.713 150.431 Z M 157.251 285.952 L 157.251 279.212 C 157.251 235.233 177.771 220.485 194.27 208.641 C 198.447 205.644 202.247 202.901 205.414 199.923 C 214.204 209.608 224.763 214.826 235.947 214.826 C 247.138 214.826 257.697 209.608 266.496 199.931 C 269.653 202.911 273.456 205.644 277.622 208.641 C 294.114 220.485 314.642 235.233 314.642 279.212 L 314.642 285.952 L 307.912 286.351 C 276.525 288.191 251.128 268.509 235.947 241.468 C 220.611 268.795 195.126 288.191 163.981 286.351 L 157.251 285.952 Z M 342.953 302.492 C 333.771 300.994 276.751 291.715 235.955 340.082 C 195.345 291.749 139.865 300.734 129.389 302.436 C 128.428 302.59 127.841 302.688 127.687 302.665 C 127.687 302.673 127.695 302.729 127.702 302.85 C 127.897 305.138 129.867 328.532 146.872 344.55 L 113.849 358.862 L 358.044 358.862 L 324.639 344.55 C 340.576 330.177 342.905 312.202 343.807 305.212 C 343.962 304.022 344.077 303.153 344.206 302.665 C 344.108 302.68 343.686 302.606 342.953 302.492 Z M 199.188 294.59 C 214.751 288.215 225.161 278.879 235.947 266.15 C 246.788 278.96 257.241 288.255 272.707 294.59 C 272.869 294.898 273.031 295.207 273.196 295.518 C 273.219 295.574 273.252 295.631 273.285 295.688 C 261.107 300.361 247.555 308.598 235.989 319.334 C 224.477 308.573 211.258 300.417 198.715 295.493 C 198.87 295.191 199.033 294.891 199.188 294.59 Z" fill=url(#paint6_linear_1677_11483) /><g mask=url(#mask1_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter2_f_1677_11483)><circle cx=38 cy=6 r=26 fill=#ED2E7E /></g><g filter=url(#filter3_f_1677_11483)><circle cx=63 cy=69 r=26 fill=#1CC8EE /></g></g></svg></div><h1>GraphQL Yoga</h1><p>Version: 5.21.2</p></div><h2>The batteries-included cross-platform GraphQL Server.</h2><div class=buttons><a href=https://www.the-guild.dev/graphql/yoga-server/docs class=docs>Read the Docs</a> <a href=https://www.the-guild.dev/graphql/yoga-server/tutorial/basic class=tutorial>Start the Tutorial </a><a href=__GRAPHIQL_LINK__ class=graphiql>Visit GraphiQL</a></div></section><section class=not-what-your-looking-for><h2>Not the page you are looking for? \u{1F440}</h2><p>This page is shown be default whenever a 404 is hit.<br>You can disable this by behavior via the <code>landingPage</code> option.</p><pre>
|
|
40
40
|
<code>
|
|
41
41
|
import { createYoga } from 'graphql-yoga';
|
|
42
42
|
|
|
@@ -52,5 +52,5 @@ const yoga = createYoga({
|
|
|
52
52
|
graphqlEndpoint: '__REQUEST_PATH__',
|
|
53
53
|
})
|
|
54
54
|
</code>
|
|
55
|
-
</pre></section></main></body></html>`;var Yy=function(e){return new e.fetchAPI.Response(ef.replace(/__GRAPHIQL_LINK__/g,e.graphqlEndpoint).replace(/__REQUEST_PATH__/g,e.url.pathname),{status:200,statusText:"OK",headers:{"Content-Type":"text/html"}})};function tf(t){let e=t.landingPageRenderer||Yy;return {onRequest({request:r,fetchAPI:n,endResponse:s,url:i}){let o=t.getGraphQLEndpoint();if(!r.url.endsWith(o)&&!r.url.endsWith(`${o}/`)&&i.pathname!==o&&i.pathname!==`${o}/`&&!t.getGraphQLEndpointURLPattern().test(i)){if(t.showLandingPage===true&&r.method==="GET"&&r.headers?.get("accept")?.includes("text/html")){let a=e({request:r,fetchAPI:n,url:i,graphqlEndpoint:o,get urlPattern(){return t.getGraphQLEndpointURLPattern()}});if(N(a))return a.then(s);s(a);return}s(new n.Response("",{status:404,statusText:"Not Found"}));}}}}chunkBUNLC3II_cjs.h();function Sn({request:t,result:e,fetchAPI:r,onResultProcessHooks:n,serverContext:s}){let i,o=[],a="*/*";return k(()=>K(n,c=>c({request:t,acceptableMediaTypes:o,result:e,setResult(l){e=l;},resultProcessor:i,setResultProcessor(l,u){i=l,a=u;},serverContext:s})),()=>i?i(e,r,a):new r.Response(null,{status:406,statusText:"Not Acceptable",headers:{accept:o.join("; charset=utf-8, ")}}))}function rf({params:t,enveloped:e}){let r=e.parse(t.query),n=e.validate(e.schema,r);return n.length>0?{errors:n}:k(()=>e.contextFactory(),s=>{let i={schema:e.schema,document:r,contextValue:s,variableValues:t.variables,operationName:t.operationName};return (chunkVOQUO2EZ_cjs.F(r,t.operationName)?.operation==="subscription"?e.subscribe:e.execute)(i)})}chunkBUNLC3II_cjs.h();function nf(t){return t?.status&&t?.headers}chunkBUNLC3II_cjs.h();function sf(t){return Re(t)?t.toJSON():t instanceof Error?{message:t.message,stack:t.stack,cause:t.cause}:t}var of=(t,e,r=globalThis.process?.env?.NODE_ENV==="development")=>{if(gn(t))return t;let n={code:"INTERNAL_SERVER_ERROR",unexpected:true},s={extensions:n};return Re(t)?(s.nodes=t.nodes,s.source=t.source,s.positions=t.positions,s.path=t.path,s.coordinate=yn(t),r&&t.originalError&&(n.originalError=sf(t.originalError)),t.extensions?.http&&(n.http=t.extensions.http)):r&&(n.originalError=sf(t)),U(e,s)};var Gi=class{getEnveloped;logger;fetchAPI;plugins;instrumentation;onRequestParseHooks;onParamsHooks;onExecutionResultHooks;onResultProcessHooks;maskedErrorsOpts;id;_graphqlEndpoint;_graphqlEndpointURLPattern;version="5.21.2";constructor(e){if(this.id=e?.id??"yoga",this.fetchAPI={...Xy},e?.fetchAPI)for(let a in e.fetchAPI)e.fetchAPI[a]&&(this.fetchAPI[a]=e.fetchAPI[a]);let r=e?.logging==null?true:e.logging;this.logger=typeof r=="boolean"?r===true?gr():gr("silent"):typeof r=="string"?gr(r):r;let n=typeof e?.maskedErrors=="object"&&e.maskedErrors.maskError||of,s=new WeakSet;this.maskedErrorsOpts=e?.maskedErrors===false?null:{errorMessage:"Unexpected error.",...typeof e?.maskedErrors=="object"?e.maskedErrors:{},maskError:(a,c)=>{if(s.has(a))return a;let l=n(a,c,this.maskedErrorsOpts?.isDev);return l!==a&&this.logger.error(a),s.add(l),l}};let i=this.maskedErrorsOpts==null?null:this.maskedErrorsOpts,o=0;e?.batching&&(typeof e.batching=="boolean"?o=10:o=e.batching.limit??10),this.graphqlEndpoint=e?.graphqlEndpoint||"/graphql",this.plugins=[sa({parse:chunkVOQUO2EZ_cjs.e,validate:chunkVOQUO2EZ_cjs.D,execute:Cr,subscribe:Cr,specifiedRules:chunkVOQUO2EZ_cjs.C}),!!e?.schema&&jo(e.schema),e?.allowedHeaders?.request!=null&&xu(e.allowedHeaders.request),e?.context!=null&&na(a=>e?.context?typeof e.context=="function"?e.context(a):e.context:{}),Mu({id:this.id,logger:this.logger,endpoint:e?.healthCheckEndpoint}),e?.cors!==false&&mu(e?.cors),e?.graphiql!==false&&Do({getGraphQLEndpoint:()=>this._graphqlEndpoint,getGraphQLEndpointURLPattern:()=>this.getUrlPatternForGraphQLEndpoint(),options:e?.graphiql,render:e?.renderGraphiQL,logger:this.logger}),It({match:Pu,parse:vu}),It({match:Au,parse:Lu}),e?.multipart!==false&&It({match:Ou,parse:Fu}),It({match:Cu,parse:Ru}),It({match:Tu,parse:ku}),Xu(),...e?.plugins??[],e?.parserAndValidationCache!==false&&Hu(!e?.parserAndValidationCache||e?.parserAndValidationCache===true?{}:e?.parserAndValidationCache),qu(o),Iu(e?.extraParamNames),tf({getGraphQLEndpoint:()=>this.graphqlEndpoint,getGraphQLEndpointURLPattern:()=>this.getUrlPatternForGraphQLEndpoint(),showLandingPage:e?.landingPage!==false,landingPageRenderer:typeof e?.landingPage=="function"?e.landingPage:void 0}),Du(),Uu(),i!==null&&{onSubscribe(){return {onSubscribeError({error:a}){if(Mi(a))throw a}}}},i!==null&&ra(i),e?.allowedHeaders?.response!=null&&gu(e.allowedHeaders.response),ju()],this.getEnveloped=ea({plugins:this.plugins}),this.plugins=this.getEnveloped._plugins,this.onRequestParseHooks=[],this.onParamsHooks=[],this.onExecutionResultHooks=[],this.onResultProcessHooks=[];for(let a of this.plugins)a&&(a.onYogaInit&&a.onYogaInit({yoga:this}),a.onRequestParse&&this.onRequestParseHooks.push(a.onRequestParse),a.onParams&&this.onParamsHooks.push(a.onParams),a.onExecutionResult&&this.onExecutionResultHooks.push(a.onExecutionResult),a.onResultProcess&&this.onResultProcessHooks.push(a.onResultProcess),a.instrumentation&&(this.instrumentation=this.instrumentation?yt(this.instrumentation,a.instrumentation):a.instrumentation));}get graphqlEndpoint(){return this._graphqlEndpoint}set graphqlEndpoint(e){this._graphqlEndpoint=e,this._graphqlEndpointURLPattern=void 0;}getUrlPatternForGraphQLEndpoint(){return this._graphqlEndpointURLPattern??=new this.fetchAPI.URLPattern({pathname:this._graphqlEndpoint}),this._graphqlEndpointURLPattern}handleParams=({request:e,context:r,params:n})=>{let s=r.request===e?{params:n}:{request:e,params:n};Object.assign(r,s);let i=this.getEnveloped(r);return this.logger.debug("Processing GraphQL Parameters"),k(()=>k(()=>rf({params:n,enveloped:i}),o=>(this.logger.debug("Processing GraphQL Parameters done."),o),o=>({errors:At(o,this.maskedErrorsOpts,this.logger)})),o=>(le(o)&&(o=Oe(o,a=>a,a=>{if(a.name==="AbortError")throw this.logger.debug("Request aborted"),a;return {errors:At(a,this.maskedErrorsOpts,this.logger)}})),o))};getResultForParams=({params:e,request:r},n)=>{let s,i=this.handleParams;return k(()=>K(this.onParamsHooks,o=>o({params:e,request:r,setParams(a){e=a;},paramsHandler:i,setParamsHandler(a){i=a;},setResult(a){s=a;},fetchAPI:this.fetchAPI,context:n})),()=>k(()=>s||i({request:r,params:e,context:n}),o=>k(()=>K(this.onExecutionResultHooks,a=>a({result:o,setResult(c){o=c;},request:r,context:n})),()=>o)))};parseRequest=(e,r)=>{let n=new Proxy({},{get:(a,c,l)=>(n=new this.fetchAPI.URL(e.url,"http://localhost"),Reflect.get(n,c,n))}),s,i,o=[];return k(()=>K(this.onRequestParseHooks,(a,c)=>k(()=>a({request:e,url:n,requestParser:s,serverContext:r,setRequestParser(l){s=l;},endResponse(l){i=l,c();},fetchAPI:this.fetchAPI}),l=>l?.onRequestParseDone),o),()=>i?{response:i}:(this.logger.debug("Parsing request to extract GraphQL parameters"),s?k(()=>s(e),a=>{if(nf(a))return {response:a};let c=a;return k(()=>K(o,l=>l({requestParserResult:c,setRequestParserResult(u){c=u;}})),()=>({requestParserResult:c}))}):{response:new this.fetchAPI.Response(null,{status:415,statusText:"Unsupported Media Type"})}))};handle=(e,r)=>{let n=this.instrumentation&&Xe({request:e}),s=this.instrumentation?.requestParse?n.asyncFn(this.instrumentation?.requestParse,this.parseRequest):this.parseRequest;return Mt($().then(()=>s(e,r)).then(({response:i,requestParserResult:o})=>{if(i)return i;let a=this.instrumentation?.operation?(c,l)=>Xe({context:l,request:c.request}).asyncFn(this.instrumentation?.operation,this.getResultForParams)(c,l):this.getResultForParams;return k(()=>Array.isArray(o)?Promise.all(o.map(c=>$().then(()=>a({params:c,request:e},Object.create(r))).catch(l=>({errors:At(l,this.maskedErrorsOpts,this.logger)})))):a({params:o,request:e},r),c=>(this.instrumentation?.resultProcess?n.asyncFn(this.instrumentation.resultProcess,Sn):Sn)({request:e,result:c,fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:r}))}).catch(i=>{let a={errors:At(i,this.maskedErrorsOpts,this.logger)};return Sn({request:e,result:a,fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:r})}))}};function af(t){let e=new Gi(t);return pu(e,{fetchAPI:e.fetchAPI,plugins:e.plugins,disposeOnProcessTerminate:t.disposeOnProcessTerminate})}chunkBUNLC3II_cjs.h();var eg={aws:{type:"aws",configKey:"s3",displayName:"S3 Compatible (AWS, Backblaze, Wasabi, etc.)",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1",admin:{placeholder:"us-east-1"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"endpoint",type:"text",label:"Endpoint URL",admin:{placeholder:"https://s3.custom.com"}},{name:"cdnUrl",type:"text",label:"CDN URL",admin:{placeholder:"https://cdn.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}]},r2:{type:"r2",configKey:"r2",displayName:"Cloudflare R2",configFields:[{name:"accountId",type:"text",label:"Account ID",required:true,admin:{placeholder:"Your Cloudflare Account ID"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"publicDevUrl",type:"text",label:"Public Dev URL ID",admin:{placeholder:"pub-xxxxxxxxxxxxxxxx",description:"Enter ONLY the ID (e.g., pub-b8d8c4cc8bcf4d868ddd95efc1b305aa). Do NOT include https:// or the full URL. Found in R2 Dashboard \u2192 Public Dev URL."}},{name:"cdnUrl",type:"text",label:"Custom CDN URL",admin:{placeholder:"https://assets.example.com (optional)"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads (optional)",description:"Optional prefix for all object keys. Do not use '/' as prefix."}}]},gcs:{type:"gcs",configKey:"gcs",displayName:"Google Cloud Storage",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"projectId",type:"text",label:"Project ID"},{name:"clientEmail",type:"text",label:"Client Email"},{name:"privateKey",type:"password",label:"Private Key"},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},digitalocean:{type:"digitalocean",configKey:"digitalocean",displayName:"DigitalOcean Spaces",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"nyc3"},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},backblaze:{type:"backblaze",configKey:"backblaze",displayName:"Backblaze B2",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"accountId",type:"text",label:"Account ID"},{name:"applicationKeyId",type:"text",label:"Application Key ID",required:true},{name:"applicationKey",type:"password",label:"Application Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},wasabi:{type:"wasabi",configKey:"wasabi",displayName:"Wasabi",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1"},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]}};function tg(t,e){switch(t){case "r2":return e?.endpoint||`https://${e?.accountId||""}.r2.cloudflarestorage.com`;case "digitalocean":return e?.endpoint||`https://${e?.region||"nyc3"}.digitaloceanspaces.com`;case "backblaze":return e?.endpoint||"https://s3.backblazeb2.com";case "wasabi":return e?.endpoint||`https://s3.${e?.region||"us-east-1"}.wasabisys.com`;default:return e?.endpoint}}function lf(t,e){return {provider:t,bucket:e?.bucket||"",region:e?.region||"us-east-1",accessKeyId:e?.accessKeyId||e?.clientEmail||e?.applicationKeyId||"",secretAccessKey:e?.secretAccessKey||e?.privateKey||e?.applicationKey||"",endpoint:tg(t,e),cdnUrl:e?.cdnUrl,prefix:e?.prefix,accountId:e?.accountId,publicDevUrl:e?.publicDevUrl}}function rg(t,e,r){let n=r[e.configKey]||{};return lf(t,n)}function ng(t,e,r){let n=r?.[e.configKey]||r;return lf(t,n)}var Hi=class extends ge{constructor(){super("@kyro-cms/storage-s3"),this.version="1.0.0",this.description="S3-compatible storage (AWS R2 GCS DigitalOcean Backblaze Wasabi)";}async init(e){let r=e.registry?.storageProviders;if(!r)return;let n=this.name;for(let s of Object.values(eg))r.register({type:s.type,displayName:s.displayName,pluginName:n,configKey:s.configKey,configFields:s.configFields,extractConfig:i=>rg(s.type,s,i),extractRawConfig:i=>ng(s.type,s,i),factory:i=>chunkOUMUIICN_cjs.Xa(i)});}},cf=new Hi;chunkBUNLC3II_cjs.h();var zi=class extends ge{constructor(){super("@kyro-cms/storage-cloudinary"),this.version="1.0.0",this.description="Cloudinary image and video storage";}async init(e){let r=e.registry?.storageProviders;r&&r.register({type:"cloudinary",displayName:"Cloudinary",pluginName:this.name,configKey:"cloudinary",configFields:[{name:"cloudName",type:"text",label:"Cloud Name",required:true},{name:"apiKey",type:"text",label:"API Key",required:true},{name:"apiSecret",type:"password",label:"API Secret",required:true},{name:"folder",type:"text",label:"Folder",admin:{placeholder:"Optional folder path"}},{name:"uploadPreset",type:"text",label:"Upload Preset (optional)",admin:{placeholder:"Leave empty for signed uploads",description:"If not set, uploads will be signed with API Secret"}}],extractConfig:n=>({cloudName:n.cloudinary?.cloudName||"",apiKey:n.cloudinary?.apiKey||"",apiSecret:n.cloudinary?.apiSecret||"",folder:n.cloudinary?.folder,uploadPreset:n.cloudinary?.uploadPreset}),extractRawConfig:n=>{let s=n?.cloudinary||n;return {cloudName:s?.cloudName||"",apiKey:s?.apiKey||"",apiSecret:s?.apiSecret||"",folder:s?.folder,uploadPreset:s?.uploadPreset}},factory:n=>chunkOUMUIICN_cjs.Ya(n)});}},uf=new zi;var sg=[cf,uf];function ct(t,e,r){let n=e.split(".");if(n.length===0)return false;let s=n[0],i=n.slice(1).join(".");for(let o of t){if(o.name===s)if(i){if(o.fields&&Array.isArray(o.fields))return ct(o.fields,i,r);if(o.type==="tabs"&&o.tabs&&Array.isArray(o.tabs)){for(let c of o.tabs)if(c.fields&&Array.isArray(c.fields)&&ct(c.fields,i,r))return true;return false}if(o.type==="blocks"&&o.blocks&&Array.isArray(o.blocks)){let c=i.split(".")[0],l=i.split(".").slice(1).join(".");if(!l)return false;for(let u of o.blocks)if(u.slug===c&&u.fields&&Array.isArray(u.fields))return ct(u.fields,l,r);return false}return o.type==="array"&&o.fields&&Array.isArray(o.fields)?ct(o.fields,i,r):false}else return Object.assign(o,r),true;if(!o.name||o.type==="tabs"||o.type==="row"||o.type==="collapsible"){if(o.fields&&Array.isArray(o.fields)&&ct(o.fields,e,r))return true;if(o.type==="tabs"&&o.tabs&&Array.isArray(o.tabs)){for(let c of o.tabs)if(c.fields&&Array.isArray(c.fields)&&ct(c.fields,e,r))return true}}}return i?false:(t.push({name:s,...r}),true)}function ig(t,e){if(e)for(let r of t){let n=e[r.slug];if(n){let{fields:s,...i}=n;if(r.admin={...r.admin,...i},s&&r.fields&&Array.isArray(r.fields))for(let[o,a]of Object.entries(s))ct(r.fields,o,a);}}}var Vi=class{registry;db;pubsub;webhookService;settings;pluginManager;wsServer;config;constructor(e){this.config=e,this.registry=Vn(),this.db=e.adapter||e.db,this.pubsub=new chunkWCFHS7EZ_cjs.b(this.registry),this.webhookService=chunkAK754S3T_cjs.o(this.db),this.pluginManager=new mr;for(let r of sg)this.pluginManager.register(r),this.registry.addPlugin(r);if(e.plugins)for(let r of e.plugins)this.pluginManager.register(r),this.registry.addPlugin(r);e.collections&&e.admin?.collectionOverrides&&ig(e.collections,e.admin.collectionOverrides),e.collections&&this.registry.addCollections(e.collections),e.globals&&this.registry.addGlobals(e.globals);}async init(){await this.pluginManager.executeHook("beforeInit",{kyro:this}),await this.registry.init(this),await this.pluginManager.executeHook("afterInit",{kyro:this}),this.registry.addGlobalPostInit(chunk7GGZA5YU_cjs.a);let e={slug:"plugin-settings",admin:{hidden:true},fields:[{name:"states",type:"json"}]};if(this.registry.addGlobalPostInit(e),!this.db)throw new Error("Database adapter is null \u2014 failed to load at startup. Check the server console for the exact error.");let r={slug:chunkDUO523BH_cjs.d,fields:[{name:"userId",type:"text",required:true},{name:"name",type:"text",required:true},{name:"key",type:"text",required:true},{name:"keyPrefix",type:"text",required:true},{name:"permissions",type:"json"},{name:"lastUsedAt",type:"date"},{name:"expiresAt",type:"date"}]},n={slug:chunkAK754S3T_cjs.f,fields:[{name:"name",type:"text",required:true},{name:"url",type:"text",required:true},{name:"events",type:"json",required:true},{name:"collections",type:"json"},{name:"status",type:"text",required:true},{name:"secret",type:"text"},{name:"headers",type:"json"},{name:"action",type:"text"},{name:"config",type:"json"},{name:"lastTriggered",type:"date"},{name:"lastError",type:"text"}]},s={slug:chunkAK754S3T_cjs.g,fields:[{name:"webhookId",type:"text",required:true},{name:"event",type:"text",required:true},{name:"payload",type:"json",required:true},{name:"attempt",type:"number",required:true},{name:"status",type:"text",required:true},{name:"responseStatus",type:"number"},{name:"responseBody",type:"text"},{name:"error",type:"text"},{name:"duration",type:"number"},{name:"deliveredAt",type:"date"},{name:"nextRetryAt",type:"date"}]},i=this.registry.getGlobals();if(this.db instanceof chunkTDGSIF5H_cjs.c&&this.db.dialect==="postgres"){let o=this.db,a=chunkDUO523BH_cjs.d.replace(/-/g,"_");o.schema&&!o.schema[a]&&(o.schema[a]=chunk7JWQ2PZP_cjs.g);}await this.db.init([...this.registry.getCollections(),r,n,s],i),await this.loadPluginState(),this.pubsub.autoRegisterHooks();}async loadSettings(){if(this.settings)return this.settings;try{let e=await this.db.findOne({collection:"_globals_access-settings",where:{},draft:!0});e&&(this.settings={access:e});}catch{}return this.settings||{}}async loadPluginState(){let e=this.registry.storageProviders,r=e.getAllPluginNames(),n={};try{let s=await this.db.findOne({collection:"_globals_plugin-settings",where:{},draft:!0});s&&s.states&&(n=s.states);}catch{}for(let s of r)n[s]!==void 0&&e.setPluginEnabled(s,n[s]);}async getREST(e){let r=typeof this.config.auth=="object"?this.config.auth:null,n=r?.secret,s=r?.checkSession!==false;return chunkOUMUIICN_cjs.ib({registry:this.registry,db:this.db,authSecret:n,authAdapter:this.config.authAdapter,checkSession:s,...e,cors:this.config.cors,webhookService:this.webhookService,settings:this.settings})}getGraphQL(e){let r=chunkVOQUO2EZ_cjs.J({registry:this.registry,db:this.db,settings:this.settings});return {fetch:af({schema:r,context:async({request:s})=>{let i=chunkDUO523BH_cjs.f(s),o,a;if(i&&this.db){let l=await chunkDUO523BH_cjs.e(i,this.db);l.user&&(o=l.user,a=chunkDUO523BH_cjs.g(l));}let c=e?.tenantId;return {db:this.db,registry:this.registry,user:o,req:s,tenantId:c,apiKey:a,relationLoader:new chunkVOQUO2EZ_cjs.H({db:this.db,tenantId:c,user:o})}},graphiql:this.config.graphQL?.disablePlayground!==true,plugins:[]}).fetch,schema:r}}getTRPC(e){return {fetch:async(r,n)=>{let i=new URL(r.url).pathname.replace(/^\/api\/trpc\//,""),[o,...a]=i.split("."),c=a.join(".");if(c=c.replace(/\.(query|mutate|subscribe)$/,""),!o||!c)return new Response(JSON.stringify({error:{message:"Invalid tRPC path",code:-32600,data:{code:"BAD_REQUEST",httpStatus:400}}}),{status:400,headers:{"Content-Type":"application/json"}});let l=await chunkMP5VC5ER_cjs.a({db:this.db,registry:this.registry,req:r,user:e?.user,tenantId:e?.tenantId,settings:this.settings}),h=chunkMP5VC5ER_cjs.i(l)[o];if(!h)return new Response(JSON.stringify({error:{message:`Collection '${o}' not found`,code:-32601,data:{code:"NOT_FOUND",httpStatus:404}}}),{status:404,headers:{"Content-Type":"application/json"}});let d=h[c];if(typeof d!="function")return new Response(JSON.stringify({error:{message:`Procedure '${c}' not found`,code:-32601,data:{code:"NOT_FOUND",httpStatus:404}}}),{status:404,headers:{"Content-Type":"application/json"}});try{let p={};if(r.method==="POST"||r.method==="PATCH")p=await r.json().catch(()=>({}));else {let R=new URL(r.url).searchParams.get("input");if(R)try{p=JSON.parse(decodeURIComponent(R));}catch{}}let x=p?.["0"]??p,S=await d({...x,collection:o});return new Response(JSON.stringify({result:{data:S}}),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){let x=p.message||"Internal error",S=x.includes("not found")?404:x.includes("denied")||x.includes("authentication required")?403:x.includes("conflict")?409:500,R=S===404?-32601:S===403?-32001:S===409?-32002:-32603;return new Response(JSON.stringify({error:{message:x,code:R,data:{code:"INTERNAL_SERVER_ERROR",httpStatus:S}}}),{status:S,headers:{"Content-Type":"application/json"}})}},router:null}}getWS(){return this.wsServer}async startWebSocket(e){let r=this.settings?.access?.apiAccess;if(r?.wsEnabled===false)return null;let n=async o=>{let a=await chunkDUO523BH_cjs.e(o,this.db);if(!a.valid)throw new Error(a.error||"Invalid API key");if(!a.user)throw new Error("API key has no associated user");return a.user},s=e?.port||8080,i=globalThis;if(i.__KYRO_WS_SERVER__)try{await i.__KYRO_WS_SERVER__.close();}catch{}return this.wsServer=chunkWCFHS7EZ_cjs.d({pubsub:this.pubsub,port:s,requireAuth:e?.requireAuth??r?.requireAuth,verifyToken:e?.verifyToken||n}),i.__KYRO_WS_SERVER__=this.wsServer,this.wsServer}async shutdown(){await this.pluginManager.executeHook("beforeServerStop",{kyro:this}),this.wsServer&&await this.wsServer.close(),await this.db.disconnect(),await this.pluginManager.executeHook("afterServerStop",{kyro:this});}};function og(t){return new Vi(t)}function Rv(t){let e=og(t),r=null;return async function(s,i){return r||(r=e.init()),await r,(await e.getREST()).fetch(s,i)}}chunkBUNLC3II_cjs.h();var ff={debug:0,info:1,warn:2,error:3,none:4},Wi=class{level;constructor(){let e=typeof process<"u"?process.env?.KYRO_LOG_LEVEL:void 0;this.level=e||"info";}setLevel(e){this.level=e;}getLevel(){return this.level}shouldLog(e){return ff[e]>=ff[this.level]}debug(...e){this.shouldLog("debug")&&console.debug("[Kyro DEBUG]",...e);}info(...e){this.shouldLog("info")&&console.log("[Kyro]",...e);}warn(...e){this.shouldLog("warn")&&console.warn("[Kyro WARN]",...e);}error(...e){this.shouldLog("error")&&console.error("[Kyro ERROR]",...e);}},Mv=new Wi;
|
|
56
|
-
exports.A=og;exports.B=Rv;exports.C=Wi;exports.D=Mv;exports.a=Gn;exports.b=
|
|
55
|
+
</pre></section></main></body></html>`;var Yy=function(e){return new e.fetchAPI.Response(ef.replace(/__GRAPHIQL_LINK__/g,e.graphqlEndpoint).replace(/__REQUEST_PATH__/g,e.url.pathname),{status:200,statusText:"OK",headers:{"Content-Type":"text/html"}})};function tf(t){let e=t.landingPageRenderer||Yy;return {onRequest({request:r,fetchAPI:n,endResponse:s,url:i}){let o=t.getGraphQLEndpoint();if(!r.url.endsWith(o)&&!r.url.endsWith(`${o}/`)&&i.pathname!==o&&i.pathname!==`${o}/`&&!t.getGraphQLEndpointURLPattern().test(i)){if(t.showLandingPage===true&&r.method==="GET"&&r.headers?.get("accept")?.includes("text/html")){let a=e({request:r,fetchAPI:n,url:i,graphqlEndpoint:o,get urlPattern(){return t.getGraphQLEndpointURLPattern()}});if(N(a))return a.then(s);s(a);return}s(new n.Response("",{status:404,statusText:"Not Found"}));}}}}chunkBUNLC3II_cjs.h();function Sn({request:t,result:e,fetchAPI:r,onResultProcessHooks:n,serverContext:s}){let i,o=[],a="*/*";return k(()=>K(n,c=>c({request:t,acceptableMediaTypes:o,result:e,setResult(l){e=l;},resultProcessor:i,setResultProcessor(l,u){i=l,a=u;},serverContext:s})),()=>i?i(e,r,a):new r.Response(null,{status:406,statusText:"Not Acceptable",headers:{accept:o.join("; charset=utf-8, ")}}))}function rf({params:t,enveloped:e}){let r=e.parse(t.query),n=e.validate(e.schema,r);return n.length>0?{errors:n}:k(()=>e.contextFactory(),s=>{let i={schema:e.schema,document:r,contextValue:s,variableValues:t.variables,operationName:t.operationName};return (chunk5DWQGEM2_cjs.F(r,t.operationName)?.operation==="subscription"?e.subscribe:e.execute)(i)})}chunkBUNLC3II_cjs.h();function nf(t){return t?.status&&t?.headers}chunkBUNLC3II_cjs.h();function sf(t){return Re(t)?t.toJSON():t instanceof Error?{message:t.message,stack:t.stack,cause:t.cause}:t}var of=(t,e,r=globalThis.process?.env?.NODE_ENV==="development")=>{if(gn(t))return t;let n={code:"INTERNAL_SERVER_ERROR",unexpected:true},s={extensions:n};return Re(t)?(s.nodes=t.nodes,s.source=t.source,s.positions=t.positions,s.path=t.path,s.coordinate=yn(t),r&&t.originalError&&(n.originalError=sf(t.originalError)),t.extensions?.http&&(n.http=t.extensions.http)):r&&(n.originalError=sf(t)),U(e,s)};var Gi=class{getEnveloped;logger;fetchAPI;plugins;instrumentation;onRequestParseHooks;onParamsHooks;onExecutionResultHooks;onResultProcessHooks;maskedErrorsOpts;id;_graphqlEndpoint;_graphqlEndpointURLPattern;version="5.21.2";constructor(e){if(this.id=e?.id??"yoga",this.fetchAPI={...Xy},e?.fetchAPI)for(let a in e.fetchAPI)e.fetchAPI[a]&&(this.fetchAPI[a]=e.fetchAPI[a]);let r=e?.logging==null?true:e.logging;this.logger=typeof r=="boolean"?r===true?gr():gr("silent"):typeof r=="string"?gr(r):r;let n=typeof e?.maskedErrors=="object"&&e.maskedErrors.maskError||of,s=new WeakSet;this.maskedErrorsOpts=e?.maskedErrors===false?null:{errorMessage:"Unexpected error.",...typeof e?.maskedErrors=="object"?e.maskedErrors:{},maskError:(a,c)=>{if(s.has(a))return a;let l=n(a,c,this.maskedErrorsOpts?.isDev);return l!==a&&this.logger.error(a),s.add(l),l}};let i=this.maskedErrorsOpts==null?null:this.maskedErrorsOpts,o=0;e?.batching&&(typeof e.batching=="boolean"?o=10:o=e.batching.limit??10),this.graphqlEndpoint=e?.graphqlEndpoint||"/graphql",this.plugins=[sa({parse:chunk5DWQGEM2_cjs.e,validate:chunk5DWQGEM2_cjs.D,execute:Cr,subscribe:Cr,specifiedRules:chunk5DWQGEM2_cjs.C}),!!e?.schema&&jo(e.schema),e?.allowedHeaders?.request!=null&&xu(e.allowedHeaders.request),e?.context!=null&&na(a=>e?.context?typeof e.context=="function"?e.context(a):e.context:{}),Mu({id:this.id,logger:this.logger,endpoint:e?.healthCheckEndpoint}),e?.cors!==false&&mu(e?.cors),e?.graphiql!==false&&Do({getGraphQLEndpoint:()=>this._graphqlEndpoint,getGraphQLEndpointURLPattern:()=>this.getUrlPatternForGraphQLEndpoint(),options:e?.graphiql,render:e?.renderGraphiQL,logger:this.logger}),It({match:Pu,parse:vu}),It({match:Au,parse:Lu}),e?.multipart!==false&&It({match:Ou,parse:Fu}),It({match:Cu,parse:Ru}),It({match:Tu,parse:ku}),Xu(),...e?.plugins??[],e?.parserAndValidationCache!==false&&zu(!e?.parserAndValidationCache||e?.parserAndValidationCache===true?{}:e?.parserAndValidationCache),qu(o),Iu(e?.extraParamNames),tf({getGraphQLEndpoint:()=>this.graphqlEndpoint,getGraphQLEndpointURLPattern:()=>this.getUrlPatternForGraphQLEndpoint(),showLandingPage:e?.landingPage!==false,landingPageRenderer:typeof e?.landingPage=="function"?e.landingPage:void 0}),Du(),Uu(),i!==null&&{onSubscribe(){return {onSubscribeError({error:a}){if(Mi(a))throw a}}}},i!==null&&ra(i),e?.allowedHeaders?.response!=null&&gu(e.allowedHeaders.response),ju()],this.getEnveloped=ea({plugins:this.plugins}),this.plugins=this.getEnveloped._plugins,this.onRequestParseHooks=[],this.onParamsHooks=[],this.onExecutionResultHooks=[],this.onResultProcessHooks=[];for(let a of this.plugins)a&&(a.onYogaInit&&a.onYogaInit({yoga:this}),a.onRequestParse&&this.onRequestParseHooks.push(a.onRequestParse),a.onParams&&this.onParamsHooks.push(a.onParams),a.onExecutionResult&&this.onExecutionResultHooks.push(a.onExecutionResult),a.onResultProcess&&this.onResultProcessHooks.push(a.onResultProcess),a.instrumentation&&(this.instrumentation=this.instrumentation?yt(this.instrumentation,a.instrumentation):a.instrumentation));}get graphqlEndpoint(){return this._graphqlEndpoint}set graphqlEndpoint(e){this._graphqlEndpoint=e,this._graphqlEndpointURLPattern=void 0;}getUrlPatternForGraphQLEndpoint(){return this._graphqlEndpointURLPattern??=new this.fetchAPI.URLPattern({pathname:this._graphqlEndpoint}),this._graphqlEndpointURLPattern}handleParams=({request:e,context:r,params:n})=>{let s=r.request===e?{params:n}:{request:e,params:n};Object.assign(r,s);let i=this.getEnveloped(r);return this.logger.debug("Processing GraphQL Parameters"),k(()=>k(()=>rf({params:n,enveloped:i}),o=>(this.logger.debug("Processing GraphQL Parameters done."),o),o=>({errors:At(o,this.maskedErrorsOpts,this.logger)})),o=>(le(o)&&(o=Oe(o,a=>a,a=>{if(a.name==="AbortError")throw this.logger.debug("Request aborted"),a;return {errors:At(a,this.maskedErrorsOpts,this.logger)}})),o))};getResultForParams=({params:e,request:r},n)=>{let s,i=this.handleParams;return k(()=>K(this.onParamsHooks,o=>o({params:e,request:r,setParams(a){e=a;},paramsHandler:i,setParamsHandler(a){i=a;},setResult(a){s=a;},fetchAPI:this.fetchAPI,context:n})),()=>k(()=>s||i({request:r,params:e,context:n}),o=>k(()=>K(this.onExecutionResultHooks,a=>a({result:o,setResult(c){o=c;},request:r,context:n})),()=>o)))};parseRequest=(e,r)=>{let n=new Proxy({},{get:(a,c,l)=>(n=new this.fetchAPI.URL(e.url,"http://localhost"),Reflect.get(n,c,n))}),s,i,o=[];return k(()=>K(this.onRequestParseHooks,(a,c)=>k(()=>a({request:e,url:n,requestParser:s,serverContext:r,setRequestParser(l){s=l;},endResponse(l){i=l,c();},fetchAPI:this.fetchAPI}),l=>l?.onRequestParseDone),o),()=>i?{response:i}:(this.logger.debug("Parsing request to extract GraphQL parameters"),s?k(()=>s(e),a=>{if(nf(a))return {response:a};let c=a;return k(()=>K(o,l=>l({requestParserResult:c,setRequestParserResult(u){c=u;}})),()=>({requestParserResult:c}))}):{response:new this.fetchAPI.Response(null,{status:415,statusText:"Unsupported Media Type"})}))};handle=(e,r)=>{let n=this.instrumentation&&Xe({request:e}),s=this.instrumentation?.requestParse?n.asyncFn(this.instrumentation?.requestParse,this.parseRequest):this.parseRequest;return Mt($().then(()=>s(e,r)).then(({response:i,requestParserResult:o})=>{if(i)return i;let a=this.instrumentation?.operation?(c,l)=>Xe({context:l,request:c.request}).asyncFn(this.instrumentation?.operation,this.getResultForParams)(c,l):this.getResultForParams;return k(()=>Array.isArray(o)?Promise.all(o.map(c=>$().then(()=>a({params:c,request:e},Object.create(r))).catch(l=>({errors:At(l,this.maskedErrorsOpts,this.logger)})))):a({params:o,request:e},r),c=>(this.instrumentation?.resultProcess?n.asyncFn(this.instrumentation.resultProcess,Sn):Sn)({request:e,result:c,fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:r}))}).catch(i=>{let a={errors:At(i,this.maskedErrorsOpts,this.logger)};return Sn({request:e,result:a,fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:r})}))}};function af(t){let e=new Gi(t);return pu(e,{fetchAPI:e.fetchAPI,plugins:e.plugins,disposeOnProcessTerminate:t.disposeOnProcessTerminate})}chunkBUNLC3II_cjs.h();var eg={aws:{type:"aws",configKey:"s3",displayName:"S3 Compatible (AWS, Backblaze, Wasabi, etc.)",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1",admin:{placeholder:"us-east-1"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"endpoint",type:"text",label:"Endpoint URL",admin:{placeholder:"https://s3.custom.com"}},{name:"cdnUrl",type:"text",label:"CDN URL",admin:{placeholder:"https://cdn.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}]},r2:{type:"r2",configKey:"r2",displayName:"Cloudflare R2",configFields:[{name:"accountId",type:"text",label:"Account ID",required:true,admin:{placeholder:"Your Cloudflare Account ID"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"publicDevUrl",type:"text",label:"Public Dev URL ID",admin:{placeholder:"pub-xxxxxxxxxxxxxxxx",description:"Enter ONLY the ID (e.g., pub-b8d8c4cc8bcf4d868ddd95efc1b305aa). Do NOT include https:// or the full URL. Found in R2 Dashboard \u2192 Public Dev URL."}},{name:"cdnUrl",type:"text",label:"Custom CDN URL",admin:{placeholder:"https://assets.example.com (optional)"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads (optional)",description:"Optional prefix for all object keys. Do not use '/' as prefix."}}]},gcs:{type:"gcs",configKey:"gcs",displayName:"Google Cloud Storage",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"projectId",type:"text",label:"Project ID"},{name:"clientEmail",type:"text",label:"Client Email"},{name:"privateKey",type:"password",label:"Private Key"},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},digitalocean:{type:"digitalocean",configKey:"digitalocean",displayName:"DigitalOcean Spaces",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"nyc3"},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},backblaze:{type:"backblaze",configKey:"backblaze",displayName:"Backblaze B2",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"accountId",type:"text",label:"Account ID"},{name:"applicationKeyId",type:"text",label:"Application Key ID",required:true},{name:"applicationKey",type:"password",label:"Application Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},wasabi:{type:"wasabi",configKey:"wasabi",displayName:"Wasabi",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1"},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]}};function tg(t,e){switch(t){case "r2":return e?.endpoint||`https://${e?.accountId||""}.r2.cloudflarestorage.com`;case "digitalocean":return e?.endpoint||`https://${e?.region||"nyc3"}.digitaloceanspaces.com`;case "backblaze":return e?.endpoint||"https://s3.backblazeb2.com";case "wasabi":return e?.endpoint||`https://s3.${e?.region||"us-east-1"}.wasabisys.com`;default:return e?.endpoint}}function lf(t,e){return {provider:t,bucket:e?.bucket||"",region:e?.region||"us-east-1",accessKeyId:e?.accessKeyId||e?.clientEmail||e?.applicationKeyId||"",secretAccessKey:e?.secretAccessKey||e?.privateKey||e?.applicationKey||"",endpoint:tg(t,e),cdnUrl:e?.cdnUrl,prefix:e?.prefix,accountId:e?.accountId,publicDevUrl:e?.publicDevUrl}}function rg(t,e,r){let n=r[e.configKey]||{};return lf(t,n)}function ng(t,e,r){let n=r?.[e.configKey]||r;return lf(t,n)}var zi=class extends ge{constructor(){super("@kyro-cms/storage-s3"),this.version="1.0.0",this.description="S3-compatible storage (AWS R2 GCS DigitalOcean Backblaze Wasabi)";}async init(e){let r=e.registry?.storageProviders;if(!r)return;let n=this.name;for(let s of Object.values(eg))r.register({type:s.type,displayName:s.displayName,pluginName:n,configKey:s.configKey,configFields:s.configFields,extractConfig:i=>rg(s.type,s,i),extractRawConfig:i=>ng(s.type,s,i),factory:i=>chunk6QWX3DEB_cjs.Xa(i)});}},cf=new zi;chunkBUNLC3II_cjs.h();var Hi=class extends ge{constructor(){super("@kyro-cms/storage-cloudinary"),this.version="1.0.0",this.description="Cloudinary image and video storage";}async init(e){let r=e.registry?.storageProviders;r&&r.register({type:"cloudinary",displayName:"Cloudinary",pluginName:this.name,configKey:"cloudinary",configFields:[{name:"cloudName",type:"text",label:"Cloud Name",required:true},{name:"apiKey",type:"text",label:"API Key",required:true},{name:"apiSecret",type:"password",label:"API Secret",required:true},{name:"folder",type:"text",label:"Folder",admin:{placeholder:"Optional folder path"}},{name:"uploadPreset",type:"text",label:"Upload Preset (optional)",admin:{placeholder:"Leave empty for signed uploads",description:"If not set, uploads will be signed with API Secret"}}],extractConfig:n=>({cloudName:n.cloudinary?.cloudName||"",apiKey:n.cloudinary?.apiKey||"",apiSecret:n.cloudinary?.apiSecret||"",folder:n.cloudinary?.folder,uploadPreset:n.cloudinary?.uploadPreset}),extractRawConfig:n=>{let s=n?.cloudinary||n;return {cloudName:s?.cloudName||"",apiKey:s?.apiKey||"",apiSecret:s?.apiSecret||"",folder:s?.folder,uploadPreset:s?.uploadPreset}},factory:n=>chunk6QWX3DEB_cjs.Ya(n)});}},uf=new Hi;var sg=[cf,uf];function ct(t,e,r){let n=e.split(".");if(n.length===0)return false;let s=n[0],i=n.slice(1).join(".");for(let o of t){if(o.name===s)if(i){if(o.fields&&Array.isArray(o.fields))return ct(o.fields,i,r);if(o.type==="tabs"&&o.tabs&&Array.isArray(o.tabs)){for(let c of o.tabs)if(c.fields&&Array.isArray(c.fields)&&ct(c.fields,i,r))return true;return false}if(o.type==="blocks"&&o.blocks&&Array.isArray(o.blocks)){let c=i.split(".")[0],l=i.split(".").slice(1).join(".");if(!l)return false;for(let u of o.blocks)if(u.slug===c&&u.fields&&Array.isArray(u.fields))return ct(u.fields,l,r);return false}return o.type==="array"&&o.fields&&Array.isArray(o.fields)?ct(o.fields,i,r):false}else return Object.assign(o,r),true;if(!o.name||o.type==="tabs"||o.type==="row"||o.type==="collapsible"){if(o.fields&&Array.isArray(o.fields)&&ct(o.fields,e,r))return true;if(o.type==="tabs"&&o.tabs&&Array.isArray(o.tabs)){for(let c of o.tabs)if(c.fields&&Array.isArray(c.fields)&&ct(c.fields,e,r))return true}}}return i?false:(t.push({name:s,...r}),true)}function ig(t,e){if(e)for(let r of t){let n=e[r.slug];if(n){let{fields:s,...i}=n;if(r.admin={...r.admin,...i},s&&r.fields&&Array.isArray(r.fields))for(let[o,a]of Object.entries(s))ct(r.fields,o,a);}}}var Vi=class{registry;db;pubsub;webhookService;settings;pluginManager;wsServer;config;constructor(e){this.config=e,this.registry=Vn(),this.db=e.adapter||e.db,this.pubsub=new chunkWCFHS7EZ_cjs.b(this.registry),this.webhookService=chunkFSL3NLRT_cjs.n(this.db),this.pluginManager=new mr;for(let r of sg)this.pluginManager.register(r),this.registry.addPlugin(r);if(e.plugins)for(let r of e.plugins)this.pluginManager.register(r),this.registry.addPlugin(r);e.collections&&e.admin?.collectionOverrides&&ig(e.collections,e.admin.collectionOverrides),e.collections&&this.registry.addCollections(e.collections),e.globals&&this.registry.addGlobals(e.globals);}async init(){await this.pluginManager.executeHook("beforeInit",{kyro:this}),await this.registry.init(this),await this.pluginManager.executeHook("afterInit",{kyro:this}),this.registry.addGlobalPostInit(chunk7GGZA5YU_cjs.a);let e={slug:"plugin-settings",admin:{hidden:true},fields:[{name:"states",type:"json"}]};if(this.registry.addGlobalPostInit(e),!this.db)throw new Error("Database adapter is null \u2014 failed to load at startup. Check the server console for the exact error.");let r={slug:chunkZHA446FA_cjs.a,fields:[{name:"userId",type:"text",required:true},{name:"name",type:"text",required:true},{name:"key",type:"text",required:true},{name:"keyPrefix",type:"text",required:true},{name:"permissions",type:"json"},{name:"lastUsedAt",type:"date"},{name:"expiresAt",type:"date"}]},n={slug:chunkFSL3NLRT_cjs.e,fields:[{name:"name",type:"text",required:true},{name:"url",type:"text",required:true},{name:"events",type:"json",required:true},{name:"collections",type:"json"},{name:"status",type:"text",required:true},{name:"secret",type:"text"},{name:"headers",type:"json"},{name:"action",type:"text"},{name:"config",type:"json"},{name:"lastTriggered",type:"date"},{name:"lastError",type:"text"}]},s={slug:chunkFSL3NLRT_cjs.f,fields:[{name:"webhookId",type:"text",required:true},{name:"event",type:"text",required:true},{name:"payload",type:"json",required:true},{name:"attempt",type:"number",required:true},{name:"status",type:"text",required:true},{name:"responseStatus",type:"number"},{name:"responseBody",type:"text"},{name:"error",type:"text"},{name:"duration",type:"number"},{name:"deliveredAt",type:"date"},{name:"nextRetryAt",type:"date"}]},i=this.registry.getGlobals();if(this.db instanceof chunkJU3UAZRY_cjs.g&&this.db.dialect==="postgres"){let o=this.db,a=chunkZHA446FA_cjs.a.replace(/-/g,"_");o.schema&&!o.schema[a]&&(o.schema[a]=chunk7JWQ2PZP_cjs.g);}await this.db.init([...this.registry.getCollections(),r,n,s],i),await this.loadPluginState(),this.pubsub.autoRegisterHooks();}async loadSettings(){if(this.settings)return this.settings;try{let e=await this.db.findOne({collection:"_globals_access-settings",where:{},draft:!0});e&&(this.settings={access:e});}catch{}return this.settings||{}}async loadPluginState(){let e=this.registry.storageProviders,r=e.getAllPluginNames(),n={};try{let s=await this.db.findOne({collection:"_globals_plugin-settings",where:{},draft:!0});s&&s.states&&(n=s.states);}catch{}for(let s of r)n[s]!==void 0&&e.setPluginEnabled(s,n[s]);}async getREST(e){let r=typeof this.config.auth=="object"?this.config.auth:null,n=r?.secret,s=r?.checkSession!==false;return chunk6QWX3DEB_cjs.ib({registry:this.registry,db:this.db,authSecret:n,authAdapter:this.config.authAdapter,checkSession:s,...e,cors:this.config.cors,webhookService:this.webhookService,settings:this.settings})}getGraphQL(e){let r=chunk5DWQGEM2_cjs.J({registry:this.registry,db:this.db,settings:this.settings});return {fetch:af({schema:r,context:async({request:s})=>{let i=chunkZHA446FA_cjs.c(s),o,a;if(i&&this.db){let l=await chunkZHA446FA_cjs.b(i,this.db);l.user&&(o=l.user,a=chunkZHA446FA_cjs.d(l));}let c=e?.tenantId;return {db:this.db,registry:this.registry,user:o,req:s,tenantId:c,apiKey:a,relationLoader:new chunk5DWQGEM2_cjs.H({db:this.db,tenantId:c,user:o})}},graphiql:this.config.graphQL?.disablePlayground!==true,plugins:[]}).fetch,schema:r}}getTRPC(e){return {fetch:async(r,n)=>{let i=new URL(r.url).pathname.replace(/^\/api\/trpc\//,""),[o,...a]=i.split("."),c=a.join(".");if(c=c.replace(/\.(query|mutate|subscribe)$/,""),!o||!c)return new Response(JSON.stringify({error:{message:"Invalid tRPC path",code:-32600,data:{code:"BAD_REQUEST",httpStatus:400}}}),{status:400,headers:{"Content-Type":"application/json"}});let l=await chunkFP5UK272_cjs.a({db:this.db,registry:this.registry,req:r,user:e?.user,tenantId:e?.tenantId,settings:this.settings}),h=chunkFP5UK272_cjs.i(l)[o];if(!h)return new Response(JSON.stringify({error:{message:`Collection '${o}' not found`,code:-32601,data:{code:"NOT_FOUND",httpStatus:404}}}),{status:404,headers:{"Content-Type":"application/json"}});let d=h[c];if(typeof d!="function")return new Response(JSON.stringify({error:{message:`Procedure '${c}' not found`,code:-32601,data:{code:"NOT_FOUND",httpStatus:404}}}),{status:404,headers:{"Content-Type":"application/json"}});try{let p={};if(r.method==="POST"||r.method==="PATCH")p=await r.json().catch(()=>({}));else {let R=new URL(r.url).searchParams.get("input");if(R)try{p=JSON.parse(decodeURIComponent(R));}catch{}}let x=p?.["0"]??p,S=await d({...x,collection:o});return new Response(JSON.stringify({result:{data:S}}),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){let x=p.message||"Internal error",S=x.includes("not found")?404:x.includes("denied")||x.includes("authentication required")?403:x.includes("conflict")?409:500,R=S===404?-32601:S===403?-32001:S===409?-32002:-32603;return new Response(JSON.stringify({error:{message:x,code:R,data:{code:"INTERNAL_SERVER_ERROR",httpStatus:S}}}),{status:S,headers:{"Content-Type":"application/json"}})}},router:null}}getWS(){return this.wsServer}async startWebSocket(e){let r=this.settings?.access?.apiAccess;if(r?.wsEnabled===false)return null;let n=async o=>{let a=await chunkZHA446FA_cjs.b(o,this.db);if(!a.valid)throw new Error(a.error||"Invalid API key");if(!a.user)throw new Error("API key has no associated user");return a.user},s=e?.port||8080,i=globalThis;if(i.__KYRO_WS_SERVER__)try{await i.__KYRO_WS_SERVER__.close();}catch{}return this.wsServer=chunkWCFHS7EZ_cjs.d({pubsub:this.pubsub,port:s,requireAuth:e?.requireAuth??r?.requireAuth,verifyToken:e?.verifyToken||n}),i.__KYRO_WS_SERVER__=this.wsServer,this.wsServer}async shutdown(){await this.pluginManager.executeHook("beforeServerStop",{kyro:this}),this.wsServer&&await this.wsServer.close(),await this.db.disconnect(),await this.pluginManager.executeHook("afterServerStop",{kyro:this});}};function og(t){return new Vi(t)}function Rv(t){let e=og(t),r=null;return async function(s,i){return r||(r=e.init()),await r,(await e.getREST()).fetch(s,i)}}chunkBUNLC3II_cjs.h();var ff={debug:0,info:1,warn:2,error:3,none:4},Wi=class{level;constructor(){let e=typeof process<"u"?process.env?.KYRO_LOG_LEVEL:void 0;this.level=e||"info";}setLevel(e){this.level=e;}getLevel(){return this.level}shouldLog(e){return ff[e]>=ff[this.level]}debug(...e){this.shouldLog("debug")&&console.debug("[Kyro DEBUG]",...e);}info(...e){this.shouldLog("info")&&console.log("[Kyro]",...e);}warn(...e){this.shouldLog("warn")&&console.warn("[Kyro WARN]",...e);}error(...e){this.shouldLog("error")&&console.error("[Kyro ERROR]",...e);}},Mv=new Wi;
|
|
56
|
+
exports.A=og;exports.B=Rv;exports.C=Wi;exports.D=Mv;exports.a=Gn;exports.b=zn;exports.c=Hn;exports.d=Ze;exports.e=_o;exports.f=b;exports.g=oe;exports.h=Eo;exports.i=Po;exports.j=vo;exports.k=To;exports.l=ko;exports.m=jt;exports.n=Ad;exports.o=Ld;exports.p=Vn;exports.q=ge;exports.r=mr;exports.s=Wn;exports.t=Kn;exports.u=Qn;exports.v=Zn;exports.w=Jn;exports.x=Cg;exports.y=ig;exports.z=Vi;
|