@webqit/fetch-plus 0.1.11 → 0.1.13

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/README.md CHANGED
@@ -236,9 +236,10 @@ Note that `request.port` above is assumed to be injected by the application runt
236
236
 
237
237
  ```js
238
238
  const response = new LiveResponse(await fetch('http://localhost/hello'));
239
+ const { port } = await response.now();
239
240
 
240
- response.port.postMessage('Hello from client');
241
- response.port.addEventListener('message', (event) => {
241
+ port.postMessage('Hello from client');
242
+ port.addEventListener('message', (event) => {
242
243
  console.log(event.data); // Hello from server
243
244
  });
244
245
  ```
@@ -398,7 +399,7 @@ This is done via the `X-Message-Port` header.
398
399
  import { StarPort, WebSocketPort } from '@webqit/port-plus';
399
400
 
400
401
  // Create a port that will contain the ws instance
401
- req.port = new StarPort();
402
+ req.port = new StarPort({ handshake: 1, postAwaitsOpen: true, autoClose: true });
402
403
  const portId = crypto.randomUUID();
403
404
  portRegistry.set(portId, req.port);
404
405
  ```
package/dist/main.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var Pr=Object.defineProperty;var jt=(t,e)=>()=>(t&&(e=t(t=0)),e);var Te=(t,e)=>{for(var r in e)Pr(t,r,{get:e[r],enumerable:!0})};function Dt(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function tt(t,e=!1){let r=[],n=0;for(;n<t.length;){let s=t[n],i=g(function(a){if(!e)throw new TypeError(a);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 a="",o=n+1;for(;o<t.length;){let u=t.substr(o,1);if(o===n+1&&Rr.test(u)||o!==n+1&&jr.test(u)){a+=t[o++];continue}break}if(!a){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:a}),n=o;continue}if(s==="("){let a=1,o="",u=n+1,f=!1;if(t[u]==="?"){i(`Pattern cannot start with "?" at ${u}`);continue}for(;u<t.length;){if(!Dt(t[u],!1)){i(`Invalid character '${t[u]}' at ${u}.`),f=!0;break}if(t[u]==="\\"){o+=t[u++]+t[u++];continue}if(t[u]===")"){if(a--,a===0){u++;break}}else if(t[u]==="("&&(a++,t[u+1]!=="?")){i(`Capturing groups are not allowed at ${u}`),f=!0;break}o+=t[u++]}if(f)continue;if(a){i(`Unbalanced pattern at ${n}`);continue}if(!o){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=u;continue}r.push({type:"CHAR",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function rt(t,e={}){let r=tt(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${R(e.delimiter)}]+?`,s=[],i=0,a=0,o="",u=new Set,f=g(d=>{if(a<r.length&&r[a].type===d)return r[a++].value},"tryConsume"),c=g(()=>f("OTHER_MODIFIER")??f("ASTERISK"),"tryConsumeModifier"),p=g(d=>{let P=f(d);if(P!==void 0)return P;let{type:E,index:q}=r[a];throw new TypeError(`Unexpected ${E} at ${q}, expected ${d}`)},"mustConsume"),h=g(()=>{let d="",P;for(;P=f("CHAR")??f("ESCAPED_CHAR");)d+=P;return d},"consumeText"),m=g(d=>d,"DefaultEncodePart"),l=e.encodePart||m,y="",b=g(d=>{y+=d},"appendToPendingFixedValue"),w=g(()=>{y.length&&(s.push(new we(3,"","",l(y),"",3)),y="")},"maybeAddPartFromPendingFixedValue"),x=g((d,P,E,q,N)=>{let T=3;switch(N){case"?":T=1;break;case"*":T=0;break;case"+":T=2;break}if(!P&&!E&&T===3){b(d);return}if(w(),!P&&!E){if(!d)return;s.push(new we(3,"","",l(d),"",T));return}let j;E?E==="*"?j=Ze:j=E:j=n;let ve=2;j===n?(ve=1,j=""):j===Ze&&(ve=0,j="");let Z;if(P?Z=P:E&&(Z=i++),u.has(Z))throw new TypeError(`Duplicate name '${Z}'.`);u.add(Z),s.push(new we(ve,Z,l(d),j,l(q),T))},"addPart");for(;a<r.length;){let d=f("CHAR"),P=f("NAME"),E=f("REGEX");if(!P&&!E&&(E=f("ASTERISK")),P||E){let N=d??"";e.prefixes.indexOf(N)===-1&&(b(N),N=""),w();let T=c();x(N,P,E,"",T);continue}let q=d??f("ESCAPED_CHAR");if(q){b(q);continue}if(f("OPEN")){let N=h(),T=f("NAME"),j=f("REGEX");!T&&!j&&(j=f("ASTERISK"));let ve=h();p("CLOSE");let Z=c();x(N,T,j,ve,Z);continue}w(),p("END")}return s}function R(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ye(t){return t&&t.ignoreCase?"ui":"u"}function kt(t,e,r){return nt(rt(t,r),e,r)}function re(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function nt(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of t){if(o.type===3){o.modifier===3?n+=R(o.value):n+=`(?:${R(o.value)})${re(o.modifier)}`;continue}e&&e.push(o.name);let u=`[^${R(r.delimiter)}]+?`,f=o.value;if(o.type===1?f=u:o.type===0&&(f=Ze),!o.prefix.length&&!o.suffix.length){o.modifier===3||o.modifier===1?n+=`(${f})${re(o.modifier)}`:n+=`((?:${f})${re(o.modifier)})`;continue}if(o.modifier===3||o.modifier===1){n+=`(?:${R(o.prefix)}(${f})${R(o.suffix)})`,n+=re(o.modifier);continue}n+=`(?:${R(o.prefix)}`,n+=`((?:${f})(?:`,n+=R(o.suffix),n+=R(o.prefix),n+=`(?:${f}))*)${R(o.suffix)})`,o.modifier===0&&(n+="?")}let s=`[${R(r.endsWith)}]|$`,i=`[${R(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${s})`:n+="$",new RegExp(n,Ye(r));r.strict||(n+=`(?:${i}(?=${s}))?`);let a=!1;if(t.length){let o=t[t.length-1];o.type===3&&o.modifier===3&&(a=r.delimiter.indexOf(o)>-1)}return a||(n+=`(?=${i}|${s})`),new RegExp(n,Ye(r))}function qt(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1}function st(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function Nt(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function ot(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function it(t){if(!t)return!0;for(let e of Ut)if(t.test(e))return!0;return!1}function Ft(t,e){if(t=st(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 Ht(t,e){if(t=st(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 Bt(t,e){return e||t===""?t:ot(t)?ut(t):ft(t)}function Wt(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function zt(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function Vt(t,e,r){if(r||t==="")return t;if(e&&!Ut.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 Gt(t,e,r){return at(e)===t&&(t=""),r||t===""?t:ct(t)}function Jt(t,e){return t=Nt(t,":"),e||t===""?t:Le(t)}function at(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function Le(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Kt(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Xt(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function ft(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 ut(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function ct(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function Qt(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 Zt(t){return t===""?t:new URL(`data:${t}`).pathname}function Yt(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function er(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function et(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 U(t,e){return e?be(t):t}function ye(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=U(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=U(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=U(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=U(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=U(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=U(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=U(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=U(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=Jt(e.protocol,r)),typeof e.username=="string"&&(t.username=zt(e.username,r)),typeof e.password=="string"&&(t.password=Wt(e.password,r)),typeof e.hostname=="string"&&(t.hostname=Bt(e.hostname,r)),typeof e.port=="string"&&(t.port=Gt(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!qt(t.pathname,r)){let s=n.pathname.lastIndexOf("/");s>=0&&(t.pathname=U(n.pathname.substring(0,s+1),r)+t.pathname)}t.pathname=Vt(t.pathname,t.protocol,r)}return typeof e.search=="string"&&(t.search=Ht(e.search,r)),typeof e.hash=="string"&&(t.hash=Ft(e.hash,r)),t}function be(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function rr(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function nr(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=".*",n=`[^${rr(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,i="";for(let a=0;a<t.length;++a){let o=t[a];if(o.type===3){if(o.modifier===3){i+=be(o.value);continue}i+=`{${be(o.value)}}${re(o.modifier)}`;continue}let u=o.hasCustomName(),f=!!o.suffix.length||!!o.prefix.length&&(o.prefix.length!==1||!e.prefixes.includes(o.prefix)),c=a>0?t[a-1]:null,p=a<t.length-1?t[a+1]:null;if(!f&&u&&o.type===1&&o.modifier===3&&p&&!p.prefix.length&&!p.suffix.length)if(p.type===3){let h=p.value.length>0?p.value[0]:"";f=s.test(h)}else f=!p.hasCustomName();if(!f&&!o.prefix.length&&c&&c.type===3){let h=c.value[c.value.length-1];f=e.prefixes.includes(h)}f&&(i+="{"),i+=be(o.prefix),u&&(i+=`:${o.name}`),o.type===2?i+=`(${o.value})`:o.type===1?u||(i+=`(${n})`):o.type===0&&(!u&&(!c||c.type===3||c.modifier!==3||f||o.prefix!=="")?i+="*":i+=`(${r})`),o.type===1&&u&&o.suffix.length&&s.test(o.suffix[0])&&(i+="\\"),i+=be(o.suffix),f&&(i+="}"),o.modifier!==3&&(i+=re(o.modifier))}return i}var Tr,g,we,Rr,jr,Ze,ee,Ir,Lr,Ut,tr,Qe,Y,De,sr=jt(()=>{Tr=Object.defineProperty,g=(t,e)=>Tr(t,"name",{value:e,configurable:!0}),we=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"}};g(we,"Part");Rr=/[$_\p{ID_Start}]/u,jr=/[$_\u200C\u200D\p{ID_Continue}]/u,Ze=".*";g(Dt,"isASCII");g(tt,"lexer");g(rt,"parse");g(R,"escapeString");g(Ye,"flags");g(kt,"stringToRegexp");g(re,"modifierToString");g(nt,"partsToRegexp");ee={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Ir={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Lr={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};g(qt,"isAbsolutePathname");g(st,"maybeStripPrefix");g(Nt,"maybeStripSuffix");g(ot,"treatAsIPv6Hostname");Ut=["ftp","file","http","https","ws","wss"];g(it,"isSpecialScheme");g(Ft,"canonicalizeHash");g(Ht,"canonicalizeSearch");g(Bt,"canonicalizeHostname");g(Wt,"canonicalizePassword");g(zt,"canonicalizeUsername");g(Vt,"canonicalizePathname");g(Gt,"canonicalizePort");g(Jt,"canonicalizeProtocol");g(at,"defaultPortForProtocol");g(Le,"protocolEncodeCallback");g(Kt,"usernameEncodeCallback");g(Xt,"passwordEncodeCallback");g(ft,"hostnameEncodeCallback");g(ut,"ipv6HostnameEncodeCallback");g(ct,"portEncodeCallback");g(Qt,"standardURLPathnameEncodeCallback");g(Zt,"pathURLPathnameEncodeCallback");g(Yt,"searchEncodeCallback");g(er,"hashEncodeCallback");tr=class{#r;#t=[];#n={};#e=0;#o=1;#a=0;#i=0;#f=0;#p=0;#l=!1;constructor(t){this.#r=t}get result(){return this.#n}parse(){for(this.#t=tt(this.#r,!0);this.#e<this.#t.length;this.#e+=this.#o){if(this.#o=1,this.#t[this.#e].type==="END"){if(this.#i===0){this.#m(),this.#y()?this.#s(9,1):this.#b()?this.#s(8,1):this.#s(7,0);continue}else if(this.#i===2){this.#g(5);continue}this.#s(10,0);break}if(this.#f>0)if(this.#O())this.#f-=1;else continue;if(this.#S()){this.#f+=1;continue}switch(this.#i){case 0:this.#_()&&this.#g(1);break;case 1:if(this.#_()){this.#M();let t=7,e=1;this.#v()?(t=2,e=3):this.#l&&(t=2),this.#s(t,e)}break;case 2:this.#w()?this.#g(3):(this.#x()||this.#b()||this.#y())&&this.#g(5);break;case 3:this.#P()?this.#s(4,1):this.#w()&&this.#s(5,1);break;case 4:this.#w()&&this.#s(5,1);break;case 5:this.#A()?this.#p+=1:this.#C()&&(this.#p-=1),this.#E()&&!this.#p?this.#s(6,1):this.#x()?this.#s(7,0):this.#b()?this.#s(8,1):this.#y()&&this.#s(9,1);break;case 6:this.#x()?this.#s(7,0):this.#b()?this.#s(8,1):this.#y()&&this.#s(9,1);break;case 7:this.#b()?this.#s(8,1):this.#y()&&this.#s(9,1);break;case 8:this.#y()&&this.#s(9,1);break;case 9:break;case 10:break}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port="")}#s(t,e){switch(this.#i){case 0:break;case 1:this.#n.protocol=this.#d();break;case 2:break;case 3:this.#n.username=this.#d();break;case 4:this.#n.password=this.#d();break;case 5:this.#n.hostname=this.#d();break;case 6:this.#n.port=this.#d();break;case 7:this.#n.pathname=this.#d();break;case 8:this.#n.search=this.#d();break;case 9:this.#n.hash=this.#d();break;case 10:break}this.#i!==0&&t!==10&&([1,2,3,4].includes(this.#i)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#i)&&[8,9].includes(t)&&(this.#n.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#i)&&t===9&&(this.#n.search??="")),this.#h(t,e)}#h(t,e){this.#i=t,this.#a=this.#e+e,this.#e+=e,this.#o=0}#m(){this.#e=this.#a,this.#o=0}#g(t){this.#m(),this.#i=t}#u(t){return t<0&&(t=this.#t.length-t),t<this.#t.length?this.#t[t]:this.#t[this.#t.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")}#_(){return this.#c(this.#e,":")}#v(){return this.#c(this.#e+1,"/")&&this.#c(this.#e+2,"/")}#w(){return this.#c(this.#e,"@")}#P(){return this.#c(this.#e,":")}#E(){return this.#c(this.#e,":")}#x(){return this.#c(this.#e,"/")}#b(){if(this.#c(this.#e,"?"))return!0;if(this.#t[this.#e].value!=="?")return!1;let t=this.#u(this.#e-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#y(){return this.#c(this.#e,"#")}#S(){return this.#t[this.#e].type=="OPEN"}#O(){return this.#t[this.#e].type=="CLOSE"}#A(){return this.#c(this.#e,"[")}#C(){return this.#c(this.#e,"]")}#d(){let t=this.#t[this.#e],e=this.#u(this.#a).index;return this.#r.substring(e,t.index)}#M(){let t={};Object.assign(t,ee),t.encodePart=Le;let e=kt(this.#d(),void 0,t);this.#l=it(e)}};g(tr,"Parser");Qe=["protocol","username","password","hostname","port","pathname","search","hash"],Y="*";g(et,"extractValues");g(U,"processBaseURLString");g(ye,"applyInit");g(be,"escapePatternString");g(rr,"escapeRegexpString");g(nr,"partsToPattern");De=class{#r;#t={};#n={};#e={};#o={};#a=!1;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let o=new tr(t);if(o.parse(),t=o.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:Y,protocol:Y,username:Y,password:Y,hostname:Y,port:Y,search:Y,hash:Y};this.#r=ye(i,t,!0),at(this.#r.protocol)===this.#r.port&&(this.#r.port="");let a;for(a of Qe){if(!(a in this.#r))continue;let o={},u=this.#r[a];switch(this.#n[a]=[],a){case"protocol":Object.assign(o,ee),o.encodePart=Le;break;case"username":Object.assign(o,ee),o.encodePart=Kt;break;case"password":Object.assign(o,ee),o.encodePart=Xt;break;case"hostname":Object.assign(o,Ir),ot(u)?o.encodePart=ut:o.encodePart=ft;break;case"port":Object.assign(o,ee),o.encodePart=ct;break;case"pathname":it(this.#t.protocol)?(Object.assign(o,Lr,s),o.encodePart=Qt):(Object.assign(o,ee,s),o.encodePart=Zt);break;case"search":Object.assign(o,ee,s),o.encodePart=Yt;break;case"hash":Object.assign(o,ee,s),o.encodePart=er;break}try{this.#o[a]=rt(u,o),this.#t[a]=nt(this.#o[a],this.#n[a],o),this.#e[a]=nr(this.#o[a],o),this.#a=this.#a||this.#o[a].some(f=>f.type===2)}catch{throw new TypeError(`invalid ${a} pattern '${this.#r[a]}'.`)}}}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!1;try{typeof t=="object"?r=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return!1}let n;for(n of Qe)if(!this.#t[n].exec(r[n]))return!1;return!0}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=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let s;for(s of Qe){let i=this.#t[s].exec(r[s]);if(!i)return null;let a={};for(let[o,u]of this.#n[s].entries())if(typeof u=="string"||typeof u=="number"){let f=i[o+1];a[u]=f}n[s]={input:r[s]??"",groups:a}}return n}static compareComponent(t,e,r){let n=g((o,u)=>{for(let f of["type","modifier","prefix","value","suffix"]){if(o[f]<u[f])return-1;if(o[f]!==u[f])return 1}return 0},"comparePart"),s=new we(3,"","","","",3),i=new we(0,"","","","",3),a=g((o,u)=>{let f=0;for(;f<Math.min(o.length,u.length);++f){let c=n(o[f],u[f]);if(c)return c}return o.length===u.length?0:n(o[f]??s,u[f]??s)},"comparePartList");return!e.#e[t]&&!r.#e[t]?0:e.#e[t]&&!r.#e[t]?a(e.#o[t],[i]):!e.#e[t]&&r.#e[t]?a([i],r.#o[t]):a(e.#o[t],r.#o[t])}get protocol(){return this.#e.protocol}get username(){return this.#e.username}get password(){return this.#e.password}get hostname(){return this.#e.hostname}get port(){return this.#e.port}get pathname(){return this.#e.pathname}get search(){return this.#e.search}get hash(){return this.#e.hash}get hasRegExpGroups(){return this.#a}};g(De,"URLPattern")});var or={};Te(or,{URLPattern:()=>De});var ir=jt(()=>{sr();globalThis.URLPattern||(globalThis.URLPattern=De)});var Rt={};Te(Rt,{FormDataPlus:()=>B,HeadersPlus:()=>W,LiveResponse:()=>ze,Observer:()=>lr,RequestPlus:()=>He,ResponsePlus:()=>z,fetchPlus:()=>gr});function v(t){return!Array.isArray(t)&&typeof t=="object"&&t}function pe(t){return typeof t}function I(t){return Array.isArray(t)}function Re(t){return t===!0||t===!1}function de(t){return typeof t=="function"}function Ve(t){return t===null||t===""}function te(t){return arguments.length&&(t===void 0||typeof t>"u")}function _(t){return Array.isArray(t)||typeof t=="object"&&t||de(t)}function Ge(t){return Ve(t)||te(t)||t===!1||t===0||_(t)&&!Object.keys(t).length}function V(t){return de(t)||t&&{}.toString.call(t)==="[object function]"}function me(t){return t instanceof Number||typeof t=="number"}function G(t){return me(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function Je(t){return I(t)&&Object.getPrototypeOf(t)===Array.prototype}function Ke(t){return v(t)&&Object.getPrototypeOf(t)===Object.prototype}function J(t){return t instanceof String||typeof t=="string"&&t!==null}function Xe(t){return!J(t)&&!te(t.length)}function D(t,...e){if(!t||!["object","function"].includes(typeof t))throw new Error("Argument #1 must be of type object");let r=t[Symbol.for("wq")];if(r||(r=new je,Object.defineProperty(t,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!e.length)return r;let n,s;for(;n=e.shift();)(s=r)&&!(r=r.get(n))&&(r=new je,s.set(n,r));return r}var je=class extends Map{};function ge(t,e,r=!1){if(e=="")return t;var n=r?t.lastIndexOf(e):t.indexOf(e);return n===-1?"":t.substr(n+e.length)}function Ie(t,e,r=!1){if(e=="")return t;var n=r?t.lastIndexOf(e):t.indexOf(e);return n===-1?t:t.substr(0,n)}(async()=>typeof URLPattern>"u"&&await Promise.resolve().then(()=>(ir(),or)))();var lt=class extends URLPattern{#r;constructor(e,r=null){typeof e=="object"&&e?.baseURL&&({baseURL:r,...e}=e),super(e,r),this.#r=new URL(e,r)}isPattern(){let e=(s,i)=>{if(!s)return!1;let a=!1;for(let o of s){if(a){a=!1;continue}if(o==="\\"){a=!0;continue}if(i.has(o))return!0}return!1},r={protocol:new Set(["*"]),username:new Set(["*"]),password:new Set(["*"]),hostname:new Set(["*","{"]),port:new Set(["*","{"]),pathname:new Set(["*",":","{","("]),search:new Set(["*","{"]),hash:new Set(["*","{"])},n=this.#r;return e(n.protocol,r.protocol)||e(n.username,r.username)||e(n.password,r.password)||e(n.hostname,r.hostname)||e(n.port,r.port)||e(n.pathname,r.pathname)||e(n.search,r.search)||e(n.hash,r.hash)}exec(...e){let r=super.exec(...e);if(!r)return;let n={};for(let a of Object.values(r))a?.groups&&Object.assign(n,a.groups);let s={named:n};return{...r,vars:s,render:a=>a.replace(/\$(\$|[A-Z0-9_]+)/gi,(o,u)=>u==="$"?"$":s.named[u]??"")}}};var Ot={};Te(Ot,{any:()=>Kr,apply:()=>xt,batch:()=>St,construct:()=>wt,defineProperties:()=>Yr,defineProperty:()=>Oe,deleteProperties:()=>en,deleteProperty:()=>Ae,get:()=>X,getOwnPropertyDescriptor:()=>qe,getOwnPropertyDescriptors:()=>Qr,getPrototypeOf:()=>gt,has:()=>Ne,intercept:()=>Xr,isExtensible:()=>yt,map:()=>Zr,observe:()=>Et,ownKeys:()=>bt,path:()=>Gr,preventExtensions:()=>vt,reduce:()=>Pt,set:()=>oe,setPrototypeOf:()=>_t,subtree:()=>Jr});function F(t,e=!0){return I(t)?t:!e&&v(t)?[t]:t!==!1&&t!==0&&Ge(t)?[]:Xe(t)?Array.prototype.slice.call(t):v(t)?Object.values(t):[t]}var O=(t,...e)=>D(t,"observerAPI",...e),xe=(t,e)=>t instanceof Promise?t.then(e):e(t),ke={};var ne=class{constructor(e,r){this.registry=e,Object.assign(this,{...r,target:e.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var Pe=class extends ne{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),ke.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(e){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let r=e,n=this.filter;if(n!==1/0&&(n=F(n,!1))&&(r=e.filter(i=>n.includes(i.key))),this.params.diff&&(r=r.filter(i=>i.type!=="set"||i.value!==i.oldValue)),!r.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...r);return}this.emit.recursionTarget=this.params.recursions==="inject"?r:[]}let s=this.filter===1/0||Array.isArray(this.filter)?this.emit(r,this):this.emit(r[0],this);return xe(s,i=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):i})}};var se=class{constructor(e){this.target=e,this.entries=[]}addRegistration(e){return this.entries.push(e),e}removeRegistration(e){this.entries=this.entries.filter(r=>r!==e)}static _getInstance(e,r,n=!0,s=this.__namespace){if(!_(r))throw new Error(`Subject must be of type object; "${pe(r)}" given!`);let i=this;return s&&O(globalThis,"observerAPI","namespaces").has(e+"-"+s)&&(i=O(globalThis,"observerAPI","namespaces").get(e+"-"+s),e+="-"+s),!O(r,"registry").has(e)&&n&&O(r,"registry").set(e,new i(r)),O(r,"registry").get(e)}static _namespace(e,r,n=null){if(e+="-"+r,arguments.length===2)return O(globalThis,"observerAPI","namespaces").get(e);if(!(n.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);O(globalThis,"observerAPI","namespaces").set(e,n),n.__namespace=r}};var A=class{constructor(e,r){if(this.target=e,!r.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,r)}get[Symbol.toStringTag](){return"Descriptor"}static[Symbol.hasInstance](e){return e?.[Symbol.toStringTag]==="Descriptor"&&e.operation}};var L=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("listeners",...arguments)}static namespace(e,r=null){return super._namespace("listeners",...arguments)}constructor(e){super(e),this.batches=[]}addRegistration(e,r,n){return super.addRegistration(new Pe(this,{filter:e,emit:r,params:n}))}emit(e,{eventsArePropertyDescriptors:r=!1,eventIsArrayMethodDescriptor:n=!1}={}){if(this.batches.length){let s=this.batches[0].params.arrayMethodName;this.batches[0].snapshots.push({events:[...e],arrayMethodName:s,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n});return}this.$emit(this.entries,[{events:e,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n}])}$emit(e,r){let n=0,s=0,i=0;for(let c of e)n+=1,c.params.withPropertyDescriptors&&(s+=1),c.params.withArrayMethodDescriptors&&(i+=1);let a=[],o=[],u=[],f=[];for(let c of r){let p=c.arrayMethodName,h=c.eventsArePropertyDescriptors,m=c.eventIsArrayMethodDescriptor;for(let l of c.events)if(p&&(l.operation=p),s&&(i&&a.push(l),m||i!==n&&o.push(l)),s!==n){let y=l;if(h){let{target:b,type:w,...x}=l;y=new A(b,{type:"set",...x}),Object.defineProperty(y,"value","get"in x.value?{get:()=>x.value.get()}:{value:x.value.value}),x.oldValue&&Object.defineProperty(y,"oldValue","get"in x.oldValue?{get:()=>x.oldValue.get()}:{value:x.oldValue.value})}i&&u.push(y),m||i!==n&&f.push(y)}}for(let c of e)c.params.withPropertyDescriptors?c.params.withArrayMethodDescriptors?a.length&&c.fire(a):o.length&&c.fire(o):c.params.withArrayMethodDescriptors?u.length&&c.fire(u):f.length&&c.fire(f)}batch(e,r={}){this.batches.unshift({entries:[...this.entries],snapshots:[],params:r});let n=e();return xe(n,s=>{let i=this.batches.shift();return i.snapshots.length&&this.$emit(i.entries,i.snapshots),s})}};var Ee=class extends ne{exec(e,r,n){return this.running||!this.traps[e.operation]?r(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[e.operation](e,n,(...s)=>(this.running=!1,r(...s))))}};var K=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("traps",...arguments)}static namespace(e,r=null){return super._namespace("traps",...arguments)}addRegistration(e){return super.addRegistration(new Ee(this,e))}emit(e,r=null){let n=this;return function s(i,...a){let o=n.entries[i];return o?o.exec(e,(...u)=>s(i+1,...u),...a):r?r(e,...a):a[0]}(0)}};var mt={};Te(mt,{accessorize:()=>zr,proxy:()=>pt,unaccessorize:()=>Vr,unproxy:()=>Se});var ur=Symbol("wqOriginal");function zr(t,e,r={}){t=dt(t);let n=O(t,"accessorizedProps");function s(u){let f,c=t;do f=Object.getOwnPropertyDescriptor(c,u);while(!f&&(c=Object.getPrototypeOf(c)));return f?{proto:c,descriptor:f}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function i(u){if(n.has(u+""))return!0;let f=s(u);f.getValue=function(h=!1){return h?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},f.setValue=function(h,m=!1){if(this.dirty=!0,m){this.descriptor=h;return}return this.descriptor.set?this.descriptor.set(h)!==!1:(this.descriptor.value=h,!0)},f.intact=function(){let h=Object.getOwnPropertyDescriptor(t,u);return h?.get===p.get&&h?.set===p.set&&n.get(u+"")===this},f.restore=function(){return this.intact()?(this.proto&&this.proto!==t||!this.proto&&!this.dirty?delete t[u]:Object.defineProperty(t,u,this.descriptor),n.delete(u+""),!0):!1},n.set(isNaN(u)?u:parseInt(u),f);let{enumerable:c=!0}=f.descriptor,p={enumerable:c,configurable:!0};("value"in f.descriptor||f.descriptor.set)&&(p.set=function(h){return oe(this,u,h,r)}),("value"in f.descriptor||f.descriptor.get)&&(p.get=function(){return X(this,u,r)});try{return Object.defineProperty(t,u,p),!0}catch{return n.delete(u+""),!1}}let o=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(i);return e===void 0||Array.isArray(e)?o:o[0]}function Vr(t,e,r={}){t=dt(t);let n=O(t,"accessorizedProps");function s(o){return n.has(o+"")?n.get(o+"").restore():!0}let a=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(s);return e===void 0||Array.isArray(e)?a:a[0]}function pt(t,e={},r=void 0){let n=dt(t);if(typeof e.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(e.membrane&&O(n,"membraneRef").has(e.membrane))return O(n,"membraneRef").get(e.membrane);let s={apply:(o,u,f)=>xt(o,u,f,void 0,e),construct:(o,u,f=null)=>wt(o,u,f,e),defineProperty:(o,u,f)=>Oe(o,u,f,e),deleteProperty:(o,u)=>Ae(o,u,e),get:(o,u,f=null)=>{if(u===ur)return n;let c={...e,receiver:f},p=X(o,u,c);return Array.isArray(o)&&typeof p=="function"&&!/^class\s?/.test(Function.prototype.toString.call(p))?pt(p,{...e,arrayMethodName:u,membrane:f},r):e.chainable&&_(p)&&u!=="prototype"&&!(typeof p=="function"&&/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(p)))?pt(p,e,r):p},getOwnPropertyDescriptor:(o,u)=>qe(o,u,e),getPrototypeOf:o=>gt(o,e),has:(o,u)=>Ne(o,u,e),isExtensible:o=>yt(o,e),ownKeys:o=>bt(o,e),preventExtensions:o=>vt(o,e),set:(o,u,f,c=null)=>oe(o,u,f,{...e,receiver:c}),setPrototypeOf:(o,u)=>_t(o,u,e)},i=r?.(s)||s,a=new Proxy(n,i);return e.membrane&&O(n,"membraneRef").set(e.membrane,a),a}function Se(t){return t&&t[ur]||t}function dt(t){if(!t||!_(t))throw new Error("Target must be of type object!");return Se(t)}var Ce=class extends Array{get[Symbol.toStringTag](){return"Path"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Path"}};function Gr(...t){return new Ce(...t)}var ie=class extends Array{get[Symbol.toStringTag](){return"Subtree"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Subtree"}};function Jr(){return new ie}function Kr(){return 1/0}function Pt(t,e,r,n=i=>i,s={}){let i=e instanceof ie;if(!(!i&&!e?.length))return function a(o,u,f,c){let p=c||u[f.level]instanceof ie,h=p?1/0:u[f.level],m=p?!1:f.level===u.length-1;return o instanceof A&&o.operation!=="get"?f={...f,probe:"always"}:f.probe!=="always"&&(f={...f,probe:!m}),r(o,h,(l,...y)=>{let b=d=>{d instanceof A&&(d.path="key"in d?[d.key]:[],o instanceof A&&(d.path="key"in d?o.path.concat(d.key):o.path.slice(0),Object.defineProperty(d,"context",{get:()=>o,configurable:!0})))},w=y[0]||{},x=d=>{if(d instanceof A&&"argumentsList"in d)return;let P=H(d,!1);return xe(P,E=>(d instanceof A?d.value=E:d=E,a(d,u,{...f,...w,keyInParent:d.key,level:f.level+1},p)))};if(Me(h)&&Array.isArray(l)){if(l.forEach(b),m)return n(l,...y);p&&l[0]instanceof A&&(l[0].operation!=="get"||s.asGet)&&n(l,...y);for(let d of l)x(d);return}return b(l),m?n(l,...y):x(l)},f)}(t,e.slice(0),{...s,level:0},i)}function Et(t,e,r,n={}){let s=H(t,!n.level);if(V(arguments[1])&&([,r,n={}]=arguments,e=1/0),!V(r))throw new Error(`Handler must be a function; "${pe(r)}" given!`);if(e instanceof Ce||e instanceof ie)return Pt(s,e,Et,r,n);if(n={...n,descripted:!0},delete n.live,!_(s))return n.probe&&X(s,e,r,n)||void 0;let i=cr(s,e,r,n);return n.probe?X(s,e,i,n):i()}function Xr(t,e,r={}){let n=H(t);return v(e)||([,,,r={}]=arguments,e={[arguments[1]]:arguments[2]}),K.getInstance(n,!0,r.namespace).addRegistration({traps:e,params:r})}function qe(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptor",{key:e},r,n)}function Qr(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptors",{key:e},r,n)}function gt(t,e=n=>n,r={}){return k(t,"getPrototypeOf",{},e,r)}function yt(t,e=n=>n,r={}){return k(t,"isExtensible",{},e,r)}function bt(t,e=n=>n,r={}){return k(t,"ownKeys",{},e,r)}function Ne(t,e,r=s=>s,n={}){return k(t,"has",{key:e},r,n)}function X(t,e,r=s=>s,n={}){let s,i=H(t,!n.level);return v(r)?[n,r]=[r,a=>a]:n.live&&(s=!0),e instanceof Ce||e instanceof ie?Pt(i,e,X,r,{...n,asGet:!0}):tn(i,e,a=>{let o=[...a];return function u(f,c,p){if(!c.length)return p(f);let h=c.shift();if(!["string","number","symbol"].includes(typeof h))throw new Error(`Property name/key ${h} invalid.`);function m(b,w=void 0){let x=E=>(b.value=E,u([...f,n.live||n.descripted?b:E],c,p));if(arguments.length>1)return x(w);if(!_(i))return x(i?.[b.key]);let d=O(i,"accessorizedProps",!1),P=d&&d.get(b.key);if(P&&P.intact())return x(P.getValue(n.withPropertyDescriptors));if(n.withPropertyDescriptors){let E=Object.getOwnPropertyDescriptor(i,b.key);return x(E)}return x(Reflect.get(i,b.key))}let l=new A(i,{type:"get",key:h,value:void 0,operation:"get",related:o});if(!_(i))return m(l);let y=K.getInstance(i,!1,n.namespace);return y?y.emit(l,m):m(l)}([],a.slice(0),u=>{let f=Me(e)?u:u[0];return s&&_(i)?cr(i,e,r,n,t.key)(f):r(f)})},n)}function St(t,e,r={}){let n=H(t);return L.getInstance(n,!0,r.namespace).batch(e,r)}function Zr(t,e,r={}){e=H(e),t=H(t);let n=(r.only||[]).slice(0),s=(r.except||[]).slice(0),i=Object.keys(r.spread?[...t]:t).map(f=>isNaN(f)?f:parseInt(f)),a=n.length?n.filter(f=>i.includes(f)):i.filter(f=>!s.includes(f)),o=f=>!Array.isArray(e)||isNaN(f)?f:f-s.filter(c=>c<f).length,u=f=>{let c=qe(t,f,r);"value"in c&&c.writable&&c.enumerable&&c.configurable?oe(e,o(f),c.value,r):(c.enumerable||r.onlyEnumerable===!1)&&Oe(e,f,{...c,configurable:!0},r)};return St(e,()=>{a.forEach(u)}),Et(t,f=>{f.filter(c=>n.length?n.includes(c.key):!s.includes(c.key)).forEach(c=>{if(c.type==="delete")return Ae(e,o(c.key),r);if(c.type==="def"){(c.value.enumerable||r.onlyEnumerable===!1)&&Oe(e,o(c.key),{...c.value,configurable:!0},r);return}u(c.key)})},{...r,withPropertyDescriptors:!0})}function oe(t,e,r,n=a=>a,s={},i=!1){let a=H(t),o=[[e,r]];v(e)&&([,,n=f=>f,s={},i=!1]=arguments,o=Object.entries(e)),v(n)&&([i,s,n]=[typeof s=="boolean"?s:i,n,f=>f]);let u=o.map(([f])=>f);return function f(c,p,h){if(!p.length)return h(c);let[m,l]=p.shift();function y(w,x=void 0){let d=q=>(w.status=q,f(c.concat(w),p,h));if(arguments.length>1)return d(w,x);let P=O(a,"accessorizedProps",!1),E=P&&P.get(w.key);return w.type==="def"?(E&&!E.restore()&&d(!1),Object.defineProperty(a,w.key,w.value),d(!0)):E&&E.intact()?d(E.setValue(w.value)):d(Reflect.set(a,w.key,w.value))}function b(w,x){if(s.diff&&l===x)return f(c,p,h);let d=new A(a,{type:i?"def":"set",key:m,value:l,isUpdate:w,oldValue:x,related:[...u],operation:i?"defineProperty":"set",detail:s.detail}),P=K.getInstance(a,!1,s.namespace);return P?P.emit(d,y):y(d)}return Ne(a,m,w=>{if(!w)return b(w);if(m==="length"&&Array.isArray(a)&&O(a).has("$length"))return b(!0,O(a).get("$length"));let x={...s,withPropertyDescriptors:i};return X(a,m,d=>b(w,d),x)},s)}([],o.slice(0),f=>{let c=L.getInstance(a,!1,s.namespace);return c&&c.emit(f,{eventsArePropertyDescriptors:!!i}),n(Me(e)?f.map(p=>p.status):f[0]?.status)})}function Oe(t,e,r,n=i=>i,s={}){return oe(t,e,r,n,s,!0)}function Yr(t,e,r=s=>s,n={}){return oe(t,e,r,n,!0)}function Ae(t,e,r=s=>s,n={}){let s=H(t);v(r)&&([n,r]=[r,o=>o]);let i=F(e,!1),a=[...i];return function o(u,f,c){if(!f.length)return c(u);let p=f.shift();function h(l,y=void 0){let b=d=>(l.status=d,o(u.concat(l),f,c));if(arguments.length>1)return b(l,y);let w=O(s,"accessorizedProps",!1),x=w&&w.get(l.key);return x&&!x.restore()&&b(!1),b(Reflect.deleteProperty(s,l.key))}function m(l){let y=new A(s,{type:"delete",key:p,oldValue:l,related:[...a],operation:"deleteProperty",detail:n.detail}),b=K.getInstance(s,!1,n.namespace);return b?b.emit(y,h):h(y)}return X(s,p,m,n)}([],i.slice(0),o=>{let u=L.getInstance(s,!1,n.namespace);return u&&u.emit(o),r(Me(e)?o.map(f=>f.status):o[0].status)})}function en(t,e,r=s=>s,n={}){return Ae(...arguments)}function wt(t,e,r=null,n=i=>i,s={}){return k(t,"construct",arguments.length>2?{argumentsList:e,newTarget:r}:{argumentsList:e},n,s)}function xt(t,e,r,n=i=>i,s={}){let i=Se(e),a;if(Array.isArray(e)){if(s.arrayMethodName){let o=new A(i,{operation:s.arrayMethodName,argumentsList:r});L.getInstance(i,!1,s.namespace)?.emit([o],{eventIsArrayMethodDescriptor:!0})}O(i).set("$length",i.length),a=St(i,()=>k(t,"apply",{thisArgument:e,argumentsList:r},n,s),s),O(i).delete("$length")}else a=k(t,"apply",{thisArgument:i,argumentsList:r},n,s);return a}function _t(t,e,r=s=>s,n={}){return k(t,"setPrototypeOf",{proto:e},r,n)}function vt(t,e=n=>n,r={}){return k(t,"preventExtensions",{},e,r)}function cr(t,e,r,n={}){let s=new AbortController;ke.setMaxListeners?.(0,s.signal),n.signal&&n.signal.addEventListener("abort",()=>s.abort());let i={...n,signal:s.signal},a=L.getInstance(t,!0,i.namespace),o=new Map;return function u(f=[],c=null){let p,h,m;if(Me(e)){if(c){m=!0,h=c;for(let l of f)o.get(l.key)?.remove(),o.delete(l.key)}else h=a.addRegistration(e,u,i);p={signal:h.signal,childRegistrations:o}}else c?.remove(),h=a.addRegistration(e,u,i),p={signal:h.signal};if(i.childRegistrations&&i.keyInParent&&i.childRegistrations.set(i.keyInParent,h),arguments.length){let l=r(f,p);if(arguments.length>1)return l}return s}}function k(t,e,r={},n=i=>i,s={}){t=H(t),v(n)&&([s,n]=[n,u=>u]);function i(u,f){return arguments.length>1?n(f):n((Reflect[e]||Object[e])(t,...Object.values(r)))}let a=new A(t,{operation:e,...r}),o=K.getInstance(t,!1,s.namespace);return o?o.emit(a,i):i(a)}function Me(t){return t===1/0||Array.isArray(t)}function H(t,e=!0,r=!0){if((!t||!_(t))&&e)throw new Error(`Object must be of type object or array! "${pe(t)}" given.`);return t instanceof A&&(t.type==="def"&&r?t=typeof t.value.get=="function"?t.value.get():t.value.value:t=t.value),t&&Se(t)}function tn(t,e,r,n={}){return e===1/0?n.level&&!_(t)?r([]):r(Object.entries(Object.getOwnPropertyDescriptors(t)).filter(([,s])=>s.writable!==!1&&!s.get&&!s.set).map(([s])=>s)):r(F(e,!1))}var S={...Ot,...mt},lr=S;var ae=class t extends URLSearchParams{#r;#t;get compatMode(){return this.#t}#n=new Set;#e;#o=!1;#a;_changeCallbackGC;constructor(e={},{compatMode:r=!0,prettyPrint:n=!1,changeCallback:s=null}={}){super(),this.#t=r,this.#e=n;let i;e instanceof t?(i=structuredClone(e.json()),r&&(this.#n=new Set(e.keys()))):e instanceof URLSearchParams||e instanceof FormData?(i=Object.fromEntries(e),r&&(this.#n=new Set(e.keys()))):J(e)?(e=decodeURIComponent(e.replace(/^\?/,"")),i=this.constructor.parse(e,!r),r&&(this.#n=new Set(e.split("&").map(a=>a.split("=")[0])))):Array.isArray(e)?(i=this.constructor.fromEntries(e),r&&(this.#n=new Set(e.map(([a])=>a)))):v(e)?(i=e,r&&this.constructor.reduceValue(e,"",(a,o,u)=>{if(u)return u;/\[\d+\]$/.test(o)&&([,o]=/^(.*)\[\d+\]$/.exec(o)),this.#n.add(o)})):i={},this._changeCallback=s,this._resetJson(i)}_resetJson(e){this.#r=S.proxy(e),this.#a&&(this._changeCallbackGC?.abort(),this._changeCallbackGC=S.observe(this.#r,S.subtree(),this.#a))}get(e){let r=this.#i(e);return this.#t&&Array.isArray(r)?r[0]:r}#i(e,r=!1){if(this.#t&&!this.#n.has(e))return null;let n=this.constructor.get(this.#r,e,r);return n===void 0?null:Array.isArray(n)?this.#t?n.map(s=>typeof s=="number"?s+"":s):n.map(s=>v(s)?new t(s,{compatMode:this.#t}):s):!this.#t&&v(n)?new t(n,{compatMode:this.#t}):this.#t&&typeof n=="number"?n+"":n}getAll(e){let r=this.#i(e,!0);return r===null?[]:Array.isArray(r)?r:[r]}set(e,r){return this.#t&&this.#n.add(e),this.constructor.set(this.#r,e,r),this}append(e,r){return this.#t&&this.#n.add(e),this.constructor.set(this.#r,e,r,!0),this}has(e){return this.#t&&!this.#n.has(e)?!1:this.constructor.get(this.#r,e)!==void 0}delete(e){if(this.#t&&!this.#n.has(e))return;let r=this.constructor.parsePath(e),n=r.pop(),s=r.length?this.constructor.get(this.#r,r):this.#r;v(s)&&S.deleteProperty(s,n)}sort(){return this.#o=!0,this}json(){return S.unproxy(this.#r)}stringify({prettyPrint:e=this.#e}={}){return this.constructor.stringify(this.#r,{only:this.#t&&this.#n,sorted:this.#o,prettyPrint:e})}toString(){return this.stringify()}entries(){let e=[];return this.constructor.reduceValue(this.#r,"",(r,n,s)=>{if(s)return s;if(this.#t&&!this.#n.has(n))if(/\[\d+\]$/.test(n)){if([,n]=/^(.*)\[\d+\]$/.exec(n),!this.#n.has(n)&&!this.#n.has(n=`${n}[]`))return}else return;this.#t&&typeof r=="number"&&(r=r+""),e.push([n,r])}),e[Symbol.iterator]()}keys(){return Array.from(this.entries(),([e])=>e)[Symbol.iterator]()}values(){return Array.from(this.entries(),([,e])=>e)[Symbol.iterator]()}forEach(e,r){for(let[n,s]of this.entries())e.call(r,s,n,this)}[Symbol.iterator](){return this.entries()}get size(){let e=0;return this.forEach(()=>e++),e}static parse(e,r=!1,n="&"){let s={};return(e.startsWith("?")?e.slice(1):e).split(n).filter(Boolean).forEach(i=>{let a=i.indexOf("="),o=a===-1?i:i.slice(0,a),u=a===-1?"":i.slice(a+1);this.set(s,o,u,!0,r)}),s}static fromEntries(e){let r={};for(let[n,s]of e)this.set(r,n,s,!0);return r}static stringify(e,{sorted:r=!1,only:n=null,prettyPrint:s=!1,delim:i="&"}={}){let a=[],o=Object.keys(e);return r&&o.sort(),o.forEach(u=>{this.reduceValue(e[u],u,(f,c,p)=>{if(p)return r?[...p].sort():p;if(n&&!n.has(c))if(/\[\d+\]$/.test(c)){if([,c]=/^(.*)\[\d+\]$/.exec(c),!n.has(c)&&!n.has(c=`${c}[]`))return}else return;s||(c=encodeURIComponent(c)),a.push(c+"="+encodeURIComponent(f))},!!s)}),a.join(i)}static get(e,r,n=!1){return this.reducePath(r,e,(s,i,a)=>a||(s===""?n?i:i?.[0]:i?.[s]))}static set(e,r,n,s=!1,i=!1){this.reducePath(r,e,(a,o,u)=>{let f=u??n;return i&&/^-?\d+(\.\d+)?$/.test(f+"")&&(f=parseFloat(f)),a===""&&Array.isArray(o)?S.proxy(o).push(f):s&&o?.[a]?Array.isArray(o[a])?S.proxy(o[a]).push(f):S.set(o,a,[o[a],f]):S.set(o,a,f),f})}static reduceValue(e,r,n,s=!1){if(_(e)){let i=Object.keys(e),a=n(e,r,i);if(Array.isArray(a)){a.forEach(o=>{s&&(o=encodeURIComponent(o)),this.reduceValue(e[o],r?`${r}[${o}]`:o,n,s)});return}}n(e,r)}static reducePath(e,r,n){let s=this.parsePath(e),i=r;for(let a=0;a<s.length;a++){let o=s[a];if(G(o)&&(o=+o),a===s.length-1)return n(o,i);if(!_(i))return;if(!_(i[o])){let u=s[a+1];i[o]=n(o,i,G(u)||u===""?[]:{})}i=i[o]}}static parsePath(e){if(Array.isArray(e))return e;if(!J(e))return[];let r=[];return e.replace(/\[([^\]]*)\]|([^[\]]+)/g,(n,s,i)=>{r.push(s??i)}),r}};var B=class t extends FormData{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}static json(e={},{encodeLiterals:r=!0,meta:n=!1}={}){let s=new t,i=!0;return ae.reduceValue(e,"",(a,o,u=void 0)=>{if(u){let f=Ue(a)==="json";return i=i&&f,f&&u}r&&[!0,!1,null].includes(a)&&(a=new Blob([a+""],{type:"application/json"})),s.append(o,a)}),n?{result:s,isDirectlySerializable:i}:s}async json({decodeLiterals:e=!0,meta:r=!1}={}){let n=!0,s;for(let[i,a]of this.entries()){s||(s=G(Ie(i,"["))?[]:{});let o=Ue(a);if(e&&["Blob","File"].includes(o)&&a.type==="application/json"&&[4,5].includes(a.size)){let u=JSON.parse(await a.text());[null,!0,!1].includes(u)&&(a=u,o="json")}n=n&&o==="json",/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(a)&&(a=Number(a)),ae.set(s,i,a)}return r?{result:s,isDirectlySerializable:n}:s}};var fe=(t,...e)=>D(t,"fetch+",...e),C=(t,...e)=>D(t,"fetch+","meta",...e);function Fe(t){return class extends t{static from(e){let r=e.headers instanceof Headers?[...e.headers.entries()].reduce((i,[a,o])=>{let u=a.toLowerCase();return i[u]=i[u]?[].concat(i[u],o):o,i},{}):Object.keys(e.headers||{}).reduce((i,a)=>(i[a.toLowerCase()]=e.headers[a],i),{}),n=e.body,s=Ue(n);if(["Blob","File"].includes(s))r["content-type"]??=n.type,r["content-length"]??=n.size;else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(s))r["content-length"]??=n.byteLength;else if(s==="json"&&_(n)){let{result:i,isDirectlySerializable:a}=B.json(n,{encodeLiterals:!0,meta:!0});a?(n=JSON.stringify(n,(o,u)=>u instanceof Error?{...u,message:u.message}:u),r["content-type"]="application/json",r["content-length"]=new Blob([n]).size):(n=i,s="FormData")}else["text","json"].includes(s)&&!r["content-length"]&&(r["content-length"]=new Blob([n]).size);return!["FormData"].includes(s)&&!["function"].includes(typeof n)&&!r["content-type"]&&(r["content-type"]="application/octet-stream"),{body:n,headers:new Headers(r),$type:s}}async formData(){let e=await super.formData();return B.upgradeInPlace(e),e}async any({to:e=null,memo:r=!1}={}){if(e&&!["blob","text","json","arrayBuffer","bytes","formData"].includes(e))throw new Error(`Invalid target type specified: ${e}`);let n=C(this,"cache"),s=async o=>{if(!r)return await this[o||"bytes"]();let u=c=>{if(c instanceof FormData){let p=new B;for(let[h,m]of c.entries())p.append(h,m);return p}return(!o||o==="json")&&(Ke(c)||Je(c))?structuredClone(c):c};if(!o&&n.has("original"))return u(n.has("original"));if(o??="bytes",n.has(o))return u(n.get(o));let f;return n.has("memo")?f=n.get("memo").clone()[o]():(n.set("memo",this.clone()),f=await this[o]()),n.set(o,f),u(f)},i=(this.headers.get("Content-Type")||"").split(";")[0].trim(),a;if((!e||["formData","json"].includes(e))&&["multipart/form-data","application/x-www-form-urlencoded"].includes(i)){let o=await s("formData");B.upgradeInPlace(o),e==="json"&&(o=await o.json({decodeLiterals:!0})),a=o}else if((!e||["formData","json"].includes(e))&&i==="application/json"){let o=await s("json");e==="formData"&&(o=B.json(o,{encodeLiterals:!0})),a=o}else if(!e&&(i.startsWith("image/")||i.startsWith("video/")||i.startsWith("audio/")||i.startsWith("application/")&&!["xml","json","javascript","x-www-form-urlencoded"].some(o=>i.includes(o))))a=await s("blob");else if(!e&&(i.startsWith("text/")||i.startsWith("application/")&&["xml","javascript"].some(o=>i.includes(o))))a=await s("text");else{if(["json","formData"].includes(e))throw new Error(`Cannot convert body of type ${i} to ${e}`);a=await s(e)}return a}forget(){C(this,"cache").clear()}}}function Ue(t){if(t instanceof FormData)return"FormData";if(t===null||me(t)||Re(t))return"json";if(J(t))return"text";if(_(t)){let e=t[Symbol.toStringTag],r=["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream","ReadableStream"].reduce((n,s)=>n||(e===s?s:null),null);if(r)return r;if(v(t)||Array.isArray(t))return"json";if("toString"in t)return"text"}return null}function nn(t){return t!==null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}function At(t){return t instanceof ReadableStream||nn(t)}var W=class t extends Headers{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}set(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){this.delete(e);for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=hr(r)),/^Content-Range$/i.test(e)&&(r=dr(r)),/^Range$/i.test(e)&&(r=pr(r)),/^Accept$/i.test(e)&&(r=mr(r)),super.set(e,r)}append(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=hr(r)),/^Content-Range$/i.test(e)&&(r=dr(r)),/^Range$/i.test(e)&&(r=pr(r)),/^Accept$/i.test(e)&&(r=mr(r)),super.append(e,r)}get(e,r=!1){let n=super.get(e);if(/^Set-Cookie$/i.test(e)&&r&&(n=this.getSetCookie().map(s=>{let[i,...a]=s.split(";"),[o,u]=i.split("=").map(c=>c.trim()),f={name:o,value:u};return a.map(c=>c.trim().split("=")).forEach(c=>{f[c[0][0].toLowerCase()+c[0].substring(1).replace("-","")]=c.length===1?!0:c[1]}),f})),/^Cookie$/i.test(e)&&r&&(n=n?.split(";").map(s=>{let[i,a]=s.split("=").map(o=>o.trim());return{name:i,value:a}})||[]),/^Content-Range$/i.test(e)&&n&&r&&(n=ge(n,"bytes ").split("/")),/^Range$/i.test(e)&&r&&(n=n?ge(n,"bytes=").split(",").map(s=>{let i=s.trim().split("-").map(a=>a?parseInt(a,10):null);return i.resolveAgainst=a=>{let o=[...i];return o[1]===null?o[1]=a-1:o[1]=Math.min(o[1],a)-1,o[0]===null&&(o[0]=o[1]?a-o[1]-1:0),o},i.canResolveAgainst=(a,o)=>{let u=[typeof i[0]=="number"?i[0]:a,typeof i[1]=="number"?i[1]:o-1];return!(u[0]>u[1]||u[0]<a||u[1]>=o)},i.toString=()=>s,i}):[]),/^Accept$/i.test(e)&&n&&r){let s=a=>{let[o,u]=a.trim().split(";").map(f=>f.trim());return[o,parseFloat((u||"q=1").replace("q=",""))]},i=n;n=n.split(",").map(a=>s(a)).sort((a,o)=>a[1]>o[1]?-1:1)||[],n.match=a=>{if(!a)return 0;let o=f=>f.split("/").map(c=>c.trim()),u=o(a+"");return n.reduce((f,[c,p])=>{if(f)return f;let h=o(c);return[0,1].every(m=>u[m]===h[m]||u[m]==="*"||h[m]==="*")?p:0},0)},n.toString=()=>i}return n}};function Ct(t){let e=[`${t.name}=${t.value}`];for(let r in t){if(["name","value"].includes(r))continue;let n=r[0].toUpperCase()+r.substring(1);n==="MaxAge"&&(n="Max-Age"),e.push(t[r]===!0?n:`${n}=${t[r]}`)}return e.join("; ")}function hr(t){return _(t)&&(t=[].concat(t).map(Ct).join("; ")),t}function pr(t){let e=[];return F(t).forEach((r,n)=>{let s=Array.isArray(r)?r.map(i=>[null,void 0].includes(i)?"":i).join("-"):r+"";n===0&&!s.includes("bytes=")&&(s=`bytes=${s}`),e.push(s)}),e.join(", ")}function dr(t){if(Array.isArray(t)){if(t.length<2||!t[0].includes("-"))throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");t=`bytes ${t.join("/")}`}return t}function mr(t){return Array.isArray(t)&&(t=t.map(e=>Array.isArray(e)?e.map((r,n)=>n===1&&(r=parseFloat(r),!0)?r===1?"":`;q=${r}`:r.trim()).join(""):e.trim()).join(",")),t}var z=class t extends Fe(Response){constructor(e,r={}){super(e,r),W.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),W.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Response)return e;let s;if(typeof e<"u"){let a;({body:e,headers:a,$type:s}=super.from({body:e,headers:n.headers})),n={...n,headers:a}}let i=new this(e,n);if(r){let a=C(i,"cache"),o={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};a.set(o[s]||"original",e)}return i}get status(){return C(this).get("status")??super.status}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};async function gr(t,e={}){let r=await fetch(t,e);return z.upgradeInPlace(r),r}var He=class t extends Fe(Request){constructor(e,r={}){super(e,r),W.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),W.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Request)return e;let s,i=n.body;if("body"in n){let{body:o,headers:u,$type:f}=super.from(n);n={...n,body:o,headers:u},s=f}let a=new this(e,n);if(r){let o=C(a,"cache"),u={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};o.set(u[s]||"original",i)}return a}static async copy(e,r={}){let s=["method","headers","mode","credentials","cache","redirect","referrer","integrity"].reduce((i,a)=>({...i,[a]:a in r?r[a]:a==="headers"?new Headers(e[a]):e[a]}),{});return["GET","HEAD"].includes(s.method.toUpperCase())?s.body=null:"body"in r?(s.body=r.body,"headers"in r||(s.headers.delete("Content-Type"),s.headers.delete("Content-Length"))):s.body=await e.clone().arrayBuffer(),s.mode==="navigate"&&(s.mode="cors"),{url:r.url||e.url,...s}}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};var Q=class extends MessageEvent{#r;get originalTarget(){return this.#r}#t;get eventID(){return this.#t}#n;get data(){return this.#n}#e;get live(){return this.#e}#o;get bubbles(){return this.#o}#a;get forwarded(){return this.#a}#i;get honourDoneMutationFlags(){return this.#i}#f=[];get ports(){return this.#f}constructor(e,{originalTarget:r=null,type:n="message",eventID:s,live:i=!1,honourDoneMutationFlags:a=!1,bubbles:o=!1,forwarded:u=!1,ports:f=[]}={}){if(n&&typeof n!="string")throw new TypeError("Where specified, wqEventOptions.type must be a string");if(super(n),this.#n=e,this.#r=r,this.#t=s,this.#e=i,this.#o=o,this.#a=u,this.#i=a,this.#f=f,this.#f.forEach(c=>M.upgradeInPlace(c)),_(this.#n)&&this.#e){if(typeof s!="string")throw new TypeError("eventID must be a non-empty string");Mt.call(r,this.#n,this.#t,{honourDoneMutationFlags:this.#i})}}#p=!1;get immediatePropagationStopped(){return this.#p}stopImmediatePropagation(){this.#p=!0,this.#l=!0,super.stopImmediatePropagation()}#l=!1;get propagationStopped(){return this.#l}stopPropagation(){this.#l=!0,super.stopPropagation()}#s=!1;get defaultPrevented(){return this.#s}preventDefault(){this.#s=!0,super.preventDefault()}respondWith(e,r=[]){for(let n of this.#f)n.postMessage(e,r);return!!this.#f.length}};var ue=class extends Be(EventTarget){#r;#t;constructor(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(super(),typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if($(this).set("options",{handshake:r,postAwaitsOpen:n}),this.#r=typeof e=="string"?new WebSocket(e):e,this.constructor.upgradeEvents(this.#r,this),this.#t=new Promise(i=>{this.#r.readyState===WebSocket.OPEN?i():this.#r.addEventListener("open",()=>i(),{once:!0})}),r===0&&this.#t.then(()=>this.start()),this.#r.readyState===WebSocket.CLOSED)try{this.close()}catch{}else this.#r.addEventListener("close",()=>{try{this.close()}catch{}},{once:!0})}static _hydrateMessage(e,r){try{let n;if(typeof r.data=="string"&&v(n=JSON.parse(r.data))&&n[".wq"])return Object.defineProperty(r,"data",{value:n,configurable:!0}),super._hydrateMessage(e,r)}catch{}return r}__postMessage(e,r){this.#t.then(()=>{this.#r.send(JSON.stringify(e),r)})}_close(){this.#r.close()}};var yr=(t,...e)=>D(t,"port+",...e),$=(t,...e)=>D(t,"port+","meta",...e),ce=t=>D(t,"port+","meta").get("options")||{},br=["addEventListener","addRequestListener","postMessage","postRequest","dispatchEvent","relay","start","readyStateChange","removeEventListener","close"],wr=["options","readyState","onmessage","onmessageerror"],M=class extends xr(EventTarget){constructor({handshake:e=0,postAwaitsOpen:r=!1,...n}={}){if(typeof e!="number")throw new Error("handshake must be a number");if(e<0||e>2)throw new Error("handshake must be between 0 and 2");super(),yr(this,"meta").set("options",{handshake:e,postAwaitsOpen:r,...n})}static[Symbol.hasInstance](e){return Function.prototype[Symbol.hasInstance].call(this,e)?!0:br.every(r=>typeof e[r]=="function")||wr.every(r=>r in e)}};function xr(t){return class extends t{static upgradeInPlace(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(e instanceof M)return e;if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");let s=this.prototype;for(let a of br.concat("_autoStart")){let o=e[a],u=s[a];o&&Object.defineProperty(e,`_${a}`,{value:o.bind(e),configurable:!0}),Object.defineProperty(e,a,{value:u.bind(e),configurable:!0})}for(let a of wr){let o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),a),u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),a);o&&Object.defineProperty(e,`_${a}`,{...o,configurable:!0}),Object.defineProperty(e,a,{...u,configurable:!0})}return yr(e,"meta").set("options",{handshake:r,postAwaitsOpen:n}),this.upgradeEvents(e),r===0&&e.start(),e}static upgradeEvents(e,r=null){r||(r=e);let n=$(e);if(n.get("events+"))return;let s=$(r),i=ce(r),a=he.call(r),o=le.call(r);e instanceof BroadcastChannel&&(i.clientServerMode==="server"?s.set("clients",new Set):i.clientServerMode==="client"&&s.set("client_id",`client-${(0|Math.random()*9e6).toString(36)}`));let u=f=>{if(f instanceof Q)return;if(e===r&&f.stopImmediatePropagation?.(),f=this._hydrateMessage?.(r,f)||f,f.data.ping==="connect"&&typeof f.data?.[".wq"]?.eventID=="string"&&(!(e instanceof WebSocket)||i.handshake)){let m=i.handshake===0||s.get("start.called"),l={isOpen:m};e instanceof BroadcastChannel&&(i.clientServerMode==="server"&&typeof f.data.id=="string"?(s.get("clients").add(f.data.id),l.id="server"):f.data.id==="server"&&s.has("client_id")&&(l.id=s.get("client_id"))),f.ports?.forEach(y=>y.postMessage(l)),m&&(s.set("remote.open.called",!0),r.start());return}if(f.data.ping==="disconnect"&&typeof f.data?.[".wq"]?.eventID=="string"){let m=()=>{s.set("remote.close.called",!0),r.close()};e instanceof BroadcastChannel?i.clientServerMode==="server"&&typeof f.data.id=="string"?(s.get("clients").delete(f.data.id),!s.get("clients").size&&i.autoClose&&!o.close.state&&m()):i.clientServerMode==="client"&&f.data.id==="server"&&m():e instanceof MessagePort&&m();return}let c=f.data,p={};typeof f.data?.[".wq"]?.eventID=="string"&&({message:c,".wq":p}=f.data);let h=new Q(c,{originalTarget:e,...p,ports:f.ports});r.dispatchEvent(h)};n.set("internal_call",!0),e.addEventListener("message",u),e.addEventListener("error",u),n.delete("internal_call"),a.add(()=>{e.removeEventListener("message",u),e.removeEventListener("error",u),n.set("events+",!1)}),n.set("events+",!0)}get options(){return{...ce(this)}}get onmessageerror(){return typeof super.onmessageerror<"u"?super.onmessageerror:typeof this._onmessageerror<"u"?this._onmessageerror:null}set onmessageerror(e){if(typeof super.onmessageerror<"u"){super.onmessageerror=e;return}if(e!==null&&typeof e!="function")throw new TypeError("onmessageerror must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessageerror")?.set){this._onmessageerror=e;return}this._onmessageerror&&this.removeEventListener("messageerror",this._onmessageerror),this.addEventListener("messageerror",e),this._onmessageerror=e}get onmessage(){return typeof super.onmessage<"u"?super.onmessage:typeof this._onmessage<"u"?this._onmessage:null}set onmessage(e){if(typeof super.onmessage<"u"){super.onmessage=e,this._autoStart();return}if(e!==null&&typeof e!="function")throw new TypeError("onmessage must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessage")?.set){this._onmessage=e,this._autoStart();return}this._onmessage&&this.removeEventListener("message",this._onmessage),this.addEventListener("message",e),this._onmessage=e,this._autoStart()}addEventListener(...e){he.call(this).add(()=>{this._removeEventListener?this._removeEventListener(...e):super.removeEventListener(...e)});let n=this._addEventListener?this._addEventListener(...e):super.addEventListener(...e);return this._autoStart(),n}dispatchEvent(e){let r=this._dispatchEvent?this._dispatchEvent(e):super.dispatchEvent(e);return e instanceof Q&&sn.call(this,e),r}postMessage(e,r={}){this._autoStart();let n=le.call(this);n.messaging.state=!0,n.messaging.resolve(this);let s,{portOptions:i,wqOptions:{relayedFrom:a,...o}}=We.call(this,e,r);(o.type!=="message"||o.live||o.bubbles||i.transfer?.length&&(this instanceof BroadcastChannel||this instanceof ue))&&(e={message:e,".wq":o}),r=i,s=a;let u=()=>{this._postMessage?this._postMessage(e,r,s):super.postMessage(e,r)};ce(this).postAwaitsOpen?n.open.promise.then(u):u()}addRequestListener(e,r,n={}){let s=async i=>{let a=await r(i);for(let o of i.ports)o.postMessage(a)};this.addEventListener(e,s,n)}postRequest(e,r,n={}){let s;v(r)&&(n={once:!0,...r},s=new Promise(c=>{r=c}));let i=new MessageChannel;this.constructor.upgradeEvents(i.port1),i.port1.start();let{signal:a=null,once:o=!1,transfer:u=[],...f}=n;return i.port1.addEventListener("message",c=>r(c),{signal:a,once:o}),a?.addEventListener("abort",()=>{i.port1.close(),i.port2.close()}),this.postMessage(e,{...f,transfer:[i.port2].concat(u)}),s}relay({to:e,from:r,types:n="*",channel:s=null,resolveMessage:i=null,bidirectional:a=!1}={}){if(e&&r)throw new Error('Only one of "to" and "from" may be specified');if(r?e=this:r=this,e===r)throw new Error("Source and target ports cannot be the same");if(!(r instanceof M)||!(e instanceof M))throw new Error("Both source and target ports must be instance of MessagePortPlus.");if(typeof n!="function"&&!(n=[].concat(n)).length)throw new Error("Event types must be specified.");if(typeof s=="string")s={from:s};else if(v(s)){if(Object.keys(s).filter(c=>!["from","to"].includes(c)).length)throw new Error('Channel must be a string or an object of "from"/"to" members')}else if(s)throw new Error("Invalid channel parameter");let o=_r.call(r),u={targetPort:e,types:n,channel:s,resolveMessage:i};o.add(u);let f;return a&&(f=e.relay({to:r,types:n,channel:s&&{to:s.from,from:s.to},resolveMessage:i,bidirectional:!1})),()=>{o.delete(u),f?.()}}channel(e,r=null,{handshake:n=0,postAwaitsOpen:s=!1}={}){let i=new MessageChannel;return M.upgradeInPlace(i.port1,{handshake:n,postAwaitsOpen:s}),M.upgradeInPlace(i.port2,{handshake:n,postAwaitsOpen:s}),he.call(this).add(this.relay({channel:e,to:i.port2,bidirectional:!0,resolveMessage:r})),i.port2.start(),this.readyStateChange("close").then(()=>{i.port2.close()}),i.port1}projectMutations({from:e,to:r,...n}){if(!e||!r||typeof e=="string"&&typeof r=="string"||_(e)&&_(r))throw new Error('Invalid "from"/"to" parameters');if(typeof e=="string"){if(!_(r))throw new Error('Invalid "to" parameter. Object/array expected');return Mt.call(this,r,e,n)}if(typeof r=="string"){if(!_(e))throw new Error('Invalid "from" parameter. Object/array expected');return vr.call(this,e,r,n)}throw new Error('Invalid "from"/"to" parameters')}get readyState(){let e=le.call(this);return e.close.state?"closed":e.open.state?"open":"connecting"}readyStateChange(e){if(!["open","messaging","close"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return le.call(this)[e].promise}_autoStart(){let e=$(this),r=ce(this);!e.get("internal_call")&&r.handshake===1&&this.start()}start(){let e=le.call(this);if(e.open.state)return;let r=$(this),n=ce(this),s=f=>{f&&(e.open.state=!0,e.open.resolve(this));let c=r.get("handshake_channel");setTimeout(()=>{c?.port1.close(),c?.port2.close(),r.delete("handshake_channel")},100)};if(r.get("remote.open.called")){s(!0);return}if(r.get("start.called"))return;if(r.set("start.called",!0),this._start?this._start():super.start?.(),n.handshake===0){s(!0);return}let i=new MessageChannel;r.set("handshake_channel",i),i.port1.onmessage=f=>{this instanceof BroadcastChannel&&n.clientServerMode==="server"&&typeof f.data?.id=="string"&&r.get("clients").add(f.data.id),f.data?.isOpen,s(!0)};let{wqOptions:a}=We.call(this),o=n.clientServerMode==="server"?"server":n.clientServerMode==="client"?r.get("client_id"):null,u={".wq":a,ping:"connect",id:o};this._postMessage?this._postMessage(u,{transfer:[i.port2]}):super.postMessage(u,{transfer:[i.port2]})}close(...e){let r=le.call(this);if(r.close.state)return;r.close.state=!0;let n=$(this),s=ce(this);if(s.handshake>0&&!n.get("remote.close.called")&&(this instanceof BroadcastChannel||this instanceof MessagePort)){let{wqOptions:i}=We.call(this),a=s.clientServerMode==="server"?"server":s.clientServerMode==="client"?n.get("client_id"):null,o={".wq":i,ping:"disconnect",id:a};this._postMessage?this._postMessage(o):super.postMessage(o)}this._close?this._close(...e):super.close(...e),r.close.resolve(this),on.call(this)}}}function Be(t){return class extends xr(t){static _hydrateMessage(e,r){if(typeof r.data?.[".wq"]?.numPorts!="number"||typeof r.data[".wq"].eventID!="string")return r;let n=he.call(e),s=r.data[".wq"].numPorts;Object.defineProperty(r,"ports",{value:[],configurable:!0});for(let i=0;i<s;i++){let a=e.channel(`${r.data[".wq"].eventID}:${i}`);r.ports.push(a)}return r}_postMessage(e,r={}){let{transfer:n=[],...s}=r;if(typeof e?.[".wq"]?.eventID=="string"){let i=he.call(this),a=n.filter(u=>u instanceof MessagePort),o=a.length;for(let u=0;u<o;u++)M.upgradeInPlace(a[u]),i.add(this.relay({channel:`${e[".wq"].eventID}:${u}`,to:a[u],bidirectional:!0})),a[u].start(),a[u].readyStateChange("close").then(()=>{let{wqOptions:f}=We.call(this),c={".wq":f,ping:"disconnect"};this.postMessage(c,{type:`${e[".wq"].eventID}:${u}:message`})});e[".wq"].numPorts=o}return this.__postMessage(e,s)}}}function sn(t){if(t.propagationStopped)return;let e=$(this);e.get("parentNode")instanceof EventTarget&&(t.bubbles||e.get("parentNode")?.findPort?.(n=>n===this)&&t instanceof Q)&&e.get("parentNode").dispatchEvent(t);let r=_r.call(this);if(r.size&&t instanceof Q){let{type:n,eventID:s,data:i,live:a,bubbles:o,ports:u}=t,f=new WeakSet;for(let{targetPort:c,types:p,channel:h,resolveMessage:m}of r){if(f.has(c))continue;let l=n;h.from&&([,l]=new RegExp(`^${h.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}:([^:]+)$`).exec(n)||[],!l)||!(typeof p=="function"?p(l,this,c,h):[].concat(p).find(b=>b===l||b==="*"))||(f.add(c),c.postMessage(m?m(i,this,c,h):i,{transfer:u,type:h.to?`${h.to}:${l}`:l,eventID:s,bubbles:o,live:a,forwarded:!0,relayedFrom:this}))}}}function he(){let t=$(this);return t.has("garbage_collection")||t.set("garbage_collection",new Set),t.get("garbage_collection")}function _r(){let t=$(this);return t.has("downstream_registry")||t.set("downstream_registry",new Set),t.get("downstream_registry")}function le(){let t=$(this);if(!t.has("readystate_registry")){let e=r=>(r.promise=new Promise((n,s)=>(r.resolve=n,r.reject=s)),r);t.set("readystate_registry",{open:e({}),messaging:e({}),close:e({})})}return t.get("readystate_registry")}function on(){let t=$(this);for(let e of t.get("garbage_collection")||[])e instanceof AbortController?e.abort():typeof e=="function"&&e();t.get("garbage_collection")?.clear(),t.get("downstream_registry")?.clear()}function We(t=void 0,e={}){if(Array.isArray(e))e={transfer:e};else if(!e||typeof e!="object")throw new TypeError("transferOrOptions must be an array or an object");let{type:r="message",eventID:n=null,live:s=!1,observing:i=!1,bubbles:a=!1,forwarded:o=!1,relayedFrom:u=null,signal:f=null,withArrayMethodDescriptors:c=!1,honourDoneMutationFlags:p=!1,...h}=e;return n||(n=`${r}-${(0|Math.random()*9e6).toString(36)}`),!i&&!o&&_(t)&&s&&!r?.endsWith(".mutate")&&(vr.call(this,t,n,{signal:f,withArrayMethodDescriptors:c,honourDoneMutationFlags:p}),i=!0),{portOptions:h,wqOptions:{type:r,eventID:n,live:s,observing:i,honourDoneMutationFlags:p,bubbles:a,forwarded:o,relayedFrom:u}}}function vr(t,e,{signal:r,withArrayMethodDescriptors:n=!0,honourDoneMutationFlags:s=!1}={}){if(!_(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let i=u=>{let f;n&&Array.isArray(u[0].target)&&!u[0].argumentsList&&!["set","defineProperty","deleteProperty"].includes(u[0].operation)||(this.postMessage(u.map(c=>(f=!f&&s&&c.detail?.done,{...c,target:void 0})),{type:`${e}.mutate`}),f&&a.abort())},a=S.observe(t,S.subtree(),i,{signal:r,withArrayMethodDescriptors:n});return he.call(this).add(a),a}function Mt(t,e,{signal:r,honourDoneMutationFlags:n=!1}={}){if(!_(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let s=o=>{if(!o.data?.length)return;let u;S.batch(t,()=>{for(let f of o.data){if(u=!u&&n&&f.detail?.done,f.argumentsList){let c=f.path.length?S.get(t,S.path(...f.path)):t;S.proxy(c)[f.operation](...f.argumentsList);continue}if(f.key!=="length"||["set","defineProperty","deleteProperty"].includes(f.operation)){let c=f.path.length===1?t:S.get(t,S.path(...f.path.slice(0,-1)));f.type==="delete"?S.deleteProperty(c,f.key):S.set(c,f.key,f.value)}}}),u&&i()};this.addEventListener(`${e}.mutate`,s,{signal:r});let i=()=>this.removeEventListener(`${e}.mutate`,s);return he.call(this).add(i),i}var $e=class extends Be(BroadcastChannel){constructor(e,{handshake:r=0,postAwaitsOpen:n=!1,clientServerMode:s=null,autoClose:i=!1}={}){super(e);let a=$(this);if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if(s&&!["server","client"].includes(s))throw new Error('clientServerMode must be "server" or "client"');a.set("options",{handshake:r,postAwaitsOpen:n,clientServerMode:s,autoClose:i}),this.constructor.upgradeEvents(this),r===0&&this.start()}__postMessage(e,r){BroadcastChannel.prototype.postMessage.call(this,e)}};var ze=class t extends EventTarget{static get xHeaderName(){return"X-Message-Port"}static test(e){return e instanceof t||e?.[Symbol.toStringTag]==="LiveResponse"?"LiveResponse":e?.[Symbol.toStringTag]==="LiveProgramHandle"?"LiveProgramHandle":e instanceof Response?"Response":fn(e)?"Generator":"Default"}static hasPort(e){return!!C(e).get("port")||!!e.headers?.get?.(this.xHeaderName)?.trim()}static getPort(e,{handshake:r=1}={}){if(!/Response/.test(this.test(e)))return;let n=C(e);if(!n.has("port")){let s=e.headers.get(this.xHeaderName)?.trim();if(!s)return;let[,i,a]=/^(socket|channel):\/\/(.*)$/.exec(s)||[];if(!i||!a)throw new Error(`Unknown port messaging protocol: ${s}`);let o=i==="channel"?new $e(a,{handshake:r,postAwaitsOpen:!0,clientServerMode:"client"}):new ue(a,{handshake:r,postAwaitsOpen:!0});n.set("port",o)}return n.get("port")}static attachPort(e,r){if(r&&!(r instanceof M))throw new Error("Client must be a MessagePortPlus interface");C(e).set("port",r)}static from(e,...r){return this.test(e)==="LiveResponse"?e.clone(...r):new this(e,...r)}[Symbol.toStringTag]="LiveResponse";#r;constructor(e,...r){super(),this.#r=L.getInstance(this,!0);let s=_e.call(this).now;this.#u(s,e,...r).catch(i=>{s.reject(i)})}#t=null;get body(){return this.#t}#n=!1;get concurrent(){return this.#n}get bodyUsed(){return!0}#e=new Headers;get headers(){return this.#e}#o=200;get status(){return this.#o}#a="";get statusText(){return this.#a}#i="basic";get type(){return this.#i}#f=!1;get redirected(){return this.#f}#p=null;get url(){return this.#p}get ok(){return this.#o>=200&&this.#o<299}async now(){return _e.call(this).now.promise}#l;get port(){return this.#l}#s=new AbortController;#h=new AbortController;get readyState(){let e=_e.call(this);return e.done.state?"done":e.live.state?"live":"waiting"}readyStateChange(e){if(!["live","now","done"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return _e.call(this)[e].promise}disconnect(e=!1){this.#s.abort(),this.#s=new AbortController,e&&(this.#h.abort(),this.#h=new AbortController)}#m;#g(e){let r=_e.call(this);if(r.done.state)throw new Error("Response already done.");return this.#m=e,e.then(n=>{this.#m===e&&(this.#m=null,r.done.state=!0,r.done.resolve(n))}).catch(n=>{this.#m===e&&(this.#m=null,r.done.state=!0,r.done.reject(n))}),e}async replaceWith(e,...r){if(this.readyState==="done")throw new Error("Response already done.");this.disconnect(),await this.#u(null,e,...r)}async#u(e,r,...n){let s=_e.call(this),i=e||s.now.refresh();if(r instanceof Promise)return this.#g(new Promise((m,l)=>{this.#s.signal.addEventListener("abort",()=>{i.aborted=!0,m()}),r.then(async y=>{await this.#u(i,y,...n),m()}).catch(y=>l(y))}));let a=(m,l)=>{if(l=Object.freeze({...l,ok:l.status>=200&&l.status<299,bodyUsed:!0}),m?.aborted){m.resolve(l);return}let y=m||s.now.refresh(),b=l.body;this.#o=l.status,this.#a=l.statusText;for(let[d]of[...this.#e.entries()])this.#e.delete(d);for(let[d,P]of l.headers.entries())this.#e.append(d,P);this.#i=l.type,this.#f=l.redirected,this.#p=l.url;let w=this.#t;this.#t=b,this.#n=!!l.concurrent,this.#l=l.port,this.#n||(this.#h.abort(),this.#h=new AbortController);let x=new A(this,{type:"set",key:"body",value:b,oldValue:w,isUpdate:!0,related:[],operation:"set",detail:null});s.live.state=!0,s.live.resolve(this),y.resolve(l),this.#r.emit([x]),this.dispatchEvent(new $t(l))},o=(m,l,y)=>{a(m,{body:l,status:200,statusText:"",...y,headers:y.headers instanceof Headers?y.headers:new Headers(y.headers||{}),type:"basic",redirected:!1,url:null})},u=async(m,l,y)=>{let b,w,x=!0;if(l instanceof Response){try{b=await z.prototype.any.call(l,{to:"json"})}catch{x=!1,b=await z.prototype.any.call(l)}w=this.constructor.getPort(l,{handshake:2})}else b=(await l.readyStateChange("live")).body,w=l.port;if(a(m,{body:b,status:l.status,statusText:l.statusText,headers:l.headers,concurrent:l.concurrent,...y,port:w,type:l.type,redirected:l.redirected,url:l.url}),this.constructor.test(l)==="LiveResponse"){let d=()=>{o(null,l.body,l)};return l.addEventListener("replace",d,{signal:this.#s.signal}),await l.readyStateChange("done"),l.removeEventListener("replace",d),l}if(w){x&&w.projectMutations({from:"initial_response",to:b,signal:this.#h.signal});let d=new Promise(P=>{let E=q=>{let{body:N,...T}=q.data;o(null,N,{...T})};w.addEventListener("response.replace",E,{signal:this.#s.signal}),w.addEventListener("response.done",()=>{w.removeEventListener("response.replace",E),P(this)},{once:!0}),w.readyStateChange("close").then(P)});return w.start(),d}},f=async(m,l,y)=>{let b=await l.next(),w=await b.value;await this.#u(m,w,{done:b.done,...y});let x=b,d=w;for(;!x.done&&!this.#s.signal.aborted;)x=await l.next(),d=await x.value,this.#s.signal.aborted||await this.#u(null,d,{concurrent:y.concurrent,done:y.done===!1?!1:x.done})},c=async(m,l,y)=>(await this.#u(m,l.value,y),S.observe(l,"value",b=>this.#u(null,b.value,{concurrent:y.concurrent,done:!1}),{signal:this.#s.signal}),new Promise(()=>{})),p=typeof n[0]=="function"?n.shift():null,h=v(n[0])?{...n.shift()}:{};if("status"in h&&(h.status=parseInt(h.status),h.status<200||h.status>599))throw new Error(`The status provided (${h.status}) is outside the range [200, 599].`);if("statusText"in h&&(h.statusText=String(h.statusText)),h.headers&&!(h.headers instanceof Headers)&&(h.headers=new Headers(h.headers)),"concurrent"in h&&(h.concurrent=!!h.concurrent),/Response/.test(this.constructor.test(r))){if(p)throw new Error("frameClosure is not supported for responses.");i.donePromise=u(i,r,h)}else if(this.constructor.test(r)==="Generator"){if(p)throw new Error("frameClosure is not supported for generators.");i.donePromise=f(i,r,h)}else if(this.constructor.test(r)==="LiveProgramHandle"){if(p)throw new Error("frameClosure is not supported for live program handles.");i.donePromise=c(i,r,h)}else if(i.donePromise=Promise.resolve(o(i,r,h)),p){let m=_(r)&&!At(r)?S.proxy(r,{chainable:!0,membrane:r}):r;i.donePromise=Promise.resolve(p.call(this,m,this.#h.signal))}return this.#g(h.done===!1?new Promise(()=>{}):i.donePromise),await new Promise((m,l)=>{this.#s.signal.addEventListener("abort",()=>m(!1)),i.donePromise.then(()=>m(!0)).catch(l)})}toResponse({port:e,signal:r}={}){if(e&&!(e instanceof M))throw new Error("Client must be a MessagePortPlus interface");let n=z.from(this.body,{status:this.#o,statusText:this.#a,headers:this.#e}),s=C(this);if(fe(n).set("meta",new Map(s)),!e)return n;_(this.#t)&&!At(this.#t)&&e.projectMutations({from:this.#t,to:"initial_response",signal:AbortSignal.any([this.#h.signal].concat(r||[]))});let i=()=>{let a=Object.fromEntries([...this.headers.entries()]);a?.["set-cookie"]&&(delete a["set-cookie"],console.warn('Warning: The "set-cookie" header is not supported for security reasons and has been removed from the response.')),e.postMessage({body:this.#t,status:this.#o,statusText:this.#a,headers:a,type:this.type,url:this.url,redirect:this.redirect,concurrent:this.#n},{type:"response.replace",live:!0,signal:AbortSignal.any([this.#h.signal].concat(r||[]))})};return this.addEventListener("replace",i,{signal:r}),this.readyStateChange("done").then(()=>{e.postMessage(null,{type:"response.done"})}),n}async*toGenerator({signal:e}={}){do yield this.body;while(await new Promise(r=>{this.addEventListener("replace",()=>r(!0),{once:!0,signal:e}),this.readyStateChange("done").then(()=>r(!1))}))}toLiveProgramHandle({signal:e}={}){let r=new Tt,n=()=>S.defineProperty(r,"value",{value:this.body,enumerable:!1,configurable:!0});return this.addEventListener("replace",n,{signal:e}),n(),r}clone(e={}){let r=new this.constructor,n=C(this);return fe(r).set("meta",new Map(n)),r.replaceWith(this,e),r}},fn=t=>typeof t?.next=="function"&&typeof t?.throw=="function"&&typeof t?.return=="function";function _e(){let t=C(this);if(!t.has("readystate_registry")){let e=n=>(n.promise=new Promise((s,i)=>(n.resolve=s,n.reject=i)),n),r={live:e({}),done:e({})};(function n(){return r.now=e({}),r.now.refresh=n,r.now})(),t.set("readystate_registry",r)}return t.get("readystate_registry")}var $t=class extends Event{#r;get data(){return this.#r}constructor(e){super("replace"),this.#r=e}},Tt=class{[Symbol.toStringTag]="LiveProgramHandle";abort(){}};globalThis.webqit||(globalThis.webqit={});Object.assign(globalThis.webqit,Rt);})();
1
+ (()=>{var Pr=Object.defineProperty;var jt=(t,e)=>()=>(t&&(e=t(t=0)),e);var Te=(t,e)=>{for(var r in e)Pr(t,r,{get:e[r],enumerable:!0})};function Dt(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function tt(t,e=!1){let r=[],n=0;for(;n<t.length;){let s=t[n],i=g(function(a){if(!e)throw new TypeError(a);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 a="",o=n+1;for(;o<t.length;){let u=t.substr(o,1);if(o===n+1&&Rr.test(u)||o!==n+1&&jr.test(u)){a+=t[o++];continue}break}if(!a){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:a}),n=o;continue}if(s==="("){let a=1,o="",u=n+1,f=!1;if(t[u]==="?"){i(`Pattern cannot start with "?" at ${u}`);continue}for(;u<t.length;){if(!Dt(t[u],!1)){i(`Invalid character '${t[u]}' at ${u}.`),f=!0;break}if(t[u]==="\\"){o+=t[u++]+t[u++];continue}if(t[u]===")"){if(a--,a===0){u++;break}}else if(t[u]==="("&&(a++,t[u+1]!=="?")){i(`Capturing groups are not allowed at ${u}`),f=!0;break}o+=t[u++]}if(f)continue;if(a){i(`Unbalanced pattern at ${n}`);continue}if(!o){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=u;continue}r.push({type:"CHAR",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function rt(t,e={}){let r=tt(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${R(e.delimiter)}]+?`,s=[],i=0,a=0,o="",u=new Set,f=g(d=>{if(a<r.length&&r[a].type===d)return r[a++].value},"tryConsume"),c=g(()=>f("OTHER_MODIFIER")??f("ASTERISK"),"tryConsumeModifier"),p=g(d=>{let P=f(d);if(P!==void 0)return P;let{type:E,index:q}=r[a];throw new TypeError(`Unexpected ${E} at ${q}, expected ${d}`)},"mustConsume"),h=g(()=>{let d="",P;for(;P=f("CHAR")??f("ESCAPED_CHAR");)d+=P;return d},"consumeText"),m=g(d=>d,"DefaultEncodePart"),l=e.encodePart||m,y="",b=g(d=>{y+=d},"appendToPendingFixedValue"),w=g(()=>{y.length&&(s.push(new we(3,"","",l(y),"",3)),y="")},"maybeAddPartFromPendingFixedValue"),x=g((d,P,E,q,N)=>{let T=3;switch(N){case"?":T=1;break;case"*":T=0;break;case"+":T=2;break}if(!P&&!E&&T===3){b(d);return}if(w(),!P&&!E){if(!d)return;s.push(new we(3,"","",l(d),"",T));return}let j;E?E==="*"?j=Ze:j=E:j=n;let ve=2;j===n?(ve=1,j=""):j===Ze&&(ve=0,j="");let Z;if(P?Z=P:E&&(Z=i++),u.has(Z))throw new TypeError(`Duplicate name '${Z}'.`);u.add(Z),s.push(new we(ve,Z,l(d),j,l(q),T))},"addPart");for(;a<r.length;){let d=f("CHAR"),P=f("NAME"),E=f("REGEX");if(!P&&!E&&(E=f("ASTERISK")),P||E){let N=d??"";e.prefixes.indexOf(N)===-1&&(b(N),N=""),w();let T=c();x(N,P,E,"",T);continue}let q=d??f("ESCAPED_CHAR");if(q){b(q);continue}if(f("OPEN")){let N=h(),T=f("NAME"),j=f("REGEX");!T&&!j&&(j=f("ASTERISK"));let ve=h();p("CLOSE");let Z=c();x(N,T,j,ve,Z);continue}w(),p("END")}return s}function R(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ye(t){return t&&t.ignoreCase?"ui":"u"}function kt(t,e,r){return nt(rt(t,r),e,r)}function re(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function nt(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of t){if(o.type===3){o.modifier===3?n+=R(o.value):n+=`(?:${R(o.value)})${re(o.modifier)}`;continue}e&&e.push(o.name);let u=`[^${R(r.delimiter)}]+?`,f=o.value;if(o.type===1?f=u:o.type===0&&(f=Ze),!o.prefix.length&&!o.suffix.length){o.modifier===3||o.modifier===1?n+=`(${f})${re(o.modifier)}`:n+=`((?:${f})${re(o.modifier)})`;continue}if(o.modifier===3||o.modifier===1){n+=`(?:${R(o.prefix)}(${f})${R(o.suffix)})`,n+=re(o.modifier);continue}n+=`(?:${R(o.prefix)}`,n+=`((?:${f})(?:`,n+=R(o.suffix),n+=R(o.prefix),n+=`(?:${f}))*)${R(o.suffix)})`,o.modifier===0&&(n+="?")}let s=`[${R(r.endsWith)}]|$`,i=`[${R(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${s})`:n+="$",new RegExp(n,Ye(r));r.strict||(n+=`(?:${i}(?=${s}))?`);let a=!1;if(t.length){let o=t[t.length-1];o.type===3&&o.modifier===3&&(a=r.delimiter.indexOf(o)>-1)}return a||(n+=`(?=${i}|${s})`),new RegExp(n,Ye(r))}function qt(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1}function st(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function Nt(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function ot(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function it(t){if(!t)return!0;for(let e of Ut)if(t.test(e))return!0;return!1}function Ft(t,e){if(t=st(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 Ht(t,e){if(t=st(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 Bt(t,e){return e||t===""?t:ot(t)?ut(t):ft(t)}function Wt(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function zt(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function Vt(t,e,r){if(r||t==="")return t;if(e&&!Ut.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 Gt(t,e,r){return at(e)===t&&(t=""),r||t===""?t:ct(t)}function Jt(t,e){return t=Nt(t,":"),e||t===""?t:Le(t)}function at(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function Le(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Kt(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Xt(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function ft(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 ut(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function ct(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function Qt(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 Zt(t){return t===""?t:new URL(`data:${t}`).pathname}function Yt(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function er(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function et(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 U(t,e){return e?be(t):t}function ye(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=U(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=U(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=U(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=U(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=U(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=U(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=U(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=U(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=Jt(e.protocol,r)),typeof e.username=="string"&&(t.username=zt(e.username,r)),typeof e.password=="string"&&(t.password=Wt(e.password,r)),typeof e.hostname=="string"&&(t.hostname=Bt(e.hostname,r)),typeof e.port=="string"&&(t.port=Gt(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!qt(t.pathname,r)){let s=n.pathname.lastIndexOf("/");s>=0&&(t.pathname=U(n.pathname.substring(0,s+1),r)+t.pathname)}t.pathname=Vt(t.pathname,t.protocol,r)}return typeof e.search=="string"&&(t.search=Ht(e.search,r)),typeof e.hash=="string"&&(t.hash=Ft(e.hash,r)),t}function be(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function rr(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function nr(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=".*",n=`[^${rr(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,i="";for(let a=0;a<t.length;++a){let o=t[a];if(o.type===3){if(o.modifier===3){i+=be(o.value);continue}i+=`{${be(o.value)}}${re(o.modifier)}`;continue}let u=o.hasCustomName(),f=!!o.suffix.length||!!o.prefix.length&&(o.prefix.length!==1||!e.prefixes.includes(o.prefix)),c=a>0?t[a-1]:null,p=a<t.length-1?t[a+1]:null;if(!f&&u&&o.type===1&&o.modifier===3&&p&&!p.prefix.length&&!p.suffix.length)if(p.type===3){let h=p.value.length>0?p.value[0]:"";f=s.test(h)}else f=!p.hasCustomName();if(!f&&!o.prefix.length&&c&&c.type===3){let h=c.value[c.value.length-1];f=e.prefixes.includes(h)}f&&(i+="{"),i+=be(o.prefix),u&&(i+=`:${o.name}`),o.type===2?i+=`(${o.value})`:o.type===1?u||(i+=`(${n})`):o.type===0&&(!u&&(!c||c.type===3||c.modifier!==3||f||o.prefix!=="")?i+="*":i+=`(${r})`),o.type===1&&u&&o.suffix.length&&s.test(o.suffix[0])&&(i+="\\"),i+=be(o.suffix),f&&(i+="}"),o.modifier!==3&&(i+=re(o.modifier))}return i}var Tr,g,we,Rr,jr,Ze,ee,Ir,Lr,Ut,tr,Qe,Y,De,sr=jt(()=>{Tr=Object.defineProperty,g=(t,e)=>Tr(t,"name",{value:e,configurable:!0}),we=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"}};g(we,"Part");Rr=/[$_\p{ID_Start}]/u,jr=/[$_\u200C\u200D\p{ID_Continue}]/u,Ze=".*";g(Dt,"isASCII");g(tt,"lexer");g(rt,"parse");g(R,"escapeString");g(Ye,"flags");g(kt,"stringToRegexp");g(re,"modifierToString");g(nt,"partsToRegexp");ee={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Ir={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Lr={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};g(qt,"isAbsolutePathname");g(st,"maybeStripPrefix");g(Nt,"maybeStripSuffix");g(ot,"treatAsIPv6Hostname");Ut=["ftp","file","http","https","ws","wss"];g(it,"isSpecialScheme");g(Ft,"canonicalizeHash");g(Ht,"canonicalizeSearch");g(Bt,"canonicalizeHostname");g(Wt,"canonicalizePassword");g(zt,"canonicalizeUsername");g(Vt,"canonicalizePathname");g(Gt,"canonicalizePort");g(Jt,"canonicalizeProtocol");g(at,"defaultPortForProtocol");g(Le,"protocolEncodeCallback");g(Kt,"usernameEncodeCallback");g(Xt,"passwordEncodeCallback");g(ft,"hostnameEncodeCallback");g(ut,"ipv6HostnameEncodeCallback");g(ct,"portEncodeCallback");g(Qt,"standardURLPathnameEncodeCallback");g(Zt,"pathURLPathnameEncodeCallback");g(Yt,"searchEncodeCallback");g(er,"hashEncodeCallback");tr=class{#r;#t=[];#n={};#e=0;#o=1;#a=0;#i=0;#f=0;#p=0;#u=!1;constructor(t){this.#r=t}get result(){return this.#n}parse(){for(this.#t=tt(this.#r,!0);this.#e<this.#t.length;this.#e+=this.#o){if(this.#o=1,this.#t[this.#e].type==="END"){if(this.#i===0){this.#m(),this.#y()?this.#s(9,1):this.#b()?this.#s(8,1):this.#s(7,0);continue}else if(this.#i===2){this.#g(5);continue}this.#s(10,0);break}if(this.#f>0)if(this.#O())this.#f-=1;else continue;if(this.#S()){this.#f+=1;continue}switch(this.#i){case 0:this.#_()&&this.#g(1);break;case 1:if(this.#_()){this.#M();let t=7,e=1;this.#v()?(t=2,e=3):this.#u&&(t=2),this.#s(t,e)}break;case 2:this.#w()?this.#g(3):(this.#x()||this.#b()||this.#y())&&this.#g(5);break;case 3:this.#P()?this.#s(4,1):this.#w()&&this.#s(5,1);break;case 4:this.#w()&&this.#s(5,1);break;case 5:this.#A()?this.#p+=1:this.#C()&&(this.#p-=1),this.#E()&&!this.#p?this.#s(6,1):this.#x()?this.#s(7,0):this.#b()?this.#s(8,1):this.#y()&&this.#s(9,1);break;case 6:this.#x()?this.#s(7,0):this.#b()?this.#s(8,1):this.#y()&&this.#s(9,1);break;case 7:this.#b()?this.#s(8,1):this.#y()&&this.#s(9,1);break;case 8:this.#y()&&this.#s(9,1);break;case 9:break;case 10:break}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port="")}#s(t,e){switch(this.#i){case 0:break;case 1:this.#n.protocol=this.#d();break;case 2:break;case 3:this.#n.username=this.#d();break;case 4:this.#n.password=this.#d();break;case 5:this.#n.hostname=this.#d();break;case 6:this.#n.port=this.#d();break;case 7:this.#n.pathname=this.#d();break;case 8:this.#n.search=this.#d();break;case 9:this.#n.hash=this.#d();break;case 10:break}this.#i!==0&&t!==10&&([1,2,3,4].includes(this.#i)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#i)&&[8,9].includes(t)&&(this.#n.pathname??=this.#u?"/":""),[1,2,3,4,5,6,7].includes(this.#i)&&t===9&&(this.#n.search??="")),this.#h(t,e)}#h(t,e){this.#i=t,this.#a=this.#e+e,this.#e+=e,this.#o=0}#m(){this.#e=this.#a,this.#o=0}#g(t){this.#m(),this.#i=t}#c(t){return t<0&&(t=this.#t.length-t),t<this.#t.length?this.#t[t]:this.#t[this.#t.length-1]}#l(t,e){let r=this.#c(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#_(){return this.#l(this.#e,":")}#v(){return this.#l(this.#e+1,"/")&&this.#l(this.#e+2,"/")}#w(){return this.#l(this.#e,"@")}#P(){return this.#l(this.#e,":")}#E(){return this.#l(this.#e,":")}#x(){return this.#l(this.#e,"/")}#b(){if(this.#l(this.#e,"?"))return!0;if(this.#t[this.#e].value!=="?")return!1;let t=this.#c(this.#e-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#y(){return this.#l(this.#e,"#")}#S(){return this.#t[this.#e].type=="OPEN"}#O(){return this.#t[this.#e].type=="CLOSE"}#A(){return this.#l(this.#e,"[")}#C(){return this.#l(this.#e,"]")}#d(){let t=this.#t[this.#e],e=this.#c(this.#a).index;return this.#r.substring(e,t.index)}#M(){let t={};Object.assign(t,ee),t.encodePart=Le;let e=kt(this.#d(),void 0,t);this.#u=it(e)}};g(tr,"Parser");Qe=["protocol","username","password","hostname","port","pathname","search","hash"],Y="*";g(et,"extractValues");g(U,"processBaseURLString");g(ye,"applyInit");g(be,"escapePatternString");g(rr,"escapeRegexpString");g(nr,"partsToPattern");De=class{#r;#t={};#n={};#e={};#o={};#a=!1;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let o=new tr(t);if(o.parse(),t=o.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:Y,protocol:Y,username:Y,password:Y,hostname:Y,port:Y,search:Y,hash:Y};this.#r=ye(i,t,!0),at(this.#r.protocol)===this.#r.port&&(this.#r.port="");let a;for(a of Qe){if(!(a in this.#r))continue;let o={},u=this.#r[a];switch(this.#n[a]=[],a){case"protocol":Object.assign(o,ee),o.encodePart=Le;break;case"username":Object.assign(o,ee),o.encodePart=Kt;break;case"password":Object.assign(o,ee),o.encodePart=Xt;break;case"hostname":Object.assign(o,Ir),ot(u)?o.encodePart=ut:o.encodePart=ft;break;case"port":Object.assign(o,ee),o.encodePart=ct;break;case"pathname":it(this.#t.protocol)?(Object.assign(o,Lr,s),o.encodePart=Qt):(Object.assign(o,ee,s),o.encodePart=Zt);break;case"search":Object.assign(o,ee,s),o.encodePart=Yt;break;case"hash":Object.assign(o,ee,s),o.encodePart=er;break}try{this.#o[a]=rt(u,o),this.#t[a]=nt(this.#o[a],this.#n[a],o),this.#e[a]=nr(this.#o[a],o),this.#a=this.#a||this.#o[a].some(f=>f.type===2)}catch{throw new TypeError(`invalid ${a} pattern '${this.#r[a]}'.`)}}}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!1;try{typeof t=="object"?r=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return!1}let n;for(n of Qe)if(!this.#t[n].exec(r[n]))return!1;return!0}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=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let s;for(s of Qe){let i=this.#t[s].exec(r[s]);if(!i)return null;let a={};for(let[o,u]of this.#n[s].entries())if(typeof u=="string"||typeof u=="number"){let f=i[o+1];a[u]=f}n[s]={input:r[s]??"",groups:a}}return n}static compareComponent(t,e,r){let n=g((o,u)=>{for(let f of["type","modifier","prefix","value","suffix"]){if(o[f]<u[f])return-1;if(o[f]!==u[f])return 1}return 0},"comparePart"),s=new we(3,"","","","",3),i=new we(0,"","","","",3),a=g((o,u)=>{let f=0;for(;f<Math.min(o.length,u.length);++f){let c=n(o[f],u[f]);if(c)return c}return o.length===u.length?0:n(o[f]??s,u[f]??s)},"comparePartList");return!e.#e[t]&&!r.#e[t]?0:e.#e[t]&&!r.#e[t]?a(e.#o[t],[i]):!e.#e[t]&&r.#e[t]?a([i],r.#o[t]):a(e.#o[t],r.#o[t])}get protocol(){return this.#e.protocol}get username(){return this.#e.username}get password(){return this.#e.password}get hostname(){return this.#e.hostname}get port(){return this.#e.port}get pathname(){return this.#e.pathname}get search(){return this.#e.search}get hash(){return this.#e.hash}get hasRegExpGroups(){return this.#a}};g(De,"URLPattern")});var or={};Te(or,{URLPattern:()=>De});var ir=jt(()=>{sr();globalThis.URLPattern||(globalThis.URLPattern=De)});var Rt={};Te(Rt,{FormDataPlus:()=>B,HeadersPlus:()=>W,LiveResponse:()=>ze,Observer:()=>lr,RequestPlus:()=>He,ResponsePlus:()=>z,fetchPlus:()=>gr});function v(t){return!Array.isArray(t)&&typeof t=="object"&&t}function pe(t){return typeof t}function I(t){return Array.isArray(t)}function Re(t){return t===!0||t===!1}function de(t){return typeof t=="function"}function Ve(t){return t===null||t===""}function te(t){return arguments.length&&(t===void 0||typeof t>"u")}function _(t){return Array.isArray(t)||typeof t=="object"&&t||de(t)}function Ge(t){return Ve(t)||te(t)||t===!1||t===0||_(t)&&!Object.keys(t).length}function V(t){return de(t)||t&&{}.toString.call(t)==="[object function]"}function me(t){return t instanceof Number||typeof t=="number"}function G(t){return me(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function Je(t){return I(t)&&Object.getPrototypeOf(t)===Array.prototype}function Ke(t){return v(t)&&Object.getPrototypeOf(t)===Object.prototype}function J(t){return t instanceof String||typeof t=="string"&&t!==null}function Xe(t){return!J(t)&&!te(t.length)}function D(t,...e){if(!t||!["object","function"].includes(typeof t))throw new Error("Argument #1 must be of type object");let r=t[Symbol.for("wq")];if(r||(r=new je,Object.defineProperty(t,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!e.length)return r;let n,s;for(;n=e.shift();)(s=r)&&!(r=r.get(n))&&(r=new je,s.set(n,r));return r}var je=class extends Map{};function ge(t,e,r=!1){if(e=="")return t;var n=r?t.lastIndexOf(e):t.indexOf(e);return n===-1?"":t.substr(n+e.length)}function Ie(t,e,r=!1){if(e=="")return t;var n=r?t.lastIndexOf(e):t.indexOf(e);return n===-1?t:t.substr(0,n)}(async()=>typeof URLPattern>"u"&&await Promise.resolve().then(()=>(ir(),or)))();var lt=class extends URLPattern{#r;constructor(e,r=null){typeof e=="object"&&e?.baseURL&&({baseURL:r,...e}=e),super(e,r),this.#r=new URL(e,r)}isPattern(){let e=(s,i)=>{if(!s)return!1;let a=!1;for(let o of s){if(a){a=!1;continue}if(o==="\\"){a=!0;continue}if(i.has(o))return!0}return!1},r={protocol:new Set(["*"]),username:new Set(["*"]),password:new Set(["*"]),hostname:new Set(["*","{"]),port:new Set(["*","{"]),pathname:new Set(["*",":","{","("]),search:new Set(["*","{"]),hash:new Set(["*","{"])},n=this.#r;return e(n.protocol,r.protocol)||e(n.username,r.username)||e(n.password,r.password)||e(n.hostname,r.hostname)||e(n.port,r.port)||e(n.pathname,r.pathname)||e(n.search,r.search)||e(n.hash,r.hash)}exec(...e){let r=super.exec(...e);if(!r)return;let n={};for(let a of Object.values(r))a?.groups&&Object.assign(n,a.groups);let s={named:n};return{...r,vars:s,render:a=>a.replace(/\$(\$|[A-Z0-9_]+)/gi,(o,u)=>u==="$"?"$":s.named[u]??"")}}};var Ot={};Te(Ot,{any:()=>Kr,apply:()=>xt,batch:()=>St,construct:()=>wt,defineProperties:()=>Yr,defineProperty:()=>Oe,deleteProperties:()=>en,deleteProperty:()=>Ae,get:()=>X,getOwnPropertyDescriptor:()=>qe,getOwnPropertyDescriptors:()=>Qr,getPrototypeOf:()=>gt,has:()=>Ne,intercept:()=>Xr,isExtensible:()=>yt,map:()=>Zr,observe:()=>Et,ownKeys:()=>bt,path:()=>Gr,preventExtensions:()=>vt,reduce:()=>Pt,set:()=>oe,setPrototypeOf:()=>_t,subtree:()=>Jr});function F(t,e=!0){return I(t)?t:!e&&v(t)?[t]:t!==!1&&t!==0&&Ge(t)?[]:Xe(t)?Array.prototype.slice.call(t):v(t)?Object.values(t):[t]}var O=(t,...e)=>D(t,"observerAPI",...e),xe=(t,e)=>t instanceof Promise?t.then(e):e(t),ke={};var ne=class{constructor(e,r){this.registry=e,Object.assign(this,{...r,target:e.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var Pe=class extends ne{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),ke.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(e){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let r=e,n=this.filter;if(n!==1/0&&(n=F(n,!1))&&(r=e.filter(i=>n.includes(i.key))),this.params.diff&&(r=r.filter(i=>i.type!=="set"||i.value!==i.oldValue)),!r.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...r);return}this.emit.recursionTarget=this.params.recursions==="inject"?r:[]}let s=this.filter===1/0||Array.isArray(this.filter)?this.emit(r,this):this.emit(r[0],this);return xe(s,i=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):i})}};var se=class{constructor(e){this.target=e,this.entries=[]}addRegistration(e){return this.entries.push(e),e}removeRegistration(e){this.entries=this.entries.filter(r=>r!==e)}static _getInstance(e,r,n=!0,s=this.__namespace){if(!_(r))throw new Error(`Subject must be of type object; "${pe(r)}" given!`);let i=this;return s&&O(globalThis,"observerAPI","namespaces").has(e+"-"+s)&&(i=O(globalThis,"observerAPI","namespaces").get(e+"-"+s),e+="-"+s),!O(r,"registry").has(e)&&n&&O(r,"registry").set(e,new i(r)),O(r,"registry").get(e)}static _namespace(e,r,n=null){if(e+="-"+r,arguments.length===2)return O(globalThis,"observerAPI","namespaces").get(e);if(!(n.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);O(globalThis,"observerAPI","namespaces").set(e,n),n.__namespace=r}};var A=class{constructor(e,r){if(this.target=e,!r.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,r)}get[Symbol.toStringTag](){return"Descriptor"}static[Symbol.hasInstance](e){return e?.[Symbol.toStringTag]==="Descriptor"&&e.operation}};var L=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("listeners",...arguments)}static namespace(e,r=null){return super._namespace("listeners",...arguments)}constructor(e){super(e),this.batches=[]}addRegistration(e,r,n){return super.addRegistration(new Pe(this,{filter:e,emit:r,params:n}))}emit(e,{eventsArePropertyDescriptors:r=!1,eventIsArrayMethodDescriptor:n=!1}={}){if(this.batches.length){let s=this.batches[0].params.arrayMethodName;this.batches[0].snapshots.push({events:[...e],arrayMethodName:s,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n});return}this.$emit(this.entries,[{events:e,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n}])}$emit(e,r){let n=0,s=0,i=0;for(let c of e)n+=1,c.params.withPropertyDescriptors&&(s+=1),c.params.withArrayMethodDescriptors&&(i+=1);let a=[],o=[],u=[],f=[];for(let c of r){let p=c.arrayMethodName,h=c.eventsArePropertyDescriptors,m=c.eventIsArrayMethodDescriptor;for(let l of c.events)if(p&&(l.operation=p),s&&(i&&a.push(l),m||i!==n&&o.push(l)),s!==n){let y=l;if(h){let{target:b,type:w,...x}=l;y=new A(b,{type:"set",...x}),Object.defineProperty(y,"value","get"in x.value?{get:()=>x.value.get()}:{value:x.value.value}),x.oldValue&&Object.defineProperty(y,"oldValue","get"in x.oldValue?{get:()=>x.oldValue.get()}:{value:x.oldValue.value})}i&&u.push(y),m||i!==n&&f.push(y)}}for(let c of e)c.params.withPropertyDescriptors?c.params.withArrayMethodDescriptors?a.length&&c.fire(a):o.length&&c.fire(o):c.params.withArrayMethodDescriptors?u.length&&c.fire(u):f.length&&c.fire(f)}batch(e,r={}){this.batches.unshift({entries:[...this.entries],snapshots:[],params:r});let n=e();return xe(n,s=>{let i=this.batches.shift();return i.snapshots.length&&this.$emit(i.entries,i.snapshots),s})}};var Ee=class extends ne{exec(e,r,n){return this.running||!this.traps[e.operation]?r(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[e.operation](e,n,(...s)=>(this.running=!1,r(...s))))}};var K=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("traps",...arguments)}static namespace(e,r=null){return super._namespace("traps",...arguments)}addRegistration(e){return super.addRegistration(new Ee(this,e))}emit(e,r=null){let n=this;return function s(i,...a){let o=n.entries[i];return o?o.exec(e,(...u)=>s(i+1,...u),...a):r?r(e,...a):a[0]}(0)}};var mt={};Te(mt,{accessorize:()=>zr,proxy:()=>pt,unaccessorize:()=>Vr,unproxy:()=>Se});var ur=Symbol("wqOriginal");function zr(t,e,r={}){t=dt(t);let n=O(t,"accessorizedProps");function s(u){let f,c=t;do f=Object.getOwnPropertyDescriptor(c,u);while(!f&&(c=Object.getPrototypeOf(c)));return f?{proto:c,descriptor:f}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function i(u){if(n.has(u+""))return!0;let f=s(u);f.getValue=function(h=!1){return h?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},f.setValue=function(h,m=!1){if(this.dirty=!0,m){this.descriptor=h;return}return this.descriptor.set?this.descriptor.set(h)!==!1:(this.descriptor.value=h,!0)},f.intact=function(){let h=Object.getOwnPropertyDescriptor(t,u);return h?.get===p.get&&h?.set===p.set&&n.get(u+"")===this},f.restore=function(){return this.intact()?(this.proto&&this.proto!==t||!this.proto&&!this.dirty?delete t[u]:Object.defineProperty(t,u,this.descriptor),n.delete(u+""),!0):!1},n.set(isNaN(u)?u:parseInt(u),f);let{enumerable:c=!0}=f.descriptor,p={enumerable:c,configurable:!0};("value"in f.descriptor||f.descriptor.set)&&(p.set=function(h){return oe(this,u,h,r)}),("value"in f.descriptor||f.descriptor.get)&&(p.get=function(){return X(this,u,r)});try{return Object.defineProperty(t,u,p),!0}catch{return n.delete(u+""),!1}}let o=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(i);return e===void 0||Array.isArray(e)?o:o[0]}function Vr(t,e,r={}){t=dt(t);let n=O(t,"accessorizedProps");function s(o){return n.has(o+"")?n.get(o+"").restore():!0}let a=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(s);return e===void 0||Array.isArray(e)?a:a[0]}function pt(t,e={},r=void 0){let n=dt(t);if(typeof e.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(e.membrane&&O(n,"membraneRef").has(e.membrane))return O(n,"membraneRef").get(e.membrane);let s={apply:(o,u,f)=>xt(o,u,f,void 0,e),construct:(o,u,f=null)=>wt(o,u,f,e),defineProperty:(o,u,f)=>Oe(o,u,f,e),deleteProperty:(o,u)=>Ae(o,u,e),get:(o,u,f=null)=>{if(u===ur)return n;let c={...e,receiver:f},p=X(o,u,c);return Array.isArray(o)&&typeof p=="function"&&!/^class\s?/.test(Function.prototype.toString.call(p))?pt(p,{...e,arrayMethodName:u,membrane:f},r):e.chainable&&_(p)&&u!=="prototype"&&!(typeof p=="function"&&/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(p)))?pt(p,e,r):p},getOwnPropertyDescriptor:(o,u)=>qe(o,u,e),getPrototypeOf:o=>gt(o,e),has:(o,u)=>Ne(o,u,e),isExtensible:o=>yt(o,e),ownKeys:o=>bt(o,e),preventExtensions:o=>vt(o,e),set:(o,u,f,c=null)=>oe(o,u,f,{...e,receiver:c}),setPrototypeOf:(o,u)=>_t(o,u,e)},i=r?.(s)||s,a=new Proxy(n,i);return e.membrane&&O(n,"membraneRef").set(e.membrane,a),a}function Se(t){return t&&t[ur]||t}function dt(t){if(!t||!_(t))throw new Error("Target must be of type object!");return Se(t)}var Ce=class extends Array{get[Symbol.toStringTag](){return"Path"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Path"}};function Gr(...t){return new Ce(...t)}var ie=class extends Array{get[Symbol.toStringTag](){return"Subtree"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Subtree"}};function Jr(){return new ie}function Kr(){return 1/0}function Pt(t,e,r,n=i=>i,s={}){let i=e instanceof ie;if(!(!i&&!e?.length))return function a(o,u,f,c){let p=c||u[f.level]instanceof ie,h=p?1/0:u[f.level],m=p?!1:f.level===u.length-1;return o instanceof A&&o.operation!=="get"?f={...f,probe:"always"}:f.probe!=="always"&&(f={...f,probe:!m}),r(o,h,(l,...y)=>{let b=d=>{d instanceof A&&(d.path="key"in d?[d.key]:[],o instanceof A&&(d.path="key"in d?o.path.concat(d.key):o.path.slice(0),Object.defineProperty(d,"context",{get:()=>o,configurable:!0})))},w=y[0]||{},x=d=>{if(d instanceof A&&"argumentsList"in d)return;let P=H(d,!1);return xe(P,E=>(d instanceof A?d.value=E:d=E,a(d,u,{...f,...w,keyInParent:d.key,level:f.level+1},p)))};if(Me(h)&&Array.isArray(l)){if(l.forEach(b),m)return n(l,...y);p&&l[0]instanceof A&&(l[0].operation!=="get"||s.asGet)&&n(l,...y);for(let d of l)x(d);return}return b(l),m?n(l,...y):x(l)},f)}(t,e.slice(0),{...s,level:0},i)}function Et(t,e,r,n={}){let s=H(t,!n.level);if(V(arguments[1])&&([,r,n={}]=arguments,e=1/0),!V(r))throw new Error(`Handler must be a function; "${pe(r)}" given!`);if(e instanceof Ce||e instanceof ie)return Pt(s,e,Et,r,n);if(n={...n,descripted:!0},delete n.live,!_(s))return n.probe&&X(s,e,r,n)||void 0;let i=cr(s,e,r,n);return n.probe?X(s,e,i,n):i()}function Xr(t,e,r={}){let n=H(t);return v(e)||([,,,r={}]=arguments,e={[arguments[1]]:arguments[2]}),K.getInstance(n,!0,r.namespace).addRegistration({traps:e,params:r})}function qe(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptor",{key:e},r,n)}function Qr(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptors",{key:e},r,n)}function gt(t,e=n=>n,r={}){return k(t,"getPrototypeOf",{},e,r)}function yt(t,e=n=>n,r={}){return k(t,"isExtensible",{},e,r)}function bt(t,e=n=>n,r={}){return k(t,"ownKeys",{},e,r)}function Ne(t,e,r=s=>s,n={}){return k(t,"has",{key:e},r,n)}function X(t,e,r=s=>s,n={}){let s,i=H(t,!n.level);return v(r)?[n,r]=[r,a=>a]:n.live&&(s=!0),e instanceof Ce||e instanceof ie?Pt(i,e,X,r,{...n,asGet:!0}):tn(i,e,a=>{let o=[...a];return function u(f,c,p){if(!c.length)return p(f);let h=c.shift();if(!["string","number","symbol"].includes(typeof h))throw new Error(`Property name/key ${h} invalid.`);function m(b,w=void 0){let x=E=>(b.value=E,u([...f,n.live||n.descripted?b:E],c,p));if(arguments.length>1)return x(w);if(!_(i))return x(i?.[b.key]);let d=O(i,"accessorizedProps",!1),P=d&&d.get(b.key);if(P&&P.intact())return x(P.getValue(n.withPropertyDescriptors));if(n.withPropertyDescriptors){let E=Object.getOwnPropertyDescriptor(i,b.key);return x(E)}return x(Reflect.get(i,b.key))}let l=new A(i,{type:"get",key:h,value:void 0,operation:"get",related:o});if(!_(i))return m(l);let y=K.getInstance(i,!1,n.namespace);return y?y.emit(l,m):m(l)}([],a.slice(0),u=>{let f=Me(e)?u:u[0];return s&&_(i)?cr(i,e,r,n,t.key)(f):r(f)})},n)}function St(t,e,r={}){let n=H(t);return L.getInstance(n,!0,r.namespace).batch(e,r)}function Zr(t,e,r={}){e=H(e),t=H(t);let n=(r.only||[]).slice(0),s=(r.except||[]).slice(0),i=Object.keys(r.spread?[...t]:t).map(f=>isNaN(f)?f:parseInt(f)),a=n.length?n.filter(f=>i.includes(f)):i.filter(f=>!s.includes(f)),o=f=>!Array.isArray(e)||isNaN(f)?f:f-s.filter(c=>c<f).length,u=f=>{let c=qe(t,f,r);"value"in c&&c.writable&&c.enumerable&&c.configurable?oe(e,o(f),c.value,r):(c.enumerable||r.onlyEnumerable===!1)&&Oe(e,f,{...c,configurable:!0},r)};return St(e,()=>{a.forEach(u)}),Et(t,f=>{f.filter(c=>n.length?n.includes(c.key):!s.includes(c.key)).forEach(c=>{if(c.type==="delete")return Ae(e,o(c.key),r);if(c.type==="def"){(c.value.enumerable||r.onlyEnumerable===!1)&&Oe(e,o(c.key),{...c.value,configurable:!0},r);return}u(c.key)})},{...r,withPropertyDescriptors:!0})}function oe(t,e,r,n=a=>a,s={},i=!1){let a=H(t),o=[[e,r]];v(e)&&([,,n=f=>f,s={},i=!1]=arguments,o=Object.entries(e)),v(n)&&([i,s,n]=[typeof s=="boolean"?s:i,n,f=>f]);let u=o.map(([f])=>f);return function f(c,p,h){if(!p.length)return h(c);let[m,l]=p.shift();function y(w,x=void 0){let d=q=>(w.status=q,f(c.concat(w),p,h));if(arguments.length>1)return d(w,x);let P=O(a,"accessorizedProps",!1),E=P&&P.get(w.key);return w.type==="def"?(E&&!E.restore()&&d(!1),Object.defineProperty(a,w.key,w.value),d(!0)):E&&E.intact()?d(E.setValue(w.value)):d(Reflect.set(a,w.key,w.value))}function b(w,x){if(s.diff&&l===x)return f(c,p,h);let d=new A(a,{type:i?"def":"set",key:m,value:l,isUpdate:w,oldValue:x,related:[...u],operation:i?"defineProperty":"set",detail:s.detail}),P=K.getInstance(a,!1,s.namespace);return P?P.emit(d,y):y(d)}return Ne(a,m,w=>{if(!w)return b(w);if(m==="length"&&Array.isArray(a)&&O(a).has("$length"))return b(!0,O(a).get("$length"));let x={...s,withPropertyDescriptors:i};return X(a,m,d=>b(w,d),x)},s)}([],o.slice(0),f=>{let c=L.getInstance(a,!1,s.namespace);return c&&c.emit(f,{eventsArePropertyDescriptors:!!i}),n(Me(e)?f.map(p=>p.status):f[0]?.status)})}function Oe(t,e,r,n=i=>i,s={}){return oe(t,e,r,n,s,!0)}function Yr(t,e,r=s=>s,n={}){return oe(t,e,r,n,!0)}function Ae(t,e,r=s=>s,n={}){let s=H(t);v(r)&&([n,r]=[r,o=>o]);let i=F(e,!1),a=[...i];return function o(u,f,c){if(!f.length)return c(u);let p=f.shift();function h(l,y=void 0){let b=d=>(l.status=d,o(u.concat(l),f,c));if(arguments.length>1)return b(l,y);let w=O(s,"accessorizedProps",!1),x=w&&w.get(l.key);return x&&!x.restore()&&b(!1),b(Reflect.deleteProperty(s,l.key))}function m(l){let y=new A(s,{type:"delete",key:p,oldValue:l,related:[...a],operation:"deleteProperty",detail:n.detail}),b=K.getInstance(s,!1,n.namespace);return b?b.emit(y,h):h(y)}return X(s,p,m,n)}([],i.slice(0),o=>{let u=L.getInstance(s,!1,n.namespace);return u&&u.emit(o),r(Me(e)?o.map(f=>f.status):o[0].status)})}function en(t,e,r=s=>s,n={}){return Ae(...arguments)}function wt(t,e,r=null,n=i=>i,s={}){return k(t,"construct",arguments.length>2?{argumentsList:e,newTarget:r}:{argumentsList:e},n,s)}function xt(t,e,r,n=i=>i,s={}){let i=Se(e),a;if(Array.isArray(e)){if(s.arrayMethodName){let o=new A(i,{operation:s.arrayMethodName,argumentsList:r});L.getInstance(i,!1,s.namespace)?.emit([o],{eventIsArrayMethodDescriptor:!0})}O(i).set("$length",i.length),a=St(i,()=>k(t,"apply",{thisArgument:e,argumentsList:r},n,s),s),O(i).delete("$length")}else a=k(t,"apply",{thisArgument:i,argumentsList:r},n,s);return a}function _t(t,e,r=s=>s,n={}){return k(t,"setPrototypeOf",{proto:e},r,n)}function vt(t,e=n=>n,r={}){return k(t,"preventExtensions",{},e,r)}function cr(t,e,r,n={}){let s=new AbortController;ke.setMaxListeners?.(0,s.signal),n.signal&&n.signal.addEventListener("abort",()=>s.abort());let i={...n,signal:s.signal},a=L.getInstance(t,!0,i.namespace),o=new Map;return function u(f=[],c=null){let p,h,m;if(Me(e)){if(c){m=!0,h=c;for(let l of f)o.get(l.key)?.remove(),o.delete(l.key)}else h=a.addRegistration(e,u,i);p={signal:h.signal,childRegistrations:o}}else c?.remove(),h=a.addRegistration(e,u,i),p={signal:h.signal};if(i.childRegistrations&&i.keyInParent&&i.childRegistrations.set(i.keyInParent,h),arguments.length){let l=r(f,p);if(arguments.length>1)return l}return s}}function k(t,e,r={},n=i=>i,s={}){t=H(t),v(n)&&([s,n]=[n,u=>u]);function i(u,f){return arguments.length>1?n(f):n((Reflect[e]||Object[e])(t,...Object.values(r)))}let a=new A(t,{operation:e,...r}),o=K.getInstance(t,!1,s.namespace);return o?o.emit(a,i):i(a)}function Me(t){return t===1/0||Array.isArray(t)}function H(t,e=!0,r=!0){if((!t||!_(t))&&e)throw new Error(`Object must be of type object or array! "${pe(t)}" given.`);return t instanceof A&&(t.type==="def"&&r?t=typeof t.value.get=="function"?t.value.get():t.value.value:t=t.value),t&&Se(t)}function tn(t,e,r,n={}){return e===1/0?n.level&&!_(t)?r([]):r(Object.entries(Object.getOwnPropertyDescriptors(t)).filter(([,s])=>s.writable!==!1&&!s.get&&!s.set).map(([s])=>s)):r(F(e,!1))}var S={...Ot,...mt},lr=S;var ae=class t extends URLSearchParams{#r;#t;get compatMode(){return this.#t}#n=new Set;#e;#o=!1;#a;_changeCallbackGC;constructor(e={},{compatMode:r=!0,prettyPrint:n=!1,changeCallback:s=null}={}){super(),this.#t=r,this.#e=n;let i;e instanceof t?(i=structuredClone(e.json()),r&&(this.#n=new Set(e.keys()))):e instanceof URLSearchParams||e instanceof FormData?(i=Object.fromEntries(e),r&&(this.#n=new Set(e.keys()))):J(e)?(e=decodeURIComponent(e.replace(/^\?/,"")),i=this.constructor.parse(e,!r),r&&(this.#n=new Set(e.split("&").map(a=>a.split("=")[0])))):Array.isArray(e)?(i=this.constructor.fromEntries(e),r&&(this.#n=new Set(e.map(([a])=>a)))):v(e)?(i=e,r&&this.constructor.reduceValue(e,"",(a,o,u)=>{if(u)return u;/\[\d+\]$/.test(o)&&([,o]=/^(.*)\[\d+\]$/.exec(o)),this.#n.add(o)})):i={},this._changeCallback=s,this._resetJson(i)}_resetJson(e){this.#r=S.proxy(e),this.#a&&(this._changeCallbackGC?.abort(),this._changeCallbackGC=S.observe(this.#r,S.subtree(),this.#a))}get(e){let r=this.#i(e);return this.#t&&Array.isArray(r)?r[0]:r}#i(e,r=!1){if(this.#t&&!this.#n.has(e))return null;let n=this.constructor.get(this.#r,e,r);return n===void 0?null:Array.isArray(n)?this.#t?n.map(s=>typeof s=="number"?s+"":s):n.map(s=>v(s)?new t(s,{compatMode:this.#t}):s):!this.#t&&v(n)?new t(n,{compatMode:this.#t}):this.#t&&typeof n=="number"?n+"":n}getAll(e){let r=this.#i(e,!0);return r===null?[]:Array.isArray(r)?r:[r]}set(e,r){return this.#t&&this.#n.add(e),this.constructor.set(this.#r,e,r),this}append(e,r){return this.#t&&this.#n.add(e),this.constructor.set(this.#r,e,r,!0),this}has(e){return this.#t&&!this.#n.has(e)?!1:this.constructor.get(this.#r,e)!==void 0}delete(e){if(this.#t&&!this.#n.has(e))return;let r=this.constructor.parsePath(e),n=r.pop(),s=r.length?this.constructor.get(this.#r,r):this.#r;v(s)&&S.deleteProperty(s,n)}sort(){return this.#o=!0,this}json(){return S.unproxy(this.#r)}stringify({prettyPrint:e=this.#e}={}){return this.constructor.stringify(this.#r,{only:this.#t&&this.#n,sorted:this.#o,prettyPrint:e})}toString(){return this.stringify()}entries(){let e=[];return this.constructor.reduceValue(this.#r,"",(r,n,s)=>{if(s)return s;if(this.#t&&!this.#n.has(n))if(/\[\d+\]$/.test(n)){if([,n]=/^(.*)\[\d+\]$/.exec(n),!this.#n.has(n)&&!this.#n.has(n=`${n}[]`))return}else return;this.#t&&typeof r=="number"&&(r=r+""),e.push([n,r])}),e[Symbol.iterator]()}keys(){return Array.from(this.entries(),([e])=>e)[Symbol.iterator]()}values(){return Array.from(this.entries(),([,e])=>e)[Symbol.iterator]()}forEach(e,r){for(let[n,s]of this.entries())e.call(r,s,n,this)}[Symbol.iterator](){return this.entries()}get size(){let e=0;return this.forEach(()=>e++),e}static parse(e,r=!1,n="&"){let s={};return(e.startsWith("?")?e.slice(1):e).split(n).filter(Boolean).forEach(i=>{let a=i.indexOf("="),o=a===-1?i:i.slice(0,a),u=a===-1?"":i.slice(a+1);this.set(s,o,u,!0,r)}),s}static fromEntries(e){let r={};for(let[n,s]of e)this.set(r,n,s,!0);return r}static stringify(e,{sorted:r=!1,only:n=null,prettyPrint:s=!1,delim:i="&"}={}){let a=[],o=Object.keys(e);return r&&o.sort(),o.forEach(u=>{this.reduceValue(e[u],u,(f,c,p)=>{if(p)return r?[...p].sort():p;if(n&&!n.has(c))if(/\[\d+\]$/.test(c)){if([,c]=/^(.*)\[\d+\]$/.exec(c),!n.has(c)&&!n.has(c=`${c}[]`))return}else return;s||(c=encodeURIComponent(c)),a.push(c+"="+encodeURIComponent(f))},!!s)}),a.join(i)}static get(e,r,n=!1){return this.reducePath(r,e,(s,i,a)=>a||(s===""?n?i:i?.[0]:i?.[s]))}static set(e,r,n,s=!1,i=!1){this.reducePath(r,e,(a,o,u)=>{let f=u??n;return i&&/^-?\d+(\.\d+)?$/.test(f+"")&&(f=parseFloat(f)),a===""&&Array.isArray(o)?S.proxy(o).push(f):s&&o?.[a]?Array.isArray(o[a])?S.proxy(o[a]).push(f):S.set(o,a,[o[a],f]):S.set(o,a,f),f})}static reduceValue(e,r,n,s=!1){if(_(e)){let i=Object.keys(e),a=n(e,r,i);if(Array.isArray(a)){a.forEach(o=>{s&&(o=encodeURIComponent(o)),this.reduceValue(e[o],r?`${r}[${o}]`:o,n,s)});return}}n(e,r)}static reducePath(e,r,n){let s=this.parsePath(e),i=r;for(let a=0;a<s.length;a++){let o=s[a];if(G(o)&&(o=+o),a===s.length-1)return n(o,i);if(!_(i))return;if(!_(i[o])){let u=s[a+1];i[o]=n(o,i,G(u)||u===""?[]:{})}i=i[o]}}static parsePath(e){if(Array.isArray(e))return e;if(!J(e))return[];let r=[];return e.replace(/\[([^\]]*)\]|([^[\]]+)/g,(n,s,i)=>{r.push(s??i)}),r}};var B=class t extends FormData{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}static json(e={},{encodeLiterals:r=!0,meta:n=!1}={}){let s=new t,i=!0;return ae.reduceValue(e,"",(a,o,u=void 0)=>{if(u){let f=Ue(a)==="json";return i=i&&f,f&&u}r&&[!0,!1,null].includes(a)&&(a=new Blob([a+""],{type:"application/json"})),s.append(o,a)}),n?{result:s,isDirectlySerializable:i}:s}async json({decodeLiterals:e=!0,meta:r=!1}={}){let n=!0,s;for(let[i,a]of this.entries()){s||(s=G(Ie(i,"["))?[]:{});let o=Ue(a);if(e&&["Blob","File"].includes(o)&&a.type==="application/json"&&[4,5].includes(a.size)){let u=JSON.parse(await a.text());[null,!0,!1].includes(u)&&(a=u,o="json")}n=n&&o==="json",/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(a)&&(a=Number(a)),ae.set(s,i,a)}return r?{result:s,isDirectlySerializable:n}:s}};var fe=(t,...e)=>D(t,"fetch+",...e),C=(t,...e)=>D(t,"fetch+","meta",...e);function Fe(t){return class extends t{static from(e){let r=e.headers instanceof Headers?[...e.headers.entries()].reduce((i,[a,o])=>{let u=a.toLowerCase();return i[u]=i[u]?[].concat(i[u],o):o,i},{}):Object.keys(e.headers||{}).reduce((i,a)=>(i[a.toLowerCase()]=e.headers[a],i),{}),n=e.body,s=Ue(n);if(["Blob","File"].includes(s))r["content-type"]??=n.type,r["content-length"]??=n.size;else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(s))r["content-length"]??=n.byteLength;else if(s==="json"&&_(n)){let{result:i,isDirectlySerializable:a}=B.json(n,{encodeLiterals:!0,meta:!0});a?(n=JSON.stringify(n,(o,u)=>u instanceof Error?{...u,message:u.message}:u),r["content-type"]="application/json",r["content-length"]=new Blob([n]).size):(n=i,s="FormData")}else["text","json"].includes(s)&&!r["content-length"]&&(r["content-length"]=new Blob([n]).size);return!["FormData"].includes(s)&&!["function"].includes(typeof n)&&!r["content-type"]&&(r["content-type"]="application/octet-stream"),{body:n,headers:new Headers(r),$type:s}}async formData(){let e=await super.formData();return B.upgradeInPlace(e),e}async any({to:e=null,memo:r=!1}={}){if(e&&!["blob","text","json","arrayBuffer","bytes","formData"].includes(e))throw new Error(`Invalid target type specified: ${e}`);let n=C(this,"cache"),s=async o=>{if(!r)return await this[o||"bytes"]();let u=c=>{if(c instanceof FormData){let p=new B;for(let[h,m]of c.entries())p.append(h,m);return p}return(!o||o==="json")&&(Ke(c)||Je(c))?structuredClone(c):c};if(!o&&n.has("original"))return u(n.has("original"));if(o??="bytes",n.has(o))return u(n.get(o));let f;return n.has("memo")?f=n.get("memo").clone()[o]():(n.set("memo",this.clone()),f=await this[o]()),n.set(o,f),u(f)},i=(this.headers.get("Content-Type")||"").split(";")[0].trim(),a;if((!e||["formData","json"].includes(e))&&["multipart/form-data","application/x-www-form-urlencoded"].includes(i)){let o=await s("formData");B.upgradeInPlace(o),e==="json"&&(o=await o.json({decodeLiterals:!0})),a=o}else if((!e||["formData","json"].includes(e))&&i==="application/json"){let o=await s("json");e==="formData"&&(o=B.json(o,{encodeLiterals:!0})),a=o}else if(!e&&(i.startsWith("image/")||i.startsWith("video/")||i.startsWith("audio/")||i.startsWith("application/")&&!["xml","json","javascript","x-www-form-urlencoded"].some(o=>i.includes(o))))a=await s("blob");else if(!e&&(i.startsWith("text/")||i.startsWith("application/")&&["xml","javascript"].some(o=>i.includes(o))))a=await s("text");else{if(["json","formData"].includes(e))throw new Error(`Cannot convert body of type ${i} to ${e}`);a=await s(e)}return a}forget(){C(this,"cache").clear()}}}function Ue(t){if(t instanceof FormData)return"FormData";if(t===null||me(t)||Re(t))return"json";if(J(t))return"text";if(_(t)){let e=t[Symbol.toStringTag],r=["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream","ReadableStream"].reduce((n,s)=>n||(e===s?s:null),null);if(r)return r;if(v(t)||Array.isArray(t))return"json";if("toString"in t)return"text"}return null}function nn(t){return t!==null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}function At(t){return t instanceof ReadableStream||nn(t)}var W=class t extends Headers{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}set(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){this.delete(e);for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=hr(r)),/^Content-Range$/i.test(e)&&(r=dr(r)),/^Range$/i.test(e)&&(r=pr(r)),/^Accept$/i.test(e)&&(r=mr(r)),super.set(e,r)}append(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=hr(r)),/^Content-Range$/i.test(e)&&(r=dr(r)),/^Range$/i.test(e)&&(r=pr(r)),/^Accept$/i.test(e)&&(r=mr(r)),super.append(e,r)}get(e,r=!1){let n=super.get(e);if(/^Set-Cookie$/i.test(e)&&r&&(n=this.getSetCookie().map(s=>{let[i,...a]=s.split(";"),[o,u]=i.split("=").map(c=>c.trim()),f={name:o,value:u};return a.map(c=>c.trim().split("=")).forEach(c=>{f[c[0][0].toLowerCase()+c[0].substring(1).replace("-","")]=c.length===1?!0:c[1]}),f})),/^Cookie$/i.test(e)&&r&&(n=n?.split(";").map(s=>{let[i,a]=s.split("=").map(o=>o.trim());return{name:i,value:a}})||[]),/^Content-Range$/i.test(e)&&n&&r&&(n=ge(n,"bytes ").split("/")),/^Range$/i.test(e)&&r&&(n=n?ge(n,"bytes=").split(",").map(s=>{let i=s.trim().split("-").map(a=>a?parseInt(a,10):null);return i.resolveAgainst=a=>{let o=[...i];return o[1]===null?o[1]=a-1:o[1]=Math.min(o[1],a)-1,o[0]===null&&(o[0]=o[1]?a-o[1]-1:0),o},i.canResolveAgainst=(a,o)=>{let u=[typeof i[0]=="number"?i[0]:a,typeof i[1]=="number"?i[1]:o-1];return!(u[0]>u[1]||u[0]<a||u[1]>=o)},i.toString=()=>s,i}):[]),/^Accept$/i.test(e)&&n&&r){let s=a=>{let[o,u]=a.trim().split(";").map(f=>f.trim());return[o,parseFloat((u||"q=1").replace("q=",""))]},i=n;n=n.split(",").map(a=>s(a)).sort((a,o)=>a[1]>o[1]?-1:1)||[],n.match=a=>{if(!a)return 0;let o=f=>f.split("/").map(c=>c.trim()),u=o(a+"");return n.reduce((f,[c,p])=>{if(f)return f;let h=o(c);return[0,1].every(m=>u[m]===h[m]||u[m]==="*"||h[m]==="*")?p:0},0)},n.toString=()=>i}return n}};function Ct(t){let e=[`${t.name}=${t.value}`];for(let r in t){if(["name","value"].includes(r))continue;let n=r[0].toUpperCase()+r.substring(1);n==="MaxAge"&&(n="Max-Age"),e.push(t[r]===!0?n:`${n}=${t[r]}`)}return e.join("; ")}function hr(t){return _(t)&&(t=[].concat(t).map(Ct).join("; ")),t}function pr(t){let e=[];return F(t).forEach((r,n)=>{let s=Array.isArray(r)?r.map(i=>[null,void 0].includes(i)?"":i).join("-"):r+"";n===0&&!s.includes("bytes=")&&(s=`bytes=${s}`),e.push(s)}),e.join(", ")}function dr(t){if(Array.isArray(t)){if(t.length<2||!t[0].includes("-"))throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");t=`bytes ${t.join("/")}`}return t}function mr(t){return Array.isArray(t)&&(t=t.map(e=>Array.isArray(e)?e.map((r,n)=>n===1&&(r=parseFloat(r),!0)?r===1?"":`;q=${r}`:r.trim()).join(""):e.trim()).join(",")),t}var z=class t extends Fe(Response){constructor(e,r={}){super(e,r),W.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),W.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Response)return e;let s;if(typeof e<"u"){let a;({body:e,headers:a,$type:s}=super.from({body:e,headers:n.headers})),n={...n,headers:a}}let i=new this(e,n);if(r){let a=C(i,"cache"),o={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};a.set(o[s]||"original",e)}return i}get status(){return C(this).get("status")??super.status}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};async function gr(t,e={}){let r=await fetch(t,e);return z.upgradeInPlace(r),r}var He=class t extends Fe(Request){constructor(e,r={}){super(e,r),W.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),W.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Request)return e;let s,i=n.body;if("body"in n){let{body:o,headers:u,$type:f}=super.from(n);n={...n,body:o,headers:u},s=f}let a=new this(e,n);if(r){let o=C(a,"cache"),u={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};o.set(u[s]||"original",i)}return a}static async copy(e,r={}){let s=["method","headers","mode","credentials","cache","redirect","referrer","integrity"].reduce((i,a)=>({...i,[a]:a in r?r[a]:a==="headers"?new Headers(e[a]):e[a]}),{});return["GET","HEAD"].includes(s.method.toUpperCase())?s.body=null:"body"in r?(s.body=r.body,"headers"in r||(s.headers.delete("Content-Type"),s.headers.delete("Content-Length"))):s.body=await e.clone().arrayBuffer(),s.mode==="navigate"&&(s.mode="cors"),{url:r.url||e.url,...s}}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};var Q=class extends MessageEvent{#r;get originalTarget(){return this.#r}#t;get eventID(){return this.#t}#n;get data(){return this.#n}#e;get live(){return this.#e}#o;get bubbles(){return this.#o}#a;get forwarded(){return this.#a}#i;get honourDoneMutationFlags(){return this.#i}#f=[];get ports(){return this.#f}constructor(e,{originalTarget:r=null,type:n="message",eventID:s,live:i=!1,honourDoneMutationFlags:a=!1,bubbles:o=!1,forwarded:u=!1,ports:f=[]}={}){if(n&&typeof n!="string")throw new TypeError("Where specified, wqEventOptions.type must be a string");if(super(n),this.#n=e,this.#r=r,this.#t=s,this.#e=i,this.#o=o,this.#a=u,this.#i=a,this.#f=f,this.#f.forEach(c=>M.upgradeInPlace(c)),_(this.#n)&&this.#e){if(typeof s!="string")throw new TypeError("eventID must be a non-empty string");Mt.call(r,this.#n,this.#t,{honourDoneMutationFlags:this.#i})}}#p=!1;get immediatePropagationStopped(){return this.#p}stopImmediatePropagation(){this.#p=!0,this.#u=!0,super.stopImmediatePropagation()}#u=!1;get propagationStopped(){return this.#u}stopPropagation(){this.#u=!0,super.stopPropagation()}#s=!1;get defaultPrevented(){return this.#s}preventDefault(){this.#s=!0,super.preventDefault()}respondWith(e,r=[]){for(let n of this.#f)n.postMessage(e,r);return!!this.#f.length}};var ue=class extends Be(EventTarget){#r;#t;constructor(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(super(),typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if($(this).set("options",{handshake:r,postAwaitsOpen:n}),this.#r=typeof e=="string"?new WebSocket(e):e,this.constructor.upgradeEvents(this.#r,this),this.#t=new Promise(i=>{this.#r.readyState===WebSocket.OPEN?i():this.#r.addEventListener("open",()=>i(),{once:!0})}),r===0&&this.#t.then(()=>this.start()),this.#r.readyState===WebSocket.CLOSED)try{this.close()}catch{}else this.#r.addEventListener("close",()=>{try{this.close()}catch{}},{once:!0})}static _hydrateMessage(e,r){try{let n;if(typeof r.data=="string"&&v(n=JSON.parse(r.data))&&n[".wq"])return Object.defineProperty(r,"data",{value:n,configurable:!0}),super._hydrateMessage(e,r)}catch{}return r}__postMessage(e,r){this.#t.then(()=>{this.#r.send(JSON.stringify(e),r)})}_close(){this.#r.close()}};var yr=(t,...e)=>D(t,"port+",...e),$=(t,...e)=>D(t,"port+","meta",...e),ce=t=>D(t,"port+","meta").get("options")||{},br=["addEventListener","addRequestListener","postMessage","postRequest","dispatchEvent","relay","start","readyStateChange","removeEventListener","close"],wr=["options","readyState","onmessage","onmessageerror"],M=class extends xr(EventTarget){constructor({handshake:e=0,postAwaitsOpen:r=!1,...n}={}){if(typeof e!="number")throw new Error("handshake must be a number");if(e<0||e>2)throw new Error("handshake must be between 0 and 2");super(),yr(this,"meta").set("options",{handshake:e,postAwaitsOpen:r,...n})}static[Symbol.hasInstance](e){return Function.prototype[Symbol.hasInstance].call(this,e)?!0:br.every(r=>typeof e[r]=="function")||wr.every(r=>r in e)}};function xr(t){return class extends t{static upgradeInPlace(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(e instanceof M)return e;if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");let s=this.prototype;for(let a of br.concat("_autoStart")){let o=e[a],u=s[a];o&&Object.defineProperty(e,`_${a}`,{value:o.bind(e),configurable:!0}),Object.defineProperty(e,a,{value:u.bind(e),configurable:!0})}for(let a of wr){let o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),a),u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),a);o&&Object.defineProperty(e,`_${a}`,{...o,configurable:!0}),Object.defineProperty(e,a,{...u,configurable:!0})}return yr(e,"meta").set("options",{handshake:r,postAwaitsOpen:n}),this.upgradeEvents(e),r===0&&e.start(),e}static upgradeEvents(e,r=null){r||(r=e);let n=$(e);if(n.get("events+"))return;let s=$(r),i=ce(r),a=he.call(r),o=le.call(r);e instanceof BroadcastChannel&&(i.clientServerMode==="server"?s.set("clients",new Set):i.clientServerMode==="client"&&s.set("client_id",`client-${(0|Math.random()*9e6).toString(36)}`));let u=f=>{if(f instanceof Q)return;if(e===r&&f.stopImmediatePropagation?.(),f=this._hydrateMessage?.(r,f)||f,f.data.ping==="connect"&&typeof f.data?.[".wq"]?.eventID=="string"&&(!(e instanceof WebSocket)||i.handshake)){let m=i.handshake===0||s.get("start.called"),l={isOpen:m};e instanceof BroadcastChannel&&(i.clientServerMode==="server"&&typeof f.data.id=="string"?(s.get("clients").add(f.data.id),l.id="server"):f.data.id==="server"&&s.has("client_id")&&(l.id=s.get("client_id"))),f.ports?.forEach(y=>y.postMessage(l)),m&&(s.set("remote.open.called",!0),r.start());return}if(f.data.ping==="disconnect"&&typeof f.data?.[".wq"]?.eventID=="string"){let m=()=>{s.set("remote.close.called",!0),r.close()};e instanceof BroadcastChannel?i.clientServerMode==="server"&&typeof f.data.id=="string"?(s.get("clients").delete(f.data.id),!s.get("clients").size&&i.autoClose&&!o.close.state&&m()):i.clientServerMode==="client"&&f.data.id==="server"&&m():e instanceof MessagePort&&m();return}let c=f.data,p={};typeof f.data?.[".wq"]?.eventID=="string"&&({message:c,".wq":p}=f.data);let h=new Q(c,{originalTarget:e,...p,ports:f.ports});r.dispatchEvent(h)};n.set("internal_call",!0),e.addEventListener("message",u),e.addEventListener("error",u),n.delete("internal_call"),a.add(()=>{e.removeEventListener("message",u),e.removeEventListener("error",u),n.set("events+",!1)}),n.set("events+",!0)}get options(){return{...ce(this)}}get onmessageerror(){return typeof super.onmessageerror<"u"?super.onmessageerror:typeof this._onmessageerror<"u"?this._onmessageerror:null}set onmessageerror(e){if(typeof super.onmessageerror<"u"){super.onmessageerror=e;return}if(e!==null&&typeof e!="function")throw new TypeError("onmessageerror must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessageerror")?.set){this._onmessageerror=e;return}this._onmessageerror&&this.removeEventListener("messageerror",this._onmessageerror),this.addEventListener("messageerror",e),this._onmessageerror=e}get onmessage(){return typeof super.onmessage<"u"?super.onmessage:typeof this._onmessage<"u"?this._onmessage:null}set onmessage(e){if(typeof super.onmessage<"u"){super.onmessage=e,this._autoStart();return}if(e!==null&&typeof e!="function")throw new TypeError("onmessage must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessage")?.set){this._onmessage=e,this._autoStart();return}this._onmessage&&this.removeEventListener("message",this._onmessage),this.addEventListener("message",e),this._onmessage=e,this._autoStart()}addEventListener(...e){he.call(this).add(()=>{this._removeEventListener?this._removeEventListener(...e):super.removeEventListener(...e)});let n=this._addEventListener?this._addEventListener(...e):super.addEventListener(...e);return this._autoStart(),n}dispatchEvent(e){let r=this._dispatchEvent?this._dispatchEvent(e):super.dispatchEvent(e);return e instanceof Q&&sn.call(this,e),r}postMessage(e,r={}){this._autoStart();let n=le.call(this);n.messaging.state=!0,n.messaging.resolve(this);let s,{portOptions:i,wqOptions:{relayedFrom:a,...o}}=We.call(this,e,r);(o.type!=="message"||o.live||o.bubbles||i.transfer?.length&&(this instanceof BroadcastChannel||this instanceof ue))&&(e={message:e,".wq":o}),r=i,s=a;let u=()=>{this._postMessage?this._postMessage(e,r,s):super.postMessage(e,r)};ce(this).postAwaitsOpen?n.open.promise.then(u):u()}addRequestListener(e,r,n={}){let s=async i=>{let a=await r(i);for(let o of i.ports)o.postMessage(a)};this.addEventListener(e,s,n)}postRequest(e,r,n={}){let s;v(r)&&(n={once:!0,...r},s=new Promise(c=>{r=c}));let i=new MessageChannel;this.constructor.upgradeEvents(i.port1),i.port1.start();let{signal:a=null,once:o=!1,transfer:u=[],...f}=n;return i.port1.addEventListener("message",c=>r(c),{signal:a,once:o}),a?.addEventListener("abort",()=>{i.port1.close(),i.port2.close()}),this.postMessage(e,{...f,transfer:[i.port2].concat(u)}),s}relay({to:e,from:r,types:n="*",channel:s=null,resolveMessage:i=null,bidirectional:a=!1}={}){if(e&&r)throw new Error('Only one of "to" and "from" may be specified');if(r?e=this:r=this,e===r)throw new Error("Source and target ports cannot be the same");if(!(r instanceof M)||!(e instanceof M))throw new Error("Both source and target ports must be instance of MessagePortPlus.");if(typeof n!="function"&&!(n=[].concat(n)).length)throw new Error("Event types must be specified.");if(typeof s=="string")s={from:s};else if(v(s)){if(Object.keys(s).filter(c=>!["from","to"].includes(c)).length)throw new Error('Channel must be a string or an object of "from"/"to" members')}else if(s)throw new Error("Invalid channel parameter");let o=_r.call(r),u={targetPort:e,types:n,channel:s,resolveMessage:i};o.add(u);let f;return a&&(f=e.relay({to:r,types:n,channel:s&&{to:s.from,from:s.to},resolveMessage:i,bidirectional:!1})),()=>{o.delete(u),f?.()}}channel(e,r=null,{handshake:n=0,postAwaitsOpen:s=!1}={}){let i=new MessageChannel;return M.upgradeInPlace(i.port1,{handshake:n,postAwaitsOpen:s}),M.upgradeInPlace(i.port2,{handshake:n,postAwaitsOpen:s}),he.call(this).add(this.relay({channel:e,to:i.port2,bidirectional:!0,resolveMessage:r})),i.port2.start(),this.readyStateChange("close").then(()=>{i.port2.close()}),i.port1}projectMutations({from:e,to:r,...n}){if(!e||!r||typeof e=="string"&&typeof r=="string"||_(e)&&_(r))throw new Error('Invalid "from"/"to" parameters');if(typeof e=="string"){if(!_(r))throw new Error('Invalid "to" parameter. Object/array expected');return Mt.call(this,r,e,n)}if(typeof r=="string"){if(!_(e))throw new Error('Invalid "from" parameter. Object/array expected');return vr.call(this,e,r,n)}throw new Error('Invalid "from"/"to" parameters')}get readyState(){let e=le.call(this);return e.close.state?"closed":e.open.state?"open":"connecting"}readyStateChange(e){if(!["open","messaging","close"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return le.call(this)[e].promise}_autoStart(){let e=$(this),r=ce(this);!e.get("internal_call")&&r.handshake===1&&this.start()}start(){let e=le.call(this);if(e.open.state)return;let r=$(this),n=ce(this),s=f=>{f&&(e.open.state=!0,e.open.resolve(this));let c=r.get("handshake_channel");setTimeout(()=>{c?.port1.close(),c?.port2.close(),r.delete("handshake_channel")},100)};if(r.get("remote.open.called")){s(!0);return}if(r.get("start.called"))return;if(r.set("start.called",!0),this._start?this._start():super.start?.(),n.handshake===0){s(!0);return}let i=new MessageChannel;r.set("handshake_channel",i),i.port1.onmessage=f=>{this instanceof BroadcastChannel&&n.clientServerMode==="server"&&typeof f.data?.id=="string"&&r.get("clients").add(f.data.id),f.data?.isOpen,s(!0)};let{wqOptions:a}=We.call(this),o=n.clientServerMode==="server"?"server":n.clientServerMode==="client"?r.get("client_id"):null,u={".wq":a,ping:"connect",id:o};this._postMessage?this._postMessage(u,{transfer:[i.port2]}):super.postMessage(u,{transfer:[i.port2]})}close(...e){let r=le.call(this);if(r.close.state)return;r.close.state=!0;let n=$(this),s=ce(this);if(s.handshake>0&&!n.get("remote.close.called")&&(this instanceof BroadcastChannel||this instanceof MessagePort)){let{wqOptions:i}=We.call(this),a=s.clientServerMode==="server"?"server":s.clientServerMode==="client"?n.get("client_id"):null,o={".wq":i,ping:"disconnect",id:a};this._postMessage?this._postMessage(o):super.postMessage(o)}this._close?this._close(...e):super.close(...e),r.close.resolve(this),on.call(this)}}}function Be(t){return class extends xr(t){static _hydrateMessage(e,r){if(typeof r.data?.[".wq"]?.numPorts!="number"||typeof r.data[".wq"].eventID!="string")return r;let n=he.call(e),s=r.data[".wq"].numPorts;Object.defineProperty(r,"ports",{value:[],configurable:!0});for(let i=0;i<s;i++){let a=e.channel(`${r.data[".wq"].eventID}:${i}`);r.ports.push(a)}return r}_postMessage(e,r={}){let{transfer:n=[],...s}=r;if(typeof e?.[".wq"]?.eventID=="string"){let i=he.call(this),a=n.filter(u=>u instanceof MessagePort),o=a.length;for(let u=0;u<o;u++)M.upgradeInPlace(a[u]),i.add(this.relay({channel:`${e[".wq"].eventID}:${u}`,to:a[u],bidirectional:!0})),a[u].start(),a[u].readyStateChange("close").then(()=>{let{wqOptions:f}=We.call(this),c={".wq":f,ping:"disconnect"};this.postMessage(c,{type:`${e[".wq"].eventID}:${u}:message`})});e[".wq"].numPorts=o}return this.__postMessage(e,s)}}}function sn(t){if(t.propagationStopped)return;let e=$(this);e.get("parentNode")instanceof EventTarget&&(t.bubbles||e.get("parentNode")?.findPort?.(n=>n===this)&&t instanceof Q)&&e.get("parentNode").dispatchEvent(t);let r=_r.call(this);if(r.size&&t instanceof Q){let{type:n,eventID:s,data:i,live:a,bubbles:o,ports:u}=t,f=new WeakSet;for(let{targetPort:c,types:p,channel:h,resolveMessage:m}of r){if(f.has(c))continue;let l=n;h.from&&([,l]=new RegExp(`^${h.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}:([^:]+)$`).exec(n)||[],!l)||!(typeof p=="function"?p(l,this,c,h):[].concat(p).find(b=>b===l||b==="*"))||(f.add(c),c.postMessage(m?m(i,this,c,h):i,{transfer:u,type:h.to?`${h.to}:${l}`:l,eventID:s,bubbles:o,live:a,forwarded:!0,relayedFrom:this}))}}}function he(){let t=$(this);return t.has("garbage_collection")||t.set("garbage_collection",new Set),t.get("garbage_collection")}function _r(){let t=$(this);return t.has("downstream_registry")||t.set("downstream_registry",new Set),t.get("downstream_registry")}function le(){let t=$(this);if(!t.has("readystate_registry")){let e=r=>(r.promise=new Promise((n,s)=>(r.resolve=n,r.reject=s)),r);t.set("readystate_registry",{open:e({}),messaging:e({}),close:e({})})}return t.get("readystate_registry")}function on(){let t=$(this);for(let e of t.get("garbage_collection")||[])e instanceof AbortController?e.abort():typeof e=="function"&&e();t.get("garbage_collection")?.clear(),t.get("downstream_registry")?.clear()}function We(t=void 0,e={}){if(Array.isArray(e))e={transfer:e};else if(!e||typeof e!="object")throw new TypeError("transferOrOptions must be an array or an object");let{type:r="message",eventID:n=null,live:s=!1,observing:i=!1,bubbles:a=!1,forwarded:o=!1,relayedFrom:u=null,signal:f=null,withArrayMethodDescriptors:c=!1,honourDoneMutationFlags:p=!1,...h}=e;return n||(n=`${r}-${(0|Math.random()*9e6).toString(36)}`),!i&&!o&&_(t)&&s&&!r?.endsWith(".mutate")&&(vr.call(this,t,n,{signal:f,withArrayMethodDescriptors:c,honourDoneMutationFlags:p}),i=!0),{portOptions:h,wqOptions:{type:r,eventID:n,live:s,observing:i,honourDoneMutationFlags:p,bubbles:a,forwarded:o,relayedFrom:u}}}function vr(t,e,{signal:r,withArrayMethodDescriptors:n=!0,honourDoneMutationFlags:s=!1}={}){if(!_(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let i=u=>{let f;n&&Array.isArray(u[0].target)&&!u[0].argumentsList&&!["set","defineProperty","deleteProperty"].includes(u[0].operation)||(this.postMessage(u.map(c=>(f=!f&&s&&c.detail?.done,{...c,target:void 0})),{type:`${e}.mutate`}),f&&a.abort())},a=S.observe(t,S.subtree(),i,{signal:r,withArrayMethodDescriptors:n});return he.call(this).add(a),a}function Mt(t,e,{signal:r,honourDoneMutationFlags:n=!1}={}){if(!_(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let s=o=>{if(!o.data?.length)return;let u;S.batch(t,()=>{for(let f of o.data){if(u=!u&&n&&f.detail?.done,f.argumentsList){let c=f.path.length?S.get(t,S.path(...f.path)):t;S.proxy(c)[f.operation](...f.argumentsList);continue}if(f.key!=="length"||["set","defineProperty","deleteProperty"].includes(f.operation)){let c=f.path.length===1?t:S.get(t,S.path(...f.path.slice(0,-1)));f.type==="delete"?S.deleteProperty(c,f.key):S.set(c,f.key,f.value)}}}),u&&i()};this.addEventListener(`${e}.mutate`,s,{signal:r});let i=()=>this.removeEventListener(`${e}.mutate`,s);return he.call(this).add(i),i}var $e=class extends Be(BroadcastChannel){constructor(e,{handshake:r=0,postAwaitsOpen:n=!1,clientServerMode:s=null,autoClose:i=!1}={}){super(e);let a=$(this);if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if(s&&!["server","client"].includes(s))throw new Error('clientServerMode must be "server" or "client"');a.set("options",{handshake:r,postAwaitsOpen:n,clientServerMode:s,autoClose:i}),this.constructor.upgradeEvents(this),r===0&&this.start()}__postMessage(e,r){BroadcastChannel.prototype.postMessage.call(this,e)}};var ze=class t extends EventTarget{static get xHeaderName(){return"X-Message-Port"}static test(e){return e instanceof t||e?.[Symbol.toStringTag]==="LiveResponse"?"LiveResponse":e?.[Symbol.toStringTag]==="LiveProgramHandle"?"LiveProgramHandle":e instanceof Response?"Response":fn(e)?"Generator":"Default"}static hasPort(e){return!!C(e).get("port")||!!e.headers?.get?.(this.xHeaderName)?.trim()}static getPort(e,{handshake:r=1}={}){if(!/Response/.test(this.test(e)))return;let n=C(e);if(!n.has("port")){let s=e.headers.get(this.xHeaderName)?.trim();if(!s)return;let[,i,a]=/^(socket|channel):\/\/(.*)$/.exec(s)||[];if(!i||!a)throw new Error(`Unknown port messaging protocol: ${s}`);let o=i==="channel"?new $e(a,{handshake:r,postAwaitsOpen:!0,clientServerMode:"client"}):new ue(a,{handshake:r,postAwaitsOpen:!0});n.set("port",o)}return n.get("port")}static attachPort(e,r){if(r&&!(r instanceof M))throw new Error("Client must be a MessagePortPlus interface");if(e instanceof t){e.#u=r;return}C(e).set("port",r)}static from(e,...r){return this.test(e)==="LiveResponse"?e.clone(...r):new this(e,...r)}[Symbol.toStringTag]="LiveResponse";#r;constructor(e,...r){super(),this.#r=L.getInstance(this,!0);let s=_e.call(this).now;this.#c(s,e,...r).catch(i=>{s.reject(i)})}#t=null;get body(){return this.#t}#n=!1;get concurrent(){return this.#n}get bodyUsed(){return!0}#e=new Headers;get headers(){return this.#e}#o=200;get status(){return this.#o}#a="";get statusText(){return this.#a}#i="basic";get type(){return this.#i}#f=!1;get redirected(){return this.#f}#p=null;get url(){return this.#p}get ok(){return this.#o>=200&&this.#o<299}async now(){return _e.call(this).now.promise}#u;get port(){return this.#u}#s=new AbortController;#h=new AbortController;get readyState(){let e=_e.call(this);return e.done.state?"done":e.live.state?"live":"waiting"}readyStateChange(e){if(!["live","now","done"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return _e.call(this)[e].promise}disconnect(e=!1){this.#s.abort(),this.#s=new AbortController,e&&(this.#h.abort(),this.#h=new AbortController)}#m;#g(e){let r=_e.call(this);if(r.done.state)throw new Error("Response already done.");return this.#m=e,e.then(n=>{this.#m===e&&(this.#m=null,r.done.state=!0,r.done.resolve(n))}).catch(n=>{this.#m===e&&(this.#m=null,r.done.state=!0,r.done.reject(n))}),e}async replaceWith(e,...r){if(this.readyState==="done")throw new Error("Response already done.");this.disconnect(),await this.#c(null,e,...r)}async#c(e,r,...n){let s=_e.call(this),i=e||s.now.refresh();if(r instanceof Promise)return this.#g(new Promise((m,l)=>{this.#s.signal.addEventListener("abort",()=>{i.aborted=!0,m()}),r.then(async y=>{await this.#c(i,y,...n),m()}).catch(y=>l(y))}));let a=(m,l)=>{if(l=Object.freeze({...l,ok:l.status>=200&&l.status<299,bodyUsed:!0}),m?.aborted){m.resolve(l);return}let y=m||s.now.refresh(),b=l.body;this.#o=l.status,this.#a=l.statusText;for(let[d]of[...this.#e.entries()])this.#e.delete(d);for(let[d,P]of l.headers.entries())this.#e.append(d,P);this.#i=l.type,this.#f=l.redirected,this.#p=l.url;let w=this.#t;this.#t=b,this.#n=!!l.concurrent,this.#u=l.port,this.#n||(this.#h.abort(),this.#h=new AbortController);let x=new A(this,{type:"set",key:"body",value:b,oldValue:w,isUpdate:!0,related:[],operation:"set",detail:null});s.live.state=!0,s.live.resolve(this),y.resolve(l),this.#r.emit([x]),this.dispatchEvent(new $t(l))},o=(m,l,y)=>{a(m,{body:l,status:200,statusText:"",...y,headers:y.headers instanceof Headers?y.headers:new Headers(y.headers||{}),type:"basic",redirected:!1,url:null})},u=async(m,l,y)=>{let b,w,x=!0;if(l instanceof Response){try{b=await z.prototype.any.call(l,{to:"json"})}catch{x=!1,b=await z.prototype.any.call(l)}w=this.constructor.getPort(l,{handshake:2})}else b=(await l.readyStateChange("live")).body,w=l.port;if(a(m,{body:b,status:l.status,statusText:l.statusText,headers:l.headers,concurrent:l.concurrent,...y,port:w,type:l.type,redirected:l.redirected,url:l.url}),this.constructor.test(l)==="LiveResponse"){let d=()=>{o(null,l.body,l)};return l.addEventListener("replace",d,{signal:this.#s.signal}),await l.readyStateChange("done"),l.removeEventListener("replace",d),l}if(w){x&&w.projectMutations({from:"initial_response",to:b,signal:this.#h.signal});let d=new Promise(P=>{let E=q=>{let{body:N,...T}=q.data;o(null,N,{...T})};w.addEventListener("response.replace",E,{signal:this.#s.signal}),w.addEventListener("response.done",()=>{w.removeEventListener("response.replace",E),P(this)},{once:!0}),w.readyStateChange("close").then(P)});return w.start(),d}},f=async(m,l,y)=>{let b=await l.next(),w=await b.value;await this.#c(m,w,{done:b.done,...y});let x=b,d=w;for(;!x.done&&!this.#s.signal.aborted;)x=await l.next(),d=await x.value,this.#s.signal.aborted||await this.#c(null,d,{concurrent:y.concurrent,done:y.done===!1?!1:x.done})},c=async(m,l,y)=>(await this.#c(m,l.value,y),S.observe(l,"value",b=>this.#c(null,b.value,{concurrent:y.concurrent,done:!1}),{signal:this.#s.signal}),new Promise(()=>{})),p=typeof n[0]=="function"?n.shift():null,h=v(n[0])?{...n.shift()}:{};if("status"in h&&(h.status=parseInt(h.status),h.status<200||h.status>599))throw new Error(`The status provided (${h.status}) is outside the range [200, 599].`);if("statusText"in h&&(h.statusText=String(h.statusText)),h.headers&&!(h.headers instanceof Headers)&&(h.headers=new Headers(h.headers)),"concurrent"in h&&(h.concurrent=!!h.concurrent),/Response/.test(this.constructor.test(r))){if(p)throw new Error("frameClosure is not supported for responses.");i.donePromise=u(i,r,h)}else if(this.constructor.test(r)==="Generator"){if(p)throw new Error("frameClosure is not supported for generators.");i.donePromise=f(i,r,h)}else if(this.constructor.test(r)==="LiveProgramHandle"){if(p)throw new Error("frameClosure is not supported for live program handles.");i.donePromise=c(i,r,h)}else if(i.donePromise=Promise.resolve(o(i,r,h)),p){let m=_(r)&&!At(r)?S.proxy(r,{chainable:!0,membrane:r}):r;i.donePromise=Promise.resolve(p.call(this,m,this.#h.signal))}return this.#g(h.done===!1?new Promise(()=>{}):i.donePromise),await new Promise((m,l)=>{this.#s.signal.addEventListener("abort",()=>m(!1)),i.donePromise.then(()=>m(!0)).catch(l)})}toResponse({port:e,signal:r}={}){if(e&&!(e instanceof M))throw new Error("Client must be a MessagePortPlus interface");let n=z.from(this.body,{status:this.#o,statusText:this.#a,headers:this.#e}),s=C(this);if(fe(n).set("meta",new Map(s)),!e)return n;_(this.#t)&&!At(this.#t)&&e.projectMutations({from:this.#t,to:"initial_response",signal:AbortSignal.any([this.#h.signal].concat(r||[]))});let i=()=>{let a=Object.fromEntries([...this.headers.entries()]);a?.["set-cookie"]&&(delete a["set-cookie"],console.warn('Warning: The "set-cookie" header is not supported for security reasons and has been removed from the response.')),e.postMessage({body:this.#t,status:this.#o,statusText:this.#a,headers:a,type:this.type,url:this.url,redirect:this.redirect,concurrent:this.#n},{type:"response.replace",live:!0,signal:AbortSignal.any([this.#h.signal].concat(r||[]))})};return this.addEventListener("replace",i,{signal:r}),this.readyStateChange("done").then(()=>{e.postMessage(null,{type:"response.done"})}),n}async*toGenerator({signal:e}={}){do yield this.body;while(await new Promise(r=>{this.addEventListener("replace",()=>r(!0),{once:!0,signal:e}),this.readyStateChange("done").then(()=>r(!1))}))}toLiveProgramHandle({signal:e}={}){let r=new Tt,n=()=>S.defineProperty(r,"value",{value:this.body,enumerable:!1,configurable:!0});return this.addEventListener("replace",n,{signal:e}),n(),r}clone(e={}){let r=new this.constructor,n=C(this);return fe(r).set("meta",new Map(n)),r.replaceWith(this,e),r}},fn=t=>typeof t?.next=="function"&&typeof t?.throw=="function"&&typeof t?.return=="function";function _e(){let t=C(this);if(!t.has("readystate_registry")){let e=n=>(n.promise=new Promise((s,i)=>(n.resolve=s,n.reject=i)),n),r={live:e({}),done:e({})};(function n(){return r.now=e({}),r.now.refresh=n,r.now})(),t.set("readystate_registry",r)}return t.get("readystate_registry")}var $t=class extends Event{#r;get data(){return this.#r}constructor(e){super("replace"),this.#r=e}},Tt=class{[Symbol.toStringTag]="LiveProgramHandle";abort(){}};globalThis.webqit||(globalThis.webqit={});Object.assign(globalThis.webqit,Rt);})();
2
2
  //# sourceMappingURL=main.js.map