soonjs 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/index.cjs +8 -8
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +650 -668
  4. package/dist/types.d.ts +4 -0
  5. package/dist/vite-plugin-soon-client.cjs +3 -3
  6. package/dist/vite-plugin-soon-client.js +15 -15
  7. package/dist/vite-plugin-soon-server.cjs +3 -2
  8. package/dist/vite-plugin-soon-server.js +3 -2
  9. package/package.json +1 -1
  10. /package/dist/deps/{acorn-jU-39Pbw5W-yvskxh9um.js → acorn-jU-39Pbw5W-h3ruckghp.js} +0 -0
  11. /package/dist/deps/{acorn-jU-39Pbw5W-z78ga6q48.js → acorn-jU-39Pbw5W-xkdgla69t.js} +0 -0
  12. /package/dist/deps/{angular-eXKcfordor-4cx2asx9u.js → angular-eXKcfordor-g9ggqmosz.js} +0 -0
  13. /package/dist/deps/{angular-eXKcfordor-uthlxmm01.js → angular-eXKcfordor-uyi234ws8.js} +0 -0
  14. /package/dist/deps/{babel-QODt_XJZCU-ffi3sfwce.js → babel-QODt_XJZCU-04et0pddu.js} +0 -0
  15. /package/dist/deps/{babel-QODt_XJZCU-82av6dtke.js → babel-QODt_XJZCU-9bzuwsjpv.js} +0 -0
  16. /package/dist/deps/{estree-_Gcr3virjH-eddzs32c5.js → estree-_Gcr3virjH-5tfq5t2is.js} +0 -0
  17. /package/dist/deps/{estree-_Gcr3virjH-1wiat3k1c.js → estree-_Gcr3virjH-qwxmzf6xk.js} +0 -0
  18. /package/dist/deps/{flow-VkrRJr6lFd-acc719y4e.js → flow-VkrRJr6lFd-2vxssacuo.js} +0 -0
  19. /package/dist/deps/{flow-VkrRJr6lFd-2ak8tw0u8.js → flow-VkrRJr6lFd-x0wyj6uqd.js} +0 -0
  20. /package/dist/deps/{glimmer-I6jyK4xw2I-5wk77alut.js → glimmer-I6jyK4xw2I-f6qd505ie.js} +0 -0
  21. /package/dist/deps/{glimmer-I6jyK4xw2I-ziyt93q4u.js → glimmer-I6jyK4xw2I-z7w74nqx7.js} +0 -0
  22. /package/dist/deps/{graphql-F7JRnTC996-579fy9e5p.js → graphql-F7JRnTC996-9c67wb7ep.js} +0 -0
  23. /package/dist/deps/{graphql-F7JRnTC996-xo2ewhpda.js → graphql-F7JRnTC996-fivswe0wh.js} +0 -0
  24. /package/dist/deps/{html-C-ZYESkdqr-wqev7uivz.js → html-C-ZYESkdqr-9u3x97fu2.js} +0 -0
  25. /package/dist/deps/{html-C-ZYESkdqr-9u9egv5e9.js → html-C-ZYESkdqr-sprodg7gy.js} +0 -0
  26. /package/dist/deps/{markdown-4m9fGqwyBD-ajfgdjjtq.js → markdown-4m9fGqwyBD-p01s6zl24.js} +0 -0
  27. /package/dist/deps/{markdown-4m9fGqwyBD-y6kb3fai0.js → markdown-4m9fGqwyBD-xydhe8qra.js} +0 -0
  28. /package/dist/deps/{meriyah-2XmgupY1jB-2r1o5c3wx.js → meriyah-2XmgupY1jB-jcofsczid.js} +0 -0
  29. /package/dist/deps/{meriyah-2XmgupY1jB-l1mx8jmvd.js → meriyah-2XmgupY1jB-w36vfsxw0.js} +0 -0
  30. /package/dist/deps/{postcss-UtIjNac23s-5881ml07v.js → postcss-UtIjNac23s-64ewg9fun.js} +0 -0
  31. /package/dist/deps/{postcss-UtIjNac23s-4aip6k58w.js → postcss-UtIjNac23s-6windfpuz.js} +0 -0
  32. /package/dist/deps/{soon-id-t25L9qRGGZ-f9zvgvt6i.js → soon-id-t25L9qRGGZ-1fn0mvfiw.js} +0 -0
  33. /package/dist/deps/{soon-id-t25L9qRGGZ-418fupuaf.js → soon-id-t25L9qRGGZ-zwi3vo6up.js} +0 -0
  34. /package/dist/deps/{typescript-7W94NRN5-v-zwk5jsg6d.js → typescript-7W94NRN5-v-audtlu32h.js} +0 -0
  35. /package/dist/deps/{typescript-7W94NRN5-v-sln6or98e.js → typescript-7W94NRN5-v-bsdaapgi8.js} +0 -0
  36. /package/dist/deps/{yaml-GTMY6ek0xu-qxhi13sa4.js → yaml-GTMY6ek0xu-dwjgwemiv.js} +0 -0
  37. /package/dist/deps/{yaml-GTMY6ek0xu-h6k112q91.js → yaml-GTMY6ek0xu-h1v3g8nse.js} +0 -0
