@edge-runtime/node-utils
Version:
A set of helpers for running edge-compliant code in Node.js environment
374 lines (367 loc) • 917 kB
JavaScript
"use strict";
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __commonJS2 = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export2 = (target, all) => {
for (var name in all)
__defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
// ../primitives/dist/console.js.text.js
var require_console_js_text = __commonJS2({
"../primitives/dist/console.js.text.js"(exports2, module2) {
"use strict";
module2.exports = '"use strict";var Gr=Object.create,E=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyNames,kr=Object.getPrototypeOf,Mr=Object.prototype.hasOwnProperty,a=(f,y)=>E(f,"name",{value:y,configurable:!0}),xr=(f,y)=>function(){return f&&(y=(0,f[T(f)[0]])(f=0)),y},Cr=(f,y)=>function(){return y||(0,f[T(f)[0]])((y={exports:{}}).exports,y),y.exports},Lr=(f,y)=>{for(var d in y)E(f,d,{get:y[d],enumerable:!0})},ir=(f,y,d,I)=>{if(y&&typeof y=="object"||typeof y=="function")for(let j of T(y))!Mr.call(f,j)&&j!==d&&E(f,j,{get:()=>y[j],enumerable:!(I=Rr(y,j))||I.enumerable});return f},vr=(f,y,d)=>(d=f!=null?Gr(kr(f)):{},ir(y||!f||!f.__esModule?E(d,"default",{value:f,enumerable:!0}):d,f)),Tr=f=>ir(E({},"__esModule",{value:!0}),f),cr=xr({"<define:process>"(){}}),Br=Cr({"../format/dist/index.js"(f,y){"use strict";cr();var d=Object.defineProperty,I=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,ar=Object.prototype.hasOwnProperty,fr=a((r,s)=>{for(var i in s)d(r,i,{get:s[i],enumerable:!0})},"__export"),pr=a((r,s,i,l)=>{if(s&&typeof s=="object"||typeof s=="function")for(let u of j(s))!ar.call(r,u)&&u!==i&&d(r,u,{get:()=>s[u],enumerable:!(l=I(s,u))||l.enumerable});return r},"__copyProps"),lr=a(r=>pr(d({},"__esModule",{value:!0}),r),"__toCommonJS"),B={};fr(B,{createFormat:()=>J}),y.exports=lr(B);var yr=Reflect.getOwnPropertyDescriptor;function N(r,s){let i=yr(r,s);return i?i.get:void 0}a(N,"GetOwnGetter");var gr=Reflect.getPrototypeOf,ur=gr(Uint8Array),br=Array.prototype.filter,D=Array.prototype.push,mr=Date.prototype.getTime,dr=Date.prototype.toISOString,Sr=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertyNames,Or=Object.getOwnPropertySymbols,_r=Object.keys,hr=Object.prototype.propertyIsEnumerable,jr=Object.prototype.toString,Pr=N(Map.prototype,"size"),wr=N(Set.prototype,"size"),Ar=String.prototype.includes,$r=Symbol.iterator,Er=Symbol.prototype.toString,Ir=N(ur.prototype,"length"),Nr=new Set(["[object BigInt64Array]","[object BigUint64Array]","[object Float32Array]","[object Float64Array]","[object Int8Array]","[object Int16Array]","[object Int32Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Uint16Array]","[object Uint32Array]"]);function R(r,s){let i=Array.isArray(r)||z(r)?new Set([...r.keys()].map(l=>l.toString())):void 0;return Object.entries(Sr(r)).filter(([l,u])=>!(i&&i.has(l)||s===1&&!u.enumerable)).map(([l])=>l)}a(R,"getOwnNonIndexProperties");var z=a(r=>g(r,"object")&&Nr.has(jr.call(r)),"isTypedArray");function g(r,s){return typeof r===s}a(g,"kind");var Dr=a(r=>{var s;return(s=r.constructor)==null?void 0:s.name},"getConstructorName"),P=a((r="",s="")=>`${r}${s} `,"getPrefix");function J(r={}){r.customInspectSymbol===void 0&&(r.customInspectSymbol=Symbol.for("edge-runtime.inspect.custom")),r.formatError===void 0&&(r.formatError=n=>{var t;let p=(t=n.stack)!=null?t:Error.prototype.toString.call(n);return String(p)});let{formatError:s,customInspectSymbol:i}=r;function l(...n){let[t]=n;if(!g(t,"string"))return w(t,i)?l(t[i]({format:l})):n.map(o=>A(o,{customInspectSymbol:i})).join(" ");let p=1,c=String(t).replace(/%[sjdOoif%]/g,o=>{if(o==="%%")return"%";if(p>=n.length)return o;switch(o){case"%s":{let e=n[p++];return w(e,i)?l(e[i]({format:l})):M(e)||x(e)||g(e,"bigint")?l(e):String(e)}case"%j":return Y(n[p++]);case"%d":{let e=n[p++];return g(e,"bigint")?l(e):String(Number(e))}case"%O":return A(n[p++],{customInspectSymbol:i});case"%o":return A(n[p++],{customInspectSymbol:i,showHidden:!0,depth:4});case"%i":{let e=n[p++];return g(e,"bigint")?l(e):String(parseInt(e,10))}case"%f":return String(parseFloat(n[p++]));default:return o}});for(let o=n[p];p<n.length;o=n[++p])o===null||!g(o,"object")?c+=" "+o:c+=" "+A(o);return c}a(l,"format");function u(n,t,p){if(w(t,i))return l(t[i]({format:l}));let c=U(t);if(c!==void 0)return c;if(n.seen.includes(t)){let o=1;return n.circular===void 0?(n.circular=new Map,n.circular.set(t,o)):(o=n.circular.get(t),o===void 0&&(o=n.circular.size+1,n.circular.set(t,o))),`[Circular *${o}]`}return h(n,t,p)}a(u,"formatValue");function h(n,t,p){let c=[],o=Dr(t),e="",S=a(()=>[],"formatter"),m=["",""],O=!0,tr=n.showHidden?0:1;if($r in t)if(O=!1,Array.isArray(t)){let b=o!=="Array"?P(o,`(${t.length})`):"";if(c=R(t,tr),m=[`${b}[`,"]"],t.length===0&&c.length===0)return`${m[0]}]`;S=Q}else if(q(t)){let b=wr.call(t),_=P(o,`(${b})`);if(c=G(t,n.showHidden),S=Z,b===0&&c.length===0)return`${_}{}`;m=[`${_}{`,"}"]}else if(K(t)){let b=Pr.call(t),_=P(o,`(${b})`);if(c=G(t,n.showHidden),S=rr,b===0&&c.length===0)return`${_}{}`;m=[`${_}{`,"}"]}else if(z(t)){c=R(t,tr);let b=Ir.call(t);if(m=[`${P(o,`(${b})`)}[`,"]"],t.length===0&&c.length===0)return`${m[0]}]`;S=X.bind(null,b)}else O=!0;if(O)if(c=G(t,n.showHidden),m=["{","}"],o===void 0){if(c.length===0)return"[Object: null prototype] {}"}else if(o==="Object"){if(c.length===0)return"{}"}else if(g(t,"function")){if(e=`[Function${t.name?": "+t.name:""}]`,c.length===0)return e}else if(k(t)){if(e=RegExp.prototype.toString.call(t),c.length===0)return e;e=" "+e}else if(M(t)){if(e=Number.isNaN(mr.call(t))?Date.prototype.toString.call(t):dr.call(t),c.length===0)return e;e=" "+e}else if(x(t))e=s(t),c=c.filter(b=>b!=="name");else if(w(t,n.customInspectSymbol)){if(e=l(t[n.customInspectSymbol]({format:l})),c.length===0)return e;e=" "+e}else m[0]=`${P(o)}{`;if(p&&p<0)return k(t)?RegExp.prototype.toString.call(t):"[Object]";n.seen.push(t);let er=new Set(c),nr=S(n,t,p,er,c);for(let b=0;b<c.length;b++)nr.push(L(n,t,p,er,c[b],!1));if(n.circular!==void 0){let b=n.circular.get(t);if(b!==void 0){let _=`<ref *${b}>`;e=e===""?_:`${_} ${e}`}}return n.seen.pop(),W(nr,e,m)}a(h,"formatRaw");function A(n,t){return t=Object.assign({seen:[],depth:2},t),u(t,n,t.depth)}a(A,"inspect");function L(n,t,p,c,o,e){let S,m,O=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]};return O.value!==void 0?m=u(n,O.value,p):O.get?m=O.set?"[Getter/Setter]":"[Getter]":O.set?m="[Setter]":m="undefined",e?m:(g(o,"symbol")?S=`[${Er.call(o)}]`:c.has(o)?S=o:S="["+o+"]",`${S}: ${m}`)}a(L,"formatProperty");function Q(n,t,p,c){let o=[];for(let e=0;e<t.length;++e)Object.prototype.hasOwnProperty.call(t,String(e))?o.push(L(n,t,p,c,String(e),!0)):o.push("");return o}a(Q,"formatArray");function X(n,t,p,c){let o=new Array(n);for(let e=0;e<n;++e)o[e]=p.length>0&&g(p[0],"number")?String(p[e]):H(p[e]);if(t.showHidden)for(let e of["BYTES_PER_ELEMENT","length","byteLength","byteOffset","buffer"]){let S=u(t,p[e],c);D.call(o,`[${String(e)}]: ${S}`)}return o}a(X,"formatTypedArray");function Z(n,t,p){let c=[];for(let o of t)D.call(c,u(n,o,p));return c}a(Z,"formatSet");function rr(n,t,p){let c=[];for(let{0:o,1:e}of t)c.push(`${u(n,o,p)} => ${u(n,e,p)}`);return c}return a(rr,"formatMap"),l}a(J,"createFormat");var H=a(r=>`${r}n`,"formatBigInt");function U(r){if(r===null)return"null";if(r===void 0)return"undefined";if(g(r,"string"))return`\'${JSON.stringify(r).replace(/^"|"$/g,"").replace(/\'/g,"\\\\\'").replace(/\\\\"/g,\'"\')}\'`;if(g(r,"boolean")||g(r,"number"))return""+r;if(g(r,"bigint"))return H(r);if(g(r,"symbol"))return r.toString()}a(U,"formatPrimitive");function w(r,s){return r!==null&&g(r,"object")&&s in r&&g(r[s],"function")}a(w,"hasCustomSymbol");function k(r){return g(r,"object")&&Object.prototype.toString.call(r)==="[object RegExp]"}a(k,"isRegExp");function M(r){return g(r,"object")&&Object.prototype.toString.call(r)==="[object Date]"}a(M,"isDate");function x(r){return g(r,"object")&&(Object.prototype.toString.call(r)==="[object Error]"||r instanceof Error)}a(x,"isError");function K(r){return g(r,"object")&&Object.prototype.toString.call(r)==="[object Map]"}a(K,"isMap");function q(r){return g(r,"object")&&Object.prototype.toString.call(r)==="[object Set]"}a(q,"isSet");function V(r,s,i){let u=r.length+s;if(u+r.length>80)return!1;for(let h=0;h<r.length;h++)if(u+=r[h].length,u>80)return!1;return i===""||!Ar.call(i,`\n`)}a(V,"isBelowBreakLength");function W(r,s,i){let l=r.length+i[0].length+s.length+10;return V(r,l,s)?((s?s+" ":"")+i[0]+" "+r.join(", ")+" "+i[1]).trim():(s?s+" ":"")+i[0]+`\n `+r.join(`,\n `)+`\n`+i[1]}a(W,"reduceToSingleString");function Y(r){return Array.isArray(r)&&(r=r.map(s=>JSON.parse(JSON.stringify(s,C())))),JSON.stringify(r,C())}a(Y,"safeStringify");function C(){let r=new WeakSet;return(s,i)=>{if(i!==null&&g(i,"object")){if(r.has(i))return"[Circular]";r.add(i)}return i}}a(C,"makeCircularReplacer");function G(r,s=!1){let i,l=Or(r);if(s)i=F(r),l.length!==0&&D.apply(i,l);else{try{i=_r(r)}catch{i=F(r)}if(l.length!==0){let u=a(h=>hr.call(r,h),"filter");D.apply(i,br.call(l,u))}}return i}a(G,"getKeys")}}),sr={};Lr(sr,{console:()=>Wr});module.exports=Tr(sr);cr();var Fr=vr(Br()),$=(0,Fr.createFormat)(),zr=console.error.bind(console),Jr=console.log.bind(console),Hr=console.assert.bind(console),Ur=console.time.bind(console),Kr=console.timeEnd.bind(console),qr=console.timeLog.bind(console),Vr=console.trace.bind(console),or=a((...f)=>zr($(...f)),"error"),v=a((...f)=>Jr($(...f)),"log"),Wr={assert:(f,...y)=>Hr(f,$(...y)),count:console.count.bind(console),debug:v,dir:console.dir.bind(console),error:or,info:v,log:v,time:(...f)=>Ur($(...f)),timeEnd:(...f)=>Kr($(...f)),timeLog:qr,trace:Vr,warn:or};\n';
}
});
// ../primitives/dist/timers.js.text.js
var require_timers_js_text = __commonJS2({
"../primitives/dist/timers.js.text.js"(exports2, module2) {
"use strict";
module2.exports = '"use strict";var a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,l=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of i(e))!u.call(t,o)&&o!==r&&a(t,o,{get:()=>e[o],enumerable:!(p=s(e,o))||p.enumerable});return t},v=t=>y(a({},"__esModule",{value:!0}),t),n={};l(n,{setInterval:()=>m,setTimeout:()=>_});module.exports=v(n);var _=new Proxy(setTimeout,{apply:(t,e,r)=>Reflect.apply(t,e,r)[Symbol.toPrimitive]()}),m=new Proxy(setInterval,{apply:(t,e,r)=>Reflect.apply(t,e,r)[Symbol.toPrimitive]()});\n';
}
});
// ../primitives/dist/events.js.text.js
var require_events_js_text = __commonJS2({
"../primitives/dist/events.js.text.js"(exports2, module2) {
"use strict";
module2.exports = '"use strict";var s=Object.defineProperty,p=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,a=(t,e)=>s(t,"name",{value:e,configurable:!0}),h=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},l=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _(e))!u.call(t,n)&&n!==r&&s(t,n,{get:()=>e[n],enumerable:!(o=p(e,n))||o.enumerable});return t},P=t=>l(s({},"__esModule",{value:!0}),t),i={};h(i,{FetchEvent:()=>E,PromiseRejectionEvent:()=>j});module.exports=P(i);var c=class extends Event{constructor(e){super("fetch"),this.request=e,this.response=null,this.awaiting=new Set}respondWith=e=>{this.response=e};waitUntil=e=>{this.awaiting.add(e),e.finally(()=>this.awaiting.delete(e))}};a(c,"FetchEvent");var E=c,v=class extends Event{constructor(e,r){super(e,{cancelable:!0}),this.promise=r.promise,this.reason=r.reason}};a(v,"PromiseRejectionEvent");var j=v;\n';
}
});
// ../primitives/dist/stream.js
var require_stream = __commonJS2({
"../primitives/dist/stream.js"(exports2, module2) {
"use strict";
var __defProp3 = Object.defineProperty;
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames3 = Object.getOwnPropertyNames;
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
var __export3 = (target, all) => {
for (var name in all)
__defProp3(target, name, { get: all[name], enumerable: true });
};
var __copyProps3 = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames3(from))
if (!__hasOwnProp3.call(to, key) && key !== except)
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
var stream_exports = {};
__export3(stream_exports, {
ReadableStream: () => import_web.ReadableStream,
ReadableStreamBYOBReader: () => import_web.ReadableStreamBYOBReader,
ReadableStreamDefaultReader: () => import_web.ReadableStreamDefaultReader,
TextDecoderStream: () => import_web.TextDecoderStream,
TextEncoderStream: () => import_web.TextEncoderStream,
TransformStream: () => import_web.TransformStream,
WritableStream: () => import_web.WritableStream,
WritableStreamDefaultWriter: () => import_web.WritableStreamDefaultWriter
});
module2.exports = __toCommonJS3(stream_exports);
var import_web = require("stream/web");
}
});
// ../primitives/dist/abort-controller.js.text.js
var require_abort_controller_js_text = __commonJS2({
"../primitives/dist/abort-controller.js.text.js"(exports2, module2) {
"use strict";
module2.exports = '"use strict";var c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,S=Object.prototype.hasOwnProperty,a=(r,t)=>c(r,"name",{value:t,configurable:!0}),m=(r,t)=>{for(var e in t)c(r,e,{get:t[e],enumerable:!0})},w=(r,t,e,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of y(t))!S.call(r,n)&&n!==e&&c(r,n,{get:()=>t[n],enumerable:!(p=f(t,n))||p.enumerable});return r},E=r=>w(c({},"__esModule",{value:!0}),r),_={};m(_,{AbortController:()=>x,AbortSignal:()=>O,DOMException:()=>u});module.exports=E(_);var v=Symbol("kSignal"),i=Symbol("kAborted"),s=Symbol("kReason"),g=Symbol("kName"),o=Symbol("kOnabort"),h=class extends Error{constructor(t,e){super(t),this[g]=e}get name(){return this[g]}};a(h,"DOMException");var u=h;function b(){let r=new EventTarget;return Object.setPrototypeOf(r,O.prototype),r[i]=!1,r[s]=void 0,r[o]=void 0,r}a(b,"createAbortSignal");function l(r,t){typeof t>"u"&&(t=new u("This operation was aborted","AbortError")),!r.aborted&&(r[s]=t,r[i]=!0,r.dispatchEvent(new Event("abort")))}a(l,"abortSignalAbort");var d=class{constructor(){this[v]=b()}get signal(){return this[v]}abort(t){l(this.signal,t)}};a(d,"AbortController");var x=d,A=class extends EventTarget{constructor(){throw new TypeError("Illegal constructor")}get aborted(){return this[i]}get reason(){return this[s]}get onabort(){return this[o]}set onabort(t){this[o]&&this.removeEventListener("abort",this[o]),t&&(this[o]=t,this.addEventListener("abort",this[o]))}throwIfAborted(){if(this[i])throw this[s]}static abort(t){let e=b();return l(e,t),e}static timeout(t){let e=b();return setTimeout(()=>{l(e,new u("The operation was aborted due to timeout","TimeoutError"))},t),e}};a(A,"AbortSignal");var O=A;\n';
}
});
// ../primitives/dist/url.js.text.js
var require_url_js_text = __commonJS2({
"../primitives/dist/url.js.text.js"(exports2, module2) {
"use strict";
module2.exports = '"use strict";var yt=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,Ae=Object.getOwnPropertyNames,Te=Object.prototype.hasOwnProperty,h=(t,e)=>yt(t,"name",{value:e,configurable:!0}),Ue=(t,e)=>{for(var s in e)yt(t,s,{get:e[s],enumerable:!0})},Me=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Ae(e))!Te.call(t,c)&&c!==s&&yt(t,c,{get:()=>e[c],enumerable:!(r=Le(e,c))||r.enumerable});return t},Ie=t=>Me(yt({},"__esModule",{value:!0}),t),Ht=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},i=(t,e,s)=>(Ht(t,e,"read from private field"),s?s.call(t):e.get(t)),p=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},v=(t,e,s,r)=>(Ht(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s),a=(t,e,s)=>(Ht(t,e,"access private method"),s),oe={};Ue(oe,{URLPattern:()=>Oe});module.exports=Ie(oe);var xt,ut=(xt=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,s,r,c,f){this.type=t,this.name=e,this.prefix=s,this.value=r,this.suffix=c,this.modifier=f}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},h(xt,"R"),xt),De=/[$_\\p{ID_Start}]/u,Ne=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,Dt=".*";function le(t,e){return(e?/^[\\x00-\\xFF]*$/:/^[\\x00-\\x7F]*$/).test(t)}h(le,"Re");function Ft(t,e=!1){let s=[],r=0;for(;r<t.length;){let c=t[r],f=h(function(l){if(!e)throw new TypeError(l);s.push({type:"INVALID_CHAR",index:r,value:t[r++]})},"c");if(c==="*"){s.push({type:"ASTERISK",index:r,value:t[r++]});continue}if(c==="+"||c==="?"){s.push({type:"OTHER_MODIFIER",index:r,value:t[r++]});continue}if(c==="\\\\"){s.push({type:"ESCAPED_CHAR",index:r++,value:t[r++]});continue}if(c==="{"){s.push({type:"OPEN",index:r,value:t[r++]});continue}if(c==="}"){s.push({type:"CLOSE",index:r,value:t[r++]});continue}if(c===":"){let l="",n=r+1;for(;n<t.length;){let u=t.substr(n,1);if(n===r+1&&De.test(u)||n!==r+1&&Ne.test(u)){l+=t[n++];continue}break}if(!l){f(`Missing parameter name at ${r}`);continue}s.push({type:"NAME",index:r,value:l}),r=n;continue}if(c==="("){let l=1,n="",u=r+1,o=!1;if(t[u]==="?"){f(`Pattern cannot start with "?" at ${u}`);continue}for(;u<t.length;){if(!le(t[u],!1)){f(`Invalid character \'${t[u]}\' at ${u}.`),o=!0;break}if(t[u]==="\\\\"){n+=t[u++]+t[u++];continue}if(t[u]===")"){if(l--,l===0){u++;break}}else if(t[u]==="("&&(l++,t[u+1]!=="?")){f(`Capturing groups are not allowed at ${u}`),o=!0;break}n+=t[u++]}if(o)continue;if(l){f(`Unbalanced pattern at ${r}`);continue}if(!n){f(`Missing pattern at ${r}`);continue}s.push({type:"REGEX",index:r,value:n}),r=u;continue}s.push({type:"CHAR",index:r,value:t[r++]})}return s.push({type:"END",index:r,value:""}),s}h(Ft,"v");function Gt(t,e={}){let s=Ft(t);e.delimiter??="/#?",e.prefixes??="./";let r=`[^${R(e.delimiter)}]+?`,c=[],f=0,l=0,n="",u=new Set,o=h(w=>{if(l<s.length&&s[l].type===w)return s[l++].value},"a"),x=h(()=>o("OTHER_MODIFIER")??o("ASTERISK"),"f"),L=h(w=>{let b=o(w);if(b!==void 0)return b;let{type:$,index:J}=s[l];throw new TypeError(`Unexpected ${$} at ${J}, expected ${w}`)},"d"),z=h(()=>{let w="",b;for(;b=o("CHAR")??o("ESCAPED_CHAR");)w+=b;return w},"T"),Pe=h(w=>w,"Se"),ft=e.encodePart||Pe,pt="",bt=h(w=>{pt+=w},"U"),kt=h(()=>{pt.length&&(c.push(new ut(3,"","",ft(pt),"",3)),pt="")},"$"),Bt=h((w,b,$,J,I)=>{let O=3;switch(I){case"?":O=1;break;case"*":O=0;break;case"+":O=2;break}if(!b&&!$&&O===3){bt(w);return}if(kt(),!b&&!$){if(!w)return;c.push(new ut(3,"","",ft(w),"",O));return}let S;$?$==="*"?S=Dt:S=$:S=r;let et=2;S===r?(et=1,S=""):S===Dt&&(et=0,S="");let D;if(b?D=b:$&&(D=f++),u.has(D))throw new TypeError(`Duplicate name \'${D}\'.`);u.add(D),c.push(new ut(et,D,ft(w),S,ft(J),O))},"V");for(;l<s.length;){let w=o("CHAR"),b=o("NAME"),$=o("REGEX");if(!b&&!$&&($=o("ASTERISK")),b||$){let I=w??"";e.prefixes.indexOf(I)===-1&&(bt(I),I=""),kt();let O=x();Bt(I,b,$,"",O);continue}let J=w??o("ESCAPED_CHAR");if(J){bt(J);continue}if(o("OPEN")){let I=z(),O=o("NAME"),S=o("REGEX");!O&&!S&&(S=o("ASTERISK"));let et=z();L("CLOSE");let D=x();Bt(I,O,S,et,D);continue}kt(),L("END")}return c}h(Gt,"D");function R(t){return t.replace(/([.+*?^${}()[\\]|/\\\\])/g,"\\\\$1")}h(R,"S");function Nt(t){return t&&t.ignoreCase?"ui":"u"}h(Nt,"X");function ce(t,e,s){return Kt(Gt(t,s),e,s)}h(ce,"Z");function V(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}h(V,"k");function Kt(t,e,s={}){s.delimiter??="/#?",s.prefixes??="./",s.sensitive??=!1,s.strict??=!1,s.end??=!0,s.start??=!0,s.endsWith="";let r=s.start?"^":"";for(let n of t){if(n.type===3){n.modifier===3?r+=R(n.value):r+=`(?:${R(n.value)})${V(n.modifier)}`;continue}e&&e.push(n.name);let u=`[^${R(s.delimiter)}]+?`,o=n.value;if(n.type===1?o=u:n.type===0&&(o=Dt),!n.prefix.length&&!n.suffix.length){n.modifier===3||n.modifier===1?r+=`(${o})${V(n.modifier)}`:r+=`((?:${o})${V(n.modifier)})`;continue}if(n.modifier===3||n.modifier===1){r+=`(?:${R(n.prefix)}(${o})${R(n.suffix)})`,r+=V(n.modifier);continue}r+=`(?:${R(n.prefix)}`,r+=`((?:${o})(?:`,r+=R(n.suffix),r+=R(n.prefix),r+=`(?:${o}))*)${R(n.suffix)})`,n.modifier===0&&(r+="?")}let c=`[${R(s.endsWith)}]|$`,f=`[${R(s.delimiter)}]`;if(s.end)return s.strict||(r+=`${f}?`),s.endsWith.length?r+=`(?=${c})`:r+="$",new RegExp(r,Nt(s));s.strict||(r+=`(?:${f}(?=${c}))?`);let l=!1;if(t.length){let n=t[t.length-1];n.type===3&&n.modifier===3&&(l=s.delimiter.indexOf(n)>-1)}return l||(r+=`(?=${f}|${c})`),new RegExp(r,Nt(s))}h(Kt,"F");var H={delimiter:"",prefixes:"",sensitive:!0,strict:!0},je={delimiter:".",prefixes:"",sensitive:!0,strict:!0},He={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function ue(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\\\"||t[0]=="{")&&t[1]=="/":!1}h(ue,"J");function Xt(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}h(Xt,"Q");function fe(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}h(fe,"Ee");function Vt(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\\\"||t[0]==="{")&&t[1]==="["}h(Vt,"W");var pe=["ftp","file","http","https","ws","wss"];function zt(t){if(!t)return!0;for(let e of pe)if(t.test(e))return!0;return!1}h(zt,"N");function de(t,e){if(t=Xt(t,"#"),e||t==="")return t;let s=new URL("https://example.com");return s.hash=t,s.hash?s.hash.substring(1,s.hash.length):""}h(de,"te");function me(t,e){if(t=Xt(t,"?"),e||t==="")return t;let s=new URL("https://example.com");return s.search=t,s.search?s.search.substring(1,s.search.length):""}h(me,"re");function we(t,e){return e||t===""?t:Vt(t)?Qt(t):Zt(t)}h(we,"ne");function ge(t,e){if(e||t==="")return t;let s=new URL("https://example.com");return s.password=t,s.password}h(ge,"se");function ve(t,e){if(e||t==="")return t;let s=new URL("https://example.com");return s.username=t,s.username}h(ve,"ie");function ye(t,e,s){if(s||t==="")return t;if(e&&!pe.includes(e))return new URL(`${e}:${t}`).pathname;let r=t[0]=="/";return t=new URL(r?t:"/-"+t,"https://example.com").pathname,r||(t=t.substring(2,t.length)),t}h(ye,"ae");function _e(t,e,s){return Jt(e)===t&&(t=""),s||t===""?t:qt(t)}h(_e,"oe");function be(t,e){return t=fe(t,":"),e||t===""?t:_t(t)}h(be,"ce");function Jt(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}h(Jt,"_");function _t(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol \'${t}\'.`)}h(_t,"y");function ke(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}h(ke,"le");function xe(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}h(xe,"fe");function Zt(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}h(Zt,"z");function Qt(t){if(t==="")return t;if(/[^0-9a-fA-F[\\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname \'${t}\'`);return t.toLowerCase()}h(Qt,"j");function qt(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port \'${t}\'.`)}h(qt,"K");function $e(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}h($e,"he");function Ee(t){return t===""?t:new URL(`data:${t}`).pathname}h(Ee,"ue");function Re(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}h(Re,"de");function Se(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}h(Se,"pe");var st,k,y,d,Z,it,W,F,G,nt,m,g,$t,Yt,dt,Et,Q,rt,at,mt,E,C,wt,Rt,St,te,ht,gt,Wt,ee,Ct,se,ot,vt,K,q,N,X,Ot,ie,Pt,ne,Lt,re,At,ae,P,A,Tt,he,Ut,Fe=(Ut=class{constructor(t){p(this,m),p(this,$t),p(this,dt),p(this,Q),p(this,at),p(this,E),p(this,wt),p(this,St),p(this,ht),p(this,Wt),p(this,Ct),p(this,ot),p(this,K),p(this,N),p(this,Ot),p(this,Pt),p(this,Lt),p(this,At),p(this,P),p(this,Tt),p(this,st,void 0),p(this,k,[]),p(this,y,{}),p(this,d,0),p(this,Z,1),p(this,it,0),p(this,W,0),p(this,F,0),p(this,G,0),p(this,nt,!1),v(this,st,t)}get result(){return i(this,y)}parse(){for(v(this,k,Ft(i(this,st),!0));i(this,d)<i(this,k).length;v(this,d,i(this,d)+i(this,Z))){if(v(this,Z,1),i(this,k)[i(this,d)].type==="END"){if(i(this,W)===0){a(this,dt,Et).call(this),a(this,N,X).call(this)?a(this,m,g).call(this,9,1):a(this,K,q).call(this)?a(this,m,g).call(this,8,1):a(this,m,g).call(this,7,0);continue}else if(i(this,W)===2){a(this,Q,rt).call(this,5);continue}a(this,m,g).call(this,10,0);break}if(i(this,F)>0)if(a(this,Pt,ne).call(this))v(this,F,i(this,F)-1);else continue;if(a(this,Ot,ie).call(this)){v(this,F,i(this,F)+1);continue}switch(i(this,W)){case 0:a(this,wt,Rt).call(this)&&a(this,Q,rt).call(this,1);break;case 1:if(a(this,wt,Rt).call(this)){a(this,Tt,he).call(this);let t=7,e=1;a(this,St,te).call(this)?(t=2,e=3):i(this,nt)&&(t=2),a(this,m,g).call(this,t,e)}break;case 2:a(this,ht,gt).call(this)?a(this,Q,rt).call(this,3):(a(this,ot,vt).call(this)||a(this,K,q).call(this)||a(this,N,X).call(this))&&a(this,Q,rt).call(this,5);break;case 3:a(this,Wt,ee).call(this)?a(this,m,g).call(this,4,1):a(this,ht,gt).call(this)&&a(this,m,g).call(this,5,1);break;case 4:a(this,ht,gt).call(this)&&a(this,m,g).call(this,5,1);break;case 5:a(this,Lt,re).call(this)?v(this,G,i(this,G)+1):a(this,At,ae).call(this)&&v(this,G,i(this,G)-1),a(this,Ct,se).call(this)&&!i(this,G)?a(this,m,g).call(this,6,1):a(this,ot,vt).call(this)?a(this,m,g).call(this,7,0):a(this,K,q).call(this)?a(this,m,g).call(this,8,1):a(this,N,X).call(this)&&a(this,m,g).call(this,9,1);break;case 6:a(this,ot,vt).call(this)?a(this,m,g).call(this,7,0):a(this,K,q).call(this)?a(this,m,g).call(this,8,1):a(this,N,X).call(this)&&a(this,m,g).call(this,9,1);break;case 7:a(this,K,q).call(this)?a(this,m,g).call(this,8,1):a(this,N,X).call(this)&&a(this,m,g).call(this,9,1);break;case 8:a(this,N,X).call(this)&&a(this,m,g).call(this,9,1);break;case 9:break;case 10:break}}i(this,y).hostname!==void 0&&i(this,y).port===void 0&&(i(this,y).port="")}},st=new WeakMap,k=new WeakMap,y=new WeakMap,d=new WeakMap,Z=new WeakMap,it=new WeakMap,W=new WeakMap,F=new WeakMap,G=new WeakMap,nt=new WeakMap,m=new WeakSet,g=h(function(t,e){switch(i(this,W)){case 0:break;case 1:i(this,y).protocol=a(this,P,A).call(this);break;case 2:break;case 3:i(this,y).username=a(this,P,A).call(this);break;case 4:i(this,y).password=a(this,P,A).call(this);break;case 5:i(this,y).hostname=a(this,P,A).call(this);break;case 6:i(this,y).port=a(this,P,A).call(this);break;case 7:i(this,y).pathname=a(this,P,A).call(this);break;case 8:i(this,y).search=a(this,P,A).call(this);break;case 9:i(this,y).hash=a(this,P,A).call(this);break;case 10:break}i(this,W)!==0&&t!==10&&([1,2,3,4].includes(i(this,W))&&[6,7,8,9].includes(t)&&(i(this,y).hostname??=""),[1,2,3,4,5,6].includes(i(this,W))&&[8,9].includes(t)&&(i(this,y).pathname??=i(this,nt)?"/":""),[1,2,3,4,5,6,7].includes(i(this,W))&&t===9&&(i(this,y).search??="")),a(this,$t,Yt).call(this,t,e)},"#r"),$t=new WeakSet,Yt=h(function(t,e){v(this,W,t),v(this,it,i(this,d)+e),v(this,d,i(this,d)+e),v(this,Z,0)},"#R"),dt=new WeakSet,Et=h(function(){v(this,d,i(this,it)),v(this,Z,0)},"#b"),Q=new WeakSet,rt=h(function(t){a(this,dt,Et).call(this),v(this,W,t)},"#u"),at=new WeakSet,mt=h(function(t){return t<0&&(t=i(this,k).length-t),t<i(this,k).length?i(this,k)[t]:i(this,k)[i(this,k).length-1]},"#m"),E=new WeakSet,C=h(function(t,e){let s=a(this,at,mt).call(this,t);return s.value===e&&(s.type==="CHAR"||s.type==="ESCAPED_CHAR"||s.type==="INVALID_CHAR")},"#a"),wt=new WeakSet,Rt=h(function(){return a(this,E,C).call(this,i(this,d),":")},"#P"),St=new WeakSet,te=h(function(){return a(this,E,C).call(this,i(this,d)+1,"/")&&a(this,E,C).call(this,i(this,d)+2,"/")},"#E"),ht=new WeakSet,gt=h(function(){return a(this,E,C).call(this,i(this,d),"@")},"#S"),Wt=new WeakSet,ee=h(function(){return a(this,E,C).call(this,i(this,d),":")},"#O"),Ct=new WeakSet,se=h(function(){return a(this,E,C).call(this,i(this,d),":")},"#k"),ot=new WeakSet,vt=h(function(){return a(this,E,C).call(this,i(this,d),"/")},"#x"),K=new WeakSet,q=h(function(){if(a(this,E,C).call(this,i(this,d),"?"))return!0;if(i(this,k)[i(this,d)].value!=="?")return!1;let t=a(this,at,mt).call(this,i(this,d)-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"},"#h"),N=new WeakSet,X=h(function(){return a(this,E,C).call(this,i(this,d),"#")},"#f"),Ot=new WeakSet,ie=h(function(){return i(this,k)[i(this,d)].type=="OPEN"},"#T"),Pt=new WeakSet,ne=h(function(){return i(this,k)[i(this,d)].type=="CLOSE"},"#A"),Lt=new WeakSet,re=h(function(){return a(this,E,C).call(this,i(this,d),"[")},"#y"),At=new WeakSet,ae=h(function(){return a(this,E,C).call(this,i(this,d),"]")},"#w"),P=new WeakSet,A=h(function(){let t=i(this,k)[i(this,d)],e=a(this,at,mt).call(this,i(this,it)).index;return i(this,st).substring(e,t.index)},"#c"),Tt=new WeakSet,he=h(function(){let t={};Object.assign(t,H),t.encodePart=_t;let e=ce(a(this,P,A).call(this),void 0,t);v(this,nt,zt(e))},"#C"),h(Ut,"H"),Ut),Mt=["protocol","username","password","hostname","port","pathname","search","hash"],j="*";function jt(t,e){if(typeof t!="string")throw new TypeError("parameter 1 is not of type \'string\'.");let s=new URL(t,e);return{protocol:s.protocol.substring(0,s.protocol.length-1),username:s.username,password:s.password,hostname:s.hostname,port:s.port,pathname:s.pathname,search:s.search!==""?s.search.substring(1,s.search.length):void 0,hash:s.hash!==""?s.hash.substring(1,s.hash.length):void 0}}h(jt,"ge");function U(t,e){return e?tt(t):t}h(U,"b");function Y(t,e,s){let r;if(typeof e.baseURL=="string")try{r=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=U(r.protocol.substring(0,r.protocol.length-1),s)),!s&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=U(r.username,s)),!s&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=U(r.password,s)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=U(r.hostname,s)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=U(r.port,s)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=U(r.pathname,s)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=U(r.search.substring(1,r.search.length),s)),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=U(r.hash.substring(1,r.hash.length),s))}catch{throw new TypeError(`invalid baseURL \'${e.baseURL}\'.`)}if(typeof e.protocol=="string"&&(t.protocol=be(e.protocol,s)),typeof e.username=="string"&&(t.username=ve(e.username,s)),typeof e.password=="string"&&(t.password=ge(e.password,s)),typeof e.hostname=="string"&&(t.hostname=we(e.hostname,s)),typeof e.port=="string"&&(t.port=_e(e.port,t.protocol,s)),typeof e.pathname=="string"){if(t.pathname=e.pathname,r&&!ue(t.pathname,s)){let c=r.pathname.lastIndexOf("/");c>=0&&(t.pathname=U(r.pathname.substring(0,c+1),s)+t.pathname)}t.pathname=ye(t.pathname,t.protocol,s)}return typeof e.search=="string"&&(t.search=me(e.search,s)),typeof e.hash=="string"&&(t.hash=de(e.hash,s)),t}h(Y,"w");function tt(t){return t.replace(/([+*?:{}()\\\\])/g,"\\\\$1")}h(tt,"C");function We(t){return t.replace(/([.+*?^${}()[\\]|/\\\\])/g,"\\\\$1")}h(We,"Oe");function Ce(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let s=".*",r=`[^${We(e.delimiter)}]+?`,c=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,f="";for(let l=0;l<t.length;++l){let n=t[l];if(n.type===3){if(n.modifier===3){f+=tt(n.value);continue}f+=`{${tt(n.value)}}${V(n.modifier)}`;continue}let u=n.hasCustomName(),o=!!n.suffix.length||!!n.prefix.length&&(n.prefix.length!==1||!e.prefixes.includes(n.prefix)),x=l>0?t[l-1]:null,L=l<t.length-1?t[l+1]:null;if(!o&&u&&n.type===1&&n.modifier===3&&L&&!L.prefix.length&&!L.suffix.length)if(L.type===3){let z=L.value.length>0?L.value[0]:"";o=c.test(z)}else o=!L.hasCustomName();if(!o&&!n.prefix.length&&x&&x.type===3){let z=x.value[x.value.length-1];o=e.prefixes.includes(z)}o&&(f+="{"),f+=tt(n.prefix),u&&(f+=`:${n.name}`),n.type===2?f+=`(${n.value})`:n.type===1?u||(f+=`(${r})`):n.type===0&&(!u&&(!x||x.type===3||x.modifier!==3||o||n.prefix!=="")?f+="*":f+=`(${s})`),n.type===1&&u&&n.suffix.length&&c.test(n.suffix[0])&&(f+="\\\\"),f+=tt(n.suffix),o&&(f+="}"),n.modifier!==3&&(f+=V(n.modifier))}return f}h(Ce,"ke");var M,B,lt,_,T,ct,It,Oe=(It=class{constructor(t={},e,s){p(this,M,void 0),p(this,B,{}),p(this,lt,{}),p(this,_,{}),p(this,T,{}),p(this,ct,!1);try{let r;if(typeof e=="string"?r=e:s=e,typeof t=="string"){let n=new Fe(t);if(n.parse(),t=n.result,r===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=r}else{if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type \'string\' and cannot convert to dictionary.");if(r)throw new TypeError("parameter 1 is not of type \'string\'.")}typeof s>"u"&&(s={ignoreCase:!1});let c={ignoreCase:s.ignoreCase===!0};v(this,M,Y({pathname:j,protocol:j,username:j,password:j,hostname:j,port:j,search:j,hash:j},t,!0)),Jt(i(this,M).protocol)===i(this,M).port&&(i(this,M).port="");let l;for(l of Mt){if(!(l in i(this,M)))continue;let n={},u=i(this,M)[l];switch(i(this,lt)[l]=[],l){case"protocol":Object.assign(n,H),n.encodePart=_t;break;case"username":Object.assign(n,H),n.encodePart=ke;break;case"password":Object.assign(n,H),n.encodePart=xe;break;case"hostname":Object.assign(n,je),Vt(u)?n.encodePart=Qt:n.encodePart=Zt;break;case"port":Object.assign(n,H),n.encodePart=qt;break;case"pathname":zt(i(this,B).protocol)?(Object.assign(n,He,c),n.encodePart=$e):(Object.assign(n,H,c),n.encodePart=Ee);break;case"search":Object.assign(n,H,c),n.encodePart=Re;break;case"hash":Object.assign(n,H,c),n.encodePart=Se;break}try{i(this,T)[l]=Gt(u,n),i(this,B)[l]=Kt(i(this,T)[l],i(this,lt)[l],n),i(this,_)[l]=Ce(i(this,T)[l],n),v(this,ct,i(this,ct)||i(this,T)[l].some(o=>o.type===2))}catch{throw new TypeError(`invalid ${l} pattern \'${i(this,M)[l]}\'.`)}}}catch(r){throw new TypeError(`Failed to construct \'URLPattern\': ${r.message}`)}}test(t={},e){let s={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!1;try{typeof t=="object"?s=Y(s,t,!1):s=Y(s,jt(t,e),!1)}catch{return!1}let r;for(r of Mt)if(!i(this,B)[r].exec(s[r]))return!1;return!0}exec(t={},e){let s={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"?s=Y(s,t,!1):s=Y(s,jt(t,e),!1)}catch{return null}let r={};e?r.inputs=[t,e]:r.inputs=[t];let c;for(c of Mt){let f=i(this,B)[c].exec(s[c]);if(!f)return null;let l={};for(let[n,u]of i(this,lt)[c].entries())if(typeof u=="string"||typeof u=="number"){let o=f[n+1];l[u]=o}r[c]={input:s[c]??"",groups:l}}return r}static compareComponent(t,e,s){let r=h((n,u)=>{for(let o of["type","modifier","prefix","value","suffix"]){if(n[o]<u[o])return-1;if(n[o]!==u[o])return 1}return 0},"o"),c=new ut(3,"","","","",3),f=new ut(0,"","","","",3),l=h((n,u)=>{let o=0;for(;o<Math.min(n.length,u.length);++o){let x=r(n[o],u[o]);if(x)return x}return n.length===u.length?0:r(n[o]??c,u[o]??c)},"s");return!i(e,_)[t]&&!i(s,_)[t]?0:i(e,_)[t]&&!i(s,_)[t]?l(i(e,T)[t],[f]):!i(e,_)[t]&&i(s,_)[t]?l([f],i(s,T)[t]):l(i(e,T)[t],i(s,T)[t])}get protocol(){return i(this,_).protocol}get username(){return i(this,_).username}get password(){return i(this,_).password}get hostname(){return i(this,_).hostname}get port(){return i(this,_).port}get pathname(){return i(this,_).pathname}get search(){return i(this,_).search}get hash(){return i(this,_).hash}get hasRegExpGroups(){return i(this,ct)}},M=new WeakMap,B=new WeakMap,lt=new WeakMap,_=new WeakMap,T=new WeakMap,ct=new WeakMap,h(It,"me"),It);globalThis.URLPattern||(globalThis.URLPattern=Oe);\n';
}
});
// ../primitives/dist/load.js
var require_load = __commonJS2({
"../primitives/dist/load.js"(exports, module) {
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __accessCheck = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
};
var __privateIn = (member, obj) => {
if (Object(obj) !== obj)
throw TypeError('Cannot use the "in" operator on this value');
return member.has(obj);
};
var __privateGet = (obj, member, getter) => {
__accessCheck(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet = (obj, member, value, setter) => {
__accessCheck(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __privateMethod = (obj, member, method) => {
__accessCheck(obj, member, "access private method");
return method;
};
var define_process_default;
var init_define_process = __esm({
"<define:process>"() {
define_process_default = { version: "v18.20.5", env: {}, versions: { node: " 18.20.5" } };
}
});
var require_symbols = __commonJS({
"../../node_modules/.pnpm/undici@6.21.0/node_modules/undici/lib/core/symbols.js"(exports2, module2) {
"use strict";
init_define_process();
module2.exports = {
kClose: Symbol("close"),
kDestroy: Symbol("destroy"),
kDispatch: Symbol("dispatch"),
kUrl: Symbol("url"),
kWriting: Symbol("writing"),
kResuming: Symbol("resuming"),
kQueue: Symbol("queue"),
kConnect: Symbol("connect"),
kConnecting: Symbol("connecting"),
kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"),
kKeepAliveMaxTimeout: Symbol("max keep alive timeout"),
kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"),
kKeepAliveTimeoutValue: Symbol("keep alive timeout"),
kKeepAlive: Symbol("keep alive"),
kHeadersTimeout: Symbol("headers timeout"),
kBodyTimeout: Symbol("body timeout"),
kServerName: Symbol("server name"),
kLocalAddress: Symbol("local address"),
kHost: Symbol("host"),
kNoRef: Symbol("no ref"),
kBodyUsed: Symbol("used"),
kBody: Symbol("abstracted request body"),
kRunning: Symbol("running"),
kBlocking: Symbol("blocking"),
kPending: Symbol("pending"),
kSize: Symbol("size"),
kBusy: Symbol("busy"),
kQueued: Symbol("queued"),
kFree: Symbol("free"),
kConnected: Symbol("connected"),
kClosed: Symbol("closed"),
kNeedDrain: Symbol("need drain"),
kReset: Symbol("reset"),
kDestroyed: Symbol.for("nodejs.stream.destroyed"),
kResume: Symbol("resume"),
kOnError: Symbol("on error"),
kMaxHeadersSize: Symbol("max headers size"),
kRunningIdx: Symbol("running index"),
kPendingIdx: Symbol("pending index"),
kError: Symbol("error"),
kClients: Symbol("clients"),
kClient: Symbol("client"),
kParser: Symbol("parser"),
kOnDestroyed: Symbol("destroy callbacks"),
kPipelining: Symbol("pipelining"),
kSocket: Symbol("socket"),
kHostHeader: Symbol("host header"),
kConnector: Symbol("connector"),
kStrictContentLength: Symbol("strict content length"),
kMaxRedirections: Symbol("maxRedirections"),
kMaxRequests: Symbol("maxRequestsPerClient"),
kProxy: Symbol("proxy agent options"),
kCounter: Symbol("socket request counter"),
kInterceptors: Symbol("dispatch interceptors"),
kMaxResponseSize: Symbol("max response size"),
kHTTP2Session: Symbol("http2Session"),
kHTTP2SessionState: Symbol("http2Session state"),
kRetryHandlerDefaultRetry: Symbol("retry agent default retry"),
kConstruct: Symbol("constructable"),
kListeners: Symbol("listeners"),
kHTTPContext: Symbol("http context"),
kMaxConcurrentStreams: Symbol("max concurrent streams"),
kNoProxyAgent: Symbol("no proxy agent"),
kHttpProxyAgent: Symbol("http proxy agent"),
kHttpsProxyAgent: Symbol("https proxy agent")
};
}
});
var require_errors = __commonJS({
"../../node_modules/.pnpm/undici@6.21.0/node_modules/undici/lib/core/errors.js"(exports2, module2) {
"use strict";
init_define_process();
var _UndiciError = class _UndiciError extends Error {
constructor(message) {
super(message);
this.name = "UndiciError";
this.code = "UND_ERR";
}
};
__name(_UndiciError, "UndiciError");
var UndiciError = _UndiciError;
var _ConnectTimeoutError = class _ConnectTimeoutError extends UndiciError {
constructor(message) {
super(message);
this.name = "ConnectTimeoutError";
this.message = message || "Connect Timeout Error";
this.code = "UND_ERR_CONNECT_TIMEOUT";
}
};
__name(_ConnectTimeoutError, "ConnectTimeoutError");
var ConnectTimeoutError = _ConnectTimeoutError;
var _HeadersTimeoutError = class _HeadersTimeoutError extends UndiciError {
constructor(message) {
super(message);
this.name = "HeadersTimeoutError";
this.message = message || "Headers Timeout Error";
this.code = "UND_ERR_HEADERS_TIMEOUT";
}
};
__name(_HeadersTimeoutError, "HeadersTimeoutError");
var HeadersTimeoutError = _HeadersTimeoutError;
var _HeadersOverflowError = class _HeadersOverflowError extends UndiciError {
constructor(message) {
super(message);
this.name = "HeadersOverflowError";
this.message = message || "Headers Overflow Error";
this.code = "UND_ERR_HEADERS_OVERFLOW";
}
};
__name(_HeadersOverflowError, "HeadersOverflowError");
var HeadersOverflowError = _HeadersOverflowError;
var _BodyTimeoutError = class _BodyTimeoutError extends UndiciError {
constructor(message) {
super(message);
this.name = "BodyTimeoutError";
this.message = message || "Body Timeout Error";
this.code = "UND_ERR_BODY_TIMEOUT";
}
};
__name(_BodyTimeoutError, "BodyTimeoutError");
var BodyTimeoutError = _BodyTimeoutError;
var _ResponseStatusCodeError = class _ResponseStatusCodeError extends UndiciError {
constructor(message, statusCode, headers, body) {
super(message);
this.name = "ResponseStatusCodeError";
this.message = message || "Response Status Code Error";
this.code = "UND_ERR_RESPONSE_STATUS_CODE";
this.body = body;
this.status = statusCode;
this.statusCode = statusCode;
this.headers = headers;
}
};
__name(_ResponseStatusCodeError, "ResponseStatusCodeError");
var ResponseStatusCodeError = _ResponseStatusCodeError;
var _InvalidArgumentError = class _InvalidArgumentError extends UndiciError {
constructor(message) {
super(message);
this.name = "InvalidArgumentError";
this.message = message || "Invalid Argument Error";
this.code = "UND_ERR_INVALID_ARG";
}
};
__name(_InvalidArgumentError, "InvalidArgumentError");
var InvalidArgumentError = _InvalidArgumentError;
var _InvalidReturnValueError = class _InvalidReturnValueError extends UndiciError {
constructor(message) {
super(message);
this.name = "InvalidReturnValueError";
this.message = message || "Invalid Return Value Error";
this.code = "UND_ERR_INVALID_RETURN_VALUE";
}
};
__name(_InvalidReturnValueError, "InvalidReturnValueError");
var InvalidReturnValueError = _InvalidReturnValueError;
var _AbortError = class _AbortError extends UndiciError {
constructor(message) {
super(message);
this.name = "AbortError";
this.message = message || "The operation was aborted";
}
};
__name(_AbortError, "AbortError");
var AbortError = _AbortError;
var _RequestAbortedError = class _RequestAbortedError extends AbortError {
constructor(message) {
super(message);
this.name = "AbortError";
this.message = message || "Request aborted";
this.code = "UND_ERR_ABORTED";
}
};
__name(_RequestAbortedError, "RequestAbortedError");
var RequestAbortedError = _RequestAbortedError;
var _InformationalError = class _InformationalError extends UndiciError {
constructor(message) {
super(message);
this.name = "InformationalError";
this.message = message || "Request information";
this.code = "UND_ERR_INFO";
}
};
__name(_InformationalError, "InformationalError");
var InformationalError =