package/dist/index.cjs CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";var Kt=Object.defineProperty;var Vt=(r,e,t)=>e in r?Kt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var P=(r,e,t)=>Vt(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Qt=require("stream"),Y=require("./deps/soon-id-t25L9qRGGZ-418fupuaf.js"),Jt=require("util");var j={};Object.defineProperty(j,"__esModule",{value:!0});j.TokenData=void 0;j.parse=Ar;j.compile=tn;var Xt=j.match=on;j.pathToRegexp=pt;const ut="/",Er=r=>r,Yt=new RegExp("^\\p{XID_Continue}$","u"),ue="https://git.new/pathToRegexpError",Zt={"!":"!","@":"@",";":";",",":",","*":"*","+":"+","?":"?","{":"{","}":"}"};function en(r){const e=[...r],t=[];let n=0;for(;n<e.length;){const a=e[n],i=Zt[a];if(i){t.push({type:i,index:n++,value:a});continue}if(a==="\\"){t.push({type:"ESCAPED",index:n++,value:e[n++]});continue}if(a===":"){let o="";for(;Yt.test(e[++n]);)o+=e[n];if(!o)throw new TypeError(`Missing parameter name at ${n}`);t.push({type:"NAME",index:n,value:o});continue}if(a==="("){const o=n++;let u=1,l="";if(e[n]==="?")throw new TypeError(`Pattern cannot start with "?" at ${n}`);for(;n<e.length;){if(e[n]==="\\"){l+=e[n++]+e[n++];continue}if(e[n]===")"){if(u--,u===0){n++;break}}else if(e[n]==="("&&(u++,e[n+1]!=="?"))throw new TypeError(`Capturing groups are not allowed at ${n}`);l+=e[n++]}if(u)throw new TypeError(`Unbalanced pattern at ${o}`);if(!l)throw new TypeError(`Missing pattern at ${o}`);t.push({type:"PATTERN",index:n,value:l});continue}t.push({type:"CHAR",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),new rn(t)}class rn{constructor(e){this.tokens=e,this.index=0}peek(){return this.tokens[this.index]}tryConsume(e){const t=this.peek();if(t.type===e)return this.index++,t.value}consume(e){const t=this.tryConsume(e);if(t!==void 0)return t;const{type:n,index:a}=this.peek();throw new TypeError(`Unexpected ${n} at ${a}, expected ${e}: ${ue}`)}text(){let e="",t;for(;t=this.tryConsume("CHAR")||this.tryConsume("ESCAPED");)e+=t;return e}modifier(){return this.tryConsume("?")||this.tryConsume("*")||this.tryConsume("+")}}class De{constructor(e,t){this.tokens=e,this.delimiter=t}}j.TokenData=De;function Ar(r,e={}){const{encodePath:t=Er,delimiter:n=t(ut)}=e,a=[],i=en(r);let o=0;do{const u=i.text();u&&a.push(t(u));const l=i.tryConsume("NAME"),c=i.tryConsume("PATTERN");if(l||c){a.push({name:l||String(o++),pattern:c});const f=i.peek();if(f.type==="*")throw new TypeError(`Unexpected * at ${f.index}, you probably want \`/*\` or \`{/:foo}*\`: ${ue}`);continue}if(i.tryConsume("*")){a.push({name:String(o++),pattern:`(?:(?!${Z(n)}).)*`,modifier:"*",separator:n});continue}if(i.tryConsume("{")){const f=i.text(),d=i.tryConsume("NAME"),y=i.tryConsume("PATTERN"),h=i.text(),g=i.tryConsume(";")&&i.text();i.consume("}");const b=i.modifier();a.push({name:d||(y?String(o++):""),prefix:t(f),suffix:t(h),pattern:y,modifier:b,separator:g});continue}i.consume("END");break}while(!0);return new De(a,n)}function tn(r,e={}){const t=r instanceof De?r:Ar(r,e);return an(t,e)}function nn(r,e){if(typeof r=="string")return()=>r;const t=e||Er,n=r.modifier==="+"||r.modifier==="*",a=r.modifier==="?"||r.modifier==="*",{prefix:i="",suffix:o="",separator:u=o+i}=r;if(e&&n){const c=(p,f)=>{if(typeof p!="string")throw new TypeError(`Expected "${r.name}/${f}" to be a string`);return t(p)},s=p=>{if(!Array.isArray(p))throw new TypeError(`Expected "${r.name}" to be an array`);return p.length===0?"":i+p.map(c).join(u)+o};return a?p=>{const f=p[r.name];return f==null?"":f.length?s(f):""}:p=>{const f=p[r.name];return s(f)}}const l=c=>{if(typeof c!="string")throw new TypeError(`Expected "${r.name}" to be a string`);return i+t(c)+o};return a?c=>{const s=c[r.name];return s==null?"":l(s)}:c=>{const s=c[r.name];return l(s)}}function an(r,e){const{encode:t=encodeURIComponent,loose:n=!0,validate:a=!0,strict:i=!1}=e,o=ct(e),u=$r(n,r.delimiter),l=st(r,u,[],o,i),c=r.tokens.map((s,p)=>{const f=nn(s,t);if(!a||typeof s=="string")return f;const d=new RegExp(`^${l[p]}$`,o);return y=>{const h=f(y);if(!d.test(h))throw new TypeError(`Invalid value for "${s.name}": ${JSON.stringify(h)}`);return h}});return function(p={}){let f="";for(const d of c)f+=d(p);return f}}function on(r,e={}){const{decode:t=decodeURIComponent,loose:n=!0,delimiter:a=ut}=e,i=pt(r,e),o=$r(n,a),u=i.keys.map(l=>{if(t&&(l.modifier==="+"||l.modifier==="*")){const{prefix:c="",suffix:s="",separator:p=s+c}=l,f=new RegExp(o(p),"g");return d=>d.split(f).map(t)}return t||Er});return function(c){const s=i.exec(c);if(!s)return!1;const{0:p,index:f}=s,d=Object.create(null);for(let y=1;y<s.length;y++){if(s[y]===void 0)continue;const h=i.keys[y-1],g=u[y-1];d[h.name]=g(s[y])}return{path:p,index:f,params:d}}}function Z(r){return r.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}function ln(r,e){const t=Z(r);return e?`(?:${t})+(?!${t})`:t}function $r(r,e){if(!r)return Z;const t=new RegExp(`(?:(?!${Z(e)}).)+|(.)`,"g");return n=>n.replace(t,ln)}function ct(r){return r.sensitive?"":"i"}function Dr(r,e,t,n){const a=r instanceof De?r:Ar(r,n),{trailing:i=!0,loose:o=!0,start:u=!0,end:l=!0,strict:c=!1}=n,s=$r(o,a.delimiter),p=st(a,s,e,t,c);let f=u?"^":"";return f+=p.join(""),i&&(f+=`(?:${s(a.delimiter)}$)?`),f+=l?"$":`(?=${Z(a.delimiter)}|$)`,f}function st(r,e,t,n,a){const i=`(?:(?!${Z(r.delimiter)}).)+?`;let o="",u=!0;return r.tokens.map(l=>{if(typeof l=="string")return o=l,e(l);const{prefix:c="",suffix:s="",separator:p=s+c,modifier:f=""}=l,d=e(c),y=e(s);if(l.name){const h=l.pattern?`(?:${l.pattern})`:i,g=fn(h,l.name,n);if(u||(u=He(g,c||o)),!u)throw new TypeError(`Ambiguous pattern for "${l.name}": ${ue}`);if(u=!a||He(g,s),o="",t.push(l),f==="+"||f==="*"){const b=f==="*"?"?":"",A=e(p);if(!A)throw new TypeError(`Missing separator for "${l.name}": ${ue}`);if(u||(u=!a||He(g,p)),!u)throw new TypeError(`Ambiguous pattern for "${l.name}" separator: ${ue}`);return u=!a,`(?:${d}(${h}(?:${A}${h})*)${y})${b}`}return`(?:${d}(${h})${y})${f}`}return`(?:${d}${y})${f}`})}function fn(r,e,t){try{return new RegExp(`^${r}$`,t)}catch(n){throw new TypeError(`Invalid pattern for "${e}": ${n.message}`)}}function He(r,e){return e?!r.test(e):!1}function pt(r,e={}){const t=[],n=ct(e);if(Array.isArray(r)){const i=r.map(o=>Dr(o,t,n,e));return Object.assign(new RegExp(i.join("|")),{keys:t})}const a=Dr(r,t,n,e);return Object.assign(new RegExp(a),{keys:t})}var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.Observable=void 0;const yt=r=>!!Symbol[r],Pr=r=>yt(r)?Symbol[r]:"@@"+r,un=Pr("iterator"),dr=Pr("observable"),dt=Pr("species");function Re(r,e){let t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function oe(r){let e=r.constructor;return e!==void 0&&(e=e[dt],e===null&&(e=void 0)),e!==void 0?e:Le}function cn(r){return r instanceof Le}function ee(r){ee.log?ee.log(r):setTimeout(()=>{throw r})}function Ae(r){Promise.resolve().then(()=>{try{r()}catch(e){ee(e)}})}function ht(r){let e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{let t=Re(e,"unsubscribe");t&&t.call(e)}}catch(t){ee(t)}}function hr(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function sn(r){let e=r._queue;if(e){r._queue=void 0,r._state="ready";for(let t=0;t<e.length&&(mt(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function mt(r,e,t){r._state="running";let n=r._observer;try{let a=Re(n,e);switch(e){case"next":a&&a.call(n,t);break;case"error":if(hr(r),a)a.call(n,t);else throw t;break;case"complete":hr(r),a&&a.call(n);break}}catch(a){ee(a)}r._state==="closed"?ht(r):r._state==="running"&&(r._state="ready")}function ze(r,e,t){if(r._state!=="closed"){if(r._state==="buffering"){r._queue.push({type:e,value:t});return}if(r._state!=="ready"){r._state="buffering",r._queue=[{type:e,value:t}],Ae(()=>sn(r));return}mt(r,e,t)}}class pn{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,a={get closed(){return n._state==="closed"},next(i){ze(n,"next",i)},error(i){ze(n,"error",i)},complete(){ze(n,"complete")}};try{this._cleanup=t.call(void 0,a)}catch(i){a.error(i)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(hr(this),ht(this))}}let Le=class $e{constructor(e){if(!(this instanceof $e))throw new TypeError("Observable cannot be called as a function");if(typeof e!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return(typeof e!="object"||e===null)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new pn(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if(typeof e!="function"){n(new TypeError(e+" is not a function"));return}function a(){i.unsubscribe(),t()}let i=this.subscribe({next(o){try{e(o,a)}catch(u){n(u),i.unsubscribe()}},error:n,complete:t})})}map(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this);return new t(n=>this.subscribe({next(a){try{a=e(a)}catch(i){return n.error(i)}n.next(a)},error(a){n.error(a)},complete(){n.complete()}}))}filter(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this);return new t(n=>this.subscribe({next(a){try{if(!e(a))return}catch(i){return n.error(i)}n.next(a)},error(a){n.error(a)},complete(){n.complete()}}))}reduce(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this),n=arguments.length>1,a=!1,o=arguments[1];return new t(u=>this.subscribe({next(l){let c=!a;if(a=!0,!c||n)try{o=e(o,l)}catch(s){return u.error(s)}else o=l},error(l){u.error(l)},complete(){if(!a&&!n)return u.error(new TypeError("Cannot reduce an empty sequence"));u.next(o),u.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=oe(this);return new t(n=>{let a,i=0;function o(u){a=u.subscribe({next(l){n.next(l)},error(l){n.error(l)},complete(){i===e.length?(a=void 0,n.complete()):o(t.from(e[i++]))}})}return o(this),()=>{a&&(a.unsubscribe(),a=void 0)}})}flatMap(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this);return new t(n=>{let a=[],i=this.subscribe({next(u){if(e)try{u=e(u)}catch(c){return n.error(c)}let l=t.from(u).subscribe({next(c){n.next(c)},error(c){n.error(c)},complete(){let c=a.indexOf(l);c>=0&&a.splice(c,1),o()}});a.push(l)},error(u){n.error(u)},complete(){o()}});function o(){i.closed&&a.length===0&&n.complete()}return()=>{a.forEach(u=>u.unsubscribe()),i.unsubscribe()}})}[dr](){return this}static from(e){let t=typeof this=="function"?this:$e;if(e==null)throw new TypeError(e+" is not an object");let n=Re(e,dr);if(n){let a=n.call(e);if(Object(a)!==a)throw new TypeError(a+" is not an object");return cn(a)&&a.constructor===t?a:new t(i=>a.subscribe(i))}if(yt("iterator")&&(n=Re(e,un),n))return new t(a=>{Ae(()=>{if(!a.closed){for(let i of n.call(e))if(a.next(i),a.closed)return;a.complete()}})});if(Array.isArray(e))return new t(a=>{Ae(()=>{if(!a.closed){for(let i=0;i<e.length;++i)if(a.next(e[i]),a.closed)return;a.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){let t=typeof this=="function"?this:$e;return new t(n=>{Ae(()=>{if(!n.closed){for(let a=0;a<e.length;++a)if(n.next(e[a]),n.closed)return;n.complete()}})})}static get[dt](){return this}};Ne.Observable=Le;Object.defineProperty(Le,Symbol("extensions"),{value:{symbol:dr,hostReportError:ee},configurable:!0});var yn=Ne.Observable;const xr=Y.getDefaultExportFromCjs(yn);var ne=TypeError,dn=Jt.inspect,Or=typeof Map=="function"&&Map.prototype,ke=Object.getOwnPropertyDescriptor&&Or?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,_e=Or&&ke&&typeof ke.get=="function"?ke.get:null,Nr=Or&&Map.prototype.forEach,Ir=typeof Set=="function"&&Set.prototype,Ke=Object.getOwnPropertyDescriptor&&Ir?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ce=Ir&&Ke&&typeof Ke.get=="function"?Ke.get:null,Lr=Ir&&Set.prototype.forEach,hn=typeof WeakMap=="function"&&WeakMap.prototype,ce=hn?WeakMap.prototype.has:null,mn=typeof WeakSet=="function"&&WeakSet.prototype,se=mn?WeakSet.prototype.has:null,vn=typeof WeakRef=="function"&&WeakRef.prototype,Br=vn?WeakRef.prototype.deref:null,gn=Boolean.prototype.valueOf,wn=Object.prototype.toString,Sn=Function.prototype.toString,bn=String.prototype.match,Rr=String.prototype.slice,L=String.prototype.replace,En=String.prototype.toUpperCase,Ur=String.prototype.toLowerCase,vt=RegExp.prototype.test,qr=Array.prototype.concat,R=Array.prototype.join,An=Array.prototype.slice,Wr=Math.floor,mr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ve=Object.getOwnPropertySymbols,vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,re=typeof Symbol=="function"&&typeof Symbol.iterator=="object",pe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===re||!0)?Symbol.toStringTag:null,gt=Object.prototype.propertyIsEnumerable,Fr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Gr(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||vt.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Wr(-r):Wr(r);if(n!==r){var a=String(n),i=Rr.call(e,a.length+1);return L.call(a,t,"$&_")+"."+L.call(L.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return L.call(e,t,"$&_")}var gr=dn,jr=gr.custom,Hr=bt(jr)?jr:null,wt={__proto__:null,double:'"',single:"'"},$n={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Be=function r(e,t,n,a){var i=t||{};if(T(i,"quoteStyle")&&!T(wt,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(T(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=T(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(T(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(T(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return At(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return u?Gr(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return u?Gr(e,c):c}var s=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=s&&s>0&&typeof e=="object")return wr(e)?"[Array]":"[Object]";var p=Gn(i,n);if(typeof a>"u")a=[];else if(Et(a,e)>=0)return"[Circular]";function f(x,N,C){if(N&&(a=An.call(a),a.push(N)),C){var ie={depth:i.depth};return T(i,"quoteStyle")&&(ie.quoteStyle=i.quoteStyle),r(x,ie,n+1,a)}return r(x,i,n+1,a)}if(typeof e=="function"&&!zr(e)){var d=Mn(e),y=be(e,f);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(y.length>0?" { "+R.call(y,", ")+" }":"")}if(bt(e)){var h=re?L.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):vr.call(e);return typeof e=="object"&&!re?le(h):h}if(qn(e)){for(var g="<"+Ur.call(String(e.nodeName)),b=e.attributes||[],A=0;A<b.length;A++)g+=" "+b[A].name+"="+St(Pn(b[A].value),"double",i);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+Ur.call(String(e.nodeName))+">",g}if(wr(e)){if(e.length===0)return"[]";var m=be(e,f);return p&&!Fn(m)?"["+Sr(m,p)+"]":"[ "+R.call(m,", ")+" ]"}if(On(e)){var M=be(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!gt.call(e,"cause")?"{ ["+String(e)+"] "+R.call(qr.call("[cause]: "+f(e.cause),M),", ")+" }":M.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+R.call(M,", ")+" }"}if(typeof e=="object"&&o){if(Hr&&typeof e[Hr]=="function"&&gr)return gr(e,{depth:s-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Dn(e)){var U=[];return Nr&&Nr.call(e,function(x,N){U.push(f(N,e,!0)+" => "+f(x,e))}),kr("Map",_e.call(e),U,p)}if(Bn(e)){var ae=[];return Lr&&Lr.call(e,function(x){ae.push(f(x,e))}),kr("Set",Ce.call(e),ae,p)}if(Nn(e))return Qe("WeakMap");if(Un(e))return Qe("WeakSet");if(Ln(e))return Qe("WeakRef");if(Rn(e))return le(f(Number(e)));if(Cn(e))return le(f(mr.call(e)));if(_n(e))return le(gn.call(e));if(In(e))return le(f(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Y.commonjsGlobal<"u"&&e===Y.commonjsGlobal)return"{ [object globalThis] }";if(!xn(e)&&!zr(e)){var z=be(e,f),we=Fr?Fr(e)===Object.prototype:e instanceof Object||e.constructor===Object,q=e instanceof Object?"":"null prototype",D=!we&&pe&&Object(e)===e&&pe in e?Rr.call(B(e),8,-1):q?"Object":"",Se=we||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",k=Se+(D||q?"["+R.call(qr.call([],D||[],q||[]),": ")+"] ":"");return z.length===0?k+"{}":p?k+"{"+Sr(z,p)+"}":k+"{ "+R.call(z,", ")+" }"}return String(e)};function St(r,e,t){var n=t.quoteStyle||e,a=wt[n];return a+r+a}function Pn(r){return L.call(String(r),/"/g,"&quot;")}function H(r){return!pe||!(typeof r=="object"&&(pe in r||typeof r[pe]<"u"))}function wr(r){return B(r)==="[object Array]"&&H(r)}function xn(r){return B(r)==="[object Date]"&&H(r)}function zr(r){return B(r)==="[object RegExp]"&&H(r)}function On(r){return B(r)==="[object Error]"&&H(r)}function In(r){return B(r)==="[object String]"&&H(r)}function Rn(r){return B(r)==="[object Number]"&&H(r)}function _n(r){return B(r)==="[object Boolean]"&&H(r)}function bt(r){if(re)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!vr)return!1;try{return vr.call(r),!0}catch{}return!1}function Cn(r){if(!r||typeof r!="object"||!mr)return!1;try{return mr.call(r),!0}catch{}return!1}var Tn=Object.prototype.hasOwnProperty||function(r){return r in this};function T(r,e){return Tn.call(r,e)}function B(r){return wn.call(r)}function Mn(r){if(r.name)return r.name;var e=bn.call(Sn.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Et(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Dn(r){if(!_e||!r||typeof r!="object")return!1;try{_e.call(r);try{Ce.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Nn(r){if(!ce||!r||typeof r!="object")return!1;try{ce.call(r,ce);try{se.call(r,se)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Ln(r){if(!Br||!r||typeof r!="object")return!1;try{return Br.call(r),!0}catch{}return!1}function Bn(r){if(!Ce||!r||typeof r!="object")return!1;try{Ce.call(r);try{_e.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Un(r){if(!se||!r||typeof r!="object")return!1;try{se.call(r,se);try{ce.call(r,ce)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function qn(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function At(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return At(Rr.call(r,0,e.maxStringLength),e)+n}var a=$n[e.quoteStyle||"single"];a.lastIndex=0;var i=L.call(L.call(r,a,"\\$1"),/[\x00-\x1f]/g,Wn);return St(i,"single",e)}function Wn(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+En.call(e.toString(16))}function le(r){return"Object("+r+")"}function Qe(r){return r+" { ? }"}function kr(r,e,t,n){var a=n?Sr(t,n):R.call(t,", ");return r+" ("+e+") {"+a+"}"}function Fn(r){for(var e=0;e<r.length;e++)if(Et(r[e],`
2
- `)>=0)return!1;return!0}function Gn(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=R.call(Array(r.indent+1)," ");else return null;return{base:t,prev:R.call(Array(e+1),t)}}function Sr(r,e){if(r.length===0)return"";var t=`
3
- `+e.prev+e.base;return t+R.call(r,","+t)+`
4
- `+e.prev}function be(r,e){var t=wr(r),n=[];if(t){n.length=r.length;for(var a=0;a<r.length;a++)n[a]=T(r,a)?e(r[a],r):""}var i=typeof Ve=="function"?Ve(r):[],o;if(re){o={};for(var u=0;u<i.length;u++)o["$"+i[u]]=i[u]}for(var l in r)T(r,l)&&(t&&String(Number(l))===l&&l<r.length||re&&o["$"+l]instanceof Symbol||(vt.call(/[^\w$]/,l)?n.push(e(l,r)+": "+e(r[l],r)):n.push(l+": "+e(r[l],r))));if(typeof Ve=="function")for(var c=0;c<i.length;c++)gt.call(r,i[c])&&n.push("["+e(i[c])+"]: "+e(r[i[c]],r));return n}var jn=Be,Hn=ne,Ue=function(r,e,t){for(var n=r,a;(a=n.next)!=null;n=a)if(a.key===e)return n.next=a.next,t||(a.next=r.next,r.next=a),a},zn=function(r,e){if(r){var t=Ue(r,e);return t&&t.value}},kn=function(r,e,t){var n=Ue(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Kn=function(r,e){return r?!!Ue(r,e):!1},Vn=function(r,e){if(r)return Ue(r,e,!0)},Qn=function(){var e,t={assert:function(n){if(!t.has(n))throw new Hn("Side channel does not contain "+jn(n))},delete:function(n){var a=e&&e.next,i=Vn(e,n);return i&&a&&a===i&&(e=void 0),!!i},get:function(n){return zn(e,n)},has:function(n){return Kn(e,n)},set:function(n,a){e||(e={next:void 0}),kn(e,n,a)}};return t},$t=Object,Jn=Error,Xn=EvalError,Yn=RangeError,Zn=ReferenceError,ea=SyntaxError,ra=URIError,ta=Math.abs,na=Math.floor,aa=Math.max,ia=Math.min,oa=Math.pow,la=Math.round,fa=Number.isNaN||function(e){return e!==e},ua=fa,ca=function(e){return ua(e)||e===0?e:e<0?-1:1},sa=Object.getOwnPropertyDescriptor,Pe=sa;if(Pe)try{Pe([],"length")}catch{Pe=null}var Pt=Pe,xe=Object.defineProperty||!1;if(xe)try{xe({},"a",{value:1})}catch{xe=!1}var pa=xe,Je,Kr;function ya(){return Kr||(Kr=1,Je=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(var i in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,t);if(u.value!==a||u.enumerable!==!0)return!1}return!0}),Je}var Xe,Vr;function da(){if(Vr)return Xe;Vr=1;var r=typeof Symbol<"u"&&Symbol,e=ya();return Xe=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Xe}var Ye,Qr;function xt(){return Qr||(Qr=1,Ye=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ye}var Ze,Jr;function Ot(){if(Jr)return Ze;Jr=1;var r=$t;return Ze=r.getPrototypeOf||null,Ze}var er,Xr;function ha(){if(Xr)return er;Xr=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",a=function(l,c){for(var s=[],p=0;p<l.length;p+=1)s[p]=l[p];for(var f=0;f<c.length;f+=1)s[f+l.length]=c[f];return s},i=function(l,c){for(var s=[],p=c,f=0;p<l.length;p+=1,f+=1)s[f]=l[p];return s},o=function(u,l){for(var c="",s=0;s<u.length;s+=1)c+=u[s],s+1<u.length&&(c+=l);return c};return er=function(l){var c=this;if(typeof c!="function"||e.apply(c)!==n)throw new TypeError(r+c);for(var s=i(arguments,1),p,f=function(){if(this instanceof p){var b=c.apply(this,a(s,arguments));return Object(b)===b?b:this}return c.apply(l,a(s,arguments))},d=t(0,c.length-s.length),y=[],h=0;h<d;h++)y[h]="$"+h;if(p=Function("binder","return function ("+o(y,",")+"){ return binder.apply(this,arguments); }")(f),c.prototype){var g=function(){};g.prototype=c.prototype,p.prototype=new g,g.prototype=null}return p},er}var rr,Yr;function qe(){if(Yr)return rr;Yr=1;var r=ha();return rr=Function.prototype.bind||r,rr}var tr,Zr;function _r(){return Zr||(Zr=1,tr=Function.prototype.call),tr}var nr,et;function It(){return et||(et=1,nr=Function.prototype.apply),nr}var ma=typeof Reflect<"u"&&Reflect&&Reflect.apply,va=qe(),ga=It(),wa=_r(),Sa=ma,ba=Sa||va.call(wa,ga),Ea=qe(),Aa=ne,$a=_r(),Pa=ba,Rt=function(e){if(e.length<1||typeof e[0]!="function")throw new Aa("a function is required");return Pa(Ea,$a,e)},ar,rt;function xa(){if(rt)return ar;rt=1;var r=Rt,e=Pt,t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&e&&e(Object.prototype,"__proto__"),a=Object,i=a.getPrototypeOf;return ar=n&&typeof n.get=="function"?r([n.get]):typeof i=="function"?function(u){return i(u==null?u:a(u))}:!1,ar}var ir,tt;function Oa(){if(tt)return ir;tt=1;var r=xt(),e=Ot(),t=xa();return ir=r?function(a){return r(a)}:e?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return e(a)}:t?function(a){return t(a)}:null,ir}var or,nt;function Ia(){if(nt)return or;nt=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=qe();return or=t.call(r,e),or}var v,Ra=$t,_a=Jn,Ca=Xn,Ta=Yn,Ma=Zn,te=ea,X=ne,Da=ra,Na=ta,La=na,Ba=aa,Ua=ia,qa=oa,Wa=la,Fa=ca,_t=Function,lr=function(r){try{return _t('"use strict"; return ('+r+").constructor;")()}catch{}},he=Pt,Ga=pa,fr=function(){throw new X},ja=he?function(){try{return arguments.callee,fr}catch{try{return he(arguments,"callee").get}catch{return fr}}}():fr,K=da()(),$=Oa(),Ha=Ot(),za=xt(),Ct=It(),me=_r(),Q={},ka=typeof Uint8Array>"u"||!$?v:$(Uint8Array),G={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":K&&$?$([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":Q,"%AsyncGenerator%":Q,"%AsyncGeneratorFunction%":Q,"%AsyncIteratorPrototype%":Q,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":_a,"%eval%":eval,"%EvalError%":Ca,"%Float16Array%":typeof Float16Array>"u"?v:Float16Array,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":_t,"%GeneratorFunction%":Q,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":K&&$?$($([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!K||!$?v:$(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ra,"%Object.getOwnPropertyDescriptor%":he,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":Ta,"%ReferenceError%":Ma,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!K||!$?v:$(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":K&&$?$(""[Symbol.iterator]()):v,"%Symbol%":K?Symbol:v,"%SyntaxError%":te,"%ThrowTypeError%":ja,"%TypedArray%":ka,"%TypeError%":X,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":Da,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet,"%Function.prototype.call%":me,"%Function.prototype.apply%":Ct,"%Object.defineProperty%":Ga,"%Object.getPrototypeOf%":Ha,"%Math.abs%":Na,"%Math.floor%":La,"%Math.max%":Ba,"%Math.min%":Ua,"%Math.pow%":qa,"%Math.round%":Wa,"%Math.sign%":Fa,"%Reflect.getPrototypeOf%":za};if($)try{null.error}catch(r){var Ka=$($(r));G["%Error.prototype%"]=Ka}var Va=function r(e){var t;if(e==="%AsyncFunction%")t=lr("async function () {}");else if(e==="%GeneratorFunction%")t=lr("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=lr("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&$&&(t=$(a.prototype))}return G[e]=t,t},at={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ve=qe(),Te=Ia(),Qa=ve.call(me,Array.prototype.concat),Ja=ve.call(Ct,Array.prototype.splice),it=ve.call(me,String.prototype.replace),Me=ve.call(me,String.prototype.slice),Xa=ve.call(me,RegExp.prototype.exec),Ya=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Za=/\\(\\)?/g,ei=function(e){var t=Me(e,0,1),n=Me(e,-1);if(t==="%"&&n!=="%")throw new te("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new te("invalid intrinsic syntax, expected opening `%`");var a=[];return it(e,Ya,function(i,o,u,l){a[a.length]=u?it(l,Za,"$1"):o||i}),a},ri=function(e,t){var n=e,a;if(Te(at,n)&&(a=at[n],n="%"+a[0]+"%"),Te(G,n)){var i=G[n];if(i===Q&&(i=Va(n)),typeof i>"u"&&!t)throw new X("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:i}}throw new te("intrinsic "+e+" does not exist!")},Cr=function(e,t){if(typeof e!="string"||e.length===0)throw new X("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new X('"allowMissing" argument must be a boolean');if(Xa(/^%?[^%]*%?$/,e)===null)throw new te("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ei(e),a=n.length>0?n[0]:"",i=ri("%"+a+"%",t),o=i.name,u=i.value,l=!1,c=i.alias;c&&(a=c[0],Ja(n,Qa([0,1],c)));for(var s=1,p=!0;s<n.length;s+=1){var f=n[s],d=Me(f,0,1),y=Me(f,-1);if((d==='"'||d==="'"||d==="`"||y==='"'||y==="'"||y==="`")&&d!==y)throw new te("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(l=!0),a+="."+f,o="%"+a+"%",Te(G,o))u=G[o];else if(u!=null){if(!(f in u)){if(!t)throw new X("base intrinsic for "+e+" exists, but the property is not available.");return}if(he&&s+1>=n.length){var h=he(u,f);p=!!h,p&&"get"in h&&!("originalValue"in h.get)?u=h.get:u=u[f]}else p=Te(u,f),u=u[f];p&&!l&&(G[o]=u)}}return u},Tt=Cr,Mt=Rt,ti=Mt([Tt("%String.prototype.indexOf%")]),Dt=function(e,t){var n=Tt(e,!!t);return typeof n=="function"&&ti(e,".prototype.")>-1?Mt([n]):n},ni=Cr,ge=Dt,ai=Be,ii=ne,ot=ni("%Map%",!0),oi=ge("Map.prototype.get",!0),li=ge("Map.prototype.set",!0),fi=ge("Map.prototype.has",!0),ui=ge("Map.prototype.delete",!0),ci=ge("Map.prototype.size",!0),Nt=!!ot&&function(){var e,t={assert:function(n){if(!t.has(n))throw new ii("Side channel does not contain "+ai(n))},delete:function(n){if(e){var a=ui(e,n);return ci(e)===0&&(e=void 0),a}return!1},get:function(n){if(e)return oi(e,n)},has:function(n){return e?fi(e,n):!1},set:function(n,a){e||(e=new ot),li(e,n,a)}};return t},si=Cr,We=Dt,pi=Be,Ee=Nt,yi=ne,V=si("%WeakMap%",!0),di=We("WeakMap.prototype.get",!0),hi=We("WeakMap.prototype.set",!0),mi=We("WeakMap.prototype.has",!0),vi=We("WeakMap.prototype.delete",!0),gi=V?function(){var e,t,n={assert:function(a){if(!n.has(a))throw new yi("Side channel does not contain "+pi(a))},delete:function(a){if(V&&a&&(typeof a=="object"||typeof a=="function")){if(e)return vi(e,a)}else if(Ee&&t)return t.delete(a);return!1},get:function(a){return V&&a&&(typeof a=="object"||typeof a=="function")&&e?di(e,a):t&&t.get(a)},has:function(a){return V&&a&&(typeof a=="object"||typeof a=="function")&&e?mi(e,a):!!t&&t.has(a)},set:function(a,i){V&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new V),hi(e,a,i)):Ee&&(t||(t=Ee()),t.set(a,i))}};return n}:Ee,wi=ne,Si=Be,bi=Qn,Ei=Nt,Ai=gi,$i=Ai||Ei||bi,Lt=function(){var e,t={assert:function(n){if(!t.has(n))throw new wi("Side channel does not contain "+Si(n))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,a){e||(e=$i()),e.set(n,a)}};return t},Pi=String.prototype.replace,xi=/%20/g,ur={RFC1738:"RFC1738",RFC3986:"RFC3986"},Tr={default:ur.RFC3986,formatters:{RFC1738:function(r){return Pi.call(r,xi,"+")},RFC3986:function(r){return String(r)}},RFC1738:ur.RFC1738,RFC3986:ur.RFC3986},Oi=Tr,Ii=Lt,cr=Object.prototype.hasOwnProperty,W=Array.isArray,Fe=Ii(),J=function(e,t){return Fe.set(e,t),e},F=function(e){return Fe.has(e)},fe=function(e){return Fe.get(e)},br=function(e,t){Fe.set(e,t)},O=function(){for(var r=[],e=0;e<256;++e)r[r.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return r}(),Ri=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(W(n)){for(var a=[],i=0;i<n.length;++i)typeof n[i]<"u"&&(a[a.length]=n[i]);t.obj[t.prop]=a}}},ye=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},a=0;a<e.length;++a)typeof e[a]<"u"&&(n[a]=e[a]);return n},_i=function r(e,t,n){if(!t)return e;if(typeof t!="object"&&typeof t!="function"){if(W(e)){var a=e.length;if(n&&typeof n.arrayLimit=="number"&&a>n.arrayLimit)return J(ye(e.concat(t),n),a);e[a]=t}else if(e&&typeof e=="object")if(F(e)){var i=fe(e)+1;e[i]=t,br(e,i)}else{if(n&&n.strictMerge)return[e,t];(n&&(n.plainObjects||n.allowPrototypes)||!cr.call(Object.prototype,t))&&(e[t]=!0)}else return[e,t];return e}if(!e||typeof e!="object"){if(F(t)){for(var o=Object.keys(t),u=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<o.length;l++){var c=parseInt(o[l],10);u[c+1]=t[o[l]]}return J(u,fe(t)+1)}var s=[e].concat(t);return n&&typeof n.arrayLimit=="number"&&s.length>n.arrayLimit?J(ye(s,n),s.length-1):s}var p=e;return W(e)&&!W(t)&&(p=ye(e,n)),W(e)&&W(t)?(t.forEach(function(f,d){if(cr.call(e,d)){var y=e[d];y&&typeof y=="object"&&f&&typeof f=="object"?e[d]=r(y,f,n):e[e.length]=f}else e[d]=f}),e):Object.keys(t).reduce(function(f,d){var y=t[d];if(cr.call(f,d)?f[d]=r(f[d],y,n):f[d]=y,F(t)&&!F(f)&&J(f,fe(t)),F(f)){var h=parseInt(d,10);String(h)===d&&h>=0&&h>fe(f)&&br(f,h)}return f},p)},Ci=function(e,t){return Object.keys(t).reduce(function(n,a){return n[a]=t[a],n},e)},Ti=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},sr=1024,Mi=function(e,t,n,a,i){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var u="",l=0;l<o.length;l+=sr){for(var c=o.length>=sr?o.slice(l,l+sr):o,s=[],p=0;p<c.length;++p){var f=c.charCodeAt(p);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===Oi.RFC1738&&(f===40||f===41)){s[s.length]=c.charAt(p);continue}if(f<128){s[s.length]=O[f];continue}if(f<2048){s[s.length]=O[192|f>>6]+O[128|f&63];continue}if(f<55296||f>=57344){s[s.length]=O[224|f>>12]+O[128|f>>6&63]+O[128|f&63];continue}p+=1,f=65536+((f&1023)<<10|c.charCodeAt(p)&1023),s[s.length]=O[240|f>>18]+O[128|f>>12&63]+O[128|f>>6&63]+O[128|f&63]}u+=s.join("")}return u},Di=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],a=0;a<t.length;++a)for(var i=t[a],o=i.obj[i.prop],u=Object.keys(o),l=0;l<u.length;++l){var c=u[l],s=o[c];typeof s=="object"&&s!==null&&n.indexOf(s)===-1&&(t[t.length]={obj:o,prop:c},n[n.length]=s)}return Ri(t),e},Ni=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Li=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Bi=function(e,t,n,a){if(F(e)){var i=fe(e)+1;return e[i]=t,br(e,i),e}var o=[].concat(e,t);return o.length>n?J(ye(o,{plainObjects:a}),o.length-1):o},Ui=function(e,t){if(W(e)){for(var n=[],a=0;a<e.length;a+=1)n[n.length]=t(e[a]);return n}return t(e)},Bt={arrayToObject:ye,assign:Ci,combine:Bi,compact:Di,decode:Ti,encode:Mi,isBuffer:Li,isOverflow:F,isRegExp:Ni,markOverflow:J,maybeMap:Ui,merge:_i},Ut=Lt,Oe=Bt,de=Tr,qi=Object.prototype.hasOwnProperty,qt={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},I=Array.isArray,Wi=Array.prototype.push,Wt=function(r,e){Wi.apply(r,I(e)?e:[e])},Fi=Date.prototype.toISOString,lt=de.default,E={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Oe.encode,encodeValuesOnly:!1,filter:void 0,format:lt,formatter:de.formatters[lt],indices:!1,serializeDate:function(e){return Fi.call(e)},skipNulls:!1,strictNullHandling:!1},Gi=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},pr={},ji=function r(e,t,n,a,i,o,u,l,c,s,p,f,d,y,h,g,b,A){for(var m=e,M=A,U=0,ae=!1;(M=M.get(pr))!==void 0&&!ae;){var z=M.get(e);if(U+=1,typeof z<"u"){if(z===U)throw new RangeError("Cyclic object value");ae=!0}typeof M.get(pr)>"u"&&(U=0)}if(typeof s=="function"?m=s(t,m):m instanceof Date?m=d(m):n==="comma"&&I(m)&&(m=Oe.maybeMap(m,function(je){return je instanceof Date?d(je):je})),m===null){if(o)return c&&!g?c(t,E.encoder,b,"key",y):t;m=""}if(Gi(m)||Oe.isBuffer(m)){if(c){var we=g?t:c(t,E.encoder,b,"key",y);return[h(we)+"="+h(c(m,E.encoder,b,"value",y))]}return[h(t)+"="+h(String(m))]}var q=[];if(typeof m>"u")return q;var D;if(n==="comma"&&I(m))g&&c&&(m=Oe.maybeMap(m,c)),D=[{value:m.length>0?m.join(",")||null:void 0}];else if(I(s))D=s;else{var Se=Object.keys(m);D=p?Se.sort(p):Se}var k=l?String(t).replace(/\./g,"%2E"):String(t),x=a&&I(m)&&m.length===1?k+"[]":k;if(i&&I(m)&&m.length===0)return x+"[]";for(var N=0;N<D.length;++N){var C=D[N],ie=typeof C=="object"&&C&&typeof C.value<"u"?C.value:m[C];if(!(u&&ie===null)){var Ge=f&&l?String(C).replace(/\./g,"%2E"):String(C),kt=I(m)?typeof n=="function"?n(x,Ge):x:x+(f?"."+Ge:"["+Ge+"]");A.set(e,U);var Mr=Ut();Mr.set(pr,A),Wt(q,r(ie,kt,n,a,i,o,u,l,n==="comma"&&g&&I(m)?null:c,s,p,f,d,y,h,g,b,Mr))}}return q},Hi=function(e){if(!e)return E;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||E.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=de.default;if(typeof e.format<"u"){if(!qi.call(de.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var a=de.formatters[n],i=E.filter;(typeof e.filter=="function"||I(e.filter))&&(i=e.filter);var o;if(e.arrayFormat in qt?o=e.arrayFormat:"indices"in e?o=e.indices?"indices":"repeat":o=E.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:E.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:E.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:E.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:E.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?E.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:E.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:E.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:E.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:E.encodeValuesOnly,filter:i,format:n,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:E.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:E.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:E.strictNullHandling}},zi=function(r,e){var t=r,n=Hi(e),a,i;typeof n.filter=="function"?(i=n.filter,t=i("",t)):I(n.filter)&&(i=n.filter,a=i);var o=[];if(typeof t!="object"||t===null)return"";var u=qt[n.arrayFormat],l=u==="comma"&&n.commaRoundTrip;a||(a=Object.keys(t)),n.sort&&a.sort(n.sort);for(var c=Ut(),s=0;s<a.length;++s){var p=a[s],f=t[p];n.skipNulls&&f===null||Wt(o,ji(f,p,u,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var d=o.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""},_=Bt,Ie=Object.prototype.hasOwnProperty,yr=Array.isArray,S={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:_.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},ki=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Ft=function(r,e,t){if(r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1)return r.split(",");if(e.throwOnLimitExceeded&&t>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return r},Ki="utf8=%26%2310003%3B",Vi="utf8=%E2%9C%93",Qi=function(e,t){var n={__proto__:null},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;a=a.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=t.parameterLimit===1/0?void 0:t.parameterLimit,o=a.split(t.delimiter,t.throwOnLimitExceeded?i+1:i);if(t.throwOnLimitExceeded&&o.length>i)throw new RangeError("Parameter limit exceeded. Only "+i+" parameter"+(i===1?"":"s")+" allowed.");var u=-1,l,c=t.charset;if(t.charsetSentinel)for(l=0;l<o.length;++l)o[l].indexOf("utf8=")===0&&(o[l]===Vi?c="utf-8":o[l]===Ki&&(c="iso-8859-1"),u=l,l=o.length);for(l=0;l<o.length;++l)if(l!==u){var s=o[l],p=s.indexOf("]="),f=p===-1?s.indexOf("="):p+1,d,y;if(f===-1?(d=t.decoder(s,S.decoder,c,"key"),y=t.strictNullHandling?null:""):(d=t.decoder(s.slice(0,f),S.decoder,c,"key"),d!==null&&(y=_.maybeMap(Ft(s.slice(f+1),t,yr(n[d])?n[d].length:0),function(g){return t.decoder(g,S.decoder,c,"value")}))),y&&t.interpretNumericEntities&&c==="iso-8859-1"&&(y=ki(String(y))),s.indexOf("[]=")>-1&&(y=yr(y)?[y]:y),t.comma&&yr(y)&&y.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");y=_.combine([],y,t.arrayLimit,t.plainObjects)}if(d!==null){var h=Ie.call(n,d);h&&(t.duplicates==="combine"||s.indexOf("[]=")>-1)?n[d]=_.combine(n[d],y,t.arrayLimit,t.plainObjects):(!h||t.duplicates==="last")&&(n[d]=y)}}return n},Ji=function(r,e,t,n){var a=0;if(r.length>0&&r[r.length-1]==="[]"){var i=r.slice(0,-1).join("");a=Array.isArray(e)&&e[i]?e[i].length:0}for(var o=n?e:Ft(e,t,a),u=r.length-1;u>=0;--u){var l,c=r[u];if(c==="[]"&&t.parseArrays)_.isOverflow(o)?l=o:l=t.allowEmptyArrays&&(o===""||t.strictNullHandling&&o===null)?[]:_.combine([],o,t.arrayLimit,t.plainObjects);else{l=t.plainObjects?{__proto__:null}:{};var s=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,p=t.decodeDotInKeys?s.replace(/%2E/g,"."):s,f=parseInt(p,10),d=!isNaN(f)&&c!==p&&String(f)===p&&f>=0&&t.parseArrays;if(!t.parseArrays&&p==="")l={0:o};else if(d&&f<t.arrayLimit)l=[],l[f]=o;else{if(d&&t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");d?(l[f]=o,_.markOverflow(l,f)):p!=="__proto__"&&(l[p]=o)}}o=l}return o},Xi=function(e,t){var n=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0)return!t.plainObjects&&Ie.call(Object.prototype,n)&&!t.allowPrototypes?void 0:[n];var a=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,o=a.exec(n),u=o?n.slice(0,o.index):n,l=[];if(u){if(!t.plainObjects&&Ie.call(Object.prototype,u)&&!t.allowPrototypes)return;l[l.length]=u}for(var c=0;(o=i.exec(n))!==null&&c<t.depth;){c+=1;var s=o[1].slice(1,-1);if(!t.plainObjects&&Ie.call(Object.prototype,s)&&!t.allowPrototypes)return;l[l.length]=o[1]}if(o){if(t.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");l[l.length]="["+n.slice(o.index)+"]"}return l},Yi=function(e,t,n,a){if(e){var i=Xi(e,n);if(i)return Ji(i,t,n,a)}},Zi=function(e){if(!e)return S;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=typeof e.charset>"u"?S.charset:e.charset,n=typeof e.duplicates>"u"?S.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var a=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:S.allowDots:!!e.allowDots;return{allowDots:a,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:S.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:S.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:S.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:S.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:S.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:S.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:S.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:S.decoder,delimiter:typeof e.delimiter=="string"||_.isRegExp(e.delimiter)?e.delimiter:S.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:S.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:S.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:S.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:S.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:S.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:S.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:S.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},eo=function(r,e){var t=Zi(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?{__proto__:null}:{};for(var n=typeof r=="string"?Qi(r,t):r,a=t.plainObjects?{__proto__:null}:{},i=Object.keys(n),o=0;o<i.length;++o){var u=i[o],l=Yi(u,n[u],t,typeof r=="string");a=_.merge(a,l,t)}return t.allowSparse===!0?a:_.compact(a)},ro=zi,to=eo,no=Tr,ao={formats:no,parse:to,stringify:ro};const io=Y.getDefaultExportFromCjs(ao);function ft(r){if(!Array.isArray(r))throw new TypeError("Middleware stack must be an array!");for(const e of r)if(typeof e!="function")throw new TypeError("Middleware must be composed of functions!");return function(e,t){let n=-1;return a(0);function a(i){if(i<=n)return Promise.reject(new Error("next() called multiple times"));n=i;let o=r[i];if(i===r.length&&(o=t),!o)return Promise.resolve();try{return Promise.resolve(o(e,a.bind(null,i+1)))}catch(u){return Promise.reject(u)}}}}const w={app:null,appPending:!0,appCb:[],services:new Map,servicePending:new Map,serviceCb:new Map,config:null,configPending:!1,configCb:[]};async function oo(r){if(w.config)return w.config;if(w.configPending)return new Promise(t=>{w.configCb.push(n=>t(n))});w.configPending=!0;const e=await r();return w.config=e,w.configCb.forEach(t=>t(e)),w.configCb=[],w.configPending=!1,e}class Gt{constructor(e={},t){P(this,"options");P(this,"apis",[]);P(this,"middlewares",[]);P(this,"defaultMiddlewares",[async(e,t)=>{try{await t()}catch(n){e.res.body=n.message||""}}]);P(this,"api404");P(this,"fnMiddleware");P(this,"getId");P(this,"extensions",new Map);P(this,"onDestroyCbs",[]);P(this,"config");P(this,"apiList");this.options={...e,baseUrl:e.baseUrl??"/"},this.options.baseUrl=this.options.baseUrl.split("/").map(a=>encodeURIComponent(a)).join("/"),this.middlewares.push(...this.defaultMiddlewares),this.middlewares.push(...e.middlewares||[]);const n=((e==null?void 0:e.apis)??[]).sort((a,i)=>{const o=i.path.substr(-1,1),u=o==="*"?0:o==="/"?.1:.2,l=a.path.substr(-1,1),c=l==="*"?0:l==="/"?.1:.2;return i.path.split("/").length+u-(a.path.split("/").length+c)}).map(a=>({...a,method:a.method??(e==null?void 0:e.defaultMethod)??"post"}));this.apiList=n,this.apis=n.filter(a=>!a.disabled),this.api404={path:"*",method:"all",action:(a,i)=>{throw i.res.status=404,Error("Not Found")}},this.fnMiddleware=ft(this.middlewares),this.getId=Y.useSoonIdGen({workerId:e.workId}),this.init(t)}async init(e){var t,n,a,i;try{if(this.options.config){const o=await this.options.config();this.config=o}await((n=(t=this.options)==null?void 0:t.onInit)==null?void 0:n.call(t,this)),w.app=this,w.appPending=!1,w.appCb.forEach(o=>o(this)),await((i=(a=this.options)==null?void 0:a.onReady)==null?void 0:i.call(a,this)),e==null||e(null,this)}catch(o){e==null||e(o,this)}}async fetchRaw(e,t,n){var f,d;const a=(n==null?void 0:n.url)??e,i=new URL(a,"http://localhost"),o=this.getId(),u={baseUrl:this.options.baseUrl??"",headers:(n==null?void 0:n.headers)??{},method:(n==null?void 0:n.method)??this.options.defaultMethod??"post",body:(n==null?void 0:n.body)??t,params:{},path:i.pathname,queryString:n!=null&&n.query?"?"+io.stringify(n.query):i.search,query:(n==null?void 0:n.query)??Object.fromEntries(i.searchParams),url:a,reqId:o,requestId:o,ip:(n==null?void 0:n.ip)??"",namespace:(n==null?void 0:n.namespace)??"default"};let l=this.api404;for(let y=0;y<this.apis.length;y++){const h=this.apis[y];if((h.namespace??"default")===u.namespace&&(h.method==="all"||h.method===((d=(f=u.method)==null?void 0:f.toLowerCase)==null?void 0:d.call(f)))){const A=Xt((this.options.baseUrl??"")+h.path,{loose:!1,trailing:!1})(u.path);if(A){u.params=A.params,l=h;break}}}const c={body:void 0,headers:{},status:200},s={app:this,currentAPI:l,req:u,request:u,reqId:o,requestId:o,res:c,response:c,platform:n==null?void 0:n.platform,config:this.config,meta:l.meta??{},service:{}},p=async()=>{var g,b;let y=u.body;if(l.bodySchema)if((g=l.bodySchema)!=null&&g.parse)try{y=l.bodySchema.parse(u.body)}catch(A){c.status=400;const m=(b=A==null?void 0:A.issues)==null?void 0:b[0];throw m&&(m.message=(m.path??[]).join(".")+" "+m.message),m?{...m,code:0}:new Error("参数错误")}else throw c.status=500,new Error("bodySchema must be ZodType");const h=await l.action(y,s);h!==void 0&&(c.body=h)};if(l.middlewares&&l.middlewares.length>0){const y=ft(l.middlewares),h=async()=>await y(s,p);n!=null&&n.noPublicMiddleware?await h:await this.fnMiddleware(s,h)}else n!=null&&n.noPublicMiddleware?await p():await this.fnMiddleware(s,p);return s.res}async fetch(e,t,n){return(await this.fetchRaw(e,t,n)).body}async action(e,t,n){const a={...n??{},noPublicMiddleware:!0},i=(n==null?void 0:n.url)??`${this.baseUrl}${e}`;return await this.fetch(i,t,a)}mount(e,t){this.extensions.set(e,t)}get(e){return this.extensions.get(e)}onUnloadService(e){this.onDestroyCbs.push(e)}async unloadService(){return Promise.all(this.onDestroyCbs.map(e=>e==null?void 0:e()))}get baseUrl(){return this.options.baseUrl??""}}const jt=Symbol("soon-api");function lo(r){const e={...r};return e._soon_symbol=jt,e}const Ht=Symbol("soon-service");function fo(r){async function e(){var i;const t=r.service;let n=w.services.get(t);if(n)return n;if(w.servicePending.get(t)){let o=w.serviceCb.get(t);return o||(o=[],w.serviceCb.set(t,o)),new Promise(u=>{o.push(l=>u(l))})}return w.servicePending.set(t,!0),await new Promise(o=>{w.app?o(1):w.appCb.push(()=>o(1))}),n=await t(w.app),w.services.set(t,n),(i=w.serviceCb.get(t))==null||i.forEach(o=>o(n)),w.serviceCb.delete(t),w.servicePending.delete(t),n}return e._soon_symbol=Ht,e.serviceName=(r==null?void 0:r.serviceName)??"",e.autoInject=(r==null?void 0:r.autoInject)??!1,e.enableClient=(r==null?void 0:r.enableClient)??!1,e}function uo(r){return r}function co(r){return async function(){return await oo(r)}}async function so(r){return await new Promise((e,t)=>{new Gt(r,(n,a)=>{if(n){t(n);return}e(a)})})}class po extends Error{constructor(t,n){super(t);P(this,"code");this.code=n}}class yo extends Error{constructor(t,n){super(t);P(this,"status");this.status=n}}function ho({pingTime:r=0,action:e}){let t=()=>null;const n=new xr(a=>{let i;r>0&&(i=setInterval(()=>{u.closed?clearInterval(i):a.next({event:"ping",message:`: ping
1
+ "use strict";var Ft=Object.defineProperty;var jt=(r,e,t)=>e in r?Ft(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var P=(r,e,t)=>jt(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ht=require("stream"),Y=require("./deps/soon-id-t25L9qRGGZ-zwi3vo6up.js"),zt=require("util");var j={};Object.defineProperty(j,"__esModule",{value:!0});j.TokenData=void 0;j.parse=Sr;j.compile=Xt;var kt=j.match=en;j.pathToRegexp=lt;const at="/",wr=r=>r,Kt=new RegExp("^\\p{XID_Continue}$","u"),ue="https://git.new/pathToRegexpError",Vt={"!":"!","@":"@",";":";",",":",","*":"*","+":"+","?":"?","{":"{","}":"}"};function Qt(r){const e=[...r],t=[];let n=0;for(;n<e.length;){const a=e[n],i=Vt[a];if(i){t.push({type:i,index:n++,value:a});continue}if(a==="\\"){t.push({type:"ESCAPED",index:n++,value:e[n++]});continue}if(a===":"){let o="";for(;Kt.test(e[++n]);)o+=e[n];if(!o)throw new TypeError(`Missing parameter name at ${n}`);t.push({type:"NAME",index:n,value:o});continue}if(a==="("){const o=n++;let f=1,l="";if(e[n]==="?")throw new TypeError(`Pattern cannot start with "?" at ${n}`);for(;n<e.length;){if(e[n]==="\\"){l+=e[n++]+e[n++];continue}if(e[n]===")"){if(f--,f===0){n++;break}}else if(e[n]==="("&&(f++,e[n+1]!=="?"))throw new TypeError(`Capturing groups are not allowed at ${n}`);l+=e[n++]}if(f)throw new TypeError(`Unbalanced pattern at ${o}`);if(!l)throw new TypeError(`Missing pattern at ${o}`);t.push({type:"PATTERN",index:n,value:l});continue}t.push({type:"CHAR",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),new Jt(t)}class Jt{constructor(e){this.tokens=e,this.index=0}peek(){return this.tokens[this.index]}tryConsume(e){const t=this.peek();if(t.type===e)return this.index++,t.value}consume(e){const t=this.tryConsume(e);if(t!==void 0)return t;const{type:n,index:a}=this.peek();throw new TypeError(`Unexpected ${n} at ${a}, expected ${e}: ${ue}`)}text(){let e="",t;for(;t=this.tryConsume("CHAR")||this.tryConsume("ESCAPED");)e+=t;return e}modifier(){return this.tryConsume("?")||this.tryConsume("*")||this.tryConsume("+")}}class De{constructor(e,t){this.tokens=e,this.delimiter=t}}j.TokenData=De;function Sr(r,e={}){const{encodePath:t=wr,delimiter:n=t(at)}=e,a=[],i=Qt(r);let o=0;do{const f=i.text();f&&a.push(t(f));const l=i.tryConsume("NAME"),c=i.tryConsume("PATTERN");if(l||c){a.push({name:l||String(o++),pattern:c});const u=i.peek();if(u.type==="*")throw new TypeError(`Unexpected * at ${u.index}, you probably want \`/*\` or \`{/:foo}*\`: ${ue}`);continue}if(i.tryConsume("*")){a.push({name:String(o++),pattern:`(?:(?!${Z(n)}).)*`,modifier:"*",separator:n});continue}if(i.tryConsume("{")){const u=i.text(),d=i.tryConsume("NAME"),y=i.tryConsume("PATTERN"),h=i.text(),g=i.tryConsume(";")&&i.text();i.consume("}");const $=i.modifier();a.push({name:d||(y?String(o++):""),prefix:t(u),suffix:t(h),pattern:y,modifier:$,separator:g});continue}i.consume("END");break}while(!0);return new De(a,n)}function Xt(r,e={}){const t=r instanceof De?r:Sr(r,e);return Zt(t,e)}function Yt(r,e){if(typeof r=="string")return()=>r;const t=e||wr,n=r.modifier==="+"||r.modifier==="*",a=r.modifier==="?"||r.modifier==="*",{prefix:i="",suffix:o="",separator:f=o+i}=r;if(e&&n){const c=(p,u)=>{if(typeof p!="string")throw new TypeError(`Expected "${r.name}/${u}" to be a string`);return t(p)},s=p=>{if(!Array.isArray(p))throw new TypeError(`Expected "${r.name}" to be an array`);return p.length===0?"":i+p.map(c).join(f)+o};return a?p=>{const u=p[r.name];return u==null?"":u.length?s(u):""}:p=>{const u=p[r.name];return s(u)}}const l=c=>{if(typeof c!="string")throw new TypeError(`Expected "${r.name}" to be a string`);return i+t(c)+o};return a?c=>{const s=c[r.name];return s==null?"":l(s)}:c=>{const s=c[r.name];return l(s)}}function Zt(r,e){const{encode:t=encodeURIComponent,loose:n=!0,validate:a=!0,strict:i=!1}=e,o=it(e),f=br(n,r.delimiter),l=ot(r,f,[],o,i),c=r.tokens.map((s,p)=>{const u=Yt(s,t);if(!a||typeof s=="string")return u;const d=new RegExp(`^${l[p]}$`,o);return y=>{const h=u(y);if(!d.test(h))throw new TypeError(`Invalid value for "${s.name}": ${JSON.stringify(h)}`);return h}});return function(p={}){let u="";for(const d of c)u+=d(p);return u}}function en(r,e={}){const{decode:t=decodeURIComponent,loose:n=!0,delimiter:a=at}=e,i=lt(r,e),o=br(n,a),f=i.keys.map(l=>{if(t&&(l.modifier==="+"||l.modifier==="*")){const{prefix:c="",suffix:s="",separator:p=s+c}=l,u=new RegExp(o(p),"g");return d=>d.split(u).map(t)}return t||wr});return function(c){const s=i.exec(c);if(!s)return!1;const{0:p,index:u}=s,d=Object.create(null);for(let y=1;y<s.length;y++){if(s[y]===void 0)continue;const h=i.keys[y-1],g=f[y-1];d[h.name]=g(s[y])}return{path:p,index:u,params:d}}}function Z(r){return r.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}function rn(r,e){const t=Z(r);return e?`(?:${t})+(?!${t})`:t}function br(r,e){if(!r)return Z;const t=new RegExp(`(?:(?!${Z(e)}).)+|(.)`,"g");return n=>n.replace(t,rn)}function it(r){return r.sensitive?"":"i"}function Cr(r,e,t,n){const a=r instanceof De?r:Sr(r,n),{trailing:i=!0,loose:o=!0,start:f=!0,end:l=!0,strict:c=!1}=n,s=br(o,a.delimiter),p=ot(a,s,e,t,c);let u=f?"^":"";return u+=p.join(""),i&&(u+=`(?:${s(a.delimiter)}$)?`),u+=l?"$":`(?=${Z(a.delimiter)}|$)`,u}function ot(r,e,t,n,a){const i=`(?:(?!${Z(r.delimiter)}).)+?`;let o="",f=!0;return r.tokens.map(l=>{if(typeof l=="string")return o=l,e(l);const{prefix:c="",suffix:s="",separator:p=s+c,modifier:u=""}=l,d=e(c),y=e(s);if(l.name){const h=l.pattern?`(?:${l.pattern})`:i,g=tn(h,l.name,n);if(f||(f=He(g,c||o)),!f)throw new TypeError(`Ambiguous pattern for "${l.name}": ${ue}`);if(f=!a||He(g,s),o="",t.push(l),u==="+"||u==="*"){const $=u==="*"?"?":"",E=e(p);if(!E)throw new TypeError(`Missing separator for "${l.name}": ${ue}`);if(f||(f=!a||He(g,p)),!f)throw new TypeError(`Ambiguous pattern for "${l.name}" separator: ${ue}`);return f=!a,`(?:${d}(${h}(?:${E}${h})*)${y})${$}`}return`(?:${d}(${h})${y})${u}`}return`(?:${d}${y})${u}`})}function tn(r,e,t){try{return new RegExp(`^${r}$`,t)}catch(n){throw new TypeError(`Invalid pattern for "${e}": ${n.message}`)}}function He(r,e){return e?!r.test(e):!1}function lt(r,e={}){const t=[],n=it(e);if(Array.isArray(r)){const i=r.map(o=>Cr(o,t,n,e));return Object.assign(new RegExp(i.join("|")),{keys:t})}const a=Cr(r,t,n,e);return Object.assign(new RegExp(a),{keys:t})}var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.Observable=void 0;const ft=r=>!!Symbol[r],Er=r=>ft(r)?Symbol[r]:"@@"+r,nn=Er("iterator"),sr=Er("observable"),ut=Er("species");function _e(r,e){let t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function oe(r){let e=r.constructor;return e!==void 0&&(e=e[ut],e===null&&(e=void 0)),e!==void 0?e:Le}function an(r){return r instanceof Le}function ee(r){ee.log?ee.log(r):setTimeout(()=>{throw r})}function Ae(r){Promise.resolve().then(()=>{try{r()}catch(e){ee(e)}})}function ct(r){let e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{let t=_e(e,"unsubscribe");t&&t.call(e)}}catch(t){ee(t)}}function pr(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function on(r){let e=r._queue;if(e){r._queue=void 0,r._state="ready";for(let t=0;t<e.length&&(st(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function st(r,e,t){r._state="running";let n=r._observer;try{let a=_e(n,e);switch(e){case"next":a&&a.call(n,t);break;case"error":if(pr(r),a)a.call(n,t);else throw t;break;case"complete":pr(r),a&&a.call(n);break}}catch(a){ee(a)}r._state==="closed"?ct(r):r._state==="running"&&(r._state="ready")}function ze(r,e,t){if(r._state!=="closed"){if(r._state==="buffering"){r._queue.push({type:e,value:t});return}if(r._state!=="ready"){r._state="buffering",r._queue=[{type:e,value:t}],Ae(()=>on(r));return}st(r,e,t)}}class ln{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,a={get closed(){return n._state==="closed"},next(i){ze(n,"next",i)},error(i){ze(n,"error",i)},complete(){ze(n,"complete")}};try{this._cleanup=t.call(void 0,a)}catch(i){a.error(i)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(pr(this),ct(this))}}let Le=class $e{constructor(e){if(!(this instanceof $e))throw new TypeError("Observable cannot be called as a function");if(typeof e!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return(typeof e!="object"||e===null)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new ln(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if(typeof e!="function"){n(new TypeError(e+" is not a function"));return}function a(){i.unsubscribe(),t()}let i=this.subscribe({next(o){try{e(o,a)}catch(f){n(f),i.unsubscribe()}},error:n,complete:t})})}map(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this);return new t(n=>this.subscribe({next(a){try{a=e(a)}catch(i){return n.error(i)}n.next(a)},error(a){n.error(a)},complete(){n.complete()}}))}filter(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this);return new t(n=>this.subscribe({next(a){try{if(!e(a))return}catch(i){return n.error(i)}n.next(a)},error(a){n.error(a)},complete(){n.complete()}}))}reduce(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this),n=arguments.length>1,a=!1,o=arguments[1];return new t(f=>this.subscribe({next(l){let c=!a;if(a=!0,!c||n)try{o=e(o,l)}catch(s){return f.error(s)}else o=l},error(l){f.error(l)},complete(){if(!a&&!n)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(o),f.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=oe(this);return new t(n=>{let a,i=0;function o(f){a=f.subscribe({next(l){n.next(l)},error(l){n.error(l)},complete(){i===e.length?(a=void 0,n.complete()):o(t.from(e[i++]))}})}return o(this),()=>{a&&(a.unsubscribe(),a=void 0)}})}flatMap(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let t=oe(this);return new t(n=>{let a=[],i=this.subscribe({next(f){if(e)try{f=e(f)}catch(c){return n.error(c)}let l=t.from(f).subscribe({next(c){n.next(c)},error(c){n.error(c)},complete(){let c=a.indexOf(l);c>=0&&a.splice(c,1),o()}});a.push(l)},error(f){n.error(f)},complete(){o()}});function o(){i.closed&&a.length===0&&n.complete()}return()=>{a.forEach(f=>f.unsubscribe()),i.unsubscribe()}})}[sr](){return this}static from(e){let t=typeof this=="function"?this:$e;if(e==null)throw new TypeError(e+" is not an object");let n=_e(e,sr);if(n){let a=n.call(e);if(Object(a)!==a)throw new TypeError(a+" is not an object");return an(a)&&a.constructor===t?a:new t(i=>a.subscribe(i))}if(ft("iterator")&&(n=_e(e,nn),n))return new t(a=>{Ae(()=>{if(!a.closed){for(let i of n.call(e))if(a.next(i),a.closed)return;a.complete()}})});if(Array.isArray(e))return new t(a=>{Ae(()=>{if(!a.closed){for(let i=0;i<e.length;++i)if(a.next(e[i]),a.closed)return;a.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){let t=typeof this=="function"?this:$e;return new t(n=>{Ae(()=>{if(!n.closed){for(let a=0;a<e.length;++a)if(n.next(e[a]),n.closed)return;n.complete()}})})}static get[ut](){return this}};Ne.Observable=Le;Object.defineProperty(Le,Symbol("extensions"),{value:{symbol:sr,hostReportError:ee},configurable:!0});var fn=Ne.Observable;const Ar=Y.getDefaultExportFromCjs(fn);var ne=TypeError,un=zt.inspect,$r=typeof Map=="function"&&Map.prototype,ke=Object.getOwnPropertyDescriptor&&$r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Re=$r&&ke&&typeof ke.get=="function"?ke.get:null,Tr=$r&&Map.prototype.forEach,Pr=typeof Set=="function"&&Set.prototype,Ke=Object.getOwnPropertyDescriptor&&Pr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ce=Pr&&Ke&&typeof Ke.get=="function"?Ke.get:null,Mr=Pr&&Set.prototype.forEach,cn=typeof WeakMap=="function"&&WeakMap.prototype,ce=cn?WeakMap.prototype.has:null,sn=typeof WeakSet=="function"&&WeakSet.prototype,se=sn?WeakSet.prototype.has:null,pn=typeof WeakRef=="function"&&WeakRef.prototype,Dr=pn?WeakRef.prototype.deref:null,yn=Boolean.prototype.valueOf,dn=Object.prototype.toString,hn=Function.prototype.toString,mn=String.prototype.match,xr=String.prototype.slice,L=String.prototype.replace,vn=String.prototype.toUpperCase,Nr=String.prototype.toLowerCase,pt=RegExp.prototype.test,Lr=Array.prototype.concat,_=Array.prototype.join,gn=Array.prototype.slice,Ur=Math.floor,yr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ve=Object.getOwnPropertySymbols,dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,re=typeof Symbol=="function"&&typeof Symbol.iterator=="object",pe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===re||!0)?Symbol.toStringTag:null,yt=Object.prototype.propertyIsEnumerable,Br=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function qr(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||pt.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Ur(-r):Ur(r);if(n!==r){var a=String(n),i=xr.call(e,a.length+1);return L.call(a,t,"$&_")+"."+L.call(L.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return L.call(e,t,"$&_")}var hr=un,Wr=hr.custom,Gr=mt(Wr)?Wr:null,dt={__proto__:null,double:'"',single:"'"},wn={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Ue=function r(e,t,n,a){var i=t||{};if(T(i,"quoteStyle")&&!T(dt,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(T(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=T(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(T(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(T(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return gt(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return f?qr(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return f?qr(e,c):c}var s=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=s&&s>0&&typeof e=="object")return mr(e)?"[Array]":"[Object]";var p=Un(i,n);if(typeof a>"u")a=[];else if(vt(a,e)>=0)return"[Circular]";function u(x,N,C){if(N&&(a=gn.call(a),a.push(N)),C){var ie={depth:i.depth};return T(i,"quoteStyle")&&(ie.quoteStyle=i.quoteStyle),r(x,ie,n+1,a)}return r(x,i,n+1,a)}if(typeof e=="function"&&!Fr(e)){var d=In(e),y=be(e,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(y.length>0?" { "+_.call(y,", ")+" }":"")}if(mt(e)){var h=re?L.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):dr.call(e);return typeof e=="object"&&!re?le(h):h}if(Dn(e)){for(var g="<"+Nr.call(String(e.nodeName)),$=e.attributes||[],E=0;E<$.length;E++)g+=" "+$[E].name+"="+ht(Sn($[E].value),"double",i);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+Nr.call(String(e.nodeName))+">",g}if(mr(e)){if(e.length===0)return"[]";var m=be(e,u);return p&&!Ln(m)?"["+vr(m,p)+"]":"[ "+_.call(m,", ")+" ]"}if(En(e)){var M=be(e,u);return!("cause"in Error.prototype)&&"cause"in e&&!yt.call(e,"cause")?"{ ["+String(e)+"] "+_.call(Lr.call("[cause]: "+u(e.cause),M),", ")+" }":M.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+_.call(M,", ")+" }"}if(typeof e=="object"&&o){if(Gr&&typeof e[Gr]=="function"&&hr)return hr(e,{depth:s-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(_n(e)){var B=[];return Tr&&Tr.call(e,function(x,N){B.push(u(N,e,!0)+" => "+u(x,e))}),jr("Map",Re.call(e),B,p)}if(Tn(e)){var ae=[];return Mr&&Mr.call(e,function(x){ae.push(u(x,e))}),jr("Set",Ce.call(e),ae,p)}if(Rn(e))return Qe("WeakMap");if(Mn(e))return Qe("WeakSet");if(Cn(e))return Qe("WeakRef");if($n(e))return le(u(Number(e)));if(xn(e))return le(u(yr.call(e)));if(Pn(e))return le(yn.call(e));if(An(e))return le(u(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Y.commonjsGlobal<"u"&&e===Y.commonjsGlobal)return"{ [object globalThis] }";if(!bn(e)&&!Fr(e)){var z=be(e,u),we=Br?Br(e)===Object.prototype:e instanceof Object||e.constructor===Object,q=e instanceof Object?"":"null prototype",D=!we&&pe&&Object(e)===e&&pe in e?xr.call(U(e),8,-1):q?"Object":"",Se=we||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",k=Se+(D||q?"["+_.call(Lr.call([],D||[],q||[]),": ")+"] ":"");return z.length===0?k+"{}":p?k+"{"+vr(z,p)+"}":k+"{ "+_.call(z,", ")+" }"}return String(e)};function ht(r,e,t){var n=t.quoteStyle||e,a=dt[n];return a+r+a}function Sn(r){return L.call(String(r),/"/g,"&quot;")}function H(r){return!pe||!(typeof r=="object"&&(pe in r||typeof r[pe]<"u"))}function mr(r){return U(r)==="[object Array]"&&H(r)}function bn(r){return U(r)==="[object Date]"&&H(r)}function Fr(r){return U(r)==="[object RegExp]"&&H(r)}function En(r){return U(r)==="[object Error]"&&H(r)}function An(r){return U(r)==="[object String]"&&H(r)}function $n(r){return U(r)==="[object Number]"&&H(r)}function Pn(r){return U(r)==="[object Boolean]"&&H(r)}function mt(r){if(re)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!dr)return!1;try{return dr.call(r),!0}catch{}return!1}function xn(r){if(!r||typeof r!="object"||!yr)return!1;try{return yr.call(r),!0}catch{}return!1}var On=Object.prototype.hasOwnProperty||function(r){return r in this};function T(r,e){return On.call(r,e)}function U(r){return dn.call(r)}function In(r){if(r.name)return r.name;var e=mn.call(hn.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function vt(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function _n(r){if(!Re||!r||typeof r!="object")return!1;try{Re.call(r);try{Ce.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Rn(r){if(!ce||!r||typeof r!="object")return!1;try{ce.call(r,ce);try{se.call(r,se)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Cn(r){if(!Dr||!r||typeof r!="object")return!1;try{return Dr.call(r),!0}catch{}return!1}function Tn(r){if(!Ce||!r||typeof r!="object")return!1;try{Ce.call(r);try{Re.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Mn(r){if(!se||!r||typeof r!="object")return!1;try{se.call(r,se);try{ce.call(r,ce)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Dn(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function gt(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return gt(xr.call(r,0,e.maxStringLength),e)+n}var a=wn[e.quoteStyle||"single"];a.lastIndex=0;var i=L.call(L.call(r,a,"\\$1"),/[\x00-\x1f]/g,Nn);return ht(i,"single",e)}function Nn(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+vn.call(e.toString(16))}function le(r){return"Object("+r+")"}function Qe(r){return r+" { ? }"}function jr(r,e,t,n){var a=n?vr(t,n):_.call(t,", ");return r+" ("+e+") {"+a+"}"}function Ln(r){for(var e=0;e<r.length;e++)if(vt(r[e],`
2
+ `)>=0)return!1;return!0}function Un(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=_.call(Array(r.indent+1)," ");else return null;return{base:t,prev:_.call(Array(e+1),t)}}function vr(r,e){if(r.length===0)return"";var t=`
3
+ `+e.prev+e.base;return t+_.call(r,","+t)+`
4
+ `+e.prev}function be(r,e){var t=mr(r),n=[];if(t){n.length=r.length;for(var a=0;a<r.length;a++)n[a]=T(r,a)?e(r[a],r):""}var i=typeof Ve=="function"?Ve(r):[],o;if(re){o={};for(var f=0;f<i.length;f++)o["$"+i[f]]=i[f]}for(var l in r)T(r,l)&&(t&&String(Number(l))===l&&l<r.length||re&&o["$"+l]instanceof Symbol||(pt.call(/[^\w$]/,l)?n.push(e(l,r)+": "+e(r[l],r)):n.push(l+": "+e(r[l],r))));if(typeof Ve=="function")for(var c=0;c<i.length;c++)yt.call(r,i[c])&&n.push("["+e(i[c])+"]: "+e(r[i[c]],r));return n}var Bn=Ue,qn=ne,Be=function(r,e,t){for(var n=r,a;(a=n.next)!=null;n=a)if(a.key===e)return n.next=a.next,t||(a.next=r.next,r.next=a),a},Wn=function(r,e){if(r){var t=Be(r,e);return t&&t.value}},Gn=function(r,e,t){var n=Be(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Fn=function(r,e){return r?!!Be(r,e):!1},jn=function(r,e){if(r)return Be(r,e,!0)},Hn=function(){var e,t={assert:function(n){if(!t.has(n))throw new qn("Side channel does not contain "+Bn(n))},delete:function(n){var a=e&&e.next,i=jn(e,n);return i&&a&&a===i&&(e=void 0),!!i},get:function(n){return Wn(e,n)},has:function(n){return Fn(e,n)},set:function(n,a){e||(e={next:void 0}),Gn(e,n,a)}};return t},wt=Object,zn=Error,kn=EvalError,Kn=RangeError,Vn=ReferenceError,Qn=SyntaxError,Jn=URIError,Xn=Math.abs,Yn=Math.floor,Zn=Math.max,ea=Math.min,ra=Math.pow,ta=Math.round,na=Number.isNaN||function(e){return e!==e},aa=na,ia=function(e){return aa(e)||e===0?e:e<0?-1:1},oa=Object.getOwnPropertyDescriptor,Pe=oa;if(Pe)try{Pe([],"length")}catch{Pe=null}var St=Pe,xe=Object.defineProperty||!1;if(xe)try{xe({},"a",{value:1})}catch{xe=!1}var la=xe,Je,Hr;function fa(){return Hr||(Hr=1,Je=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(var i in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(e,t);if(f.value!==a||f.enumerable!==!0)return!1}return!0}),Je}var Xe,zr;function ua(){if(zr)return Xe;zr=1;var r=typeof Symbol<"u"&&Symbol,e=fa();return Xe=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Xe}var Ye,kr;function bt(){return kr||(kr=1,Ye=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ye}var Ze,Kr;function Et(){if(Kr)return Ze;Kr=1;var r=wt;return Ze=r.getPrototypeOf||null,Ze}var ca="Function.prototype.bind called on incompatible ",sa=Object.prototype.toString,pa=Math.max,ya="[object Function]",Vr=function(e,t){for(var n=[],a=0;a<e.length;a+=1)n[a]=e[a];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},da=function(e,t){for(var n=[],a=t,i=0;a<e.length;a+=1,i+=1)n[i]=e[a];return n},ha=function(r,e){for(var t="",n=0;n<r.length;n+=1)t+=r[n],n+1<r.length&&(t+=e);return t},ma=function(e){var t=this;if(typeof t!="function"||sa.apply(t)!==ya)throw new TypeError(ca+t);for(var n=da(arguments,1),a,i=function(){if(this instanceof a){var s=t.apply(this,Vr(n,arguments));return Object(s)===s?s:this}return t.apply(e,Vr(n,arguments))},o=pa(0,t.length-n.length),f=[],l=0;l<o;l++)f[l]="$"+l;if(a=Function("binder","return function ("+ha(f,",")+"){ return binder.apply(this,arguments); }")(i),t.prototype){var c=function(){};c.prototype=t.prototype,a.prototype=new c,c.prototype=null}return a},va=ma,qe=Function.prototype.bind||va,Or=Function.prototype.call,er,Qr;function At(){return Qr||(Qr=1,er=Function.prototype.apply),er}var ga=typeof Reflect<"u"&&Reflect&&Reflect.apply,wa=qe,Sa=At(),ba=Or,Ea=ga,Aa=Ea||wa.call(ba,Sa),$a=qe,Pa=ne,xa=Or,Oa=Aa,$t=function(e){if(e.length<1||typeof e[0]!="function")throw new Pa("a function is required");return Oa($a,xa,e)},rr,Jr;function Ia(){if(Jr)return rr;Jr=1;var r=$t,e=St,t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&e&&e(Object.prototype,"__proto__"),a=Object,i=a.getPrototypeOf;return rr=n&&typeof n.get=="function"?r([n.get]):typeof i=="function"?function(f){return i(f==null?f:a(f))}:!1,rr}var tr,Xr;function _a(){if(Xr)return tr;Xr=1;var r=bt(),e=Et(),t=Ia();return tr=r?function(a){return r(a)}:e?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return e(a)}:t?function(a){return t(a)}:null,tr}var nr,Yr;function Ra(){if(Yr)return nr;Yr=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=qe;return nr=t.call(r,e),nr}var v,Ca=wt,Ta=zn,Ma=kn,Da=Kn,Na=Vn,te=Qn,X=ne,La=Jn,Ua=Xn,Ba=Yn,qa=Zn,Wa=ea,Ga=ra,Fa=ta,ja=ia,Pt=Function,ar=function(r){try{return Pt('"use strict"; return ('+r+").constructor;")()}catch{}},he=St,Ha=la,ir=function(){throw new X},za=he?function(){try{return arguments.callee,ir}catch{try{return he(arguments,"callee").get}catch{return ir}}}():ir,K=ua()(),A=_a(),ka=Et(),Ka=bt(),xt=At(),me=Or,Q={},Va=typeof Uint8Array>"u"||!A?v:A(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":K&&A?A([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":Q,"%AsyncGenerator%":Q,"%AsyncGeneratorFunction%":Q,"%AsyncIteratorPrototype%":Q,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ta,"%eval%":eval,"%EvalError%":Ma,"%Float16Array%":typeof Float16Array>"u"?v:Float16Array,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":Pt,"%GeneratorFunction%":Q,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":K&&A?A(A([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!K||!A?v:A(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ca,"%Object.getOwnPropertyDescriptor%":he,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":Da,"%ReferenceError%":Na,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!K||!A?v:A(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":K&&A?A(""[Symbol.iterator]()):v,"%Symbol%":K?Symbol:v,"%SyntaxError%":te,"%ThrowTypeError%":za,"%TypedArray%":Va,"%TypeError%":X,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":La,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet,"%Function.prototype.call%":me,"%Function.prototype.apply%":xt,"%Object.defineProperty%":Ha,"%Object.getPrototypeOf%":ka,"%Math.abs%":Ua,"%Math.floor%":Ba,"%Math.max%":qa,"%Math.min%":Wa,"%Math.pow%":Ga,"%Math.round%":Fa,"%Math.sign%":ja,"%Reflect.getPrototypeOf%":Ka};if(A)try{null.error}catch(r){var Qa=A(A(r));F["%Error.prototype%"]=Qa}var Ja=function r(e){var t;if(e==="%AsyncFunction%")t=ar("async function () {}");else if(e==="%GeneratorFunction%")t=ar("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=ar("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&A&&(t=A(a.prototype))}return F[e]=t,t},Zr={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ve=qe,Te=Ra(),Xa=ve.call(me,Array.prototype.concat),Ya=ve.call(xt,Array.prototype.splice),et=ve.call(me,String.prototype.replace),Me=ve.call(me,String.prototype.slice),Za=ve.call(me,RegExp.prototype.exec),ei=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ri=/\\(\\)?/g,ti=function(e){var t=Me(e,0,1),n=Me(e,-1);if(t==="%"&&n!=="%")throw new te("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new te("invalid intrinsic syntax, expected opening `%`");var a=[];return et(e,ei,function(i,o,f,l){a[a.length]=f?et(l,ri,"$1"):o||i}),a},ni=function(e,t){var n=e,a;if(Te(Zr,n)&&(a=Zr[n],n="%"+a[0]+"%"),Te(F,n)){var i=F[n];if(i===Q&&(i=Ja(n)),typeof i>"u"&&!t)throw new X("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:i}}throw new te("intrinsic "+e+" does not exist!")},Ir=function(e,t){if(typeof e!="string"||e.length===0)throw new X("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new X('"allowMissing" argument must be a boolean');if(Za(/^%?[^%]*%?$/,e)===null)throw new te("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ti(e),a=n.length>0?n[0]:"",i=ni("%"+a+"%",t),o=i.name,f=i.value,l=!1,c=i.alias;c&&(a=c[0],Ya(n,Xa([0,1],c)));for(var s=1,p=!0;s<n.length;s+=1){var u=n[s],d=Me(u,0,1),y=Me(u,-1);if((d==='"'||d==="'"||d==="`"||y==='"'||y==="'"||y==="`")&&d!==y)throw new te("property names with quotes must have matching quotes");if((u==="constructor"||!p)&&(l=!0),a+="."+u,o="%"+a+"%",Te(F,o))f=F[o];else if(f!=null){if(!(u in f)){if(!t)throw new X("base intrinsic for "+e+" exists, but the property is not available.");return}if(he&&s+1>=n.length){var h=he(f,u);p=!!h,p&&"get"in h&&!("originalValue"in h.get)?f=h.get:f=f[u]}else p=Te(f,u),f=f[u];p&&!l&&(F[o]=f)}}return f},Ot=Ir,It=$t,ai=It([Ot("%String.prototype.indexOf%")]),_t=function(e,t){var n=Ot(e,!!t);return typeof n=="function"&&ai(e,".prototype.")>-1?It([n]):n},ii=Ir,ge=_t,oi=Ue,li=ne,rt=ii("%Map%",!0),fi=ge("Map.prototype.get",!0),ui=ge("Map.prototype.set",!0),ci=ge("Map.prototype.has",!0),si=ge("Map.prototype.delete",!0),pi=ge("Map.prototype.size",!0),Rt=!!rt&&function(){var e,t={assert:function(n){if(!t.has(n))throw new li("Side channel does not contain "+oi(n))},delete:function(n){if(e){var a=si(e,n);return pi(e)===0&&(e=void 0),a}return!1},get:function(n){if(e)return fi(e,n)},has:function(n){return e?ci(e,n):!1},set:function(n,a){e||(e=new rt),ui(e,n,a)}};return t},yi=Ir,We=_t,di=Ue,Ee=Rt,hi=ne,V=yi("%WeakMap%",!0),mi=We("WeakMap.prototype.get",!0),vi=We("WeakMap.prototype.set",!0),gi=We("WeakMap.prototype.has",!0),wi=We("WeakMap.prototype.delete",!0),Si=V?function(){var e,t,n={assert:function(a){if(!n.has(a))throw new hi("Side channel does not contain "+di(a))},delete:function(a){if(V&&a&&(typeof a=="object"||typeof a=="function")){if(e)return wi(e,a)}else if(Ee&&t)return t.delete(a);return!1},get:function(a){return V&&a&&(typeof a=="object"||typeof a=="function")&&e?mi(e,a):t&&t.get(a)},has:function(a){return V&&a&&(typeof a=="object"||typeof a=="function")&&e?gi(e,a):!!t&&t.has(a)},set:function(a,i){V&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new V),vi(e,a,i)):Ee&&(t||(t=Ee()),t.set(a,i))}};return n}:Ee,bi=ne,Ei=Ue,Ai=Hn,$i=Rt,Pi=Si,xi=Pi||$i||Ai,Ct=function(){var e,t={assert:function(n){if(!t.has(n))throw new bi("Side channel does not contain "+Ei(n))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,a){e||(e=xi()),e.set(n,a)}};return t},Oi=String.prototype.replace,Ii=/%20/g,or={RFC1738:"RFC1738",RFC3986:"RFC3986"},_r={default:or.RFC3986,formatters:{RFC1738:function(r){return Oi.call(r,Ii,"+")},RFC3986:function(r){return String(r)}},RFC1738:or.RFC1738,RFC3986:or.RFC3986},_i=_r,Ri=Ct,lr=Object.prototype.hasOwnProperty,W=Array.isArray,Ge=Ri(),J=function(e,t){return Ge.set(e,t),e},G=function(e){return Ge.has(e)},fe=function(e){return Ge.get(e)},gr=function(e,t){Ge.set(e,t)},O=function(){for(var r=[],e=0;e<256;++e)r[r.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return r}(),Ci=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(W(n)){for(var a=[],i=0;i<n.length;++i)typeof n[i]<"u"&&(a[a.length]=n[i]);t.obj[t.prop]=a}}},ye=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},a=0;a<e.length;++a)typeof e[a]<"u"&&(n[a]=e[a]);return n},Ti=function r(e,t,n){if(!t)return e;if(typeof t!="object"&&typeof t!="function"){if(W(e)){var a=e.length;if(n&&typeof n.arrayLimit=="number"&&a>n.arrayLimit)return J(ye(e.concat(t),n),a);e[a]=t}else if(e&&typeof e=="object")if(G(e)){var i=fe(e)+1;e[i]=t,gr(e,i)}else{if(n&&n.strictMerge)return[e,t];(n&&(n.plainObjects||n.allowPrototypes)||!lr.call(Object.prototype,t))&&(e[t]=!0)}else return[e,t];return e}if(!e||typeof e!="object"){if(G(t)){for(var o=Object.keys(t),f=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<o.length;l++){var c=parseInt(o[l],10);f[c+1]=t[o[l]]}return J(f,fe(t)+1)}var s=[e].concat(t);return n&&typeof n.arrayLimit=="number"&&s.length>n.arrayLimit?J(ye(s,n),s.length-1):s}var p=e;return W(e)&&!W(t)&&(p=ye(e,n)),W(e)&&W(t)?(t.forEach(function(u,d){if(lr.call(e,d)){var y=e[d];y&&typeof y=="object"&&u&&typeof u=="object"?e[d]=r(y,u,n):e[e.length]=u}else e[d]=u}),e):Object.keys(t).reduce(function(u,d){var y=t[d];if(lr.call(u,d)?u[d]=r(u[d],y,n):u[d]=y,G(t)&&!G(u)&&J(u,fe(t)),G(u)){var h=parseInt(d,10);String(h)===d&&h>=0&&h>fe(u)&&gr(u,h)}return u},p)},Mi=function(e,t){return Object.keys(t).reduce(function(n,a){return n[a]=t[a],n},e)},Di=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},fr=1024,Ni=function(e,t,n,a,i){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var f="",l=0;l<o.length;l+=fr){for(var c=o.length>=fr?o.slice(l,l+fr):o,s=[],p=0;p<c.length;++p){var u=c.charCodeAt(p);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===_i.RFC1738&&(u===40||u===41)){s[s.length]=c.charAt(p);continue}if(u<128){s[s.length]=O[u];continue}if(u<2048){s[s.length]=O[192|u>>6]+O[128|u&63];continue}if(u<55296||u>=57344){s[s.length]=O[224|u>>12]+O[128|u>>6&63]+O[128|u&63];continue}p+=1,u=65536+((u&1023)<<10|c.charCodeAt(p)&1023),s[s.length]=O[240|u>>18]+O[128|u>>12&63]+O[128|u>>6&63]+O[128|u&63]}f+=s.join("")}return f},Li=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],a=0;a<t.length;++a)for(var i=t[a],o=i.obj[i.prop],f=Object.keys(o),l=0;l<f.length;++l){var c=f[l],s=o[c];typeof s=="object"&&s!==null&&n.indexOf(s)===-1&&(t[t.length]={obj:o,prop:c},n[n.length]=s)}return Ci(t),e},Ui=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Bi=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},qi=function(e,t,n,a){if(G(e)){var i=fe(e)+1;return e[i]=t,gr(e,i),e}var o=[].concat(e,t);return o.length>n?J(ye(o,{plainObjects:a}),o.length-1):o},Wi=function(e,t){if(W(e)){for(var n=[],a=0;a<e.length;a+=1)n[n.length]=t(e[a]);return n}return t(e)},Tt={arrayToObject:ye,assign:Mi,combine:qi,compact:Li,decode:Di,encode:Ni,isBuffer:Bi,isOverflow:G,isRegExp:Ui,markOverflow:J,maybeMap:Wi,merge:Ti},Mt=Ct,Oe=Tt,de=_r,Gi=Object.prototype.hasOwnProperty,Dt={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},I=Array.isArray,Fi=Array.prototype.push,Nt=function(r,e){Fi.apply(r,I(e)?e:[e])},ji=Date.prototype.toISOString,tt=de.default,b={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Oe.encode,encodeValuesOnly:!1,filter:void 0,format:tt,formatter:de.formatters[tt],indices:!1,serializeDate:function(e){return ji.call(e)},skipNulls:!1,strictNullHandling:!1},Hi=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ur={},zi=function r(e,t,n,a,i,o,f,l,c,s,p,u,d,y,h,g,$,E){for(var m=e,M=E,B=0,ae=!1;(M=M.get(ur))!==void 0&&!ae;){var z=M.get(e);if(B+=1,typeof z<"u"){if(z===B)throw new RangeError("Cyclic object value");ae=!0}typeof M.get(ur)>"u"&&(B=0)}if(typeof s=="function"?m=s(t,m):m instanceof Date?m=d(m):n==="comma"&&I(m)&&(m=Oe.maybeMap(m,function(je){return je instanceof Date?d(je):je})),m===null){if(o)return c&&!g?c(t,b.encoder,$,"key",y):t;m=""}if(Hi(m)||Oe.isBuffer(m)){if(c){var we=g?t:c(t,b.encoder,$,"key",y);return[h(we)+"="+h(c(m,b.encoder,$,"value",y))]}return[h(t)+"="+h(String(m))]}var q=[];if(typeof m>"u")return q;var D;if(n==="comma"&&I(m))g&&c&&(m=Oe.maybeMap(m,c)),D=[{value:m.length>0?m.join(",")||null:void 0}];else if(I(s))D=s;else{var Se=Object.keys(m);D=p?Se.sort(p):Se}var k=l?String(t).replace(/\./g,"%2E"):String(t),x=a&&I(m)&&m.length===1?k+"[]":k;if(i&&I(m)&&m.length===0)return x+"[]";for(var N=0;N<D.length;++N){var C=D[N],ie=typeof C=="object"&&C&&typeof C.value<"u"?C.value:m[C];if(!(f&&ie===null)){var Fe=u&&l?String(C).replace(/\./g,"%2E"):String(C),Gt=I(m)?typeof n=="function"?n(x,Fe):x:x+(u?"."+Fe:"["+Fe+"]");E.set(e,B);var Rr=Mt();Rr.set(ur,E),Nt(q,r(ie,Gt,n,a,i,o,f,l,n==="comma"&&g&&I(m)?null:c,s,p,u,d,y,h,g,$,Rr))}}return q},ki=function(e){if(!e)return b;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||b.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=de.default;if(typeof e.format<"u"){if(!Gi.call(de.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var a=de.formatters[n],i=b.filter;(typeof e.filter=="function"||I(e.filter))&&(i=e.filter);var o;if(e.arrayFormat in Dt?o=e.arrayFormat:"indices"in e?o=e.indices?"indices":"repeat":o=b.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:b.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:b.addQueryPrefix,allowDots:f,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:b.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:b.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?b.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:b.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:b.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:b.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:b.encodeValuesOnly,filter:i,format:n,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:b.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:b.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:b.strictNullHandling}},Ki=function(r,e){var t=r,n=ki(e),a,i;typeof n.filter=="function"?(i=n.filter,t=i("",t)):I(n.filter)&&(i=n.filter,a=i);var o=[];if(typeof t!="object"||t===null)return"";var f=Dt[n.arrayFormat],l=f==="comma"&&n.commaRoundTrip;a||(a=Object.keys(t)),n.sort&&a.sort(n.sort);for(var c=Mt(),s=0;s<a.length;++s){var p=a[s],u=t[p];n.skipNulls&&u===null||Nt(o,zi(u,p,f,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var d=o.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""},R=Tt,Ie=Object.prototype.hasOwnProperty,cr=Array.isArray,S={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:R.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},Vi=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Lt=function(r,e,t){if(r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1)return r.split(",");if(e.throwOnLimitExceeded&&t>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return r},Qi="utf8=%26%2310003%3B",Ji="utf8=%E2%9C%93",Xi=function(e,t){var n={__proto__:null},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;a=a.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=t.parameterLimit===1/0?void 0:t.parameterLimit,o=a.split(t.delimiter,t.throwOnLimitExceeded?i+1:i);if(t.throwOnLimitExceeded&&o.length>i)throw new RangeError("Parameter limit exceeded. Only "+i+" parameter"+(i===1?"":"s")+" allowed.");var f=-1,l,c=t.charset;if(t.charsetSentinel)for(l=0;l<o.length;++l)o[l].indexOf("utf8=")===0&&(o[l]===Ji?c="utf-8":o[l]===Qi&&(c="iso-8859-1"),f=l,l=o.length);for(l=0;l<o.length;++l)if(l!==f){var s=o[l],p=s.indexOf("]="),u=p===-1?s.indexOf("="):p+1,d,y;if(u===-1?(d=t.decoder(s,S.decoder,c,"key"),y=t.strictNullHandling?null:""):(d=t.decoder(s.slice(0,u),S.decoder,c,"key"),d!==null&&(y=R.maybeMap(Lt(s.slice(u+1),t,cr(n[d])?n[d].length:0),function(g){return t.decoder(g,S.decoder,c,"value")}))),y&&t.interpretNumericEntities&&c==="iso-8859-1"&&(y=Vi(String(y))),s.indexOf("[]=")>-1&&(y=cr(y)?[y]:y),t.comma&&cr(y)&&y.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");y=R.combine([],y,t.arrayLimit,t.plainObjects)}if(d!==null){var h=Ie.call(n,d);h&&(t.duplicates==="combine"||s.indexOf("[]=")>-1)?n[d]=R.combine(n[d],y,t.arrayLimit,t.plainObjects):(!h||t.duplicates==="last")&&(n[d]=y)}}return n},Yi=function(r,e,t,n){var a=0;if(r.length>0&&r[r.length-1]==="[]"){var i=r.slice(0,-1).join("");a=Array.isArray(e)&&e[i]?e[i].length:0}for(var o=n?e:Lt(e,t,a),f=r.length-1;f>=0;--f){var l,c=r[f];if(c==="[]"&&t.parseArrays)R.isOverflow(o)?l=o:l=t.allowEmptyArrays&&(o===""||t.strictNullHandling&&o===null)?[]:R.combine([],o,t.arrayLimit,t.plainObjects);else{l=t.plainObjects?{__proto__:null}:{};var s=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,p=t.decodeDotInKeys?s.replace(/%2E/g,"."):s,u=parseInt(p,10),d=!isNaN(u)&&c!==p&&String(u)===p&&u>=0&&t.parseArrays;if(!t.parseArrays&&p==="")l={0:o};else if(d&&u<t.arrayLimit)l=[],l[u]=o;else{if(d&&t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");d?(l[u]=o,R.markOverflow(l,u)):p!=="__proto__"&&(l[p]=o)}}o=l}return o},Zi=function(e,t){var n=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0)return!t.plainObjects&&Ie.call(Object.prototype,n)&&!t.allowPrototypes?void 0:[n];var a=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,o=a.exec(n),f=o?n.slice(0,o.index):n,l=[];if(f){if(!t.plainObjects&&Ie.call(Object.prototype,f)&&!t.allowPrototypes)return;l[l.length]=f}for(var c=0;(o=i.exec(n))!==null&&c<t.depth;){c+=1;var s=o[1].slice(1,-1);if(!t.plainObjects&&Ie.call(Object.prototype,s)&&!t.allowPrototypes)return;l[l.length]=o[1]}if(o){if(t.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");l[l.length]="["+n.slice(o.index)+"]"}return l},eo=function(e,t,n,a){if(e){var i=Zi(e,n);if(i)return Yi(i,t,n,a)}},ro=function(e){if(!e)return S;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=typeof e.charset>"u"?S.charset:e.charset,n=typeof e.duplicates>"u"?S.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var a=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:S.allowDots:!!e.allowDots;return{allowDots:a,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:S.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:S.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:S.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:S.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:S.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:S.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:S.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:S.decoder,delimiter:typeof e.delimiter=="string"||R.isRegExp(e.delimiter)?e.delimiter:S.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:S.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:S.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:S.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:S.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:S.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:S.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:S.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},to=function(r,e){var t=ro(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?{__proto__:null}:{};for(var n=typeof r=="string"?Xi(r,t):r,a=t.plainObjects?{__proto__:null}:{},i=Object.keys(n),o=0;o<i.length;++o){var f=i[o],l=eo(f,n[f],t,typeof r=="string");a=R.merge(a,l,t)}return t.allowSparse===!0?a:R.compact(a)},no=Ki,ao=to,io=_r,oo={formats:io,parse:ao,stringify:no};const lo=Y.getDefaultExportFromCjs(oo);function nt(r){if(!Array.isArray(r))throw new TypeError("Middleware stack must be an array!");for(const e of r)if(typeof e!="function")throw new TypeError("Middleware must be composed of functions!");return function(e,t){let n=-1;return a(0);function a(i){if(i<=n)return Promise.reject(new Error("next() called multiple times"));n=i;let o=r[i];if(i===r.length&&(o=t),!o)return Promise.resolve();try{return Promise.resolve(o(e,a.bind(null,i+1)))}catch(f){return Promise.reject(f)}}}}const w={app:null,appPending:!0,appCb:[],services:new Map,servicePending:new Map,serviceCb:new Map,config:null,configPending:!1,configCb:[]};async function fo(r){if(w.config)return w.config;if(w.configPending)return new Promise(t=>{w.configCb.push(n=>t(n))});w.configPending=!0;const e=await r();return w.config=e,w.configCb.forEach(t=>t(e)),w.configCb=[],w.configPending=!1,e}class Ut{constructor(e={},t){P(this,"options");P(this,"apis",[]);P(this,"middlewares",[]);P(this,"defaultMiddlewares",[async(e,t)=>{try{await t()}catch(n){e.res.body=n.message||""}}]);P(this,"api404");P(this,"fnMiddleware");P(this,"getId");P(this,"extensions",new Map);P(this,"onDestroyCbs",[]);P(this,"config");P(this,"apiList");this.options={...e,baseUrl:e.baseUrl??"/"},this.options.baseUrl=this.options.baseUrl.split("/").map(a=>encodeURIComponent(a)).join("/"),this.middlewares.push(...this.defaultMiddlewares),this.middlewares.push(...e.middlewares||[]);const n=((e==null?void 0:e.apis)??[]).sort((a,i)=>{const o=i.path.substr(-1,1),f=o==="*"?0:o==="/"?.1:.2,l=a.path.substr(-1,1),c=l==="*"?0:l==="/"?.1:.2;return i.path.split("/").length+f-(a.path.split("/").length+c)}).map(a=>({...a,method:a.method??(e==null?void 0:e.defaultMethod)??"post"}));this.apiList=n,this.apis=n.filter(a=>!a.disabled),this.api404={path:"*",method:"all",action:(a,i)=>{throw i.res.status=404,Error("Not Found")}},this.fnMiddleware=nt(this.middlewares),this.getId=Y.useSoonIdGen({workerId:e.workId}),this.init(t)}async init(e){var t,n,a,i;try{if(this.options.config){const o=await this.options.config();this.config=o}await((n=(t=this.options)==null?void 0:t.onInit)==null?void 0:n.call(t,this)),w.app=this,w.appPending=!1,w.appCb.forEach(o=>o(this)),await((i=(a=this.options)==null?void 0:a.onReady)==null?void 0:i.call(a,this)),e==null||e(null,this)}catch(o){e==null||e(o,this)}}async fetchRaw(e,t,n){var u,d;const a=(n==null?void 0:n.url)??e,i=new URL(a,"http://localhost"),o=this.getId(),f={baseUrl:this.options.baseUrl??"",headers:(n==null?void 0:n.headers)??{},method:(n==null?void 0:n.method)??this.options.defaultMethod??"post",body:(n==null?void 0:n.body)??t,params:{},path:i.pathname,queryString:n!=null&&n.query?"?"+lo.stringify(n.query):i.search,query:(n==null?void 0:n.query)??Object.fromEntries(i.searchParams),url:a,reqId:o,requestId:o,ip:(n==null?void 0:n.ip)??"",namespace:(n==null?void 0:n.namespace)??"default"};let l=this.api404;for(let y=0;y<this.apis.length;y++){const h=this.apis[y];if((h.namespace??"default")===f.namespace&&(h.method==="all"||h.method===((d=(u=f.method)==null?void 0:u.toLowerCase)==null?void 0:d.call(u)))){const E=kt((h.baseUrl??this.options.baseUrl??"")+h.path,{loose:!1,trailing:!1})(f.path);if(E){f.params=E.params,l=h;break}}}const c={body:void 0,headers:{},status:200},s={app:this,currentAPI:l,req:f,request:f,reqId:o,requestId:o,res:c,response:c,platform:n==null?void 0:n.platform,config:this.config,meta:l.meta??{},service:{}},p=async()=>{var g,$;let y=f.body;if(l.bodySchema)if((g=l.bodySchema)!=null&&g.parse)try{y=l.bodySchema.parse(f.body)}catch(E){c.status=400;const m=($=E==null?void 0:E.issues)==null?void 0:$[0];throw m&&(m.message=(m.path??[]).join(".")+" "+m.message),m?{...m,code:0}:new Error("参数错误")}else throw c.status=500,new Error("bodySchema must be ZodType");const h=await l.action(y,s);h!==void 0&&(c.body=h)};if(l.middlewares&&l.middlewares.length>0){const y=nt(l.middlewares),h=async()=>await y(s,p);n!=null&&n.noPublicMiddleware?await h:await this.fnMiddleware(s,h)}else n!=null&&n.noPublicMiddleware?await p():await this.fnMiddleware(s,p);return s.res}async fetch(e,t,n){return(await this.fetchRaw(e,t,n)).body}async action(e,t,n){const a={...n??{},noPublicMiddleware:!0},i=(n==null?void 0:n.url)??`${this.baseUrl}${e}`;return await this.fetch(i,t,a)}mount(e,t){this.extensions.set(e,t)}get(e){return this.extensions.get(e)}onUnloadService(e){this.onDestroyCbs.push(e)}async unloadService(){return Promise.all(this.onDestroyCbs.map(e=>e==null?void 0:e()))}get baseUrl(){return this.options.baseUrl??""}}const Bt=Symbol("soon-api");function uo(r){const e={...r};return e._soon_symbol=Bt,e}const qt=Symbol("soon-service");function co(r){async function e(){var i;const t=r.service;let n=w.services.get(t);if(n)return n;if(w.servicePending.get(t)){let o=w.serviceCb.get(t);return o||(o=[],w.serviceCb.set(t,o)),new Promise(f=>{o.push(l=>f(l))})}return w.servicePending.set(t,!0),await new Promise(o=>{w.app?o(1):w.appCb.push(()=>o(1))}),n=await t(w.app),w.services.set(t,n),(i=w.serviceCb.get(t))==null||i.forEach(o=>o(n)),w.serviceCb.delete(t),w.servicePending.delete(t),n}return e._soon_symbol=qt,e.serviceName=(r==null?void 0:r.serviceName)??"",e.autoInject=(r==null?void 0:r.autoInject)??!1,e.enableClient=(r==null?void 0:r.enableClient)??!1,e}function so(r){return r}function po(r){return async function(){return await fo(r)}}async function yo(r){return await new Promise((e,t)=>{new Ut(r,(n,a)=>{if(n){t(n);return}e(a)})})}class ho extends Error{constructor(t,n){super(t);P(this,"code");this.code=n}}class mo extends Error{constructor(t,n){super(t);P(this,"status");this.status=n}}function vo({pingTime:r=0,action:e}){let t=()=>null;const n=new Ar(a=>{let i;r>0&&(i=setInterval(()=>{f.closed?clearInterval(i):a.next({event:"ping",message:`: ping
5
5
 
6
- `})},r));const o=[],u={send(l){try{a.next({...l,message:`${l.event?`event: ${l.event}
6
+ `})},r));const o=[],f={send(l){try{a.next({...l,message:`${l.event?`event: ${l.event}
7
7
  `:""}data: ${typeof l.data=="string"?l.data:JSON.stringify(l.data)}
8
8
 
9
- `})}catch(c){u.error(c.message)}},error(l){a.next({event:"error",data:l,message:`event: error
9
+ `})}catch(c){f.error(c.message)}},error(l){a.next({event:"error",data:l,message:`event: error
10
10
  data: ${l}
11
11
 
12
- `}),a.complete(),u.closed=!0,o.forEach(c=>c==null?void 0:c())},close(){a.next({event:"close",message:`event: close
12
+ `}),a.complete(),f.closed=!0,o.forEach(c=>c==null?void 0:c())},close(){a.next({event:"close",message:`event: close
13
13
  data:
14
14
 
15
- `}),a.complete(),u.closed=!0,i&&clearInterval(i),o.forEach(l=>l==null?void 0:l())},closed:!1,onClosed(l){o.push(l)}};t=()=>{u.closed||u.close()},e(u)});return n.streamClose=()=>t==null?void 0:t(),n}function zt(r){return r instanceof xr}function mo(r){if(zt(r)){const e=new Qt.PassThrough;return r.subscribe({next(t){e.write(t.message)},complete(){e.closed||e.end()}}),e.on("close",()=>{var t;return(t=r==null?void 0:r.streamClose)==null?void 0:t.call(r)}),e.on("error",()=>{var t;return(t=r==null?void 0:r.streamClose)==null?void 0:t.call(r)}),e.on("end",()=>{var t;return(t=r==null?void 0:r.streamClose)==null?void 0:t.call(r)}),e}else throw new Error("Not a valid SSE body")}exports.useSoonIdGen=Y.useSoonIdGen;exports.BizError=po;exports.Observable=xr;exports.SoonApp=Gt;exports.SoonError=yo;exports.createSoonApp=so;exports.defineApi=lo;exports.defineConfig=co;exports.defineMiddleware=uo;exports.defineService=fo;exports.isSSEBody=zt;exports.resolveSSEBody=mo;exports.soonApiSymbol=jt;exports.soonServiceSymbol=Ht;exports.useSSE=ho;
15
+ `}),a.complete(),f.closed=!0,i&&clearInterval(i),o.forEach(l=>l==null?void 0:l())},closed:!1,onClosed(l){o.push(l)}};t=()=>{f.closed||f.close()},e(f)});return n.streamClose=()=>t==null?void 0:t(),n}function Wt(r){return r instanceof Ar}function go(r){if(Wt(r)){const e=new Ht.PassThrough;return r.subscribe({next(t){e.write(t.message)},complete(){e.closed||e.end()}}),e.on("close",()=>{var t;return(t=r==null?void 0:r.streamClose)==null?void 0:t.call(r)}),e.on("error",()=>{var t;return(t=r==null?void 0:r.streamClose)==null?void 0:t.call(r)}),e.on("end",()=>{var t;return(t=r==null?void 0:r.streamClose)==null?void 0:t.call(r)}),e}else throw new Error("Not a valid SSE body")}exports.useSoonIdGen=Y.useSoonIdGen;exports.BizError=ho;exports.Observable=Ar;exports.SoonApp=Ut;exports.SoonError=mo;exports.createSoonApp=yo;exports.defineApi=uo;exports.defineConfig=po;exports.defineMiddleware=so;exports.defineService=co;exports.isSSEBody=Wt;exports.resolveSSEBody=go;exports.soonApiSymbol=Bt;exports.soonServiceSymbol=qt;exports.useSSE=vo;
package/dist/index.d.ts CHANGED
@@ -66,6 +66,7 @@ export declare function defineApi<BodySchema extends ZodType<any, any, any>, Cus
66
66
  bodySchema?: BodySchema;
67
67
  }>) => Promise<Data> | Data;
68
68
  }): {
69
+ baseUrl?: string;
69
70
  path?: string;
70
71
  method?: "get" | "head" | "post" | "put" | "delete" | "options" | "patch" | "all";
71
72
  disabled?: boolean;