@fern-api/swift-dynamic-snippets 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DynamicSnippetsGenerator.cjs +19 -1
- package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
- package/cjs/EndpointSnippetGenerator.cjs +30 -1
- package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +19 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
- package/cjs/context/DynamicTypeLiteralMapper.cjs +19 -1
- package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -1
- package/cjs/context/DynamicTypeMapper.cjs +19 -1
- package/cjs/context/DynamicTypeMapper.cjs.map +1 -1
- package/cjs/context/FilePropertyMapper.cjs +30 -1
- package/cjs/context/FilePropertyMapper.cjs.map +1 -1
- package/cjs/context/index.cjs +19 -1
- package/cjs/context/index.cjs.map +1 -1
- package/cjs/index.cjs +29 -11
- package/cjs/index.cjs.map +1 -1
- package/esm/Config.js +1 -1
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/{chunk-4YR7VIA5.js → chunk-2M2RBZK2.js} +2 -2
- package/esm/chunk-6DFEQNIA.js +2 -0
- package/esm/{chunk-NEAKFXXW.js.map → chunk-6DFEQNIA.js.map} +1 -1
- package/esm/chunk-7RC2HH3P.js +2 -0
- package/esm/{chunk-JBDWOK23.js.map → chunk-7RC2HH3P.js.map} +1 -1
- package/esm/chunk-FX6IFKZ7.js +2 -0
- package/esm/chunk-HTU5V5TT.js +2 -0
- package/esm/chunk-IHG2VZKL.js +2 -0
- package/esm/chunk-IHG2VZKL.js.map +1 -0
- package/esm/chunk-JFTYS7SI.js +20 -0
- package/esm/chunk-JFTYS7SI.js.map +1 -0
- package/esm/chunk-KIHSBETU.js +2 -0
- package/esm/{chunk-QKXS634U.js.map → chunk-KIHSBETU.js.map} +1 -1
- package/esm/chunk-PJTPV2D6.js +15 -0
- package/esm/chunk-PJTPV2D6.js.map +1 -0
- package/esm/{chunk-PKOEJ7HU.js → chunk-PYMG6Y4R.js} +2 -2
- package/esm/{chunk-P4BOVZKM.js → chunk-WG3NZOM6.js} +2 -2
- package/esm/chunk-WXHVUJ6D.js +2 -0
- package/esm/{chunk-T6A4SG7G.js.map → chunk-WXHVUJ6D.js.map} +1 -1
- package/esm/chunk-ZIQ5ITTV.js +2 -0
- package/esm/{chunk-F6NGJ242.js.map → chunk-ZIQ5ITTV.js.map} +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeLiteralMapper.js +1 -1
- package/esm/context/DynamicTypeMapper.js +1 -1
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/context/index.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/util/pascal-case.js +1 -1
- package/package.json +1 -1
- package/esm/chunk-243PMR4C.js +0 -2
- package/esm/chunk-7GLUP3NF.js +0 -2
- package/esm/chunk-7GLUP3NF.js.map +0 -1
- package/esm/chunk-BGT34OGK.js +0 -15
- package/esm/chunk-BGT34OGK.js.map +0 -1
- package/esm/chunk-F6NGJ242.js +0 -2
- package/esm/chunk-JBDWOK23.js +0 -2
- package/esm/chunk-NEAKFXXW.js +0 -2
- package/esm/chunk-NH2Q3QVN.js +0 -2
- package/esm/chunk-QKXS634U.js +0 -2
- package/esm/chunk-T6A4SG7G.js +0 -2
- /package/esm/{chunk-4YR7VIA5.js.map → chunk-2M2RBZK2.js.map} +0 -0
- /package/esm/{chunk-NH2Q3QVN.js.map → chunk-FX6IFKZ7.js.map} +0 -0
- /package/esm/{chunk-243PMR4C.js.map → chunk-HTU5V5TT.js.map} +0 -0
- /package/esm/{chunk-PKOEJ7HU.js.map → chunk-PYMG6Y4R.js.map} +0 -0
- /package/esm/{chunk-P4BOVZKM.js.map → chunk-WG3NZOM6.js.map} +0 -0
package/cjs/index.cjs
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
"use strict";var gf=Object.create;var Be=Object.defineProperty,vf=Object.defineProperties,wf=Object.getOwnPropertyDescriptor,bf=Object.getOwnPropertyDescriptors,Ef=Object.getOwnPropertyNames,cr=Object.getOwnPropertySymbols,Sf=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty,On=Object.prototype.propertyIsEnumerable;var ut=(t,e,r)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fn=(t,e)=>{for(var r in e||(e={}))ft.call(e,r)&&ut(t,r,e[r]);if(cr)for(var r of cr(e))On.call(e,r)&&ut(t,r,e[r]);return t},Cn=(t,e)=>vf(t,bf(e));var qn=t=>typeof t=="symbol"?t:t+"",Nn=(t,e)=>{var r={};for(var n in t)ft.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&cr)for(var n of cr(t))e.indexOf(n)<0&&On.call(t,n)&&(r[n]=t[n]);return r};var he=(t,e)=>()=>(t&&(e=t(t=0)),e);var d=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Un=(t,e)=>{for(var r in e)Be(t,r,{get:e[r],enumerable:!0})},Bn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ef(e))!ft.call(t,o)&&o!==r&&Be(t,o,{get:()=>e[o],enumerable:!(n=wf(e,o))||n.enumerable});return t};var Af=(t,e,r)=>(r=t!=null?gf(Sf(t)):{},Bn(e||!t||!t.__esModule?Be(r,"default",{value:t,enumerable:!0}):r,t)),Mn=t=>Bn(Be({},"__esModule",{value:!0}),t);var E=(t,e,r)=>ut(t,typeof e!="symbol"?e+"":e,r);function _n(){throw new Error("setTimeout has not been defined")}function $n(){throw new Error("clearTimeout has not been defined")}function Ln(t){if(Z===setTimeout)return setTimeout(t,0);if((Z===_n||!Z)&&setTimeout)return Z=setTimeout,setTimeout(t,0);try{return Z(t,0)}catch(e){try{return Z.call(null,t,0)}catch(r){return Z.call(this,t,0)}}}function Rf(t){if(Q===clearTimeout)return clearTimeout(t);if((Q===$n||!Q)&&clearTimeout)return Q=clearTimeout,clearTimeout(t);try{return Q(t)}catch(e){try{return Q.call(null,t)}catch(r){return Q.call(this,t)}}}function Tf(){!ge||!ae||(ge=!1,ae.length?G=ae.concat(G):dr=-1,G.length&&kn())}function kn(){if(!ge){var t=Ln(Tf);ge=!0;for(var e=G.length;e;){for(ae=G,G=[];++dr<e;)ae&&ae[dr].run();dr=-1,e=G.length}ae=null,ge=!1,Rf(t)}}function If(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];G.push(new Wn(t,e)),G.length===1&&!ge&&Ln(kn)}function Wn(t,e){this.fun=t,this.array=e}function se(){}function Gf(t){throw new Error("process.binding is not supported")}function zf(){return"/"}function Vf(t){throw new Error("process.chdir is not supported")}function Yf(){return 0}function Jf(t){var e=Hf.call(xe)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}function Zf(){var t=new Date,e=t-Kf;return e/1e3}var Z,Q,G,ge,ae,dr,Pf,Of,Ff,Cf,qf,Nf,Uf,Bf,Mf,Df,_f,$f,Lf,kf,Wf,jf,xe,Hf,Kf,c,Dn,a=he(()=>{"use strict";Z=_n,Q=$n;typeof globalThis.setTimeout=="function"&&(Z=setTimeout);typeof globalThis.clearTimeout=="function"&&(Q=clearTimeout);G=[],ge=!1,dr=-1;Wn.prototype.run=function(){this.fun.apply(null,this.array)};Pf="browser",Of="browser",Ff=!0,Cf={},qf=[],Nf="",Uf={},Bf={},Mf={};Df=se,_f=se,$f=se,Lf=se,kf=se,Wf=se,jf=se;xe=globalThis.performance||{},Hf=xe.now||xe.mozNow||xe.msNow||xe.oNow||xe.webkitNow||function(){return new Date().getTime()};Kf=new Date;c={nextTick:If,title:Pf,browser:Ff,env:Cf,argv:qf,version:Nf,versions:Uf,on:Df,addListener:_f,once:$f,off:Lf,removeListener:kf,removeAllListeners:Wf,emit:jf,binding:Gf,cwd:zf,chdir:Vf,umask:Yf,hrtime:Jf,platform:Of,release:Bf,config:Mf,uptime:Zf},Dn={};Object.keys(Dn).forEach(t=>{let e=t.split("."),r=c;for(let n=0;n<e.length;n++){let o=e[n];n===e.length-1?r[o]=Dn[t]:r=r[o]||(r[o]={})}})});function Vn(){lt=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)M[e]=t[e],B[t.charCodeAt(e)]=e;B[45]=62,B[95]=63}function Xf(t){lt||Vn();var e,r,n,o,i,u,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[p-2]==="="?2:t[p-1]==="="?1:0,u=new Qf(p*3/4-i),n=i>0?p-4:p;var l=0;for(e=0,r=0;e<n;e+=4,r+=3)o=B[t.charCodeAt(e)]<<18|B[t.charCodeAt(e+1)]<<12|B[t.charCodeAt(e+2)]<<6|B[t.charCodeAt(e+3)],u[l++]=o>>16&255,u[l++]=o>>8&255,u[l++]=o&255;return i===2?(o=B[t.charCodeAt(e)]<<2|B[t.charCodeAt(e+1)]>>4,u[l++]=o&255):i===1&&(o=B[t.charCodeAt(e)]<<10|B[t.charCodeAt(e+1)]<<4|B[t.charCodeAt(e+2)]>>2,u[l++]=o>>8&255,u[l++]=o&255),u}function ep(t){return M[t>>18&63]+M[t>>12&63]+M[t>>6&63]+M[t&63]}function rp(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ep(n));return o.join("")}function jn(t){lt||Vn();for(var e,r=t.length,n=r%3,o="",i=[],u=16383,p=0,l=r-n;p<l;p+=u)i.push(rp(t,p,p+u>l?l:p+u));return n===1?(e=t[r-1],o+=M[e>>2],o+=M[e<<4&63],o+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],o+=M[e>>10],o+=M[e>>4&63],o+=M[e<<2&63],o+="="),i.push(o),i.join("")}function mr(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function z(t,e){if(mr()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=f.prototype):(t===null&&(t=new f(e)),t.length=e),t}function f(t,e,r){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return ct(this,t)}return Yn(this,t,e,r)}function Yn(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?op(t,e,r,n):typeof e=="string"?np(t,e,r):ip(t,e)}function Hn(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function tp(t,e,r,n){return Hn(e),e<=0?z(t,e):r!==void 0?typeof n=="string"?z(t,e).fill(r,n):z(t,e).fill(r):z(t,e)}function ct(t,e){if(Hn(e),t=z(t,e<0?0:dt(e)|0),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function np(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Jn(e,r)|0;t=z(t,n);var o=t.write(e,r);return o!==n&&(t=t.slice(0,o)),t}function pt(t,e){var r=e.length<0?0:dt(e.length)|0;t=z(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function op(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),f.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=f.prototype):t=pt(t,e),t}function ip(t,e){if(D(e)){var r=dt(e.length)|0;return t=z(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Ap(e.length)?z(t,0):pt(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return pt(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function dt(t){if(t>=mr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+mr().toString(16)+" bytes");return t|0}function D(t){return!!(t!=null&&t._isBuffer)}function Jn(t,e){if(D(t))return t.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return yr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return to(t).length;default:if(n)return yr(t).length;e=(""+e).toLowerCase(),n=!0}}function ap(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return hp(this,e,r);case"utf8":case"utf-8":return Qn(this,e,r);case"ascii":return mp(this,e,r);case"latin1":case"binary":return yp(this,e,r);case"base64":return cp(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xp(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function ue(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Kn(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=f.from(e,n)),D(e))return e.length===0?-1:Gn(t,e,r,n,o);if(typeof e=="number")return e=e&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Gn(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Gn(t,e,r,n,o){var i=1,u=t.length,p=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,u/=2,p/=2,r/=2}function l(S,I){return i===1?S[I]:S.readUInt16BE(I*i)}var y;if(o){var h=-1;for(y=r;y<u;y++)if(l(t,y)===l(e,h===-1?0:y-h)){if(h===-1&&(h=y),y-h+1===p)return h*i}else h!==-1&&(y-=y-h),h=-1}else for(r+p>u&&(r=u-p),y=r;y>=0;y--){for(var m=!0,g=0;g<p;g++)if(l(t,y+g)!==l(e,g)){m=!1;break}if(m)return y}return-1}function sp(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var p=parseInt(e.substr(u*2,2),16);if(isNaN(p))return u;t[r+u]=p}return u}function up(t,e,r,n){return gr(yr(e,t.length-r),t,r,n)}function Zn(t,e,r,n){return gr(Ep(e),t,r,n)}function fp(t,e,r,n){return Zn(t,e,r,n)}function pp(t,e,r,n){return gr(to(e),t,r,n)}function lp(t,e,r,n){return gr(Sp(e,t.length-r),t,r,n)}function cp(t,e,r){return e===0&&r===t.length?jn(t):jn(t.slice(e,r))}function Qn(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],u=null,p=i>239?4:i>223?3:i>191?2:1;if(o+p<=r){var l,y,h,m;switch(p){case 1:i<128&&(u=i);break;case 2:l=t[o+1],(l&192)===128&&(m=(i&31)<<6|l&63,m>127&&(u=m));break;case 3:l=t[o+1],y=t[o+2],(l&192)===128&&(y&192)===128&&(m=(i&15)<<12|(l&63)<<6|y&63,m>2047&&(m<55296||m>57343)&&(u=m));break;case 4:l=t[o+1],y=t[o+2],h=t[o+3],(l&192)===128&&(y&192)===128&&(h&192)===128&&(m=(i&15)<<18|(l&63)<<12|(y&63)<<6|h&63,m>65535&&m<1114112&&(u=m))}}u===null?(u=65533,p=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),o+=p}return dp(n)}function dp(t){var e=t.length;if(e<=zn)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=zn));return r}function mp(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function yp(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function hp(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=bp(t[i]);return o}function xp(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}function P(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,o,i){if(!D(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function hr(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}function xr(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>(n?o:3-o)*8&255}function Xn(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function eo(t,e,r,n,o){return o||Xn(t,e,r,4,34028234663852886e22,-34028234663852886e22),oo(t,e,r,n,23,4),r+4}function ro(t,e,r,n,o){return o||Xn(t,e,r,8,17976931348623157e292,-17976931348623157e292),oo(t,e,r,n,52,8),r+8}function vp(t){if(t=wp(t).replace(gp,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function wp(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function bp(t){return t<16?"0"+t.toString(16):t.toString(16)}function yr(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],u=0;u<n;++u){if(r=t.charCodeAt(u),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function Ep(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Sp(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function to(t){return Xf(vp(t))}function gr(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function Ap(t){return t!==t}function Rp(t){return t!=null&&(!!t._isBuffer||no(t)||Tp(t))}function no(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Tp(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&no(t.slice(0,0))}function vr(t,e,r,n,o){var i,u,p=o*8-n-1,l=(1<<p)-1,y=l>>1,h=-7,m=r?o-1:0,g=r?-1:1,S=t[e+m];for(m+=g,i=S&(1<<-h)-1,S>>=-h,h+=p;h>0;i=i*256+t[e+m],m+=g,h-=8);for(u=i&(1<<-h)-1,i>>=-h,h+=n;h>0;u=u*256+t[e+m],m+=g,h-=8);if(i===0)i=1-y;else{if(i===l)return u?NaN:(S?-1:1)*(1/0);u=u+Math.pow(2,n),i=i-y}return(S?-1:1)*u*Math.pow(2,i-n)}function oo(t,e,r,n,o,i){var u,p,l,y=i*8-o-1,h=(1<<y)-1,m=h>>1,g=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:i-1,I=n?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-u))<1&&(u--,l*=2),u+m>=1?e+=g/l:e+=g*Math.pow(2,1-m),e*l>=2&&(u++,l/=2),u+m>=h?(p=0,u=h):u+m>=1?(p=(e*l-1)*Math.pow(2,o),u=u+m):(p=e*Math.pow(2,m-1)*Math.pow(2,o),u=0));o>=8;t[r+S]=p&255,S+=I,p/=256,o-=8);for(u=u<<o|p,y+=o;y>0;t[r+S]=u&255,S+=I,u/=256,y-=8);t[r+S-I]|=T*128}var M,B,Qf,lt,zn,gp,io=he(()=>{"use strict";a();s();M=[],B=[],Qf=typeof Uint8Array!="undefined"?Uint8Array:Array,lt=!1;f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;f.poolSize=8192;f._augment=function(t){return t.__proto__=f.prototype,t};f.from=function(t,e,r){return Yn(null,t,e,r)};f.kMaxLength=mr();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]);f.alloc=function(t,e,r){return tp(null,t,e,r)};f.allocUnsafe=function(t){return ct(null,t)};f.allocUnsafeSlow=function(t){return ct(null,t)};f.isBuffer=Rp;f.compare=function(e,r){if(!D(e)||!D(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,u=Math.min(n,o);i<u;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};f.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};f.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return f.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var o=f.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var u=e[n];if(!D(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(o,i),i+=u.length}return o};f.byteLength=Jn;f.prototype._isBuffer=!0;f.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)ue(this,r,r+1);return this};f.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)ue(this,r,r+3),ue(this,r+1,r+2);return this};f.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)ue(this,r,r+7),ue(this,r+1,r+6),ue(this,r+2,r+5),ue(this,r+3,r+4);return this};f.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Qn(this,0,e):ap.apply(this,arguments)};f.prototype.equals=function(e){if(!D(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:f.compare(this,e)===0};f.prototype.compare=function(e,r,n,o,i){if(!D(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var u=i-o,p=n-r,l=Math.min(u,p),y=this.slice(o,i),h=e.slice(r,n),m=0;m<l;++m)if(y[m]!==h[m]){u=y[m],p=h[m];break}return u<p?-1:p<u?1:0};f.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};f.prototype.indexOf=function(e,r,n){return Kn(this,e,r,n,!0)};f.prototype.lastIndexOf=function(e,r,n){return Kn(this,e,r,n,!1)};f.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var u=!1;;)switch(o){case"hex":return sp(this,e,r,n);case"utf8":case"utf-8":return up(this,e,r,n);case"ascii":return Zn(this,e,r,n);case"latin1":case"binary":return fp(this,e,r,n);case"base64":return pp(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lp(this,e,r,n);default:if(u)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};zn=4096;f.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var o;if(f.TYPED_ARRAY_SUPPORT)o=this.subarray(e,r),o.__proto__=f.prototype;else{var i=r-e;o=new f(i,void 0);for(var u=0;u<i;++u)o[u]=this[u+e]}return o};f.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||P(e,r,this.length);for(var o=this[e],i=1,u=0;++u<r&&(i*=256);)o+=this[e+u]*i;return o};f.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||P(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o};f.prototype.readUInt8=function(e,r){return r||P(e,1,this.length),this[e]};f.prototype.readUInt16LE=function(e,r){return r||P(e,2,this.length),this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function(e,r){return r||P(e,2,this.length),this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function(e,r){return r||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function(e,r){return r||P(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||P(e,r,this.length);for(var o=this[e],i=1,u=0;++u<r&&(i*=256);)o+=this[e+u]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};f.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||P(e,r,this.length);for(var o=r,i=1,u=this[e+--o];o>0&&(i*=256);)u+=this[e+--o]*i;return i*=128,u>=i&&(u-=Math.pow(2,8*r)),u};f.prototype.readInt8=function(e,r){return r||P(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};f.prototype.readInt16LE=function(e,r){r||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};f.prototype.readInt16BE=function(e,r){r||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};f.prototype.readInt32LE=function(e,r){return r||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function(e,r){return r||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function(e,r){return r||P(e,4,this.length),vr(this,e,!0,23,4)};f.prototype.readFloatBE=function(e,r){return r||P(e,4,this.length),vr(this,e,!1,23,4)};f.prototype.readDoubleLE=function(e,r){return r||P(e,8,this.length),vr(this,e,!0,52,8)};f.prototype.readDoubleBE=function(e,r){return r||P(e,8,this.length),vr(this,e,!1,52,8)};f.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;N(this,e,r,n,i,0)}var u=1,p=0;for(this[r]=e&255;++p<n&&(u*=256);)this[r+p]=e/u&255;return r+n};f.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;N(this,e,r,n,i,0)}var u=n-1,p=1;for(this[r+u]=e&255;--u>=0&&(p*=256);)this[r+u]=e/p&255;return r+n};f.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};f.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):hr(this,e,r,!0),r+2};f.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):hr(this,e,r,!1),r+2};f.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):xr(this,e,r,!0),r+4};f.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):xr(this,e,r,!1),r+4};f.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);N(this,e,r,n,i-1,-i)}var u=0,p=1,l=0;for(this[r]=e&255;++u<n&&(p*=256);)e<0&&l===0&&this[r+u-1]!==0&&(l=1),this[r+u]=(e/p>>0)-l&255;return r+n};f.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);N(this,e,r,n,i-1,-i)}var u=n-1,p=1,l=0;for(this[r+u]=e&255;--u>=0&&(p*=256);)e<0&&l===0&&this[r+u+1]!==0&&(l=1),this[r+u]=(e/p>>0)-l&255;return r+n};f.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};f.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):hr(this,e,r,!0),r+2};f.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):hr(this,e,r,!1),r+2};f.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):xr(this,e,r,!0),r+4};f.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):xr(this,e,r,!1),r+4};f.prototype.writeFloatLE=function(e,r,n){return eo(this,e,r,!0,n)};f.prototype.writeFloatBE=function(e,r,n){return eo(this,e,r,!1,n)};f.prototype.writeDoubleLE=function(e,r,n){return ro(this,e,r,!0,n)};f.prototype.writeDoubleBE=function(e,r,n){return ro(this,e,r,!1,n)};f.prototype.copy=function(e,r,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);var i=o-n,u;if(this===e&&n<r&&r<o)for(u=i-1;u>=0;--u)e[u+r]=this[u+n];else if(i<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<i;++u)e[u+r]=this[u+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),r);return i};f.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!f.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var u;if(typeof e=="number")for(u=r;u<n;++u)this[u]=e;else{var p=D(e)?e:yr(new f(e,o).toString()),l=p.length;for(u=0;u<n-r;++u)this[u+r]=p[u%l]}return this};gp=/[^+\/0-9A-Za-z-_]/g});var s=he(()=>{"use strict";io()});var mt=d((kh,ao)=>{"use strict";a();s();ao.exports=Object});var uo=d((Gh,so)=>{"use strict";a();s();so.exports=Error});var po=d((Yh,fo)=>{"use strict";a();s();fo.exports=EvalError});var co=d((Kh,lo)=>{"use strict";a();s();lo.exports=RangeError});var yo=d((Xh,mo)=>{"use strict";a();s();mo.exports=ReferenceError});var yt=d((tx,ho)=>{"use strict";a();s();ho.exports=SyntaxError});var O=d((ix,xo)=>{"use strict";a();s();xo.exports=TypeError});var vo=d((ux,go)=>{"use strict";a();s();go.exports=URIError});var ht=d((lx,wo)=>{"use strict";a();s();wo.exports=Math.abs});var xt=d((mx,bo)=>{"use strict";a();s();bo.exports=Math.floor});var So=d((xx,Eo)=>{"use strict";a();s();Eo.exports=Math.max});var gt=d((wx,Ao)=>{"use strict";a();s();Ao.exports=Math.min});var To=d((Sx,Ro)=>{"use strict";a();s();Ro.exports=Math.pow});var Po=d((Tx,Io)=>{"use strict";a();s();Io.exports=Math.round});var wr=d((Ox,Oo)=>{"use strict";a();s();Oo.exports=Number.isNaN||function(e){return e!==e}});var Co=d((qx,Fo)=>{"use strict";a();s();var Ip=wr();Fo.exports=function(e){return Ip(e)||e===0?e:e<0?-1:1}});var No=d((Bx,qo)=>{"use strict";a();s();qo.exports=Object.getOwnPropertyDescriptor});var ve=d((_x,Uo)=>{"use strict";a();s();var br=No();if(br)try{br([],"length")}catch(t){br=null}Uo.exports=br});var Me=d((kx,Bo)=>{"use strict";a();s();var Er=Object.defineProperty||!1;if(Er)try{Er({},"a",{value:1})}catch(t){Er=!1}Bo.exports=Er});var vt=d((Gx,Mo)=>{"use strict";a();s();Mo.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;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 u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(e,r);if(p.value!==o||p.enumerable!==!0)return!1}return!0}});var wt=d((Yx,_o)=>{"use strict";a();s();var Do=typeof Symbol!="undefined"&&Symbol,Pp=vt();_o.exports=function(){return typeof Do!="function"||typeof Symbol!="function"||typeof Do("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Pp()}});var bt=d((Kx,$o)=>{"use strict";a();s();$o.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var Et=d((Xx,Lo)=>{"use strict";a();s();var Op=mt();Lo.exports=Op.getPrototypeOf||null});var jo=d((t0,Wo)=>{"use strict";a();s();var Fp="Function.prototype.bind called on incompatible ",Cp=Object.prototype.toString,qp=Math.max,Np="[object Function]",ko=function(e,r){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var i=0;i<r.length;i+=1)n[i+e.length]=r[i];return n},Up=function(e,r){for(var n=[],o=r||0,i=0;o<e.length;o+=1,i+=1)n[i]=e[o];return n},Bp=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};Wo.exports=function(e){var r=this;if(typeof r!="function"||Cp.apply(r)!==Np)throw new TypeError(Fp+r);for(var n=Up(arguments,1),o,i=function(){if(this instanceof o){var h=r.apply(this,ko(n,arguments));return Object(h)===h?h:this}return r.apply(e,ko(n,arguments))},u=qp(0,r.length-n.length),p=[],l=0;l<u;l++)p[l]="$"+l;if(o=Function("binder","return function ("+Bp(p,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var y=function(){};y.prototype=r.prototype,o.prototype=new y,y.prototype=null}return o}});var we=d((i0,Go)=>{"use strict";a();s();var Mp=jo();Go.exports=Function.prototype.bind||Mp});var Sr=d((u0,zo)=>{"use strict";a();s();zo.exports=Function.prototype.call});var Ar=d((l0,Vo)=>{"use strict";a();s();Vo.exports=Function.prototype.apply});var Ho=d((m0,Yo)=>{"use strict";a();s();Yo.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var St=d((x0,Jo)=>{"use strict";a();s();var Dp=we(),_p=Ar(),$p=Sr(),Lp=Ho();Jo.exports=Lp||Dp.call($p,_p)});var Rr=d((w0,Ko)=>{"use strict";a();s();var kp=we(),Wp=O(),jp=Sr(),Gp=St();Ko.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new Wp("a function is required");return Gp(kp,jp,e)}});var ti=d((S0,ri)=>{"use strict";a();s();var zp=Rr(),Zo=ve(),Xo;try{Xo=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var At=!!Xo&&Zo&&Zo(Object.prototype,"__proto__"),ei=Object,Qo=ei.getPrototypeOf;ri.exports=At&&typeof At.get=="function"?zp([At.get]):typeof Qo=="function"?function(e){return Qo(e==null?e:ei(e))}:!1});var si=d((T0,ai)=>{"use strict";a();s();var ni=bt(),oi=Et(),ii=ti();ai.exports=ni?function(e){return ni(e)}:oi?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return oi(e)}:ii?function(e){return ii(e)}:null});var Rt=d((O0,ui)=>{"use strict";a();s();var Vp=Function.prototype.call,Yp=Object.prototype.hasOwnProperty,Hp=we();ui.exports=Hp.call(Vp,Yp)});var _=d((q0,mi)=>{"use strict";a();s();var w,Jp=mt(),Kp=uo(),Zp=po(),Qp=co(),Xp=yo(),Ae=yt(),Se=O(),el=vo(),rl=ht(),tl=xt(),nl=So(),ol=gt(),il=To(),al=Po(),sl=Co(),ci=Function,Tt=function(t){try{return ci('"use strict"; return ('+t+").constructor;")()}catch(e){}},De=ve(),ul=Me(),It=function(){throw new Se},fl=De?(function(){try{return arguments.callee,It}catch(t){try{return De(arguments,"callee").get}catch(e){return It}}})():It,be=wt()(),F=si(),pl=Et(),ll=bt(),di=Ar(),_e=Sr(),Ee={},cl=typeof Uint8Array=="undefined"||!F?w:F(Uint8Array),fe={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?w:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?w:ArrayBuffer,"%ArrayIteratorPrototype%":be&&F?F([][Symbol.iterator]()):w,"%AsyncFromSyncIteratorPrototype%":w,"%AsyncFunction%":Ee,"%AsyncGenerator%":Ee,"%AsyncGeneratorFunction%":Ee,"%AsyncIteratorPrototype%":Ee,"%Atomics%":typeof Atomics=="undefined"?w:Atomics,"%BigInt%":typeof BigInt=="undefined"?w:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?w:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?w:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?w:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Kp,"%eval%":eval,"%EvalError%":Zp,"%Float16Array%":typeof Float16Array=="undefined"?w:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?w:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?w:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?w:FinalizationRegistry,"%Function%":ci,"%GeneratorFunction%":Ee,"%Int8Array%":typeof Int8Array=="undefined"?w:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?w:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?w:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":be&&F?F(F([][Symbol.iterator]())):w,"%JSON%":typeof JSON=="object"?JSON:w,"%Map%":typeof Map=="undefined"?w:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!be||!F?w:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Jp,"%Object.getOwnPropertyDescriptor%":De,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?w:Promise,"%Proxy%":typeof Proxy=="undefined"?w:Proxy,"%RangeError%":Qp,"%ReferenceError%":Xp,"%Reflect%":typeof Reflect=="undefined"?w:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?w:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!be||!F?w:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?w:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":be&&F?F(""[Symbol.iterator]()):w,"%Symbol%":be?Symbol:w,"%SyntaxError%":Ae,"%ThrowTypeError%":fl,"%TypedArray%":cl,"%TypeError%":Se,"%Uint8Array%":typeof Uint8Array=="undefined"?w:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?w:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?w:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?w:Uint32Array,"%URIError%":el,"%WeakMap%":typeof WeakMap=="undefined"?w:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?w:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?w:WeakSet,"%Function.prototype.call%":_e,"%Function.prototype.apply%":di,"%Object.defineProperty%":ul,"%Object.getPrototypeOf%":pl,"%Math.abs%":rl,"%Math.floor%":tl,"%Math.max%":nl,"%Math.min%":ol,"%Math.pow%":il,"%Math.round%":al,"%Math.sign%":sl,"%Reflect.getPrototypeOf%":ll};if(F)try{null.error}catch(t){fi=F(F(t)),fe["%Error.prototype%"]=fi}var fi,dl=function t(e){var r;if(e==="%AsyncFunction%")r=Tt("async function () {}");else if(e==="%GeneratorFunction%")r=Tt("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Tt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&F&&(r=F(o.prototype))}return fe[e]=r,r},pi={__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"]},$e=we(),Tr=Rt(),ml=$e.call(_e,Array.prototype.concat),yl=$e.call(di,Array.prototype.splice),li=$e.call(_e,String.prototype.replace),Ir=$e.call(_e,String.prototype.slice),hl=$e.call(_e,RegExp.prototype.exec),xl=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,gl=/\\(\\)?/g,vl=function(e){var r=Ir(e,0,1),n=Ir(e,-1);if(r==="%"&&n!=="%")throw new Ae("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ae("invalid intrinsic syntax, expected opening `%`");var o=[];return li(e,xl,function(i,u,p,l){o[o.length]=p?li(l,gl,"$1"):u||i}),o},wl=function(e,r){var n=e,o;if(Tr(pi,n)&&(o=pi[n],n="%"+o[0]+"%"),Tr(fe,n)){var i=fe[n];if(i===Ee&&(i=dl(n)),typeof i=="undefined"&&!r)throw new Se("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Ae("intrinsic "+e+" does not exist!")};mi.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Se("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Se('"allowMissing" argument must be a boolean');if(hl(/^%?[^%]*%?$/,e)===null)throw new Ae("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=vl(e),o=n.length>0?n[0]:"",i=wl("%"+o+"%",r),u=i.name,p=i.value,l=!1,y=i.alias;y&&(o=y[0],yl(n,ml([0,1],y)));for(var h=1,m=!0;h<n.length;h+=1){var g=n[h],S=Ir(g,0,1),I=Ir(g,-1);if((S==='"'||S==="'"||S==="`"||I==='"'||I==="'"||I==="`")&&S!==I)throw new Ae("property names with quotes must have matching quotes");if((g==="constructor"||!m)&&(l=!0),o+="."+g,u="%"+o+"%",Tr(fe,u))p=fe[u];else if(p!=null){if(!(g in p)){if(!r)throw new Se("base intrinsic for "+e+" exists, but the property is not available.");return}if(De&&h+1>=n.length){var T=De(p,g);m=!!T,m&&"get"in T&&!("originalValue"in T.get)?p=T.get:p=p[g]}else m=Tr(p,g),p=p[g];m&&!l&&(fe[u]=p)}}return p}});var Pr=d((B0,xi)=>{"use strict";a();s();var yi=Me(),bl=yt(),Re=O(),hi=ve();xi.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Re("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Re("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Re("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Re("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Re("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Re("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,l=!!hi&&hi(e,r);if(yi)yi(e,r,{configurable:u===null&&l?l.configurable:!u,enumerable:o===null&&l?l.enumerable:!o,value:n,writable:i===null&&l?l.writable:!i});else if(p||!o&&!i&&!u)e[r]=n;else throw new bl("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Or=d((_0,vi)=>{"use strict";a();s();var Pt=Me(),gi=function(){return!!Pt};gi.hasArrayLengthDefineBug=function(){if(!Pt)return null;try{return Pt([],"length",{value:1}).length!==1}catch(e){return!0}};vi.exports=gi});var Ai=d((k0,Si)=>{"use strict";a();s();var El=_(),wi=Pr(),Sl=Or()(),bi=ve(),Ei=O(),Al=El("%Math.floor%");Si.exports=function(e,r){if(typeof e!="function")throw new Ei("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Al(r)!==r)throw new Ei("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in e&&bi){var u=bi(e,"length");u&&!u.configurable&&(o=!1),u&&!u.writable&&(i=!1)}return(o||i||!n)&&(Sl?wi(e,"length",r,!0,!0):wi(e,"length",r)),e}});var Ti=d((G0,Ri)=>{"use strict";a();s();var Rl=we(),Tl=Ar(),Il=St();Ri.exports=function(){return Il(Rl,Tl,arguments)}});var Cr=d((Y0,Fr)=>{"use strict";a();s();var Pl=Ai(),Ii=Me(),Ol=Rr(),Pi=Ti();Fr.exports=function(e){var r=Ol(arguments),n=e.length-(arguments.length-1);return Pl(r,1+(n>0?n:0),!0)};Ii?Ii(Fr.exports,"apply",{value:Pi}):Fr.exports.apply=Pi});var Ot=d((K0,Fi)=>{"use strict";a();s();var Oi=Object.prototype.toString;Fi.exports=function(e){var r=Oi.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Oi.call(e.callee)==="[object Function]"),n}});var $i=d((X0,_i)=>{"use strict";a();s();var Di;Object.keys||(Le=Object.prototype.hasOwnProperty,Ft=Object.prototype.toString,Ci=Ot(),Ct=Object.prototype.propertyIsEnumerable,qi=!Ct.call({toString:null},"toString"),Ni=Ct.call(function(){},"prototype"),ke=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],qr=function(t){var e=t.constructor;return e&&e.prototype===t},Ui={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Bi=(function(){if(typeof window=="undefined")return!1;for(var t in window)try{if(!Ui["$"+t]&&Le.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{qr(window[t])}catch(e){return!0}}catch(e){return!0}return!1})(),Mi=function(t){if(typeof window=="undefined"||!Bi)return qr(t);try{return qr(t)}catch(e){return!1}},Di=function(e){var r=e!==null&&typeof e=="object",n=Ft.call(e)==="[object Function]",o=Ci(e),i=r&&Ft.call(e)==="[object String]",u=[];if(!r&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var p=Ni&&n;if(i&&e.length>0&&!Le.call(e,0))for(var l=0;l<e.length;++l)u.push(String(l));if(o&&e.length>0)for(var y=0;y<e.length;++y)u.push(String(y));else for(var h in e)!(p&&h==="prototype")&&Le.call(e,h)&&u.push(String(h));if(qi)for(var m=Mi(e),g=0;g<ke.length;++g)!(m&&ke[g]==="constructor")&&Le.call(e,ke[g])&&u.push(ke[g]);return u});var Le,Ft,Ci,Ct,qi,Ni,ke,qr,Ui,Bi,Mi;_i.exports=Di});var ji=d((tg,Wi)=>{"use strict";a();s();var Fl=Array.prototype.slice,Cl=Ot(),Li=Object.keys,Nr=Li?function(e){return Li(e)}:$i(),ki=Object.keys;Nr.shim=function(){if(Object.keys){var e=(function(){var r=Object.keys(arguments);return r&&r.length===arguments.length})(1,2);e||(Object.keys=function(n){return Cl(n)?ki(Fl.call(n)):ki(n)})}else Object.keys=Nr;return Object.keys||Nr};Wi.exports=Nr});var Ur=d((ig,Yi)=>{"use strict";a();s();var ql=ji(),Nl=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Ul=Object.prototype.toString,Bl=Array.prototype.concat,Gi=Pr(),Ml=function(t){return typeof t=="function"&&Ul.call(t)==="[object Function]"},zi=Or()(),Dl=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!Ml(n)||!n())return}zi?Gi(t,e,r,!0):Gi(t,e,r)},Vi=function(t,e){var r=arguments.length>2?arguments[2]:{},n=ql(e);Nl&&(n=Bl.call(n,Object.getOwnPropertySymbols(e)));for(var o=0;o<n.length;o+=1)Dl(t,n[o],e[n[o]],r[n[o]])};Vi.supportsDescriptors=!!zi;Yi.exports=Vi});var $=d((ug,Ki)=>{"use strict";a();s();var Hi=_(),Ji=Rr(),_l=Ji([Hi("%String.prototype.indexOf%")]);Ki.exports=function(e,r){var n=Hi(e,!!r);return typeof n=="function"&&_l(e,".prototype.")>-1?Ji([n]):n}});var Xi=d((lg,Qi)=>{"use strict";a();s();var $l=_(),Zi=$l("%Array%"),Ll=!Zi.isArray&&$()("Object.prototype.toString");Qi.exports=Zi.isArray||function(e){return Ll(e)==="[object Array]"}});var qt=d((mg,ea)=>{"use strict";a();s();ea.exports=Xi()});var ta=d((xg,ra)=>{"use strict";a();s();var kl=_(),Wl=$(),jl=O(),Gl=qt(),zl=kl("%Reflect.apply%",!0)||Wl("Function.prototype.apply");ra.exports=function(e,r){var n=arguments.length>2?arguments[2]:[];if(!Gl(n))throw new jl("Assertion failed: optional `argumentsList`, if provided, must be a List");return zl(e,r,n)}});function na(){throw new Error("setTimeout has not been defined")}function oa(){throw new Error("clearTimeout has not been defined")}function ia(t){if(X===setTimeout)return setTimeout(t,0);if((X===na||!X)&&setTimeout)return X=setTimeout,setTimeout(t,0);try{return X(t,0)}catch(e){try{return X.call(null,t,0)}catch(r){return X.call(this,t,0)}}}function Vl(t){if(ee===clearTimeout)return clearTimeout(t);if((ee===oa||!ee)&&clearTimeout)return ee=clearTimeout,clearTimeout(t);try{return ee(t)}catch(e){try{return ee.call(null,t)}catch(r){return ee.call(this,t)}}}function Yl(){!Ie||!pe||(Ie=!1,pe.length?V=pe.concat(V):Br=-1,V.length&&aa())}function aa(){if(!Ie){var t=ia(Yl);Ie=!0;for(var e=V.length;e;){for(pe=V,V=[];++Br<e;)pe&&pe[Br].run();Br=-1,e=V.length}pe=null,Ie=!1,Vl(t)}}function Hl(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];V.push(new sa(t,e)),V.length===1&&!Ie&&ia(aa)}function sa(t,e){this.fun=t,this.array=e}function le(){}function lc(t){throw new Error("process.binding is not supported")}function cc(){return"/"}function dc(t){throw new Error("process.chdir is not supported")}function mc(){return 0}function hc(t){var e=yc.call(Te)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}function gc(){var t=new Date,e=t-xc;return e/1e3}var X,ee,V,Ie,pe,Br,Jl,Kl,Zl,Ql,Xl,ec,rc,tc,nc,oc,ic,ac,sc,uc,fc,pc,Te,yc,xc,vc,We,ua=he(()=>{"use strict";a();s();X=na,ee=oa;typeof globalThis.setTimeout=="function"&&(X=setTimeout);typeof globalThis.clearTimeout=="function"&&(ee=clearTimeout);V=[],Ie=!1,Br=-1;sa.prototype.run=function(){this.fun.apply(null,this.array)};Jl="browser",Kl="browser",Zl=!0,Ql={},Xl=[],ec="",rc={},tc={},nc={};oc=le,ic=le,ac=le,sc=le,uc=le,fc=le,pc=le;Te=globalThis.performance||{},yc=Te.now||Te.mozNow||Te.msNow||Te.oNow||Te.webkitNow||function(){return new Date().getTime()};xc=new Date;vc={nextTick:Hl,title:Jl,browser:Zl,env:Ql,argv:Xl,version:ec,versions:rc,on:oc,addListener:ic,once:ac,off:sc,removeListener:uc,removeAllListeners:fc,emit:pc,binding:lc,cwd:cc,chdir:dc,umask:mc,hrtime:hc,platform:Kl,release:tc,config:nc,uptime:gc},We=vc});var Nt,Ut,fa=he(()=>{"use strict";a();s();typeof Object.create=="function"?Nt=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Nt=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};Ut=Nt});var xa={};Un(xa,{_extend:()=>jt,debuglog:()=>pa,default:()=>Oc,deprecate:()=>$t,format:()=>$r,inherits:()=>Ut,inspect:()=>k,isArray:()=>Lt,isBoolean:()=>Lr,isBuffer:()=>ma,isDate:()=>_r,isError:()=>Ge,isFunction:()=>ze,isNull:()=>Ve,isNullOrUndefined:()=>la,isNumber:()=>kt,isObject:()=>ce,isPrimitive:()=>da,isRegExp:()=>je,isString:()=>Ye,isSymbol:()=>ca,isUndefined:()=>L,log:()=>ya});function $r(t){if(!Ye(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(k(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,o=n.length,i=String(t).replace(wc,function(p){if(p==="%%")return"%";if(r>=o)return p;switch(p){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(l){return"[Circular]"}default:return p}}),u=n[r];r<o;u=n[++r])Ve(u)||!ce(u)?i+=" "+u:i+=" "+k(u);return i}function $t(t,e){if(L(globalThis.process))return function(){return $t(t,e).apply(this,arguments)};if(We.noDeprecation===!0)return t;var r=!1;function n(){if(!r){if(We.throwDeprecation)throw new Error(e);We.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n}function pa(t){if(L(Bt)&&(Bt=We.env.NODE_DEBUG||""),t=t.toUpperCase(),!Mr[t])if(new RegExp("\\b"+t+"\\b","i").test(Bt)){var e=0;Mr[t]=function(){var r=$r.apply(null,arguments);console.error("%s %d: %s",t,e,r)}}else Mr[t]=function(){};return Mr[t]}function k(t,e){var r={seen:[],stylize:Ec};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Lr(e)?r.showHidden=e:e&&jt(r,e),L(r.showHidden)&&(r.showHidden=!1),L(r.depth)&&(r.depth=2),L(r.colors)&&(r.colors=!1),L(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=bc),Dr(r,t,r.depth)}function bc(t,e){var r=k.styles[e];return r?"\x1B["+k.colors[r][0]+"m"+t+"\x1B["+k.colors[r][1]+"m":t}function Ec(t,e){return t}function Sc(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Dr(t,e,r){if(t.customInspect&&e&&ze(e.inspect)&&e.inspect!==k&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Ye(n)||(n=Dr(t,n,r)),n}var o=Ac(t,e);if(o)return o;var i=Object.keys(e),u=Sc(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),Ge(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Mt(e);if(i.length===0){if(ze(e)){var p=e.name?": "+e.name:"";return t.stylize("[Function"+p+"]","special")}if(je(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_r(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Ge(e))return Mt(e)}var l="",y=!1,h=["{","}"];if(Lt(e)&&(y=!0,h=["[","]"]),ze(e)){var m=e.name?": "+e.name:"";l=" [Function"+m+"]"}if(je(e)&&(l=" "+RegExp.prototype.toString.call(e)),_r(e)&&(l=" "+Date.prototype.toUTCString.call(e)),Ge(e)&&(l=" "+Mt(e)),i.length===0&&(!y||e.length==0))return h[0]+l+h[1];if(r<0)return je(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var g;return y?g=Rc(t,e,r,u,i):g=i.map(function(S){return _t(t,e,r,u,S,y)}),t.seen.pop(),Tc(g,l,h)}function Ac(t,e){if(L(e))return t.stylize("undefined","undefined");if(Ye(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(kt(e))return t.stylize(""+e,"number");if(Lr(e))return t.stylize(""+e,"boolean");if(Ve(e))return t.stylize("null","null")}function Mt(t){return"["+Error.prototype.toString.call(t)+"]"}function Rc(t,e,r,n,o){for(var i=[],u=0,p=e.length;u<p;++u)ha(e,String(u))?i.push(_t(t,e,r,n,String(u),!0)):i.push("");return o.forEach(function(l){l.match(/^\d+$/)||i.push(_t(t,e,r,n,l,!0))}),i}function _t(t,e,r,n,o,i){var u,p,l;if(l=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]},l.get?l.set?p=t.stylize("[Getter/Setter]","special"):p=t.stylize("[Getter]","special"):l.set&&(p=t.stylize("[Setter]","special")),ha(n,o)||(u="["+o+"]"),p||(t.seen.indexOf(l.value)<0?(Ve(r)?p=Dr(t,l.value,null):p=Dr(t,l.value,r-1),p.indexOf(`
|
|
2
|
-
`)>-1&&(
|
|
1
|
+
"use strict";var Wf=Object.create;var lt=Object.defineProperty,jf=Object.defineProperties,zf=Object.getOwnPropertyDescriptor,Vf=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertyNames,jt=Object.getOwnPropertySymbols,Yf=Object.getPrototypeOf,tn=Object.prototype.hasOwnProperty,Bi=Object.prototype.propertyIsEnumerable;var en=(r,t,e)=>t in r?lt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,N=(r,t)=>{for(var e in t||(t={}))tn.call(t,e)&&en(r,e,t[e]);if(jt)for(var e of jt(t))Bi.call(t,e)&&en(r,e,t[e]);return r},qi=(r,t)=>jf(r,Vf(t));var Mi=r=>typeof r=="symbol"?r:r+"",Di=(r,t)=>{var e={};for(var n in r)tn.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&jt)for(var n of jt(r))t.indexOf(n)<0&&Bi.call(r,n)&&(e[n]=r[n]);return e};var Oe=(r,t)=>()=>(r&&(t=r(r=0)),t);var h=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ft=(r,t)=>{for(var e in t)lt(r,e,{get:t[e],enumerable:!0})},Ui=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gf(t))!tn.call(r,i)&&i!==e&<(r,i,{get:()=>t[i],enumerable:!(n=zf(t,i))||n.enumerable});return r};var ki=(r,t,e)=>(e=r!=null?Wf(Yf(r)):{},Ui(t||!r||!r.__esModule?lt(e,"default",{value:r,enumerable:!0}):e,r)),$i=r=>Ui(lt({},"__esModule",{value:!0}),r);var d=(r,t,e)=>en(r,typeof t!="symbol"?t+"":t,e);function Wi(){throw new Error("setTimeout has not been defined")}function ji(){throw new Error("clearTimeout has not been defined")}function zi(r){if(ae===setTimeout)return setTimeout(r,0);if((ae===Wi||!ae)&&setTimeout)return ae=setTimeout,setTimeout(r,0);try{return ae(r,0)}catch(t){try{return ae.call(null,r,0)}catch(e){return ae.call(this,r,0)}}}function Hf(r){if(se===clearTimeout)return clearTimeout(r);if((se===ji||!se)&&clearTimeout)return se=clearTimeout,clearTimeout(r);try{return se(r)}catch(t){try{return se.call(null,r)}catch(e){return se.call(this,r)}}}function Kf(){!Ce||!ge||(Ce=!1,ge.length?Q=ge.concat(Q):zt=-1,Q.length&&Vi())}function Vi(){if(!Ce){var r=zi(Kf);Ce=!0;for(var t=Q.length;t;){for(ge=Q,Q=[];++zt<t;)ge&&ge[zt].run();zt=-1,t=Q.length}ge=null,Ce=!1,Hf(r)}}function Jf(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];Q.push(new Gi(r,t)),Q.length===1&&!Ce&&zi(Vi)}function Gi(r,t){this.fun=r,this.array=t}function xe(){}function dp(r){throw new Error("process.binding is not supported")}function mp(){return"/"}function yp(r){throw new Error("process.chdir is not supported")}function hp(){return 0}function xp(r){var t=gp.call(Le)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function wp(){var r=new Date,t=r-vp;return t/1e3}var ae,se,Q,Ce,ge,zt,Zf,Xf,Qf,ep,tp,rp,np,ip,op,ap,sp,up,lp,fp,pp,cp,Le,gp,vp,c,_i,a=Oe(()=>{"use strict";ae=Wi,se=ji;typeof globalThis.setTimeout=="function"&&(ae=setTimeout);typeof globalThis.clearTimeout=="function"&&(se=clearTimeout);Q=[],Ce=!1,zt=-1;Gi.prototype.run=function(){this.fun.apply(null,this.array)};Zf="browser",Xf="browser",Qf=!0,ep={},tp=[],rp="",np={},ip={},op={};ap=xe,sp=xe,up=xe,lp=xe,fp=xe,pp=xe,cp=xe;Le=globalThis.performance||{},gp=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};vp=new Date;c={nextTick:Jf,title:Zf,browser:Qf,env:ep,argv:tp,version:rp,versions:np,on:ap,addListener:sp,once:up,off:lp,removeListener:fp,removeAllListeners:pp,emit:cp,binding:dp,cwd:mp,chdir:yp,umask:hp,hrtime:xp,platform:Xf,release:ip,config:op,uptime:wp},_i={};Object.keys(_i).forEach(r=>{let t=r.split("."),e=c;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=_i[r]:e=e[i]||(e[i]={})}})});function Ji(){nn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)z[t]=r[t],$[r.charCodeAt(t)]=t;$[45]=62,$[95]=63}function Sp(r){nn||Ji();var t,e,n,i,o,u,f=r.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[f-2]==="="?2:r[f-1]==="="?1:0,u=new bp(f*3/4-o),n=o>0?f-4:f;var p=0;for(t=0,e=0;t<n;t+=4,e+=3)i=$[r.charCodeAt(t)]<<18|$[r.charCodeAt(t+1)]<<12|$[r.charCodeAt(t+2)]<<6|$[r.charCodeAt(t+3)],u[p++]=i>>16&255,u[p++]=i>>8&255,u[p++]=i&255;return o===2?(i=$[r.charCodeAt(t)]<<2|$[r.charCodeAt(t+1)]>>4,u[p++]=i&255):o===1&&(i=$[r.charCodeAt(t)]<<10|$[r.charCodeAt(t+1)]<<4|$[r.charCodeAt(t+2)]>>2,u[p++]=i>>8&255,u[p++]=i&255),u}function Ep(r){return z[r>>18&63]+z[r>>12&63]+z[r>>6&63]+z[r&63]}function Tp(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16)+(r[o+1]<<8)+r[o+2],i.push(Ep(n));return i.join("")}function Yi(r){nn||Ji();for(var t,e=r.length,n=e%3,i="",o=[],u=16383,f=0,p=e-n;f<p;f+=u)o.push(Tp(r,f,f+u>p?p:f+u));return n===1?(t=r[e-1],i+=z[t>>2],i+=z[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=z[t>>10],i+=z[t>>4&63],i+=z[t<<2&63],i+="="),o.push(i),o.join("")}function Vt(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ee(r,t){if(Vt()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=l.prototype):(r===null&&(r=new l(t)),r.length=t),r}function l(r,t,e){if(!l.TYPED_ARRAY_SUPPORT&&!(this instanceof l))return new l(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return on(this,r)}return Zi(this,r,t,e)}function Zi(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Np(r,t,e,n):typeof t=="string"?Ip(r,t,e):Rp(r,t)}function Xi(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Ap(r,t,e,n){return Xi(t),t<=0?ee(r,t):e!==void 0?typeof n=="string"?ee(r,t).fill(e,n):ee(r,t).fill(e):ee(r,t)}function on(r,t){if(Xi(t),r=ee(r,t<0?0:an(t)|0),!l.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Ip(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!l.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Qi(t,e)|0;r=ee(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function rn(r,t){var e=t.length<0?0:an(t.length)|0;r=ee(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Np(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),l.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=l.prototype):r=rn(r,t),r}function Rp(r,t){if(V(t)){var e=an(t.length)|0;return r=ee(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Yp(t.length)?ee(r,0):rn(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return rn(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function an(r){if(r>=Vt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Vt().toString(16)+" bytes");return r|0}function V(r){return!!(r!=null&&r._isBuffer)}function Qi(r,t){if(V(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Gt(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ao(r).length;default:if(n)return Gt(r).length;t=(""+t).toLowerCase(),n=!0}}function Op(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return kp(this,t,e);case"utf8":case"utf-8":return ro(this,t,e);case"ascii":return Dp(this,t,e);case"latin1":case"binary":return Up(this,t,e);case"base64":return qp(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $p(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function ve(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function eo(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=l.from(t,n)),V(t))return t.length===0?-1:Hi(r,t,e,n,i);if(typeof t=="number")return t=t&255,l.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Hi(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Hi(r,t,e,n,i){var o=1,u=r.length,f=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,u/=2,f/=2,e/=2}function p(A,R){return o===1?A[R]:A.readUInt16BE(R*o)}var y;if(i){var g=-1;for(y=e;y<u;y++)if(p(r,y)===p(t,g===-1?0:y-g)){if(g===-1&&(g=y),y-g+1===f)return g*o}else g!==-1&&(y-=y-g),g=-1}else for(e+f>u&&(e=u-f),y=e;y>=0;y--){for(var x=!0,v=0;v<f;v++)if(p(r,y+v)!==p(t,v)){x=!1;break}if(x)return y}return-1}function Lp(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(t.substr(u*2,2),16);if(isNaN(f))return u;r[e+u]=f}return u}function Cp(r,t,e,n){return Kt(Gt(t,r.length-e),r,e,n)}function to(r,t,e,n){return Kt(Vp(t),r,e,n)}function Pp(r,t,e,n){return to(r,t,e,n)}function Fp(r,t,e,n){return Kt(ao(t),r,e,n)}function Bp(r,t,e,n){return Kt(Gp(t,r.length-e),r,e,n)}function qp(r,t,e){return t===0&&e===r.length?Yi(r):Yi(r.slice(t,e))}function ro(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],u=null,f=o>239?4:o>223?3:o>191?2:1;if(i+f<=e){var p,y,g,x;switch(f){case 1:o<128&&(u=o);break;case 2:p=r[i+1],(p&192)===128&&(x=(o&31)<<6|p&63,x>127&&(u=x));break;case 3:p=r[i+1],y=r[i+2],(p&192)===128&&(y&192)===128&&(x=(o&15)<<12|(p&63)<<6|y&63,x>2047&&(x<55296||x>57343)&&(u=x));break;case 4:p=r[i+1],y=r[i+2],g=r[i+3],(p&192)===128&&(y&192)===128&&(g&192)===128&&(x=(o&15)<<18|(p&63)<<12|(y&63)<<6|g&63,x>65535&&x<1114112&&(u=x))}}u===null?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=f}return Mp(n)}function Mp(r){var t=r.length;if(t<=Ki)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Ki));return e}function Dp(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function Up(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function kp(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=t;o<e;++o)i+=zp(r[o]);return i}function $p(r,t,e){for(var n=r.slice(t,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function L(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function D(r,t,e,n,i,o){if(!V(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function Yt(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(r.length-e,2);i<o;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function Ht(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(r.length-e,4);i<o;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function no(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function io(r,t,e,n,i){return i||no(r,t,e,4,34028234663852886e22,-34028234663852886e22),uo(r,t,e,n,23,4),e+4}function oo(r,t,e,n,i){return i||no(r,t,e,8,17976931348623157e292,-17976931348623157e292),uo(r,t,e,n,52,8),e+8}function Wp(r){if(r=jp(r).replace(_p,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function jp(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function zp(r){return r<16?"0"+r.toString(16):r.toString(16)}function Gt(r,t){t=t||1/0;for(var e,n=r.length,i=null,o=[],u=0;u<n;++u){if(e=r.charCodeAt(u),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Vp(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Gp(r,t){for(var e,n,i,o=[],u=0;u<r.length&&!((t-=2)<0);++u)e=r.charCodeAt(u),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ao(r){return Sp(Wp(r))}function Kt(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function Yp(r){return r!==r}function Hp(r){return r!=null&&(!!r._isBuffer||so(r)||Kp(r))}function so(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Kp(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&so(r.slice(0,0))}function Jt(r,t,e,n,i){var o,u,f=i*8-n-1,p=(1<<f)-1,y=p>>1,g=-7,x=e?i-1:0,v=e?-1:1,A=r[t+x];for(x+=v,o=A&(1<<-g)-1,A>>=-g,g+=f;g>0;o=o*256+r[t+x],x+=v,g-=8);for(u=o&(1<<-g)-1,o>>=-g,g+=n;g>0;u=u*256+r[t+x],x+=v,g-=8);if(o===0)o=1-y;else{if(o===p)return u?NaN:(A?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-y}return(A?-1:1)*u*Math.pow(2,o-n)}function uo(r,t,e,n,i,o){var u,f,p,y=o*8-i-1,g=(1<<y)-1,x=g>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,R=n?1:-1,I=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,u=g):(u=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-u))<1&&(u--,p*=2),u+x>=1?t+=v/p:t+=v*Math.pow(2,1-x),t*p>=2&&(u++,p/=2),u+x>=g?(f=0,u=g):u+x>=1?(f=(t*p-1)*Math.pow(2,i),u=u+x):(f=t*Math.pow(2,x-1)*Math.pow(2,i),u=0));i>=8;r[e+A]=f&255,A+=R,f/=256,i-=8);for(u=u<<i|f,y+=i;y>0;r[e+A]=u&255,A+=R,u/=256,y-=8);r[e+A-R]|=I*128}var z,$,bp,nn,Ki,_p,lo=Oe(()=>{"use strict";a();s();z=[],$=[],bp=typeof Uint8Array!="undefined"?Uint8Array:Array,nn=!1;l.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;l.poolSize=8192;l._augment=function(r){return r.__proto__=l.prototype,r};l.from=function(r,t,e){return Zi(null,r,t,e)};l.kMaxLength=Vt();l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&l[Symbol.species]);l.alloc=function(r,t,e){return Ap(null,r,t,e)};l.allocUnsafe=function(r){return on(null,r)};l.allocUnsafeSlow=function(r){return on(null,r)};l.isBuffer=Hp;l.compare=function(t,e){if(!V(t)||!V(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,o=0,u=Math.min(n,i);o<u;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return l.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=l.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var u=t[n];if(!V(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i};l.byteLength=Qi;l.prototype._isBuffer=!0;l.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)ve(this,e,e+1);return this};l.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)ve(this,e,e+3),ve(this,e+1,e+2);return this};l.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)ve(this,e,e+7),ve(this,e+1,e+6),ve(this,e+2,e+5),ve(this,e+3,e+4);return this};l.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?ro(this,0,t):Op.apply(this,arguments)};l.prototype.equals=function(t){if(!V(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:l.compare(this,t)===0};l.prototype.compare=function(t,e,n,i,o){if(!V(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var u=o-i,f=n-e,p=Math.min(u,f),y=this.slice(i,o),g=t.slice(e,n),x=0;x<p;++x)if(y[x]!==g[x]){u=y[x],f=g[x];break}return u<f?-1:f<u?1:0};l.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};l.prototype.indexOf=function(t,e,n){return eo(this,t,e,n,!0)};l.prototype.lastIndexOf=function(t,e,n){return eo(this,t,e,n,!1)};l.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return Lp(this,t,e,n);case"utf8":case"utf-8":return Cp(this,t,e,n);case"ascii":return to(this,t,e,n);case"latin1":case"binary":return Pp(this,t,e,n);case"base64":return Fp(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bp(this,t,e,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ki=4096;l.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(l.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=l.prototype;else{var o=e-t;i=new l(o,void 0);for(var u=0;u<o;++u)i[u]=this[u+t]}return i};l.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=this[t],o=1,u=0;++u<e&&(o*=256);)i+=this[t+u]*o;return i};l.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]};l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8};l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]};l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};l.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=this[t],o=1,u=0;++u<e&&(o*=256);)i+=this[t+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};l.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=e,o=1,u=this[t+--i];i>0&&(o*=256);)u+=this[t+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*e)),u};l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),Jt(this,t,!0,23,4)};l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),Jt(this,t,!1,23,4)};l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),Jt(this,t,!0,52,8)};l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),Jt(this,t,!1,52,8)};l.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;D(this,t,e,n,o,0)}var u=1,f=0;for(this[e]=t&255;++f<n&&(u*=256);)this[e+f]=t/u&255;return e+n};l.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;D(this,t,e,n,o,0)}var u=n-1,f=1;for(this[e+u]=t&255;--u>=0&&(f*=256);)this[e+u]=t/f&255;return e+n};l.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Yt(this,t,e,!0),e+2};l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Yt(this,t,e,!1),e+2};l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):Ht(this,t,e,!0),e+4};l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Ht(this,t,e,!1),e+4};l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);D(this,t,e,n,o-1,-o)}var u=0,f=1,p=0;for(this[e]=t&255;++u<n&&(f*=256);)t<0&&p===0&&this[e+u-1]!==0&&(p=1),this[e+u]=(t/f>>0)-p&255;return e+n};l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);D(this,t,e,n,o-1,-o)}var u=n-1,f=1,p=0;for(this[e+u]=t&255;--u>=0&&(f*=256);)t<0&&p===0&&this[e+u+1]!==0&&(p=1),this[e+u]=(t/f>>0)-p&255;return e+n};l.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};l.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Yt(this,t,e,!0),e+2};l.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Yt(this,t,e,!1),e+2};l.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Ht(this,t,e,!0),e+4};l.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Ht(this,t,e,!1),e+4};l.prototype.writeFloatLE=function(t,e,n){return io(this,t,e,!0,n)};l.prototype.writeFloatBE=function(t,e,n){return io(this,t,e,!1,n)};l.prototype.writeDoubleLE=function(t,e,n){return oo(this,t,e,!0,n)};l.prototype.writeDoubleBE=function(t,e,n){return oo(this,t,e,!1,n)};l.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var o=i-n,u;if(this===t&&n<e&&e<i)for(u=o-1;u>=0;--u)t[u+e]=this[u+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)t[u+e]=this[u+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o};l.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var u;if(typeof t=="number")for(u=e;u<n;++u)this[u]=t;else{var f=V(t)?t:Gt(new l(t,i).toString()),p=f.length;for(u=0;u<n-e;++u)this[u+e]=f[u%p]}return this};_p=/[^+\/0-9A-Za-z-_]/g});var s=Oe(()=>{"use strict";lo()});var sn=h((e0,fo)=>{"use strict";a();s();fo.exports=Object});var co=h((n0,po)=>{"use strict";a();s();po.exports=Error});var yo=h((a0,mo)=>{"use strict";a();s();mo.exports=EvalError});var go=h((l0,ho)=>{"use strict";a();s();ho.exports=RangeError});var vo=h((c0,xo)=>{"use strict";a();s();xo.exports=ReferenceError});var un=h((y0,wo)=>{"use strict";a();s();wo.exports=SyntaxError});var C=h((x0,bo)=>{"use strict";a();s();bo.exports=TypeError});var Eo=h((b0,So)=>{"use strict";a();s();So.exports=URIError});var ln=h((T0,To)=>{"use strict";a();s();To.exports=Math.abs});var fn=h((N0,Ao)=>{"use strict";a();s();Ao.exports=Math.floor});var No=h((L0,Io)=>{"use strict";a();s();Io.exports=Math.max});var pn=h((F0,Ro)=>{"use strict";a();s();Ro.exports=Math.min});var Lo=h((M0,Oo)=>{"use strict";a();s();Oo.exports=Math.pow});var Po=h((k0,Co)=>{"use strict";a();s();Co.exports=Math.round});var Zt=h((W0,Fo)=>{"use strict";a();s();Fo.exports=Number.isNaN||function(t){return t!==t}});var qo=h((V0,Bo)=>{"use strict";a();s();var Jp=Zt();Bo.exports=function(t){return Jp(t)||t===0?t:t<0?-1:1}});var Do=h((H0,Mo)=>{"use strict";a();s();Mo.exports=Object.getOwnPropertyDescriptor});var Pe=h((Z0,Uo)=>{"use strict";a();s();var Xt=Do();if(Xt)try{Xt([],"length")}catch(r){Xt=null}Uo.exports=Xt});var pt=h((ev,ko)=>{"use strict";a();s();var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch(r){Qt=!1}ko.exports=Qt});var cn=h((nv,$o)=>{"use strict";a();s();$o.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==i||f.enumerable!==!0)return!1}return!0}});var dn=h((av,Wo)=>{"use strict";a();s();var _o=typeof Symbol!="undefined"&&Symbol,Zp=cn();Wo.exports=function(){return typeof _o!="function"||typeof Symbol!="function"||typeof _o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Zp()}});var mn=h((lv,jo)=>{"use strict";a();s();jo.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var yn=h((cv,zo)=>{"use strict";a();s();var Xp=sn();zo.exports=Xp.getPrototypeOf||null});var Yo=h((yv,Go)=>{"use strict";a();s();var Qp="Function.prototype.bind called on incompatible ",ec=Object.prototype.toString,tc=Math.max,rc="[object Function]",Vo=function(t,e){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var o=0;o<e.length;o+=1)n[o+t.length]=e[o];return n},nc=function(t,e){for(var n=[],i=e||0,o=0;i<t.length;i+=1,o+=1)n[o]=t[i];return n},ic=function(r,t){for(var e="",n=0;n<r.length;n+=1)e+=r[n],n+1<r.length&&(e+=t);return e};Go.exports=function(t){var e=this;if(typeof e!="function"||ec.apply(e)!==rc)throw new TypeError(Qp+e);for(var n=nc(arguments,1),i,o=function(){if(this instanceof i){var g=e.apply(this,Vo(n,arguments));return Object(g)===g?g:this}return e.apply(t,Vo(n,arguments))},u=tc(0,e.length-n.length),f=[],p=0;p<u;p++)f[p]="$"+p;if(i=Function("binder","return function ("+ic(f,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var y=function(){};y.prototype=e.prototype,i.prototype=new y,y.prototype=null}return i}});var Fe=h((xv,Ho)=>{"use strict";a();s();var oc=Yo();Ho.exports=Function.prototype.bind||oc});var er=h((bv,Ko)=>{"use strict";a();s();Ko.exports=Function.prototype.call});var tr=h((Tv,Jo)=>{"use strict";a();s();Jo.exports=Function.prototype.apply});var Xo=h((Nv,Zo)=>{"use strict";a();s();Zo.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var hn=h((Lv,Qo)=>{"use strict";a();s();var ac=Fe(),sc=tr(),uc=er(),lc=Xo();Qo.exports=lc||ac.call(uc,sc)});var rr=h((Fv,ea)=>{"use strict";a();s();var fc=Fe(),pc=C(),cc=er(),dc=hn();ea.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new pc("a function is required");return dc(fc,cc,t)}});var aa=h((Mv,oa)=>{"use strict";a();s();var mc=rr(),ta=Pe(),na;try{na=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var gn=!!na&&ta&&ta(Object.prototype,"__proto__"),ia=Object,ra=ia.getPrototypeOf;oa.exports=gn&&typeof gn.get=="function"?mc([gn.get]):typeof ra=="function"?function(t){return ra(t==null?t:ia(t))}:!1});var pa=h((kv,fa)=>{"use strict";a();s();var sa=mn(),ua=yn(),la=aa();fa.exports=sa?function(t){return sa(t)}:ua?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ua(t)}:la?function(t){return la(t)}:null});var xn=h((Wv,ca)=>{"use strict";a();s();var yc=Function.prototype.call,hc=Object.prototype.hasOwnProperty,gc=Fe();ca.exports=gc.call(yc,hc)});var G=h((Vv,xa)=>{"use strict";a();s();var E,xc=sn(),vc=co(),wc=yo(),bc=go(),Sc=vo(),De=un(),Me=C(),Ec=Eo(),Tc=ln(),Ac=fn(),Ic=No(),Nc=pn(),Rc=Lo(),Oc=Po(),Lc=qo(),ha=Function,vn=function(r){try{return ha('"use strict"; return ('+r+").constructor;")()}catch(t){}},ct=Pe(),Cc=pt(),wn=function(){throw new Me},Pc=ct?(function(){try{return arguments.callee,wn}catch(r){try{return ct(arguments,"callee").get}catch(t){return wn}}})():wn,Be=dn()(),P=pa(),Fc=yn(),Bc=mn(),ga=tr(),dt=er(),qe={},qc=typeof Uint8Array=="undefined"||!P?E:P(Uint8Array),we={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?E:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?E:ArrayBuffer,"%ArrayIteratorPrototype%":Be&&P?P([][Symbol.iterator]()):E,"%AsyncFromSyncIteratorPrototype%":E,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics=="undefined"?E:Atomics,"%BigInt%":typeof BigInt=="undefined"?E:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?E:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?E:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?E:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vc,"%eval%":eval,"%EvalError%":wc,"%Float16Array%":typeof Float16Array=="undefined"?E:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?E:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?E:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?E:FinalizationRegistry,"%Function%":ha,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array=="undefined"?E:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?E:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?E:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Be&&P?P(P([][Symbol.iterator]())):E,"%JSON%":typeof JSON=="object"?JSON:E,"%Map%":typeof Map=="undefined"?E:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Be||!P?E:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":xc,"%Object.getOwnPropertyDescriptor%":ct,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?E:Promise,"%Proxy%":typeof Proxy=="undefined"?E:Proxy,"%RangeError%":bc,"%ReferenceError%":Sc,"%Reflect%":typeof Reflect=="undefined"?E:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?E:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Be||!P?E:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?E:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Be&&P?P(""[Symbol.iterator]()):E,"%Symbol%":Be?Symbol:E,"%SyntaxError%":De,"%ThrowTypeError%":Pc,"%TypedArray%":qc,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array=="undefined"?E:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?E:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?E:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?E:Uint32Array,"%URIError%":Ec,"%WeakMap%":typeof WeakMap=="undefined"?E:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?E:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?E:WeakSet,"%Function.prototype.call%":dt,"%Function.prototype.apply%":ga,"%Object.defineProperty%":Cc,"%Object.getPrototypeOf%":Fc,"%Math.abs%":Tc,"%Math.floor%":Ac,"%Math.max%":Ic,"%Math.min%":Nc,"%Math.pow%":Rc,"%Math.round%":Oc,"%Math.sign%":Lc,"%Reflect.getPrototypeOf%":Bc};if(P)try{null.error}catch(r){da=P(P(r)),we["%Error.prototype%"]=da}var da,Mc=function r(t){var e;if(t==="%AsyncFunction%")e=vn("async function () {}");else if(t==="%GeneratorFunction%")e=vn("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=vn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&P&&(e=P(i.prototype))}return we[t]=e,e},ma={__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"]},mt=Fe(),nr=xn(),Dc=mt.call(dt,Array.prototype.concat),Uc=mt.call(ga,Array.prototype.splice),ya=mt.call(dt,String.prototype.replace),ir=mt.call(dt,String.prototype.slice),kc=mt.call(dt,RegExp.prototype.exec),$c=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_c=/\\(\\)?/g,Wc=function(t){var e=ir(t,0,1),n=ir(t,-1);if(e==="%"&&n!=="%")throw new De("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new De("invalid intrinsic syntax, expected opening `%`");var i=[];return ya(t,$c,function(o,u,f,p){i[i.length]=f?ya(p,_c,"$1"):u||o}),i},jc=function(t,e){var n=t,i;if(nr(ma,n)&&(i=ma[n],n="%"+i[0]+"%"),nr(we,n)){var o=we[n];if(o===qe&&(o=Mc(n)),typeof o=="undefined"&&!e)throw new Me("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new De("intrinsic "+t+" does not exist!")};xa.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(kc(/^%?[^%]*%?$/,t)===null)throw new De("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Wc(t),i=n.length>0?n[0]:"",o=jc("%"+i+"%",e),u=o.name,f=o.value,p=!1,y=o.alias;y&&(i=y[0],Uc(n,Dc([0,1],y)));for(var g=1,x=!0;g<n.length;g+=1){var v=n[g],A=ir(v,0,1),R=ir(v,-1);if((A==='"'||A==="'"||A==="`"||R==='"'||R==="'"||R==="`")&&A!==R)throw new De("property names with quotes must have matching quotes");if((v==="constructor"||!x)&&(p=!0),i+="."+v,u="%"+i+"%",nr(we,u))f=we[u];else if(f!=null){if(!(v in f)){if(!e)throw new Me("base intrinsic for "+t+" exists, but the property is not available.");return}if(ct&&g+1>=n.length){var I=ct(f,v);x=!!I,x&&"get"in I&&!("originalValue"in I.get)?f=I.get:f=f[v]}else x=nr(f,v),f=f[v];x&&!p&&(we[u]=f)}}return f}});var or=h((Hv,ba)=>{"use strict";a();s();var va=pt(),zc=un(),Ue=C(),wa=Pe();ba.exports=function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Ue("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ue("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ue("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ue("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ue("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ue("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!wa&&wa(t,e);if(va)va(t,e,{configurable:u===null&&p?p.configurable:!u,enumerable:i===null&&p?p.enumerable:!i,value:n,writable:o===null&&p?p.writable:!o});else if(f||!i&&!o&&!u)t[e]=n;else throw new zc("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var ar=h((Zv,Ea)=>{"use strict";a();s();var bn=pt(),Sa=function(){return!!bn};Sa.hasArrayLengthDefineBug=function(){if(!bn)return null;try{return bn([],"length",{value:1}).length!==1}catch(t){return!0}};Ea.exports=Sa});var Ra=h((ew,Na)=>{"use strict";a();s();var Vc=G(),Ta=or(),Gc=ar()(),Aa=Pe(),Ia=C(),Yc=Vc("%Math.floor%");Na.exports=function(t,e){if(typeof t!="function")throw new Ia("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||Yc(e)!==e)throw new Ia("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in t&&Aa){var u=Aa(t,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(o=!1)}return(i||o||!n)&&(Gc?Ta(t,"length",e,!0,!0):Ta(t,"length",e)),t}});var La=h((nw,Oa)=>{"use strict";a();s();var Hc=Fe(),Kc=tr(),Jc=hn();Oa.exports=function(){return Jc(Hc,Kc,arguments)}});var ur=h((aw,sr)=>{"use strict";a();s();var Zc=Ra(),Ca=pt(),Xc=rr(),Pa=La();sr.exports=function(t){var e=Xc(arguments),n=t.length-(arguments.length-1);return Zc(e,1+(n>0?n:0),!0)};Ca?Ca(sr.exports,"apply",{value:Pa}):sr.exports.apply=Pa});var Sn=h((lw,Ba)=>{"use strict";a();s();var Fa=Object.prototype.toString;Ba.exports=function(t){var e=Fa.call(t),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Fa.call(t.callee)==="[object Function]"),n}});var ja=h((cw,Wa)=>{"use strict";a();s();var _a;Object.keys||(yt=Object.prototype.hasOwnProperty,En=Object.prototype.toString,qa=Sn(),Tn=Object.prototype.propertyIsEnumerable,Ma=!Tn.call({toString:null},"toString"),Da=Tn.call(function(){},"prototype"),ht=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lr=function(r){var t=r.constructor;return t&&t.prototype===r},Ua={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},ka=(function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!Ua["$"+r]&&yt.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{lr(window[r])}catch(t){return!0}}catch(t){return!0}return!1})(),$a=function(r){if(typeof window=="undefined"||!ka)return lr(r);try{return lr(r)}catch(t){return!1}},_a=function(t){var e=t!==null&&typeof t=="object",n=En.call(t)==="[object Function]",i=qa(t),o=e&&En.call(t)==="[object String]",u=[];if(!e&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var f=Da&&n;if(o&&t.length>0&&!yt.call(t,0))for(var p=0;p<t.length;++p)u.push(String(p));if(i&&t.length>0)for(var y=0;y<t.length;++y)u.push(String(y));else for(var g in t)!(f&&g==="prototype")&&yt.call(t,g)&&u.push(String(g));if(Ma)for(var x=$a(t),v=0;v<ht.length;++v)!(x&&ht[v]==="constructor")&&yt.call(t,ht[v])&&u.push(ht[v]);return u});var yt,En,qa,Tn,Ma,Da,ht,lr,Ua,ka,$a;Wa.exports=_a});var Ya=h((yw,Ga)=>{"use strict";a();s();var Qc=Array.prototype.slice,ed=Sn(),za=Object.keys,fr=za?function(t){return za(t)}:ja(),Va=Object.keys;fr.shim=function(){if(Object.keys){var t=(function(){var e=Object.keys(arguments);return e&&e.length===arguments.length})(1,2);t||(Object.keys=function(n){return ed(n)?Va(Qc.call(n)):Va(n)})}else Object.keys=fr;return Object.keys||fr};Ga.exports=fr});var pr=h((xw,Za)=>{"use strict";a();s();var td=Ya(),rd=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",nd=Object.prototype.toString,id=Array.prototype.concat,Ha=or(),od=function(r){return typeof r=="function"&&nd.call(r)==="[object Function]"},Ka=ar()(),ad=function(r,t,e,n){if(t in r){if(n===!0){if(r[t]===e)return}else if(!od(n)||!n())return}Ka?Ha(r,t,e,!0):Ha(r,t,e)},Ja=function(r,t){var e=arguments.length>2?arguments[2]:{},n=td(t);rd&&(n=id.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)ad(r,n[i],t[n[i]],e[n[i]])};Ja.supportsDescriptors=!!Ka;Za.exports=Ja});var Y=h((bw,es)=>{"use strict";a();s();var Xa=G(),Qa=rr(),sd=Qa([Xa("%String.prototype.indexOf%")]);es.exports=function(t,e){var n=Xa(t,!!e);return typeof n=="function"&&sd(t,".prototype.")>-1?Qa([n]):n}});var ns=h((Tw,rs)=>{"use strict";a();s();var ud=G(),ts=ud("%Array%"),ld=!ts.isArray&&Y()("Object.prototype.toString");rs.exports=ts.isArray||function(t){return ld(t)==="[object Array]"}});var An=h((Nw,is)=>{"use strict";a();s();is.exports=ns()});var as=h((Lw,os)=>{"use strict";a();s();var fd=G(),pd=Y(),cd=C(),dd=An(),md=fd("%Reflect.apply%",!0)||pd("Function.prototype.apply");os.exports=function(t,e){var n=arguments.length>2?arguments[2]:[];if(!dd(n))throw new cd("Assertion failed: optional `argumentsList`, if provided, must be a List");return md(t,e,n)}});function ss(){throw new Error("setTimeout has not been defined")}function us(){throw new Error("clearTimeout has not been defined")}function ls(r){if(ue===setTimeout)return setTimeout(r,0);if((ue===ss||!ue)&&setTimeout)return ue=setTimeout,setTimeout(r,0);try{return ue(r,0)}catch(t){try{return ue.call(null,r,0)}catch(e){return ue.call(this,r,0)}}}function yd(r){if(le===clearTimeout)return clearTimeout(r);if((le===us||!le)&&clearTimeout)return le=clearTimeout,clearTimeout(r);try{return le(r)}catch(t){try{return le.call(null,r)}catch(e){return le.call(this,r)}}}function hd(){!$e||!be||($e=!1,be.length?te=be.concat(te):cr=-1,te.length&&fs())}function fs(){if(!$e){var r=ls(hd);$e=!0;for(var t=te.length;t;){for(be=te,te=[];++cr<t;)be&&be[cr].run();cr=-1,t=te.length}be=null,$e=!1,yd(r)}}function gd(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];te.push(new ps(r,t)),te.length===1&&!$e&&ls(fs)}function ps(r,t){this.fun=r,this.array=t}function Se(){}function Bd(r){throw new Error("process.binding is not supported")}function qd(){return"/"}function Md(r){throw new Error("process.chdir is not supported")}function Dd(){return 0}function kd(r){var t=Ud.call(ke)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function _d(){var r=new Date,t=r-$d;return t/1e3}var ue,le,te,$e,be,cr,xd,vd,wd,bd,Sd,Ed,Td,Ad,Id,Nd,Rd,Od,Ld,Cd,Pd,Fd,ke,Ud,$d,Wd,gt,cs=Oe(()=>{"use strict";a();s();ue=ss,le=us;typeof globalThis.setTimeout=="function"&&(ue=setTimeout);typeof globalThis.clearTimeout=="function"&&(le=clearTimeout);te=[],$e=!1,cr=-1;ps.prototype.run=function(){this.fun.apply(null,this.array)};xd="browser",vd="browser",wd=!0,bd={},Sd=[],Ed="",Td={},Ad={},Id={};Nd=Se,Rd=Se,Od=Se,Ld=Se,Cd=Se,Pd=Se,Fd=Se;ke=globalThis.performance||{},Ud=ke.now||ke.mozNow||ke.msNow||ke.oNow||ke.webkitNow||function(){return new Date().getTime()};$d=new Date;Wd={nextTick:gd,title:xd,browser:wd,env:bd,argv:Sd,version:Ed,versions:Td,on:Nd,addListener:Rd,once:Od,off:Ld,removeListener:Cd,removeAllListeners:Pd,emit:Fd,binding:Bd,cwd:qd,chdir:Md,umask:Dd,hrtime:kd,platform:vd,release:Ad,config:Id,uptime:_d},gt=Wd});var In,Nn,ds=Oe(()=>{"use strict";a();s();typeof Object.create=="function"?In=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:In=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t};Nn=In});var bs={};ft(bs,{_extend:()=>Mn,debuglog:()=>ms,default:()=>Xd,deprecate:()=>Pn,format:()=>hr,inherits:()=>Nn,inspect:()=>K,isArray:()=>Fn,isBoolean:()=>gr,isBuffer:()=>xs,isDate:()=>yr,isError:()=>vt,isFunction:()=>wt,isNull:()=>bt,isNullOrUndefined:()=>ys,isNumber:()=>Bn,isObject:()=>Ee,isPrimitive:()=>gs,isRegExp:()=>xt,isString:()=>St,isSymbol:()=>hs,isUndefined:()=>H,log:()=>vs});function hr(r){if(!St(r)){for(var t=[],e=0;e<arguments.length;e++)t.push(K(arguments[e]));return t.join(" ")}for(var e=1,n=arguments,i=n.length,o=String(r).replace(jd,function(f){if(f==="%%")return"%";if(e>=i)return f;switch(f){case"%s":return String(n[e++]);case"%d":return Number(n[e++]);case"%j":try{return JSON.stringify(n[e++])}catch(p){return"[Circular]"}default:return f}}),u=n[e];e<i;u=n[++e])bt(u)||!Ee(u)?o+=" "+u:o+=" "+K(u);return o}function Pn(r,t){if(H(globalThis.process))return function(){return Pn(r,t).apply(this,arguments)};if(gt.noDeprecation===!0)return r;var e=!1;function n(){if(!e){if(gt.throwDeprecation)throw new Error(t);gt.traceDeprecation?console.trace(t):console.error(t),e=!0}return r.apply(this,arguments)}return n}function ms(r){if(H(Rn)&&(Rn=gt.env.NODE_DEBUG||""),r=r.toUpperCase(),!dr[r])if(new RegExp("\\b"+r+"\\b","i").test(Rn)){var t=0;dr[r]=function(){var e=hr.apply(null,arguments);console.error("%s %d: %s",r,t,e)}}else dr[r]=function(){};return dr[r]}function K(r,t){var e={seen:[],stylize:Vd};return arguments.length>=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),gr(t)?e.showHidden=t:t&&Mn(e,t),H(e.showHidden)&&(e.showHidden=!1),H(e.depth)&&(e.depth=2),H(e.colors)&&(e.colors=!1),H(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=zd),mr(e,r,e.depth)}function zd(r,t){var e=K.styles[t];return e?"\x1B["+K.colors[e][0]+"m"+r+"\x1B["+K.colors[e][1]+"m":r}function Vd(r,t){return r}function Gd(r){var t={};return r.forEach(function(e,n){t[e]=!0}),t}function mr(r,t,e){if(r.customInspect&&t&&wt(t.inspect)&&t.inspect!==K&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(e,r);return St(n)||(n=mr(r,n,e)),n}var i=Yd(r,t);if(i)return i;var o=Object.keys(t),u=Gd(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(t)),vt(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return On(t);if(o.length===0){if(wt(t)){var f=t.name?": "+t.name:"";return r.stylize("[Function"+f+"]","special")}if(xt(t))return r.stylize(RegExp.prototype.toString.call(t),"regexp");if(yr(t))return r.stylize(Date.prototype.toString.call(t),"date");if(vt(t))return On(t)}var p="",y=!1,g=["{","}"];if(Fn(t)&&(y=!0,g=["[","]"]),wt(t)){var x=t.name?": "+t.name:"";p=" [Function"+x+"]"}if(xt(t)&&(p=" "+RegExp.prototype.toString.call(t)),yr(t)&&(p=" "+Date.prototype.toUTCString.call(t)),vt(t)&&(p=" "+On(t)),o.length===0&&(!y||t.length==0))return g[0]+p+g[1];if(e<0)return xt(t)?r.stylize(RegExp.prototype.toString.call(t),"regexp"):r.stylize("[Object]","special");r.seen.push(t);var v;return y?v=Hd(r,t,e,u,o):v=o.map(function(A){return Cn(r,t,e,u,A,y)}),r.seen.pop(),Kd(v,p,g)}function Yd(r,t){if(H(t))return r.stylize("undefined","undefined");if(St(t)){var e="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(e,"string")}if(Bn(t))return r.stylize(""+t,"number");if(gr(t))return r.stylize(""+t,"boolean");if(bt(t))return r.stylize("null","null")}function On(r){return"["+Error.prototype.toString.call(r)+"]"}function Hd(r,t,e,n,i){for(var o=[],u=0,f=t.length;u<f;++u)ws(t,String(u))?o.push(Cn(r,t,e,n,String(u),!0)):o.push("");return i.forEach(function(p){p.match(/^\d+$/)||o.push(Cn(r,t,e,n,p,!0))}),o}function Cn(r,t,e,n,i,o){var u,f,p;if(p=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},p.get?p.set?f=r.stylize("[Getter/Setter]","special"):f=r.stylize("[Getter]","special"):p.set&&(f=r.stylize("[Setter]","special")),ws(n,i)||(u="["+i+"]"),f||(r.seen.indexOf(p.value)<0?(bt(e)?f=mr(r,p.value,null):f=mr(r,p.value,e-1),f.indexOf(`
|
|
2
|
+
`)>-1&&(o?f=f.split(`
|
|
3
3
|
`).map(function(y){return" "+y}).join(`
|
|
4
|
-
`).substr(2):
|
|
5
|
-
`+
|
|
4
|
+
`).substr(2):f=`
|
|
5
|
+
`+f.split(`
|
|
6
6
|
`).map(function(y){return" "+y}).join(`
|
|
7
|
-
`))):
|
|
8
|
-
`)>=0&&n++,
|
|
9
|
-
`)+" "+
|
|
10
|
-
`)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Lt(t){return Array.isArray(t)}function Lr(t){return typeof t=="boolean"}function Ve(t){return t===null}function la(t){return t==null}function kt(t){return typeof t=="number"}function Ye(t){return typeof t=="string"}function ca(t){return typeof t=="symbol"}function L(t){return t===void 0}function je(t){return ce(t)&&Wt(t)==="[object RegExp]"}function ce(t){return typeof t=="object"&&t!==null}function _r(t){return ce(t)&&Wt(t)==="[object Date]"}function Ge(t){return ce(t)&&(Wt(t)==="[object Error]"||t instanceof Error)}function ze(t){return typeof t=="function"}function da(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t=="undefined"}function ma(t){return f.isBuffer(t)}function Wt(t){return Object.prototype.toString.call(t)}function Dt(t){return t<10?"0"+t.toString(10):t.toString(10)}function Pc(){var t=new Date,e=[Dt(t.getHours()),Dt(t.getMinutes()),Dt(t.getSeconds())].join(":");return[t.getDate(),Ic[t.getMonth()],e].join(" ")}function ya(){console.log("%s - %s",Pc(),$r.apply(null,arguments))}function jt(t,e){if(!e||!ce(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function ha(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var wc,Mr,Bt,Ic,Oc,ga=he(()=>{"use strict";a();s();ua();fa();wc=/%[sdj%]/g;Mr={};k.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};k.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};Ic=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Oc={inherits:Ut,_extend:jt,log:ya,isBuffer:ma,isPrimitive:da,isFunction:ze,isError:Ge,isDate:_r,isObject:ce,isRegExp:je,isUndefined:L,isSymbol:ca,isString:Ye,isNumber:kt,isNullOrUndefined:la,isNull:Ve,isBoolean:Lr,isArray:Lt,inspect:k,deprecate:$t,format:$r,debuglog:pa}});var va=d((Fg,kr)=>{"use strict";a();s();var de=(ga(),Mn(xa));if(de&&de.default){kr.exports=de.default;for(let t in de)kr.exports[t]=de[t]}else de&&(kr.exports=de)});var ba=d((Ng,wa)=>{"use strict";a();s();wa.exports=va().inspect});var Qe=d((Mg,ka)=>{"use strict";a();s();var Xt=typeof Map=="function"&&Map.prototype,Gt=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,jr=Xt&&Gt&&typeof Gt.get=="function"?Gt.get:null,Ea=Xt&&Map.prototype.forEach,en=typeof Set=="function"&&Set.prototype,zt=Object.getOwnPropertyDescriptor&&en?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Gr=en&&zt&&typeof zt.get=="function"?zt.get:null,Sa=en&&Set.prototype.forEach,Fc=typeof WeakMap=="function"&&WeakMap.prototype,Je=Fc?WeakMap.prototype.has:null,Cc=typeof WeakSet=="function"&&WeakSet.prototype,Ke=Cc?WeakSet.prototype.has:null,qc=typeof WeakRef=="function"&&WeakRef.prototype,Aa=qc?WeakRef.prototype.deref:null,Nc=Boolean.prototype.valueOf,Uc=Object.prototype.toString,Bc=Function.prototype.toString,Mc=String.prototype.match,rn=String.prototype.slice,re=String.prototype.replace,Dc=String.prototype.toUpperCase,Ra=String.prototype.toLowerCase,Ua=RegExp.prototype.test,Ta=Array.prototype.concat,W=Array.prototype.join,_c=Array.prototype.slice,Ia=Math.floor,Ht=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Vt=Object.getOwnPropertySymbols,Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ze=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Pe||!0)?Symbol.toStringTag:null,Ba=Object.prototype.propertyIsEnumerable,Pa=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Oa(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Ua.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Ia(-t):Ia(t);if(n!==t){var o=String(n),i=rn.call(e,o.length+1);return re.call(o,r,"$&_")+"."+re.call(re.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return re.call(e,r,"$&_")}var Kt=ba(),Fa=Kt.custom,Ca=_a(Fa)?Fa:null,Ma={__proto__:null,double:'"',single:"'"},$c={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ka.exports=function t(e,r,n,o){var i=r||{};if(Y(i,"quoteStyle")&&!Y(Ma,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Y(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 u=Y(i,"customInspect")?i.customInspect:!0;if(typeof u!="boolean"&&u!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Y(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(Y(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=i.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return La(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return p?Oa(e,l):l}if(typeof e=="bigint"){var y=String(e)+"n";return p?Oa(e,y):y}var h=typeof i.depth=="undefined"?5:i.depth;if(typeof n=="undefined"&&(n=0),n>=h&&h>0&&typeof e=="object")return Zt(e)?"[Array]":"[Object]";var m=nd(i,n);if(typeof o=="undefined")o=[];else if($a(o,e)>=0)return"[Circular]";function g(ye,lr,xf){if(lr&&(o=_c.call(o),o.push(lr)),xf){var Pn={depth:i.depth};return Y(i,"quoteStyle")&&(Pn.quoteStyle=i.quoteStyle),t(ye,Pn,n+1,o)}return t(ye,i,n+1,o)}if(typeof e=="function"&&!qa(e)){var S=Hc(e),I=Wr(e,g);return"[Function"+(S?": "+S:" (anonymous)")+"]"+(I.length>0?" { "+W.call(I,", ")+" }":"")}if(_a(e)){var T=Pe?re.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Jt.call(e);return typeof e=="object"&&!Pe?He(T):T}if(ed(e)){for(var q="<"+Ra.call(String(e.nodeName)),U=e.attributes||[],j=0;j<U.length;j++)q+=" "+U[j].name+"="+Da(Lc(U[j].value),"double",i);return q+=">",e.childNodes&&e.childNodes.length&&(q+="..."),q+="</"+Ra.call(String(e.nodeName))+">",q}if(Zt(e)){if(e.length===0)return"[]";var ie=Wr(e,g);return m&&!td(ie)?"["+Qt(ie,m)+"]":"[ "+W.call(ie,", ")+" ]"}if(Wc(e)){var Ue=Wr(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!Ba.call(e,"cause")?"{ ["+String(e)+"] "+W.call(Ta.call("[cause]: "+g(e.cause),Ue),", ")+" }":Ue.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+W.call(Ue,", ")+" }"}if(typeof e=="object"&&u){if(Ca&&typeof e[Ca]=="function"&&Kt)return Kt(e,{depth:h-n});if(u!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Jc(e)){var pr=[];return Ea&&Ea.call(e,function(ye,lr){pr.push(g(lr,e,!0)+" => "+g(ye,e))}),Na("Map",jr.call(e),pr,m)}if(Qc(e)){var Rn=[];return Sa&&Sa.call(e,function(ye){Rn.push(g(ye,e))}),Na("Set",Gr.call(e),Rn,m)}if(Kc(e))return Yt("WeakMap");if(Xc(e))return Yt("WeakSet");if(Zc(e))return Yt("WeakRef");if(Gc(e))return He(g(Number(e)));if(Vc(e))return He(g(Ht.call(e)));if(zc(e))return He(Nc.call(e));if(jc(e))return He(g(String(e)));if(typeof window!="undefined"&&e===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&e===globalThis||typeof globalThis!="undefined"&&e===globalThis)return"{ [object globalThis] }";if(!kc(e)&&!qa(e)){var it=Wr(e,g),Tn=Pa?Pa(e)===Object.prototype:e instanceof Object||e.constructor===Object,at=e instanceof Object?"":"null prototype",In=!Tn&&Ze&&Object(e)===e&&Ze in e?rn.call(te(e),8,-1):at?"Object":"",hf=Tn||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",st=hf+(In||at?"["+W.call(Ta.call([],In||[],at||[]),": ")+"] ":"");return it.length===0?st+"{}":m?st+"{"+Qt(it,m)+"}":st+"{ "+W.call(it,", ")+" }"}return String(e)};function Da(t,e,r){var n=r.quoteStyle||e,o=Ma[n];return o+t+o}function Lc(t){return re.call(String(t),/"/g,""")}function me(t){return!Ze||!(typeof t=="object"&&(Ze in t||typeof t[Ze]!="undefined"))}function Zt(t){return te(t)==="[object Array]"&&me(t)}function kc(t){return te(t)==="[object Date]"&&me(t)}function qa(t){return te(t)==="[object RegExp]"&&me(t)}function Wc(t){return te(t)==="[object Error]"&&me(t)}function jc(t){return te(t)==="[object String]"&&me(t)}function Gc(t){return te(t)==="[object Number]"&&me(t)}function zc(t){return te(t)==="[object Boolean]"&&me(t)}function _a(t){if(Pe)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Jt)return!1;try{return Jt.call(t),!0}catch(e){}return!1}function Vc(t){if(!t||typeof t!="object"||!Ht)return!1;try{return Ht.call(t),!0}catch(e){}return!1}var Yc=Object.prototype.hasOwnProperty||function(t){return t in this};function Y(t,e){return Yc.call(t,e)}function te(t){return Uc.call(t)}function Hc(t){if(t.name)return t.name;var e=Mc.call(Bc.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function $a(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Jc(t){if(!jr||!t||typeof t!="object")return!1;try{jr.call(t);try{Gr.call(t)}catch(e){return!0}return t instanceof Map}catch(e){}return!1}function Kc(t){if(!Je||!t||typeof t!="object")return!1;try{Je.call(t,Je);try{Ke.call(t,Ke)}catch(e){return!0}return t instanceof WeakMap}catch(e){}return!1}function Zc(t){if(!Aa||!t||typeof t!="object")return!1;try{return Aa.call(t),!0}catch(e){}return!1}function Qc(t){if(!Gr||!t||typeof t!="object")return!1;try{Gr.call(t);try{jr.call(t)}catch(e){return!0}return t instanceof Set}catch(e){}return!1}function Xc(t){if(!Ke||!t||typeof t!="object")return!1;try{Ke.call(t,Ke);try{Je.call(t,Je)}catch(e){return!0}return t instanceof WeakSet}catch(e){}return!1}function ed(t){return!t||typeof t!="object"?!1:typeof HTMLElement!="undefined"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function La(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return La(rn.call(t,0,e.maxStringLength),e)+n}var o=$c[e.quoteStyle||"single"];o.lastIndex=0;var i=re.call(re.call(t,o,"\\$1"),/[\x00-\x1f]/g,rd);return Da(i,"single",e)}function rd(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Dc.call(e.toString(16))}function He(t){return"Object("+t+")"}function Yt(t){return t+" { ? }"}function Na(t,e,r,n){var o=n?Qt(r,n):W.call(r,", ");return t+" ("+e+") {"+o+"}"}function td(t){for(var e=0;e<t.length;e++)if($a(t[e],`
|
|
11
|
-
`)>=0)return!1;return!0}function
|
|
12
|
-
`+
|
|
13
|
-
`+e.prev}function Wr(t,e){var r=Zt(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=Y(t,o)?e(t[o],t):""}var i=typeof Vt=="function"?Vt(t):[],u;if(Pe){u={};for(var p=0;p<i.length;p++)u["$"+i[p]]=i[p]}for(var l in t)Y(t,l)&&(r&&String(Number(l))===l&&l<t.length||Pe&&u["$"+l]instanceof Symbol||(Ua.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof Vt=="function")for(var y=0;y<i.length;y++)Ba.call(t,i[y])&&n.push("["+e(i[y])+"]: "+e(t[i[y]],t));return n}});var zr=d(($g,Wa)=>{"use strict";a();s();Wa.exports=function(e){return typeof e=="string"||typeof e=="symbol"}});var Ga=d((Wg,ja)=>{"use strict";a();s();var od=O(),id=Qe(),ad=zr();ja.exports=function(e,r){if(!ad(r))throw new od("Assertion failed: P is not a Property Key, got "+id(r));return e[r]}});var Ha=d((zg,Ya)=>{"use strict";a();s();var Va=Function.prototype.toString,Oe=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,nn,Vr;if(typeof Oe=="function"&&typeof Object.defineProperty=="function")try{nn=Object.defineProperty({},"length",{get:function(){throw Vr}}),Vr={},Oe(function(){throw 42},null,nn)}catch(t){t!==Vr&&(Oe=null)}else Oe=null;var sd=/^\s*class\b/,on=function(e){try{var r=Va.call(e);return sd.test(r)}catch(n){return!1}},tn=function(e){try{return on(e)?!1:(Va.call(e),!0)}catch(r){return!1}},Yr=Object.prototype.toString,ud="[object Object]",fd="[object Function]",pd="[object GeneratorFunction]",ld="[object HTMLAllCollection]",cd="[object HTML document.all class]",dd="[object HTMLCollection]",md=typeof Symbol=="function"&&!!Symbol.toStringTag,yd=!(0 in[,]),an=function(){return!1};typeof document=="object"&&(za=document.all,Yr.call(za)===Yr.call(document.all)&&(an=function(e){if((yd||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var r=Yr.call(e);return(r===ld||r===cd||r===dd||r===ud)&&e("")==null}catch(n){}return!1}));var za;Ya.exports=Oe?function(e){if(an(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Oe(e,null,nn)}catch(r){if(r!==Vr)return!1}return!on(e)&&tn(e)}:function(e){if(an(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(md)return tn(e);if(on(e))return!1;var r=Yr.call(e);return r!==fd&&r!==pd&&!/^\[object HTML/.test(r)?!1:tn(e)}});var sn=d((Hg,Ja)=>{"use strict";a();s();Ja.exports=Ha()});var Xa=d((Zg,Qa)=>{"use strict";a();s();var Ka=O(),hd=Ga(),xd=sn(),gd=zr(),Za=Qe();Qa.exports=function(e,r){if(!gd(r))throw new Ka("Assertion failed: P is not a Property Key");var n=hd(e,r);if(n!=null){if(!xd(n))throw new Ka(Za(r)+" is not a function: "+Za(n));return n}}});var rs=d((ev,es)=>{"use strict";a();s();var vd=wr();es.exports=function(e){return(typeof e=="number"||typeof e=="bigint")&&!vd(e)&&e!==1/0&&e!==-1/0}});var Hr=d((nv,ts)=>{"use strict";a();s();var wd=ht(),bd=xt(),Ed=wr(),Sd=rs();ts.exports=function(e){if(typeof e!="number"||Ed(e)||!Sd(e))return!1;var r=wd(e);return bd(r)===r}});var un=d((av,ns)=>{"use strict";a();s();ns.exports=function(e){return!!e&&(typeof e=="function"||typeof e=="object")}});var is=d((fv,os)=>{"use strict";a();s();var Ad=vt();os.exports=function(){return Ad()&&!!Symbol.toStringTag}});var cn=d((cv,ps)=>{"use strict";a();s();var as=$(),Rd=is()(),Td=Rt(),Id=ve(),ln;Rd?(ss=as("RegExp.prototype.exec"),fn={},Jr=function(){throw fn},pn={toString:Jr,valueOf:Jr},typeof Symbol.toPrimitive=="symbol"&&(pn[Symbol.toPrimitive]=Jr),ln=function(e){if(!e||typeof e!="object")return!1;var r=Id(e,"lastIndex"),n=r&&Td(r,"value");if(!n)return!1;try{ss(e,pn)}catch(o){return o===fn}}):(us=as("Object.prototype.toString"),fs="[object RegExp]",ln=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:us(e)===fs});var ss,fn,Jr,pn,us,fs;ps.exports=ln});var dn=d((yv,ls)=>{"use strict";a();s();var Pd=$(),Od=cn(),Fd=Pd("RegExp.prototype.exec"),Cd=O();ls.exports=function(e){if(!Od(e))throw new Cd("`regex` must be a RegExp");return function(n){return Fd(e,n)!==null}}});var ms=d((gv,ds)=>{"use strict";a();s();var cs=O(),qd=Qe(),Nd=zr(),Ud=un();ds.exports=function(e,r){if(!Ud(e))throw new cs("Assertion failed: Type(O) is not Object");if(!Nd(r))throw new cs("Assertion failed: P is not a Property Key, got "+qd(r));return e[r]}});var hs=d((bv,ys)=>{"use strict";a();s();ys.exports=gt()});var yn=d((Av,xs)=>{"use strict";a();s();var Bd=$(),mn=O(),Md=Hr(),Dd=Bd("String.prototype.slice");xs.exports=function(e,r,n){if(typeof e!="string")throw new mn("Assertion failed: `string` must be a String");if(typeof r!="string")throw new mn("Assertion failed: `searchValue` must be a String");if(!Md(n)||n<0)throw new mn("Assertion failed: `fromIndex` must be a non-negative integer");var o=e.length;if(r===""&&n<=o)return n;for(var i=r.length,u=n;u<=o-i;u+=1){var p=Dd(e,u,u+i);if(p===r)return u}return"NOT-FOUND"}});var Kr=d((Iv,gs)=>{"use strict";a();s();var _d=O();gs.exports=function(e){if(e==null)throw new _d(arguments.length>0&&arguments[1]||"Cannot call method on "+e);return e}});var ws=d((Fv,vs)=>{"use strict";a();s();var $d=_(),Ld=$d("%String%"),kd=O();vs.exports=function(e){if(typeof e=="symbol")throw new kd("Cannot convert a Symbol value to a string");return Ld(e)}});var hn=d((Nv,Ss)=>{"use strict";a();s();var Wd=Kr(),jd=ws(),Gd=$(),bs=Gd("String.prototype.replace"),Es=/^\s$/.test("\u180E"),zd=Es?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Vd=Es?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;Ss.exports=function(){var e=jd(Wd(this));return bs(bs(e,zd,""),Vd,"")}});var xn=d((Mv,Rs)=>{"use strict";a();s();var Yd=hn(),As="\u200B",Fe="\u180E";Rs.exports=function(){return String.prototype.trim&&As.trim()===As&&Fe.trim()===Fe&&("_"+Fe).trim()==="_"+Fe&&(Fe+"_").trim()===Fe+"_"?String.prototype.trim:Yd}});var Ps=d(($v,Is)=>{"use strict";a();s();var Hd=Or()(),Ts=Pr(),Jd=xn();Is.exports=function(){var e=Jd();return String.prototype.trim!==e&&(Hd?Ts(String.prototype,"trim",e,!0):Ts(String.prototype,"trim",e)),e}});var qs=d((Wv,Cs)=>{"use strict";a();s();var Kd=Cr(),Zd=Ur(),Qd=Kr(),Xd=hn(),Os=xn(),em=Ps(),rm=Kd(Os()),Fs=function(e){return Qd(e),rm(e)};Zd(Fs,{getPolyfill:Os,implementation:Xd,shim:em});Cs.exports=Fs});var Ds=d((zv,Ms)=>{"use strict";a();s();var Bs=_(),tm=Bs("%RegExp%"),nm=O(),Ns=Bs("%parseInt%"),om=$(),Zr=dn(),Us=om("String.prototype.slice"),im=Zr(/^0b[01]+$/i),am=Zr(/^0o[0-7]+$/i),sm=Zr(/^[-+]0x[0-9a-f]+$/i),um=["\x85","\u200B","\uFFFE"].join(""),fm=new tm("["+um+"]","g"),pm=Zr(fm),lm=qs();Ms.exports=function t(e){if(typeof e!="string")throw new nm("Assertion failed: `argument` is not a String");if(im(e))return+Ns(Us(e,2),2);if(am(e))return+Ns(Us(e,2),8);if(pm(e)||sm(e))return NaN;var r=lm(e);return r!==e?t(r):+e}});var Ls=d((Hv,$s)=>{"use strict";a();s();var cm=O(),_s=Hr(),dm=$(),mm=dm("String.prototype.slice");$s.exports=function(e,r,n){if(typeof e!="string"||!_s(r)||arguments.length>2&&!_s(n))throw new cm("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return mm(e,r,arguments.length>2?n:e.length)}});var gn=d((Zv,ks)=>{"use strict";a();s();var ym=_(),hm=ym("%String%"),xm=O();ks.exports=function(e){if(typeof e=="symbol")throw new xm("Cannot convert a Symbol value to a string");return hm(e)}});var js=d((ew,Ws)=>{"use strict";a();s();Ws.exports=function(e,r){for(var n=0;n<e.length;n+=1)if(!r(e[n],n,e))return!1;return!0}});var zs=d((nw,Gs)=>{"use strict";a();s();var gm=$()("String.prototype.slice");Gs.exports=function(e,r){return e===r?!0:e.length>r.length?!1:gm(r,0,e.length)===e}});var Ys=d((aw,Vs)=>{"use strict";a();s();Vs.exports=function(e){return typeof e=="string"||typeof e=="undefined"}});var Qs=d((fw,Zs)=>{"use strict";a();s();var H=O(),vn=Qe(),vm=Hr(),Hs=un(),Ks=dn(),wm=ms(),bm=qt(),Em=hs(),Sm=yn(),Js=Ds(),J=Ls(),Am=gn(),Rm=js(),Xe=zs(),Tm=Ys(),Im=Ks(/^\$[0-9]/),Pm=Ks(/^\$[0-9][0-9]/);Zs.exports=function(e,r,n,o,i,u){if(typeof e!="string")throw new H("Assertion failed: `matched` must be a String");if(typeof r!="string")throw new H("Assertion failed: `str` must be a String");if(!vm(n)||n<0)throw new H("Assertion failed: `position` must be a nonnegative integer, got "+vn(n));if(!bm(o)||!Rm(o,Tm))throw new H("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+vn(o));if(typeof i!="undefined"&&!Hs(i))throw new H("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof u!="string")throw new H("Assertion failed: `replacementTemplate` must be a String");var p=r.length;if(n>p)throw new H("Assertion failed: position > stringLength, got "+vn(n));for(var l=u,y="";l!=="";){var h,m,g;if(Xe("$$",l))h="$$",m="$";else if(Xe("$`",l))h="$`",m=J(r,0,n);else if(Xe("$&",l))h="$&",m=e;else if(Xe("$'",l)){h="$'";var S=e.length,I=n+S;m=J(r,Em(I,p))}else if(Im(l)){var T=Pm(l)?2:1,q=J(l,1,1+T),U=Js(q);if(U<0||U>99)throw new H("Assertion failed: `index` must be >= 0 and <= 99");var j=o.length;U>j&&T===2&&(T=1,q=J(q,0,1),U=Js(q)),h=J(l,0,1+T),1<=U&&U<=j?(g=o[U-1],typeof g=="undefined"?m="":m=g):m=h}else if(Xe("$<",l)){var ie=Sm(l,">",0);if(!(ie>-1)||typeof i=="undefined")h="$<",m=h;else{h=J(l,0,ie+1);var Ue=J(l,2,ie);if(!Hs(i))throw new H("Assertion failed: Type(namedCaptures) is not Object");g=wm(i,Ue),typeof g=="undefined"?m="":m=Am(g)}}else h=J(l,0,1),m=h;var pr=h.length;l=J(l,pr),y+=m}return y}});var tu=d((cw,ru)=>{"use strict";a();s();var Xs=_(),eu=Cr(),Om=eu(Xs("String.prototype.indexOf"));ru.exports=function(e,r){var n=Xs(e,!!r);return typeof n=="function"&&Om(e,".prototype.")>-1?eu(n):n}});var bn=d((yw,au)=>{"use strict";a();s();var nu=ta(),Fm=Xa(),Cm=Qs(),qm=sn(),Nm=Kr(),Qr=gn(),ou=yn(),Um=_(),Xr=tu(),Bm=wt()(),Mm=cn(),Dm=Um("%Math.max%"),iu=O(),_m=Xr("Array.prototype.push"),wn=Xr("String.prototype.slice"),$m=Xr("String.prototype.indexOf"),Lm=Xr("String.prototype.replace");au.exports=function(e,r){var n=Nm(this),o=Mm(e);if(o&&$m(wn(e,e.source.length+2),"g")===-1)throw new iu("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(Bm&&Symbol.replace){if(e!=null){var i=Fm(e,Symbol.replace);if(typeof i!="undefined")return nu(i,e,[n,r])}}else if(o)return Lm(n,e,r);var u=Qr(n),p=Qr(e),l=qm(r);l||(r=Qr(r));for(var y=p.length,h=Dm(1,y),m=[],g=ou(u,p,0);g!=="NOT-FOUND";)_m(m,g),g=ou(u,p,g+h);for(var S=0,I="",T=0;T<m.length;T+=1){var q;if(l)q=Qr(nu(r,void 0,[p,m[T],u]));else{if(typeof r!="string")throw new iu("Assertion failed: `replaceValue` should be a string at this point");var U=[];q=Cm(p,u,m[T],U,void 0,r)}var j=wn(u,S,m[T]);I+=j+q,S=m[T]+y}return S<u.length&&(I+=wn(u,S)),I}});var En=d((gw,su)=>{"use strict";a();s();var km=bn();su.exports=function(){return String.prototype.replaceAll||km}});var fu=d((bw,uu)=>{"use strict";a();s();var Wm=Ur(),jm=En();uu.exports=function(){var e=jm();return Wm(String.prototype,{replaceAll:e},{replaceAll:function(){return String.prototype.replaceAll!==e}}),e}});var du=d((Aw,cu)=>{"use strict";a();s();var Gm=Cr(),zm=Ur(),pu=bn(),Vm=En(),Ym=fu(),lu=Gm(pu);zm(lu,{getPolyfill:Vm,implementation:pu,shim:Ym});cu.exports=lu});var Nh={};Un(Nh,{DynamicSnippetsGenerator:()=>ot,EndpointSnippetGenerator:()=>Ne});module.exports=Mn(Nh);a();s();var Z1=Af(du(),1);a();s();a();s();a();s();function A(t){throw new Error("Unexpected value: "+JSON.stringify(t))}a();s();a();s();a();s();a();s();a();s();a();s();var Hm=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,mu=Hm;var Jm=typeof self=="object"&&self&&self.Object===Object&&self,Km=mu||Jm||Function("return this")(),yu=Km;var Zm=yu.Symbol,K=Zm;a();s();var hu=Object.prototype,Qm=hu.hasOwnProperty,Xm=hu.toString,er=K?K.toStringTag:void 0;function ey(t){var e=Qm.call(t,er),r=t[er];try{t[er]=void 0;var n=!0}catch(i){}var o=Xm.call(t);return n&&(e?t[er]=r:delete t[er]),o}var xu=ey;a();s();var ry=Object.prototype,ty=ry.toString;function ny(t){return ty.call(t)}var gu=ny;var oy="[object Null]",iy="[object Undefined]",vu=K?K.toStringTag:void 0;function ay(t){return t==null?t===void 0?iy:oy:vu&&vu in Object(t)?xu(t):gu(t)}var wu=ay;a();s();function sy(t){return t!=null&&typeof t=="object"}var bu=sy;var uy="[object Symbol]";function fy(t){return typeof t=="symbol"||bu(t)&&wu(t)==uy}var Eu=fy;a();s();a();s();function py(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var Su=py;a();s();var ly=Array.isArray,Au=ly;var cy=1/0,Ru=K?K.prototype:void 0,Tu=Ru?Ru.toString:void 0;function Iu(t){if(typeof t=="string")return t;if(Au(t))return Su(t,Iu)+"";if(Eu(t))return Tu?Tu.call(t):"";var e=t+"";return e=="0"&&1/t==-cy?"-0":e}var Pu=Iu;a();s();function dy(t){return t==null?"":Pu(t)}var ne=dy;a();s();a();s();a();s();a();s();a();s();a();s();function my(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}var Ou=my;function yy(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:Ou(t,e,r)}var Fu=yy;a();s();var hy="\\ud800-\\udfff",xy="\\u0300-\\u036f",gy="\\ufe20-\\ufe2f",vy="\\u20d0-\\u20ff",wy=xy+gy+vy,by="\\ufe0e\\ufe0f",Ey="\\u200d",Sy=RegExp("["+Ey+hy+wy+by+"]");function Ay(t){return Sy.test(t)}var et=Ay;a();s();a();s();function Ry(t){return t.split("")}var Cu=Ry;a();s();var qu="\\ud800-\\udfff",Ty="\\u0300-\\u036f",Iy="\\ufe20-\\ufe2f",Py="\\u20d0-\\u20ff",Oy=Ty+Iy+Py,Fy="\\ufe0e\\ufe0f",Cy="["+qu+"]",Sn="["+Oy+"]",An="\\ud83c[\\udffb-\\udfff]",qy="(?:"+Sn+"|"+An+")",Nu="[^"+qu+"]",Uu="(?:\\ud83c[\\udde6-\\uddff]){2}",Bu="[\\ud800-\\udbff][\\udc00-\\udfff]",Ny="\\u200d",Mu=qy+"?",Du="["+Fy+"]?",Uy="(?:"+Ny+"(?:"+[Nu,Uu,Bu].join("|")+")"+Du+Mu+")*",By=Du+Mu+Uy,My="(?:"+[Nu+Sn+"?",Sn,Uu,Bu,Cy].join("|")+")",Dy=RegExp(An+"(?="+An+")|"+My+By,"g");function _y(t){return t.match(Dy)||[]}var _u=_y;function $y(t){return et(t)?_u(t):Cu(t)}var $u=$y;function Ly(t){return function(e){e=ne(e);var r=et(e)?$u(e):void 0,n=r?r[0]:e.charAt(0),o=r?Fu(r,1).join(""):e.slice(1);return n[t]()+o}}var Lu=Ly;var ky=Lu("toUpperCase"),rr=ky;function Wy(t){return rr(ne(t).toLowerCase())}var ku=Wy;a();s();a();s();function jy(t,e,r,n){var o=-1,i=t==null?0:t.length;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}var Wu=jy;a();s();a();s();a();s();function Gy(t){return function(e){return t==null?void 0:t[e]}}var ju=Gy;var zy={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Vy=ju(zy),Gu=Vy;var Yy=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hy="\\u0300-\\u036f",Jy="\\ufe20-\\ufe2f",Ky="\\u20d0-\\u20ff",Zy=Hy+Jy+Ky,Qy="["+Zy+"]",Xy=RegExp(Qy,"g");function eh(t){return t=ne(t),t&&t.replace(Yy,Gu).replace(Xy,"")}var zu=eh;a();s();a();s();var rh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function th(t){return t.match(rh)||[]}var Vu=th;a();s();var nh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function oh(t){return nh.test(t)}var Yu=oh;a();s();var Qu="\\ud800-\\udfff",ih="\\u0300-\\u036f",ah="\\ufe20-\\ufe2f",sh="\\u20d0-\\u20ff",uh=ih+ah+sh,Xu="\\u2700-\\u27bf",ef="a-z\\xdf-\\xf6\\xf8-\\xff",fh="\\xac\\xb1\\xd7\\xf7",ph="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lh="\\u2000-\\u206f",ch=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rf="A-Z\\xc0-\\xd6\\xd8-\\xde",dh="\\ufe0e\\ufe0f",tf=fh+ph+lh+ch,nf="['\u2019]",Hu="["+tf+"]",mh="["+uh+"]",of="\\d+",yh="["+Xu+"]",af="["+ef+"]",sf="[^"+Qu+tf+of+Xu+ef+rf+"]",hh="\\ud83c[\\udffb-\\udfff]",xh="(?:"+mh+"|"+hh+")",gh="[^"+Qu+"]",uf="(?:\\ud83c[\\udde6-\\uddff]){2}",ff="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="["+rf+"]",vh="\\u200d",Ju="(?:"+af+"|"+sf+")",wh="(?:"+Ce+"|"+sf+")",Ku="(?:"+nf+"(?:d|ll|m|re|s|t|ve))?",Zu="(?:"+nf+"(?:D|LL|M|RE|S|T|VE))?",pf=xh+"?",lf="["+dh+"]?",bh="(?:"+vh+"(?:"+[gh,uf,ff].join("|")+")"+lf+pf+")*",Eh="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ah=lf+pf+bh,Rh="(?:"+[yh,uf,ff].join("|")+")"+Ah,Th=RegExp([Ce+"?"+af+"+"+Ku+"(?="+[Hu,Ce,"$"].join("|")+")",wh+"+"+Zu+"(?="+[Hu,Ce+Ju,"$"].join("|")+")",Ce+"?"+Ju+"+"+Ku,Ce+"+"+Zu,Sh,Eh,of,Rh].join("|"),"g");function Ih(t){return t.match(Th)||[]}var cf=Ih;function Ph(t,e,r){return t=ne(t),e=r?void 0:e,e===void 0?Yu(t)?cf(t):Vu(t):t.match(e)||[]}var df=Ph;var Oh="['\u2019]",Fh=RegExp(Oh,"g");function Ch(t){return function(e){return Wu(df(zu(e).replace(Fh,"")),t,"")}}var mf=Ch;var qh=mf(function(t,e,r){return e=e.toLowerCase(),t+(r?ku(e):e)}),tr=qh;a();s();function nr(t){return Object.keys(t)}a();s();a();s();a();s();var or=class{constructor(){E(this,"reporter");E(this,"snippet");E(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){this.shouldUpdate({snippet:r,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:r}){var n,o;return this.reporter==null||this.reporter.size()>0&&r.size()===0?!0:e.length>((o=(n=this.snippet)==null?void 0:n.length)!=null?o:0)}};var ir=class{constructor(e){E(this,"context");this.context=e}async generate(e,r={}){let n=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let o=new or;for(let i of n){let u=this.context.clone(),p=this.createSnippetGenerator(u);try{let l=await p.generateSnippet({endpoint:i,request:e,options:r});if(u.errors.empty())return{snippet:l,errors:void 0};o.update({context:u,snippet:l})}catch(l){o.err==null&&(o.err=l)}}return o.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e,r={}){let n=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let o=new or;for(let i of n){let u=this.context.clone(),p=this.createSnippetGenerator(u);try{let l=p.generateSnippetSync({endpoint:i,request:e,options:r});if(u.errors.empty())return{snippet:l,errors:void 0};o.update({context:u,snippet:l})}catch(l){o.err==null&&(o.err=l)}}return o.getResponseOrThrow({endpoint:e.endpoint})}};a();s();a();s();a();s();var ar=class{constructor(){E(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let n=e.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};a();s();var b={Critical:"CRITICAL",Warning:"WARNING"},sr=class t{constructor(){E(this,"errors");E(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(Cn(Fn({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new t;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let n of e){if(typeof n=="string"){r.push(n);continue}r[r.length-1]+=`[${n.index}]`}return r}};var ur=class{constructor({ir:e,config:r,options:n={}}){E(this,"config");E(this,"options");E(this,"errors");E(this,"_ir");E(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.options=n,this.errors=new sr,this.httpEndpointReferenceParser=new ar}associateQueryParametersByWireValue({parameters:e,values:r}){let n=[];for(let[o,i]of Object.entries(r)){this.errors.scope(o);try{let u=e.find(l=>l.name.wireValue===o);if(u==null)throw this.newParameterNotRecognizedError(o);let p=this.isListTypeReference(u.typeReference)&&!Array.isArray(i)?[i]:i;n.push({name:u.name,typeReference:u.typeReference,value:p})}finally{this.errors.unscope()}}return n}associateByWireValueOrDefault({parameters:e,values:r}){let n=[];for(let o of e){this.errors.scope(o.name.wireValue);try{let i=r[o.name.wireValue];if(i==null)if(o.typeReference.type==="primitive"&&o.typeReference.value==="STRING")i=`<${o.name.wireValue}>`;else{this.errors.add({severity:b.Critical,message:this.newParameterNotRecognizedError(o.name.wireValue).message});continue}n.push({name:o.name,typeReference:o.typeReference,value:i})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:n}){let o=[];for(let[i,u]of Object.entries(r)){this.errors.scope(i);try{let p=e.find(l=>l.name.wireValue===i);if(p==null){if(n)continue;this.errors.add({severity:b.Critical,message:this.newParameterNotRecognizedError(i).message});continue}o.push({name:p.name,typeReference:p.typeReference,value:u})}finally{this.errors.unscope()}}return o}getExampleObjectProperties({parameters:e,snippetObject:r}){let n=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{},o=[];for(let i of e){let u=n[i.name.wireValue];u==null?i.typeReference.type==="nullable"&&o.push({name:i.name,typeReference:i.typeReference,value:null}):o.push({name:i.name,typeReference:i.typeReference,value:u})}return o}getSingleFileValue({property:e,record:r}){let n=r[e.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:b.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:e,record:r}){let n=r[e.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:b.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let o=[];for(let i of n){if(typeof i!="string"){this.errors.add({severity:b.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}o.push(i)}return o}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:b.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:b.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let n=this.getRecord(r);if(n==null)return;let o=e.discriminant.wireValue,i=n[o];if(i==null){this.errors.add({severity:b.Critical,message:this.newParameterNotRecognizedError(o).message});return}if(typeof i!="string"){this.errors.add({severity:b.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let u=e.types[i];if(u==null){this.errors.add({severity:b.Critical,message:`No type found for discriminant value "${i}"`});return}let y=n,{[o]:p}=y,l=Nn(y,[qn(o)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.discriminantValue,value:l}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocation(e){let r=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:e})&&r.push(n);return r}resolveEndpointLocationOrThrow(e){let r=this.resolveEndpointLocation(e);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:n}){var o;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:n}):!((o=e.metadata)!=null&&o.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var n,o;return r&&((o=(n=e.metadata)==null?void 0:n.includePathParameters)!=null?o:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:A(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let n=r.environments.find(o=>o.id===e);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=r.environments.find(o=>o.id===e);return n==null?void 0:n.name}default:A(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:b.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:b.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=r.environments[0];if(n==null)return this.errors.add({severity:b.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let o=new Set(nr(n.urls));for(let i of nr(e))o.has(i)&&o.delete(i);return o.size>0?(this.errors.add({severity:b.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${nr(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:b.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:b.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:b.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:A(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:A(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:A(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};a();s();var oe={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();s();a();s();function fr(t){return rr(tr(t))}a();s();var x=require("@fern-api/swift-codegen");a();s();var R=require("@fern-api/swift-codegen");var qe=class{constructor({context:e}){E(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return R.swift.Type.array(this.convert({typeReference:e.typeReference.value}));case"literal":return this.convertLiteral({literal:e.typeReference.value});case"map":return R.swift.Type.dictionary(this.convert({typeReference:e.typeReference.key}),this.convert({typeReference:e.typeReference.value}));case"named":{let r=this.context.resolveNamedType({typeId:e.typeReference.value});return r==null?this.convertUnknown():this.convertNamed({named:r})}case"optional":return R.swift.Type.optional(this.convert({typeReference:e.typeReference.value}));case"nullable":return R.swift.Type.nullable(this.convert({typeReference:e.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value});case"set":return R.swift.Type.jsonValue();case"unknown":return this.convertUnknown();default:A(e.typeReference)}}convertNamed({named:e}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return R.swift.Type.custom(e.declaration.name.pascalCase.unsafeName);default:A(e)}}convertLiteral({literal:e}){switch(e.type){case"boolean":return R.swift.Type.bool();case"string":return R.swift.Type.custom(fr(e.value))}}convertUnknown(){return R.swift.Type.jsonValue()}convertPrimitive({primitive:e}){switch(e){case"INTEGER":return R.swift.Type.int();case"UINT":return R.swift.Type.int();case"LONG":return R.swift.Type.int64();case"UINT_64":return R.swift.Type.uint64();case"FLOAT":return R.swift.Type.float();case"DOUBLE":return R.swift.Type.double();case"BOOLEAN":return R.swift.Type.bool();case"STRING":return R.swift.Type.string();case"DATE":return R.swift.Type.date();case"DATE_TIME":return R.swift.Type.date();case"UUID":return R.swift.Type.uuid();case"BASE_64":return R.swift.Type.string();case"BIG_INTEGER":return R.swift.Type.string();default:A(e)}}};var rt=class{constructor({context:e}){E(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":{if(e.typeReference.value.type==="string")return x.swift.Expression.enumCaseShorthand(x.LiteralEnum.generateEnumCaseLabel(e.typeReference.value.value));if(e.typeReference.value.type==="boolean")return x.swift.Expression.nop();A(e.typeReference.value);break}case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let r=this.context.resolveNamedType({typeId:e.typeReference.value});return r==null?x.swift.Expression.nop():this.convertNamed({named:r,value:e.value,as:e.as})}case"nullable":return this.convertNullable({nullable:e.typeReference,value:e.value,as:e.as});case"optional":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return x.swift.Expression.nop();case"unknown":return this.convertUnknown(e.value);default:A(e.typeReference)}}convertList({list:e,value:r}){return Array.isArray(r)?x.swift.Expression.arrayLiteral({elements:r.map((n,o)=>{this.context.errors.scope({index:o});try{return this.convert({typeReference:e,value:n})}finally{this.context.errors.unscope()}}),multiline:!0}):(this.context.errors.add({severity:b.Critical,message:`Expected array but got: ${typeof r}`}),x.swift.Expression.nop())}convertMap({map:e,value:r}){return typeof r!="object"||r==null?(this.context.errors.add({severity:b.Critical,message:`Expected object but got: ${r==null?"null":typeof r}`}),x.swift.Expression.nop()):x.swift.Expression.dictionaryLiteral({entries:Object.entries(r).map(([n,o])=>{this.context.errors.scope(n);try{return[this.convert({typeReference:e.key,value:n,as:"mapKey"}),this.convert({typeReference:e.value,value:o,as:"mapValue"})]}finally{this.context.errors.unscope()}}),multiline:!0})}convertNamed({named:e,value:r,as:n}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:r,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:r});case"enum":return this.convertEnum({enum_:e,value:r});case"object":return this.convertObject({object_:e,value:r,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r});default:A(e)}}convertNullable({nullable:e,value:r,as:n}){return r==null?x.swift.Expression.enumCaseShorthand("null"):x.swift.Expression.contextualMethodCall({methodName:"value",arguments_:[x.swift.functionArgument({value:this.convert({typeReference:e.value,value:r,as:n})})]})}convertDiscriminatedUnion({discriminatedUnion:e,value:r}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r});if(n==null)return x.swift.Expression.nop();let o=n.singleDiscriminatedUnionType,i=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:o});return i==null?x.swift.Expression.nop():x.swift.Expression.methodCall({target:x.swift.Expression.reference(e.declaration.name.pascalCase.unsafeName),methodName:x.EnumWithAssociatedValues.sanitizeToCamelCase(o.discriminantValue.name.camelCase.unsafeName),arguments_:[x.swift.functionArgument({value:x.swift.Expression.contextualMethodCall({methodName:"init",arguments_:i,multiline:!0})})],multiline:!0})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:e,unionVariant:r}){var o;let n=this.getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:r});switch(r.type){case"samePropertiesAsObject":{let i=this.context.resolveNamedType({typeId:r.typeId});if(i==null)return;let u=this.convertNamed({named:i,value:e.value});if(!u.isStructInitialization()){this.context.errors.add({severity:b.Critical,message:"Internal error; expected union value to be a struct"});return}let p=u.asStructInitializationOrThrow();return[...n,...(o=p.arguments_)!=null?o:[]]}case"singleProperty":try{this.context.errors.scope(r.discriminantValue.wireValue);let i=this.context.getRecord(e.value);return i==null?[...n]:[...n,x.swift.functionArgument({label:(0,x.sanitizeSelf)(x.EnumWithAssociatedValues.sanitizeToCamelCase(r.discriminantValue.name.camelCase.unsafeName)),value:this.convert({typeReference:r.typeReference,value:i[r.discriminantValue.wireValue]})})]}finally{this.context.errors.unscope()}case"noProperties":return n;default:A(r)}}getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:r}){var o;return this.context.getExampleObjectProperties({parameters:(o=r.properties)!=null?o:[],snippetObject:e.value}).map(i=>{this.context.errors.scope(i.name.wireValue);try{return x.swift.functionArgument({label:(0,x.sanitizeSelf)(i.name.name.camelCase.unsafeName),value:this.convert(i)})}finally{this.context.errors.unscope()}})}convertEnum({enum_:e,value:r}){let n=this.getEnumValue({enum_:e,value:r});return n==null?x.swift.Expression.nop():x.swift.Expression.enumCaseShorthand(n.name.camelCase.unsafeName)}getEnumValue({enum_:e,value:r}){if(typeof r!="string"){this.context.errors.add({severity:b.Critical,message:`Expected enum value string, got: ${typeof r}`});return}let n=e.values.find(o=>o.wireValue===r);if(n==null){this.context.errors.add({severity:b.Critical,message:`An enum value named "${r}" does not exist in this context`});return}return n}convertObject({object_:e,value:r,as:n}){return x.swift.Expression.structInitialization({unsafeName:e.declaration.name.pascalCase.unsafeName,arguments_:this.context.getExampleObjectProperties({parameters:e.properties,snippetObject:r}).map(o=>this.convert(o).isNop()?null:x.swift.functionArgument({label:(0,x.sanitizeSelf)(o.name.name.camelCase.unsafeName),value:this.convert(o)})).filter(o=>o!=null),multiline:!0})}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r});return n==null?x.swift.Expression.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r}){for(let n of e.types)try{let o=this.convert({typeReference:n,value:r}),u=new qe({context:this.context}).convert({typeReference:n});return x.swift.Expression.methodCall({target:x.swift.Expression.reference(e.declaration.name.pascalCase.unsafeName),methodName:u.toCaseName(),arguments_:[x.swift.functionArgument({value:o})],multiline:!0})}catch(o){continue}this.context.errors.add({severity:b.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof r}" value`})}convertUnknown(e){switch(typeof e){case"boolean":return x.swift.Expression.contextualMethodCall({methodName:"bool",arguments_:[x.swift.functionArgument({value:x.swift.Expression.boolLiteral(e)})]});case"string":return x.swift.Expression.contextualMethodCall({methodName:"string",arguments_:[x.swift.functionArgument({value:x.swift.Expression.stringLiteral(e)})]});case"number":return x.swift.Expression.contextualMethodCall({methodName:"number",arguments_:[x.swift.functionArgument({value:x.swift.Expression.numberLiteral(e)})]});case"object":return e===null?x.swift.Expression.enumCaseShorthand("null"):Array.isArray(e)?x.swift.Expression.contextualMethodCall({methodName:"array",arguments_:[x.swift.functionArgument({value:x.swift.Expression.arrayLiteral({elements:e.map(r=>this.convertUnknown(r)),multiline:!0})})]}):x.swift.Expression.contextualMethodCall({methodName:"object",arguments_:[x.swift.functionArgument({value:x.swift.Expression.dictionaryLiteral({entries:Object.entries(e).map(([r,n])=>[x.swift.Expression.stringLiteral(r),this.convertUnknown(n)]),multiline:!0})})]});default:throw new Error(`Internal error; unsupported unknown type: ${typeof e}`)}}convertPrimitive({primitive:e,value:r,as:n}){switch(e){case"INTEGER":case"UINT":case"LONG":case"UINT_64":case"FLOAT":case"DOUBLE":{let o=this.getValueAsNumber({value:r,as:n});return o==null?x.swift.Expression.nop():x.swift.Expression.numberLiteral(o)}case"BOOLEAN":{let o=this.getValueAsBoolean({value:r,as:n});return o==null?x.swift.Expression.nop():x.swift.Expression.boolLiteral(o)}case"STRING":{let o=this.context.getValueAsString({value:r});return o==null?x.swift.Expression.nop():x.swift.Expression.stringLiteral(o)}case"DATE":{let o=this.context.getValueAsString({value:r});return o==null?x.swift.Expression.nop():x.swift.Expression.calendarDateLiteral(o)}case"DATE_TIME":{let o=this.context.getValueAsString({value:r});if(o==null)return x.swift.Expression.nop();let i=new Date(o).getTime(),u=Math.round(i/1e3),l=new Date(u*1e3).toISOString().replace(/\.\d{3}Z$/,"Z");return x.swift.Expression.dateLiteral(l)}case"UUID":{let o=this.context.getValueAsString({value:r});return o==null?x.swift.Expression.nop():x.swift.Expression.uuidLiteral(o)}case"BASE_64":{let o=this.context.getValueAsString({value:r});return o==null?x.swift.Expression.nop():x.swift.Expression.stringLiteral(o)}case"BIG_INTEGER":return this.context.getValueAsString({value:r})==null?x.swift.Expression.nop():x.swift.Expression.nop();default:A(e)}}getValueAsNumber({value:e,as:r}){let n=r==="mapKey"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:e,as:r}){let n=(()=>{switch(r){case"mapKey":return e==="true"?!0:e==="false"?!1:e;case"mapValue":case void 0:return e;default:A(r)}})();return this.context.getValueAsBoolean({value:n})}};a();s();var C=require("@fern-api/swift-codegen");var tt=class{constructor({context:e}){E(this,"context");this.context=e}getFilePropertyInfo({body:e,value:r}){var i;let n={fileFields:[],bodyPropertyFields:[]},o=(i=this.context.getRecord(r))!=null?i:{};for(let u of e.properties)switch(u.type){case"file":{let p=C.swift.functionArgument({label:(0,C.sanitizeSelf)(u.name.camelCase.unsafeName),value:this.getSingleFileProperty({property:u,record:o})});n.fileFields.push(p);break}case"fileArray":{let p=C.swift.functionArgument({label:(0,C.sanitizeSelf)(u.name.camelCase.unsafeName),value:this.getArrayFileProperty({property:u,record:o})});n.fileFields.push(p);break}case"bodyProperty":{let p=C.swift.functionArgument({label:(0,C.sanitizeSelf)(u.name.name.camelCase.unsafeName),value:this.getBodyProperty({property:u,record:o})});n.bodyPropertyFields.push(p);break}default:A(u)}return n}getSingleFileProperty({property:e,record:r}){let n=this.context.getSingleFileValue({property:e,record:r});return C.swift.Expression.contextualMethodCall({methodName:"init",arguments_:[C.swift.functionArgument({label:"data",value:C.swift.Expression.dataLiteral(n!=null?n:"")})]})}getArrayFileProperty({property:e,record:r}){let n=this.context.getFileArrayValues({property:e,record:r});return C.swift.Expression.arrayLiteral({elements:(n!=null?n:[]).map(o=>C.swift.Expression.contextualMethodCall({methodName:"init",arguments_:[C.swift.functionArgument({label:"data",value:C.swift.Expression.dataLiteral(o)})]})),multiline:!0})}getBodyProperty({property:e,record:r}){let n=r[e.name.wireValue];return n==null?C.swift.Expression.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:n})}};var nt=class t extends ur{constructor({ir:r,config:n,options:o}){super({ir:r,config:n,options:o});E(this,"ir");E(this,"customConfig");E(this,"dynamicTypeMapper");E(this,"dynamicTypeLiteralMapper");E(this,"filePropertyMapper");this.ir=r,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeMapper=new qe({context:this}),this.dynamicTypeLiteralMapper=new rt({context:this}),this.filePropertyMapper=new tt({context:this})}clone(){return new t({ir:this.ir,config:this.config,options:this.options})}getModuleName(){var r,n;return(n=(r=this.customConfig)==null?void 0:r.moduleName)!=null?n:fr(this.getApiName())}getRootClientClassName(){var r,n;return(n=(r=this.customConfig)==null?void 0:r.clientClassName)!=null?n:`${fr(this.getApiName())}Client`}getApiName(){return tr(this.config.workspaceName)}};a();s();var v=require("@fern-api/swift-codegen");var yf="client",Ne=class{constructor({context:e}){E(this,"context");this.context=e}async generateSnippet({endpoint:e,request:r,options:n}){return this.buildCodeBlock({endpoint:e,snippetRequest:r,options:n})}generateSnippetSync({endpoint:e,request:r,options:n}){return this.buildCodeBlock({endpoint:e,snippetRequest:r,options:n})}buildCodeBlock({endpoint:e,snippetRequest:r,options:n}){return[this.generateImportFoundationStatement(),this.generateImportModuleStatement(),v.swift.LineBreak.single(),this.generateMainFunctionDeclarationWithEndpointSnippet({endpoint:e,snippet:r}),v.swift.LineBreak.single(),this.generateMainFunctionInvocationStatement()].map(i=>i.toString()).join("")}generateImportFoundationStatement(){return v.swift.Statement.import("Foundation")}generateImportModuleStatement(){return v.swift.Statement.import(this.context.getModuleName())}generateMainFunctionDeclarationWithEndpointSnippet({endpoint:e,snippet:r}){return v.swift.Statement.functionDeclaration({unsafeName:"main",accessLevel:"private",async:!0,throws:!0,body:v.swift.CodeBlock.withStatements([this.generateRootClientInitializationStatement({auth:e.auth,snippet:r}),v.swift.LineBreak.single(),this.generateEndpointMethodCallStatement({endpoint:e,snippet:r})])})}generateRootClientInitializationStatement({auth:e,snippet:r,additionalArgs:n=[]}){let o=[],i=this.getRootClientBaseURLArg({snippet:r});i!=null&&o.push(i);let u=e?this.getRootClientAuthArgs({auth:e,snippet:r}):[];o.push(...u),o.push(...n);let p=o.filter(l=>!l.value.isNop());return v.swift.Statement.constantDeclaration({unsafeName:yf,value:v.swift.Expression.classInitialization({unsafeName:this.context.getRootClientClassName(),arguments_:p,multiline:p.length>1?!0:void 0})})}getRootClientBaseURLArg({snippet:e}){var r;return e.baseURL!=null&&e.environment!=null?(this.context.errors.add({severity:b.Critical,message:"Cannot specify both baseUrl and environment options"}),null):e.baseURL!=null?((r=this.context.ir.environments)==null?void 0:r.environments.type)==="multipleBaseUrls"?null:v.swift.functionArgument({label:"baseURL",value:v.swift.Expression.stringLiteral(e.baseURL)}):null}getRootClientAuthArgs({auth:e,snippet:r}){let n=[],o=r.auth;if(o==null)return n;switch(e.type){case"basic":if(o.type!=="basic"){this.context.errors.add({severity:b.Critical,message:this.context.newAuthMismatchError({auth:e,values:o}).message});break}n.push(v.swift.functionArgument({label:e.username.camelCase.unsafeName,value:v.swift.Expression.stringLiteral(o.username)}),v.swift.functionArgument({label:e.password.camelCase.unsafeName,value:v.swift.Expression.stringLiteral(o.password)}));break;case"bearer":if(o.type!=="bearer")return this.context.errors.add({severity:b.Critical,message:this.context.newAuthMismatchError({auth:e,values:o}).message}),n;n.push(v.swift.functionArgument({label:e.token.camelCase.unsafeName,value:v.swift.Expression.stringLiteral(o.token)}));break;case"header":if(o.type!=="header")return this.context.errors.add({severity:b.Critical,message:this.context.newAuthMismatchError({auth:e,values:o}).message}),n;n.push(v.swift.functionArgument({label:e.header.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:o.value})}));break;case"oauth":return o.type!=="oauth"&&this.context.errors.add({severity:b.Critical,message:this.context.newAuthMismatchError({auth:e,values:o}).message}),n;case"inferred":return o.type!=="inferred"&&this.context.errors.add({severity:b.Critical,message:this.context.newAuthMismatchError({auth:e,values:o}).message}),n;default:A(e)}return n}generateEndpointMethodCallStatement({endpoint:e,snippet:r}){return v.swift.Statement.discardAssignment(this.generateEndpointMethodCallExpression({endpoint:e,snippet:r}))}generateEndpointMethodCallExpression({endpoint:e,snippet:r}){let n=this.getMethodArguments({endpoint:e,snippet:r}).filter(o=>!o.value.isNop());return v.swift.Expression.try(v.swift.Expression.await(v.swift.Expression.methodCall({target:v.swift.Expression.rawValue(yf),methodName:this.getMethodName({endpoint:e}),arguments_:n,multiline:n.length>1?!0:void 0})))}generateMainFunctionInvocationStatement(){return v.swift.Statement.expressionStatement(v.swift.Expression.try(v.swift.Expression.await(v.swift.Expression.functionCall({unsafeName:"main"}))))}getMethodName({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${`${e.declaration.fernFilepath.allParts.map(n=>n.camelCase.unsafeName).join(".")}`}.${e.declaration.name.camelCase.unsafeName}`:e.declaration.name.camelCase.unsafeName}getMethodArguments({endpoint:e,snippet:r}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:r});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:r});default:A(e.request)}}getMethodArgsForInlinedRequest({request:e,snippet:r}){let n=[];this.context.errors.scope(oe.PathParameters);let o=[];e.pathParameters!=null&&o.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:r})),this.context.errors.unscope(),n.push(...o),this.context.errors.scope(oe.QueryParameters);let i=[];e.queryParameters!=null&&i.push(...this.getQueryParameters({namedParameters:e.queryParameters,snippet:r})),this.context.errors.unscope(),n.push(...i),this.context.errors.scope(oe.RequestBody);let u=this.getFilePropertyInfo({request:e,snippet:r});return this.context.errors.unscope(),e.body!=null&&n.push(v.swift.functionArgument({label:"request",value:this.getInlinedRequestArg({request:e,snippet:r,filePropertyInfo:u})})),n}getPathParameters({namedParameters:e,snippet:r}){var n;return this.context.getExampleObjectProperties({parameters:e,snippetObject:(n=r.pathParameters)!=null?n:{}}).map(o=>v.swift.functionArgument({label:o.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(o)}))}getQueryParameters({namedParameters:e,snippet:r}){var n;return this.context.getExampleObjectProperties({parameters:e,snippetObject:(n=r.queryParameters)!=null?n:{}}).map(o=>v.swift.functionArgument({label:o.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(o)}))}getFilePropertyInfo({request:e,snippet:r}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:r.requestBody})}getInlinedRequestArg({request:e,snippet:r,filePropertyInfo:n}){this.context.errors.scope(oe.RequestBody);let o=e.body!=null?this.getInlinedRequestBodyObjectFields({body:e.body,value:r.requestBody,filePropertyInfo:n}):[];this.context.errors.unscope();let i=o.filter(u=>!u.value.isNop());return v.swift.Expression.contextualMethodCall({methodName:"init",arguments_:i,multiline:i.length>1?!0:void 0})}getInlinedRequestBodyObjectFields({body:e,value:r,filePropertyInfo:n}){switch(e.type){case"fileUpload":return[...n.fileFields,...n.bodyPropertyFields];case"properties":return this.getInlinedRequestBodyPropertyObjectFields({parameters:e.value,value:r});case"referenced":return[this.getReferencedRequestBodyPropertyObjectField({body:e,value:r})];default:A(e)}}getInlinedRequestBodyPropertyObjectFields({parameters:e,value:r}){return this.context.getExampleObjectProperties({parameters:e,snippetObject:r}).map(n=>v.swift.functionArgument({label:n.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(n)}))}getReferencedRequestBodyPropertyObjectField({body:e,value:r}){return v.swift.functionArgument({label:e.bodyKey.camelCase.unsafeName,value:this.getReferencedRequestBodyPropertyTypeLiteral({body:e.bodyType,value:r})})}getReferencedRequestBodyPropertyTypeLiteral({body:e,value:r}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:r});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:r});default:A(e)}}getBytesBodyRequestArg({value:e}){return typeof e!="string"?(this.context.errors.add({severity:b.Critical,message:`Expected bytes value to be a string, got ${typeof e}`}),v.swift.Expression.dataLiteral("data")):v.swift.Expression.dataLiteral(e)}getMethodArgsForBodyRequest({request:e,snippet:r}){var i,u;let n=[];this.context.errors.scope(oe.PathParameters);let o=[...(i=this.context.ir.pathParameters)!=null?i:[],...(u=e.pathParameters)!=null?u:[]];return o.length>0&&n.push(...this.getPathParameters({namedParameters:o,snippet:r})),this.context.errors.unscope(),this.context.errors.scope(oe.RequestBody),e.body!=null&&n.push(this.getBodyRequestArg({body:e.body,value:r.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:e,value:r}){switch(e.type){case"bytes":return v.swift.functionArgument({label:"request",value:this.getBytesBodyRequestArg({value:r})});case"typeReference":return v.swift.functionArgument({label:"request",value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:r})});default:A(e)}}};var ot=class extends ir{constructor({ir:e,config:r,options:n={}}){super(new nt({ir:e,config:r,options:n}))}async generate(e,r={}){return super.generate(e,r)}generateSync(e,r={}){return super.generateSync(e,r)}createSnippetGenerator(e){return new Ne({context:e})}};0&&(module.exports={DynamicSnippetsGenerator,EndpointSnippetGenerator});
|
|
7
|
+
`))):f=r.stylize("[Circular]","special")),H(u)){if(o&&i.match(/^\d+$/))return f;u=JSON.stringify(""+i),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=r.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=r.stylize(u,"string"))}return u+": "+f}function Kd(r,t,e){var n=0,i=r.reduce(function(o,u){return n++,u.indexOf(`
|
|
8
|
+
`)>=0&&n++,o+u.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?e[0]+(t===""?"":t+`
|
|
9
|
+
`)+" "+r.join(`,
|
|
10
|
+
`)+" "+e[1]:e[0]+t+" "+r.join(", ")+" "+e[1]}function Fn(r){return Array.isArray(r)}function gr(r){return typeof r=="boolean"}function bt(r){return r===null}function ys(r){return r==null}function Bn(r){return typeof r=="number"}function St(r){return typeof r=="string"}function hs(r){return typeof r=="symbol"}function H(r){return r===void 0}function xt(r){return Ee(r)&&qn(r)==="[object RegExp]"}function Ee(r){return typeof r=="object"&&r!==null}function yr(r){return Ee(r)&&qn(r)==="[object Date]"}function vt(r){return Ee(r)&&(qn(r)==="[object Error]"||r instanceof Error)}function wt(r){return typeof r=="function"}function gs(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r=="undefined"}function xs(r){return l.isBuffer(r)}function qn(r){return Object.prototype.toString.call(r)}function Ln(r){return r<10?"0"+r.toString(10):r.toString(10)}function Zd(){var r=new Date,t=[Ln(r.getHours()),Ln(r.getMinutes()),Ln(r.getSeconds())].join(":");return[r.getDate(),Jd[r.getMonth()],t].join(" ")}function vs(){console.log("%s - %s",Zd(),hr.apply(null,arguments))}function Mn(r,t){if(!t||!Ee(t))return r;for(var e=Object.keys(t),n=e.length;n--;)r[e[n]]=t[e[n]];return r}function ws(r,t){return Object.prototype.hasOwnProperty.call(r,t)}var jd,dr,Rn,Jd,Xd,Ss=Oe(()=>{"use strict";a();s();cs();ds();jd=/%[sdj%]/g;dr={};K.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};K.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};Jd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Xd={inherits:Nn,_extend:Mn,log:vs,isBuffer:xs,isPrimitive:gs,isFunction:wt,isError:vt,isDate:yr,isObject:Ee,isRegExp:xt,isUndefined:H,isSymbol:hs,isString:St,isNumber:Bn,isNullOrUndefined:ys,isNull:bt,isBoolean:gr,isArray:Fn,inspect:K,deprecate:Pn,format:hr,debuglog:ms}});var Es=h((jw,xr)=>{"use strict";a();s();var Te=(Ss(),$i(bs));if(Te&&Te.default){xr.exports=Te.default;for(let r in Te)xr.exports[r]=Te[r]}else Te&&(xr.exports=Te)});var As=h((Gw,Ts)=>{"use strict";a();s();Ts.exports=Es().inspect});var Nt=h((Kw,Vs)=>{"use strict";a();s();var Gn=typeof Map=="function"&&Map.prototype,Dn=Object.getOwnPropertyDescriptor&&Gn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,wr=Gn&&Dn&&typeof Dn.get=="function"?Dn.get:null,Is=Gn&&Map.prototype.forEach,Yn=typeof Set=="function"&&Set.prototype,Un=Object.getOwnPropertyDescriptor&&Yn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,br=Yn&&Un&&typeof Un.get=="function"?Un.get:null,Ns=Yn&&Set.prototype.forEach,Qd=typeof WeakMap=="function"&&WeakMap.prototype,Tt=Qd?WeakMap.prototype.has:null,em=typeof WeakSet=="function"&&WeakSet.prototype,At=em?WeakSet.prototype.has:null,tm=typeof WeakRef=="function"&&WeakRef.prototype,Rs=tm?WeakRef.prototype.deref:null,rm=Boolean.prototype.valueOf,nm=Object.prototype.toString,im=Function.prototype.toString,om=String.prototype.match,Hn=String.prototype.slice,fe=String.prototype.replace,am=String.prototype.toUpperCase,Os=String.prototype.toLowerCase,Us=RegExp.prototype.test,Ls=Array.prototype.concat,J=Array.prototype.join,sm=Array.prototype.slice,Cs=Math.floor,_n=typeof BigInt=="function"?BigInt.prototype.valueOf:null,kn=Object.getOwnPropertySymbols,Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,_e=typeof Symbol=="function"&&typeof Symbol.iterator=="object",It=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_e||!0)?Symbol.toStringTag:null,ks=Object.prototype.propertyIsEnumerable,Ps=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Fs(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Us.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Cs(-r):Cs(r);if(n!==r){var i=String(n),o=Hn.call(t,i.length+1);return fe.call(i,e,"$&_")+"."+fe.call(fe.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fe.call(t,e,"$&_")}var jn=As(),Bs=jn.custom,qs=Ws(Bs)?Bs:null,$s={__proto__:null,double:'"',single:"'"},um={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Vs.exports=function r(t,e,n,i){var o=e||{};if(re(o,"quoteStyle")&&!re($s,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(re(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=re(o,"customInspect")?o.customInspect:!0;if(typeof u!="boolean"&&u!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(re(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(re(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=o.numericSeparator;if(typeof t=="undefined")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return zs(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var p=String(t);return f?Fs(t,p):p}if(typeof t=="bigint"){var y=String(t)+"n";return f?Fs(t,y):y}var g=typeof o.depth=="undefined"?5:o.depth;if(typeof n=="undefined"&&(n=0),n>=g&&g>0&&typeof t=="object")return zn(t)?"[Array]":"[Object]";var x=Im(o,n);if(typeof i=="undefined")i=[];else if(js(i,t)>=0)return"[Circular]";function v(Re,Wt,_f){if(Wt&&(i=sm.call(i),i.push(Wt)),_f){var Fi={depth:o.depth};return re(o,"quoteStyle")&&(Fi.quoteStyle=o.quoteStyle),r(Re,Fi,n+1,i)}return r(Re,o,n+1,i)}if(typeof t=="function"&&!Ms(t)){var A=gm(t),R=vr(t,v);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(R.length>0?" { "+J.call(R,", ")+" }":"")}if(Ws(t)){var I=_e?fe.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Wn.call(t);return typeof t=="object"&&!_e?Et(I):I}if(Em(t)){for(var M="<"+Os.call(String(t.nodeName)),k=t.attributes||[],X=0;X<k.length;X++)M+=" "+k[X].name+"="+_s(lm(k[X].value),"double",o);return M+=">",t.childNodes&&t.childNodes.length&&(M+="..."),M+="</"+Os.call(String(t.nodeName))+">",M}if(zn(t)){if(t.length===0)return"[]";var he=vr(t,v);return x&&!Am(he)?"["+Vn(he,x)+"]":"[ "+J.call(he,", ")+" ]"}if(pm(t)){var ut=vr(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!ks.call(t,"cause")?"{ ["+String(t)+"] "+J.call(Ls.call("[cause]: "+v(t.cause),ut),", ")+" }":ut.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+J.call(ut,", ")+" }"}if(typeof t=="object"&&u){if(qs&&typeof t[qs]=="function"&&jn)return jn(t,{depth:g-n});if(u!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(xm(t)){var _t=[];return Is&&Is.call(t,function(Re,Wt){_t.push(v(Wt,t,!0)+" => "+v(Re,t))}),Ds("Map",wr.call(t),_t,x)}if(bm(t)){var Li=[];return Ns&&Ns.call(t,function(Re){Li.push(v(Re,t))}),Ds("Set",br.call(t),Li,x)}if(vm(t))return $n("WeakMap");if(Sm(t))return $n("WeakSet");if(wm(t))return $n("WeakRef");if(dm(t))return Et(v(Number(t)));if(ym(t))return Et(v(_n.call(t)));if(mm(t))return Et(rm.call(t));if(cm(t))return Et(v(String(t)));if(typeof window!="undefined"&&t===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&t===globalThis||typeof globalThis!="undefined"&&t===globalThis)return"{ [object globalThis] }";if(!fm(t)&&!Ms(t)){var Zr=vr(t,v),Ci=Ps?Ps(t)===Object.prototype:t instanceof Object||t.constructor===Object,Xr=t instanceof Object?"":"null prototype",Pi=!Ci&&It&&Object(t)===t&&It in t?Hn.call(pe(t),8,-1):Xr?"Object":"",$f=Ci||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Qr=$f+(Pi||Xr?"["+J.call(Ls.call([],Pi||[],Xr||[]),": ")+"] ":"");return Zr.length===0?Qr+"{}":x?Qr+"{"+Vn(Zr,x)+"}":Qr+"{ "+J.call(Zr,", ")+" }"}return String(t)};function _s(r,t,e){var n=e.quoteStyle||t,i=$s[n];return i+r+i}function lm(r){return fe.call(String(r),/"/g,""")}function Ae(r){return!It||!(typeof r=="object"&&(It in r||typeof r[It]!="undefined"))}function zn(r){return pe(r)==="[object Array]"&&Ae(r)}function fm(r){return pe(r)==="[object Date]"&&Ae(r)}function Ms(r){return pe(r)==="[object RegExp]"&&Ae(r)}function pm(r){return pe(r)==="[object Error]"&&Ae(r)}function cm(r){return pe(r)==="[object String]"&&Ae(r)}function dm(r){return pe(r)==="[object Number]"&&Ae(r)}function mm(r){return pe(r)==="[object Boolean]"&&Ae(r)}function Ws(r){if(_e)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Wn)return!1;try{return Wn.call(r),!0}catch(t){}return!1}function ym(r){if(!r||typeof r!="object"||!_n)return!1;try{return _n.call(r),!0}catch(t){}return!1}var hm=Object.prototype.hasOwnProperty||function(r){return r in this};function re(r,t){return hm.call(r,t)}function pe(r){return nm.call(r)}function gm(r){if(r.name)return r.name;var t=om.call(im.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function js(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1}function xm(r){if(!wr||!r||typeof r!="object")return!1;try{wr.call(r);try{br.call(r)}catch(t){return!0}return r instanceof Map}catch(t){}return!1}function vm(r){if(!Tt||!r||typeof r!="object")return!1;try{Tt.call(r,Tt);try{At.call(r,At)}catch(t){return!0}return r instanceof WeakMap}catch(t){}return!1}function wm(r){if(!Rs||!r||typeof r!="object")return!1;try{return Rs.call(r),!0}catch(t){}return!1}function bm(r){if(!br||!r||typeof r!="object")return!1;try{br.call(r);try{wr.call(r)}catch(t){return!0}return r instanceof Set}catch(t){}return!1}function Sm(r){if(!At||!r||typeof r!="object")return!1;try{At.call(r,At);try{Tt.call(r,Tt)}catch(t){return!0}return r instanceof WeakSet}catch(t){}return!1}function Em(r){return!r||typeof r!="object"?!1:typeof HTMLElement!="undefined"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function zs(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return zs(Hn.call(r,0,t.maxStringLength),t)+n}var i=um[t.quoteStyle||"single"];i.lastIndex=0;var o=fe.call(fe.call(r,i,"\\$1"),/[\x00-\x1f]/g,Tm);return _s(o,"single",t)}function Tm(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+am.call(t.toString(16))}function Et(r){return"Object("+r+")"}function $n(r){return r+" { ? }"}function Ds(r,t,e,n){var i=n?Vn(e,n):J.call(e,", ");return r+" ("+t+") {"+i+"}"}function Am(r){for(var t=0;t<r.length;t++)if(js(r[t],`
|
|
11
|
+
`)>=0)return!1;return!0}function Im(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=J.call(Array(r.indent+1)," ");else return null;return{base:e,prev:J.call(Array(t+1),e)}}function Vn(r,t){if(r.length===0)return"";var e=`
|
|
12
|
+
`+t.prev+t.base;return e+J.call(r,","+e)+`
|
|
13
|
+
`+t.prev}function vr(r,t){var e=zn(r),n=[];if(e){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=re(r,i)?t(r[i],r):""}var o=typeof kn=="function"?kn(r):[],u;if(_e){u={};for(var f=0;f<o.length;f++)u["$"+o[f]]=o[f]}for(var p in r)re(r,p)&&(e&&String(Number(p))===p&&p<r.length||_e&&u["$"+p]instanceof Symbol||(Us.call(/[^\w$]/,p)?n.push(t(p,r)+": "+t(r[p],r)):n.push(p+": "+t(r[p],r))));if(typeof kn=="function")for(var y=0;y<o.length;y++)ks.call(r,o[y])&&n.push("["+t(o[y])+"]: "+t(r[o[y]],r));return n}});var Sr=h((Xw,Gs)=>{"use strict";a();s();Gs.exports=function(t){return typeof t=="string"||typeof t=="symbol"}});var Hs=h((tb,Ys)=>{"use strict";a();s();var Nm=C(),Rm=Nt(),Om=Sr();Ys.exports=function(t,e){if(!Om(e))throw new Nm("Assertion failed: P is not a Property Key, got "+Rm(e));return t[e]}});var Xs=h((ib,Zs)=>{"use strict";a();s();var Js=Function.prototype.toString,We=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Jn,Er;if(typeof We=="function"&&typeof Object.defineProperty=="function")try{Jn=Object.defineProperty({},"length",{get:function(){throw Er}}),Er={},We(function(){throw 42},null,Jn)}catch(r){r!==Er&&(We=null)}else We=null;var Lm=/^\s*class\b/,Zn=function(t){try{var e=Js.call(t);return Lm.test(e)}catch(n){return!1}},Kn=function(t){try{return Zn(t)?!1:(Js.call(t),!0)}catch(e){return!1}},Tr=Object.prototype.toString,Cm="[object Object]",Pm="[object Function]",Fm="[object GeneratorFunction]",Bm="[object HTMLAllCollection]",qm="[object HTML document.all class]",Mm="[object HTMLCollection]",Dm=typeof Symbol=="function"&&!!Symbol.toStringTag,Um=!(0 in[,]),Xn=function(){return!1};typeof document=="object"&&(Ks=document.all,Tr.call(Ks)===Tr.call(document.all)&&(Xn=function(t){if((Um||!t)&&(typeof t=="undefined"||typeof t=="object"))try{var e=Tr.call(t);return(e===Bm||e===qm||e===Mm||e===Cm)&&t("")==null}catch(n){}return!1}));var Ks;Zs.exports=We?function(t){if(Xn(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{We(t,null,Jn)}catch(e){if(e!==Er)return!1}return!Zn(t)&&Kn(t)}:function(t){if(Xn(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Dm)return Kn(t);if(Zn(t))return!1;var e=Tr.call(t);return e!==Pm&&e!==Fm&&!/^\[object HTML/.test(e)?!1:Kn(t)}});var Qn=h((sb,Qs)=>{"use strict";a();s();Qs.exports=Xs()});var nu=h((fb,ru)=>{"use strict";a();s();var eu=C(),km=Hs(),$m=Qn(),_m=Sr(),tu=Nt();ru.exports=function(t,e){if(!_m(e))throw new eu("Assertion failed: P is not a Property Key");var n=km(t,e);if(n!=null){if(!$m(n))throw new eu(tu(e)+" is not a function: "+tu(n));return n}}});var ou=h((db,iu)=>{"use strict";a();s();var Wm=Zt();iu.exports=function(t){return(typeof t=="number"||typeof t=="bigint")&&!Wm(t)&&t!==1/0&&t!==-1/0}});var Ar=h((hb,au)=>{"use strict";a();s();var jm=ln(),zm=fn(),Vm=Zt(),Gm=ou();au.exports=function(t){if(typeof t!="number"||Vm(t)||!Gm(t))return!1;var e=jm(t);return zm(e)===e}});var ei=h((vb,su)=>{"use strict";a();s();su.exports=function(t){return!!t&&(typeof t=="function"||typeof t=="object")}});var lu=h((Sb,uu)=>{"use strict";a();s();var Ym=cn();uu.exports=function(){return Ym()&&!!Symbol.toStringTag}});var ii=h((Ab,mu)=>{"use strict";a();s();var fu=Y(),Hm=lu()(),Km=xn(),Jm=Pe(),ni;Hm?(pu=fu("RegExp.prototype.exec"),ti={},Ir=function(){throw ti},ri={toString:Ir,valueOf:Ir},typeof Symbol.toPrimitive=="symbol"&&(ri[Symbol.toPrimitive]=Ir),ni=function(t){if(!t||typeof t!="object")return!1;var e=Jm(t,"lastIndex"),n=e&&Km(e,"value");if(!n)return!1;try{pu(t,ri)}catch(i){return i===ti}}):(cu=fu("Object.prototype.toString"),du="[object RegExp]",ni=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:cu(t)===du});var pu,ti,Ir,ri,cu,du;mu.exports=ni});var oi=h((Rb,yu)=>{"use strict";a();s();var Zm=Y(),Xm=ii(),Qm=Zm("RegExp.prototype.exec"),ey=C();yu.exports=function(t){if(!Xm(t))throw new ey("`regex` must be a RegExp");return function(n){return Qm(t,n)!==null}}});var xu=h((Cb,gu)=>{"use strict";a();s();var hu=C(),ty=Nt(),ry=Sr(),ny=ei();gu.exports=function(t,e){if(!ny(t))throw new hu("Assertion failed: Type(O) is not Object");if(!ry(e))throw new hu("Assertion failed: P is not a Property Key, got "+ty(e));return t[e]}});var wu=h((Bb,vu)=>{"use strict";a();s();vu.exports=pn()});var si=h((Db,bu)=>{"use strict";a();s();var iy=Y(),ai=C(),oy=Ar(),ay=iy("String.prototype.slice");bu.exports=function(t,e,n){if(typeof t!="string")throw new ai("Assertion failed: `string` must be a String");if(typeof e!="string")throw new ai("Assertion failed: `searchValue` must be a String");if(!oy(n)||n<0)throw new ai("Assertion failed: `fromIndex` must be a non-negative integer");var i=t.length;if(e===""&&n<=i)return n;for(var o=e.length,u=n;u<=i-o;u+=1){var f=ay(t,u,u+o);if(f===e)return u}return"NOT-FOUND"}});var Nr=h(($b,Su)=>{"use strict";a();s();var sy=C();Su.exports=function(t){if(t==null)throw new sy(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}});var Tu=h((jb,Eu)=>{"use strict";a();s();var uy=G(),ly=uy("%String%"),fy=C();Eu.exports=function(t){if(typeof t=="symbol")throw new fy("Cannot convert a Symbol value to a string");return ly(t)}});var ui=h((Gb,Nu)=>{"use strict";a();s();var py=Nr(),cy=Tu(),dy=Y(),Au=dy("String.prototype.replace"),Iu=/^\s$/.test("\u180E"),my=Iu?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,yy=Iu?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;Nu.exports=function(){var t=cy(py(this));return Au(Au(t,my,""),yy,"")}});var li=h((Kb,Ou)=>{"use strict";a();s();var hy=ui(),Ru="\u200B",je="\u180E";Ou.exports=function(){return String.prototype.trim&&Ru.trim()===Ru&&je.trim()===je&&("_"+je).trim()==="_"+je&&(je+"_").trim()===je+"_"?String.prototype.trim:hy}});var Pu=h((Xb,Cu)=>{"use strict";a();s();var gy=ar()(),Lu=or(),xy=li();Cu.exports=function(){var t=xy();return String.prototype.trim!==t&&(gy?Lu(String.prototype,"trim",t,!0):Lu(String.prototype,"trim",t)),t}});var Mu=h((tS,qu)=>{"use strict";a();s();var vy=ur(),wy=pr(),by=Nr(),Sy=ui(),Fu=li(),Ey=Pu(),Ty=vy(Fu()),Bu=function(t){return by(t),Ty(t)};wy(Bu,{getPolyfill:Fu,implementation:Sy,shim:Ey});qu.exports=Bu});var _u=h((iS,$u)=>{"use strict";a();s();var ku=G(),Ay=ku("%RegExp%"),Iy=C(),Du=ku("%parseInt%"),Ny=Y(),Rr=oi(),Uu=Ny("String.prototype.slice"),Ry=Rr(/^0b[01]+$/i),Oy=Rr(/^0o[0-7]+$/i),Ly=Rr(/^[-+]0x[0-9a-f]+$/i),Cy=["\x85","\u200B","\uFFFE"].join(""),Py=new Ay("["+Cy+"]","g"),Fy=Rr(Py),By=Mu();$u.exports=function r(t){if(typeof t!="string")throw new Iy("Assertion failed: `argument` is not a String");if(Ry(t))return+Du(Uu(t,2),2);if(Oy(t))return+Du(Uu(t,2),8);if(Fy(t)||Ly(t))return NaN;var e=By(t);return e!==t?r(e):+t}});var zu=h((sS,ju)=>{"use strict";a();s();var qy=C(),Wu=Ar(),My=Y(),Dy=My("String.prototype.slice");ju.exports=function(t,e,n){if(typeof t!="string"||!Wu(e)||arguments.length>2&&!Wu(n))throw new qy("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return Dy(t,e,arguments.length>2?n:t.length)}});var fi=h((fS,Vu)=>{"use strict";a();s();var Uy=G(),ky=Uy("%String%"),$y=C();Vu.exports=function(t){if(typeof t=="symbol")throw new $y("Cannot convert a Symbol value to a string");return ky(t)}});var Yu=h((dS,Gu)=>{"use strict";a();s();Gu.exports=function(t,e){for(var n=0;n<t.length;n+=1)if(!e(t[n],n,t))return!1;return!0}});var Ku=h((hS,Hu)=>{"use strict";a();s();var _y=Y()("String.prototype.slice");Hu.exports=function(t,e){return t===e?!0:t.length>e.length?!1:_y(e,0,t.length)===t}});var Zu=h((vS,Ju)=>{"use strict";a();s();Ju.exports=function(t){return typeof t=="string"||typeof t=="undefined"}});var rl=h((SS,tl)=>{"use strict";a();s();var ne=C(),pi=Nt(),Wy=Ar(),Xu=ei(),el=oi(),jy=xu(),zy=An(),Vy=wu(),Gy=si(),Qu=_u(),ie=zu(),Yy=fi(),Hy=Yu(),Rt=Ku(),Ky=Zu(),Jy=el(/^\$[0-9]/),Zy=el(/^\$[0-9][0-9]/);tl.exports=function(t,e,n,i,o,u){if(typeof t!="string")throw new ne("Assertion failed: `matched` must be a String");if(typeof e!="string")throw new ne("Assertion failed: `str` must be a String");if(!Wy(n)||n<0)throw new ne("Assertion failed: `position` must be a nonnegative integer, got "+pi(n));if(!zy(i)||!Hy(i,Ky))throw new ne("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+pi(i));if(typeof o!="undefined"&&!Xu(o))throw new ne("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof u!="string")throw new ne("Assertion failed: `replacementTemplate` must be a String");var f=e.length;if(n>f)throw new ne("Assertion failed: position > stringLength, got "+pi(n));for(var p=u,y="";p!=="";){var g,x,v;if(Rt("$$",p))g="$$",x="$";else if(Rt("$`",p))g="$`",x=ie(e,0,n);else if(Rt("$&",p))g="$&",x=t;else if(Rt("$'",p)){g="$'";var A=t.length,R=n+A;x=ie(e,Vy(R,f))}else if(Jy(p)){var I=Zy(p)?2:1,M=ie(p,1,1+I),k=Qu(M);if(k<0||k>99)throw new ne("Assertion failed: `index` must be >= 0 and <= 99");var X=i.length;k>X&&I===2&&(I=1,M=ie(M,0,1),k=Qu(M)),g=ie(p,0,1+I),1<=k&&k<=X?(v=i[k-1],typeof v=="undefined"?x="":x=v):x=g}else if(Rt("$<",p)){var he=Gy(p,">",0);if(!(he>-1)||typeof o=="undefined")g="$<",x=g;else{g=ie(p,0,he+1);var ut=ie(p,2,he);if(!Xu(o))throw new ne("Assertion failed: Type(namedCaptures) is not Object");v=jy(o,ut),typeof v=="undefined"?x="":x=Yy(v)}}else g=ie(p,0,1),x=g;var _t=g.length;p=ie(p,_t),y+=x}return y}});var al=h((AS,ol)=>{"use strict";a();s();var nl=G(),il=ur(),Xy=il(nl("String.prototype.indexOf"));ol.exports=function(t,e){var n=nl(t,!!e);return typeof n=="function"&&Xy(t,".prototype.")>-1?il(n):n}});var di=h((RS,fl)=>{"use strict";a();s();var sl=as(),Qy=nu(),eh=rl(),th=Qn(),rh=Nr(),Or=fi(),ul=si(),nh=G(),Lr=al(),ih=dn()(),oh=ii(),ah=nh("%Math.max%"),ll=C(),sh=Lr("Array.prototype.push"),ci=Lr("String.prototype.slice"),uh=Lr("String.prototype.indexOf"),lh=Lr("String.prototype.replace");fl.exports=function(t,e){var n=rh(this),i=oh(t);if(i&&uh(ci(t,t.source.length+2),"g")===-1)throw new ll("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(ih&&Symbol.replace){if(t!=null){var o=Qy(t,Symbol.replace);if(typeof o!="undefined")return sl(o,t,[n,e])}}else if(i)return lh(n,t,e);var u=Or(n),f=Or(t),p=th(e);p||(e=Or(e));for(var y=f.length,g=ah(1,y),x=[],v=ul(u,f,0);v!=="NOT-FOUND";)sh(x,v),v=ul(u,f,v+g);for(var A=0,R="",I=0;I<x.length;I+=1){var M;if(p)M=Or(sl(e,void 0,[f,x[I],u]));else{if(typeof e!="string")throw new ll("Assertion failed: `replaceValue` should be a string at this point");var k=[];M=eh(f,u,x[I],k,void 0,e)}var X=ci(u,A,x[I]);R+=X+M,A=x[I]+y}return A<u.length&&(R+=ci(u,A)),R}});var mi=h((CS,pl)=>{"use strict";a();s();var fh=di();pl.exports=function(){return String.prototype.replaceAll||fh}});var dl=h((BS,cl)=>{"use strict";a();s();var ph=pr(),ch=mi();cl.exports=function(){var t=ch();return ph(String.prototype,{replaceAll:t},{replaceAll:function(){return String.prototype.replaceAll!==t}}),t}});var gl=h((DS,hl)=>{"use strict";a();s();var dh=ur(),mh=pr(),ml=di(),yh=mi(),hh=dl(),yl=dh(ml);mh(yl,{getPolyfill:yh,implementation:ml,shim:hh});hl.exports=yl});var xi=h((H1,vf)=>{"use strict";a();s();function ix(r){return!(typeof r!="number"||r!==r||r===1/0||r===-1/0)}vf.exports=ix});var bf=h((Z1,wf)=>{"use strict";a();s();var ox=9007199254740991;wf.exports=ox});var vi=h((eI,Sf)=>{"use strict";a();s();var ax=bf();function sx(r){return typeof r=="number"&&Math.abs(r)<=ax}Sf.exports=sx});var Tf=h((nI,Ef)=>{"use strict";a();s();var ux=xi(),lx=vi();function fx(r){var t=parseInt(r,10);if(!ux(t))throw new TypeError("Not a finite number: "+r+" ("+typeof r+")");if(!lx(t))throw new RangeError("Input is not a safe number, it\u2019s either too large or too small.");var e=String(t),n=Math.abs(t%100),i=n>=11&&n<=13,o=e.charAt(e.length-1);return e+(i?"th":o==="1"?"st":o==="2"?"nd":o==="3"?"rd":"th")}Ef.exports=fx});var wi=h((aI,Nf)=>{"use strict";a();s();var px=/(hundred|thousand|(m|b|tr|quadr)illion)$/,cx=/teen$/,Af=/y$/,If=/(zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)$/,dx={zero:"zeroth",one:"first",two:"second",three:"third",four:"fourth",five:"fifth",six:"sixth",seven:"seventh",eight:"eighth",nine:"ninth",ten:"tenth",eleven:"eleventh",twelve:"twelfth"};function mx(r){return px.test(r)||cx.test(r)?r+"th":Af.test(r)?r.replace(Af,"ieth"):If.test(r)?r.replace(If,yx):r}function yx(r,t){return dx[t]}Nf.exports=mx});var Ni=h((lI,Lf)=>{"use strict";a();s();var hx=wi(),gx=xi(),xx=vi(),Rf=10,bi=100,Si=1e3,Ei=1e6,Ti=1e9,Ai=1e12,Ii=1e15,vx=9007199254740992,Of=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],wx=["zero","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function bx(r,t){var e,n=parseInt(r,10);if(!gx(n))throw new TypeError("Not a finite number: "+r+" ("+typeof r+")");if(!xx(n))throw new RangeError("Input is not a safe number, it\u2019s either too large or too small.");return e=me(n),t?hx(e):e}function me(r){var t,e,n=arguments[1];return r===0?n?n.join(" ").replace(/,$/,""):"zero":(n||(n=[]),r<0&&(n.push("minus"),r=Math.abs(r)),r<20?(t=0,e=Of[r]):r<bi?(t=r%Rf,e=wx[Math.floor(r/Rf)],t&&(e+="-"+Of[t],t=0)):r<Si?(t=r%bi,e=me(Math.floor(r/bi))+" hundred"):r<Ei?(t=r%Si,e=me(Math.floor(r/Si))+" thousand,"):r<Ti?(t=r%Ei,e=me(Math.floor(r/Ei))+" million,"):r<Ai?(t=r%Ti,e=me(Math.floor(r/Ti))+" billion,"):r<Ii?(t=r%Ai,e=me(Math.floor(r/Ai))+" trillion,"):r<=vx&&(t=r%Ii,e=me(Math.floor(r/Ii))+" quadrillion,"),n.push(e),me(t,n))}Lf.exports=bx});var Pf=h((cI,Cf)=>{"use strict";a();s();var Sx=wi(),Ex=Ni();function Tx(r){var t=Ex(r);return Sx(t)}Cf.exports=Tx});var Bf=h((yI,Ff)=>{"use strict";a();s();Ff.exports={toOrdinal:Tf(),toWords:Ni(),toWordsOrdinal:Pf()}});var Gx={};ft(Gx,{DynamicSnippetsGenerator:()=>Jr,EndpointSnippetGenerator:()=>st});module.exports=$i(Gx);a();s();var DC=ki(gl(),1);a();s();a();s();a();s();function Cr(r,t){if(r===void 0)throw new Error(t!=null?t:"Expected value to be defined but got undefined.")}function _(r,t){if(r===null)throw new Error(t!=null?t:"Expected value to be non-null but got null.")}function S(r){throw new Error("Unexpected value: "+JSON.stringify(r))}a();s();a();s();a();s();a();s();a();s();a();s();var gh=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,xl=gh;var xh=typeof self=="object"&&self&&self.Object===Object&&self,vh=xl||xh||Function("return this")(),vl=vh;var wh=vl.Symbol,oe=wh;a();s();var wl=Object.prototype,bh=wl.hasOwnProperty,Sh=wl.toString,Ot=oe?oe.toStringTag:void 0;function Eh(r){var t=bh.call(r,Ot),e=r[Ot];try{r[Ot]=void 0;var n=!0}catch(o){}var i=Sh.call(r);return n&&(t?r[Ot]=e:delete r[Ot]),i}var bl=Eh;a();s();var Th=Object.prototype,Ah=Th.toString;function Ih(r){return Ah.call(r)}var Sl=Ih;var Nh="[object Null]",Rh="[object Undefined]",El=oe?oe.toStringTag:void 0;function Oh(r){return r==null?r===void 0?Rh:Nh:El&&El in Object(r)?bl(r):Sl(r)}var Tl=Oh;a();s();function Lh(r){return r!=null&&typeof r=="object"}var Al=Lh;var Ch="[object Symbol]";function Ph(r){return typeof r=="symbol"||Al(r)&&Tl(r)==Ch}var Il=Ph;a();s();a();s();function Fh(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i}var Nl=Fh;a();s();var Bh=Array.isArray,Rl=Bh;var qh=1/0,Ol=oe?oe.prototype:void 0,Ll=Ol?Ol.toString:void 0;function Cl(r){if(typeof r=="string")return r;if(Rl(r))return Nl(r,Cl)+"";if(Il(r))return Ll?Ll.call(r):"";var t=r+"";return t=="0"&&1/r==-qh?"-0":t}var Pl=Cl;a();s();function Mh(r){return r==null?"":Pl(r)}var ce=Mh;a();s();a();s();a();s();a();s();a();s();a();s();function Dh(r,t,e){var n=-1,i=r.length;t<0&&(t=-t>i?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=r[n+t];return o}var Fl=Dh;function Uh(r,t,e){var n=r.length;return e=e===void 0?n:e,!t&&e>=n?r:Fl(r,t,e)}var Bl=Uh;a();s();var kh="\\ud800-\\udfff",$h="\\u0300-\\u036f",_h="\\ufe20-\\ufe2f",Wh="\\u20d0-\\u20ff",jh=$h+_h+Wh,zh="\\ufe0e\\ufe0f",Vh="\\u200d",Gh=RegExp("["+Vh+kh+jh+zh+"]");function Yh(r){return Gh.test(r)}var Pr=Yh;a();s();a();s();function Hh(r){return r.split("")}var ql=Hh;a();s();var Ml="\\ud800-\\udfff",Kh="\\u0300-\\u036f",Jh="\\ufe20-\\ufe2f",Zh="\\u20d0-\\u20ff",Xh=Kh+Jh+Zh,Qh="\\ufe0e\\ufe0f",eg="["+Ml+"]",yi="["+Xh+"]",hi="\\ud83c[\\udffb-\\udfff]",tg="(?:"+yi+"|"+hi+")",Dl="[^"+Ml+"]",Ul="(?:\\ud83c[\\udde6-\\uddff]){2}",kl="[\\ud800-\\udbff][\\udc00-\\udfff]",rg="\\u200d",$l=tg+"?",_l="["+Qh+"]?",ng="(?:"+rg+"(?:"+[Dl,Ul,kl].join("|")+")"+_l+$l+")*",ig=_l+$l+ng,og="(?:"+[Dl+yi+"?",yi,Ul,kl,eg].join("|")+")",ag=RegExp(hi+"(?="+hi+")|"+og+ig,"g");function sg(r){return r.match(ag)||[]}var Wl=sg;function ug(r){return Pr(r)?Wl(r):ql(r)}var jl=ug;function lg(r){return function(t){t=ce(t);var e=Pr(t)?jl(t):void 0,n=e?e[0]:t.charAt(0),i=e?Bl(e,1).join(""):t.slice(1);return n[r]()+i}}var Fr=lg;var fg=Fr("toUpperCase"),B=fg;function pg(r){return B(ce(r).toLowerCase())}var zl=pg;a();s();a();s();function cg(r,t,e,n){var i=-1,o=r==null?0:r.length;for(n&&o&&(e=r[++i]);++i<o;)e=t(e,r[i],i,r);return e}var Vl=cg;a();s();a();s();a();s();function dg(r){return function(t){return r==null?void 0:r[t]}}var Gl=dg;var mg={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},yg=Gl(mg),Yl=yg;var hg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gg="\\u0300-\\u036f",xg="\\ufe20-\\ufe2f",vg="\\u20d0-\\u20ff",wg=gg+xg+vg,bg="["+wg+"]",Sg=RegExp(bg,"g");function Eg(r){return r=ce(r),r&&r.replace(hg,Yl).replace(Sg,"")}var Hl=Eg;a();s();a();s();var Tg=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ag(r){return r.match(Tg)||[]}var Kl=Ag;a();s();var Ig=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ng(r){return Ig.test(r)}var Jl=Ng;a();s();var tf="\\ud800-\\udfff",Rg="\\u0300-\\u036f",Og="\\ufe20-\\ufe2f",Lg="\\u20d0-\\u20ff",Cg=Rg+Og+Lg,rf="\\u2700-\\u27bf",nf="a-z\\xdf-\\xf6\\xf8-\\xff",Pg="\\xac\\xb1\\xd7\\xf7",Fg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bg="\\u2000-\\u206f",qg=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",of="A-Z\\xc0-\\xd6\\xd8-\\xde",Mg="\\ufe0e\\ufe0f",af=Pg+Fg+Bg+qg,sf="['\u2019]",Zl="["+af+"]",Dg="["+Cg+"]",uf="\\d+",Ug="["+rf+"]",lf="["+nf+"]",ff="[^"+tf+af+uf+rf+nf+of+"]",kg="\\ud83c[\\udffb-\\udfff]",$g="(?:"+Dg+"|"+kg+")",_g="[^"+tf+"]",pf="(?:\\ud83c[\\udde6-\\uddff]){2}",cf="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+of+"]",Wg="\\u200d",Xl="(?:"+lf+"|"+ff+")",jg="(?:"+ze+"|"+ff+")",Ql="(?:"+sf+"(?:d|ll|m|re|s|t|ve))?",ef="(?:"+sf+"(?:D|LL|M|RE|S|T|VE))?",df=$g+"?",mf="["+Mg+"]?",zg="(?:"+Wg+"(?:"+[_g,pf,cf].join("|")+")"+mf+df+")*",Vg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Gg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yg=mf+df+zg,Hg="(?:"+[Ug,pf,cf].join("|")+")"+Yg,Kg=RegExp([ze+"?"+lf+"+"+Ql+"(?="+[Zl,ze,"$"].join("|")+")",jg+"+"+ef+"(?="+[Zl,ze+Xl,"$"].join("|")+")",ze+"?"+Xl+"+"+Ql,ze+"+"+ef,Gg,Vg,uf,Hg].join("|"),"g");function Jg(r){return r.match(Kg)||[]}var yf=Jg;function Zg(r,t,e){return r=ce(r),t=e?void 0:t,t===void 0?Jl(r)?yf(r):Kl(r):r.match(t)||[]}var hf=Zg;var Xg="['\u2019]",Qg=RegExp(Xg,"g");function ex(r){return function(t){return Vl(hf(Hl(t).replace(Qg,"")),r,"")}}var gf=ex;var tx=gf(function(r,t,e){return t=t.toLowerCase(),r+(e?zl(t):t)}),q=tx;a();s();var rx=Fr("toLowerCase"),Br=rx;a();s();function gi(){}a();s();function Lt(r){return Object.keys(r)}a();s();function qr(r){return Object.values(r)}a();s();a();s();var Ie=class{};a();s();a();s();var W=class extends Ie{constructor(e){super();d(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var nx=4,xf=!!c.env.FERN_STACK_TRACK;xf&&(Error.stackTraceLimit=50);var Ct=class{constructor(){d(this,"buffer","");d(this,"indentLevel",0);d(this,"hasWrittenAnything",!1);d(this,"lastCharacterIsSemicolon",!1);d(this,"lastCharacterIsNewline",!1)}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let n=e.length>0&&e.endsWith(`
|
|
14
|
+
`),i=n?e.substring(0,e.length-1):e,o=this.getIndentString(),u=i.replaceAll(`
|
|
15
|
+
`,`
|
|
16
|
+
${o}`);this.isAtStartOfLine()&&(u=o+u),n&&(u+=`
|
|
17
|
+
`),this.writeInternal(u)}else this.writeNode(e)}writeStatement(...t){this.write(...t),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new W(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new W(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new W(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new W(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new W(t).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(t=!0){this.dedent(),this.writeNewLineIfLastLineNot(),t?this.writeLine("}"):this.write("}")}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
18
|
+
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
19
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let o=1;o<t.length;o++){this.write(e);let u=t[o];u!=null&&n(u)}}}toString(){return this.buffer}writeInternal(t){if(t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
20
|
+
`),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t,xf&&this.buffer.endsWith(`
|
|
21
|
+
`)&&!this.buffer.endsWith(`"""
|
|
22
|
+
`)){let e=this.stacktrace(15).map(n=>`${n.fn} - ${n.path}:${n.position}`).join(" ");e&&(this.buffer=this.buffer.slice(0,-1),this.buffer+=`//@@ ${e}
|
|
23
|
+
`)}return this.buffer}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return nx}stacktrace(t=50){var n;let e=!1;return((n=new Error().stack)!=null?n:"").split(`
|
|
24
|
+
`).map(i=>{var u;let o=i.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(o&&o.length===5){let[,f,p,y,g]=o;if(e||f!=null&&f.includes("runInteractiveTask")){e=!0;return}switch(f){case"Object.<anonymous>":f="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":f=`${f.substring(f.indexOf(".")+1)}()=> { ... }`;break}return{fn:f,path:(u=p==null?void 0:p.replace(/^.*?fern.*?\//,""))!=null?u:"",position:`${y}:${g}`}}}).filter(i=>{var o,u,f,p,y,g,x;return i&&!((o=i.path)!=null&&o.startsWith("node:"))&&!((u=i.path)!=null&&u.endsWith(".js"))&&!((f=i.path)!=null&&f.includes("AbstractWriter"))&&!((p=i.fn)!=null&&p.includes("stacktrace"))&&!((y=i.fn)!=null&&y.includes("stackLine"))&&!((g=i.fn)!=null&&g.includes("SdkGeneratorCLI"))&&!((x=i.fn)!=null&&x.includes("runCli"))}).slice(0,t)}};a();s();a();s();a();s();var Pt=class{constructor(){d(this,"reporter");d(this,"snippet");d(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:t,snippet:e}){this.shouldUpdate({snippet:e,reporter:t.errors})&&(this.reporter=t.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:t}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${t.method} ${t.path}"`)}shouldUpdate({snippet:t,reporter:e}){var n,i;return this.reporter==null||this.reporter.size()>0&&e.size()===0?!0:t.length>((i=(n=this.snippet)==null?void 0:n.length)!=null?i:0)}};var Ft=class{constructor(t){d(this,"context");this.context=t}async generate(t,e={}){let n=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new Pt;for(let o of n){let u=this.context.clone(),f=this.createSnippetGenerator(u);try{let p=await f.generateSnippet({endpoint:o,request:t,options:e});if(u.errors.empty())return{snippet:p,errors:void 0};i.update({context:u,snippet:p})}catch(p){i.err==null&&(i.err=p)}}return i.getResponseOrThrow({endpoint:t.endpoint})}generateSync(t,e={}){let n=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new Pt;for(let o of n){let u=this.context.clone(),f=this.createSnippetGenerator(u);try{let p=f.generateSnippetSync({endpoint:o,request:t,options:e});if(u.errors.empty())return{snippet:p,errors:void 0};i.update({context:u,snippet:p})}catch(p){i.err==null&&(i.err=p)}}return i.getResponseOrThrow({endpoint:t.endpoint})}};a();s();a();s();a();s();var Bt=class{constructor(){d(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let n=t.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};a();s();var T={Critical:"CRITICAL",Warning:"WARNING"},qt=class r{constructor(){d(this,"errors");d(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(qi(N({},t),{path:[...this.path]}))}scope(t){this.path.push(t)}unscope(){this.path.pop()}getBySeverity(t){return this.errors.filter(e=>e.severity===t)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let t=new r;return t.errors=[...this.errors],t.path=[...this.path],t}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(t=>({severity:t.severity,path:t.path!=null?this.pathToStringArray(t.path):void 0,message:t.message}))}pathToStringArray(t){let e=[];for(let n of t){if(typeof n=="string"){e.push(n);continue}e[e.length-1]+=`[${n.index}]`}return e}};var Mt=class{constructor({ir:t,config:e,options:n={}}){d(this,"config");d(this,"options");d(this,"errors");d(this,"_ir");d(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=n,this.errors=new qt,this.httpEndpointReferenceParser=new Bt}associateQueryParametersByWireValue({parameters:t,values:e}){let n=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let u=t.find(p=>p.name.wireValue===i);if(u==null)throw this.newParameterNotRecognizedError(i);let f=this.isListTypeReference(u.typeReference)&&!Array.isArray(o)?[o]:o;n.push({name:u.name,typeReference:u.typeReference,value:f})}finally{this.errors.unscope()}}return n}associateByWireValueOrDefault({parameters:t,values:e}){let n=[];for(let i of t){this.errors.scope(i.name.wireValue);try{let o=e[i.name.wireValue];if(o==null)if(i.typeReference.type==="primitive"&&i.typeReference.value==="STRING")o=`<${i.name.wireValue}>`;else{this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(i.name.wireValue).message});continue}n.push({name:i.name,typeReference:i.typeReference,value:o})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:n}){let i=[];for(let[o,u]of Object.entries(e)){this.errors.scope(o);try{let f=t.find(p=>p.name.wireValue===o);if(f==null){if(n)continue;this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:f.name,typeReference:f.typeReference,value:u})}finally{this.errors.unscope()}}return i}getExampleObjectProperties({parameters:t,snippetObject:e}){let n=typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{},i=[];for(let o of t){let u=n[o.name.wireValue];u==null?o.typeReference.type==="nullable"&&i.push({name:o.name,typeReference:o.typeReference,value:null}):i.push({name:o.name,typeReference:o.typeReference,value:u})}return i}getSingleFileValue({property:t,record:e}){let n=e[t.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:T.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:t,record:e}){let n=e[t.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:T.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let i=[];for(let o of n){if(typeof o!="string"){this.errors.add({severity:T.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:T.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(t)?"array":typeof t}`});return}return t==null?{}:t}resolveNamedType({typeId:t}){let e=this._ir.types[t];if(e==null){this.errors.add({severity:T.Critical,message:`Type identified by "${t}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e}){let n=this.getRecord(e);if(n==null)return;let i=t.discriminant.wireValue,o=n[i];if(o==null){this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:T.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let u=t.types[o];if(u==null){this.errors.add({severity:T.Critical,message:`No type found for discriminant value "${o}"`});return}let y=n,{[i]:f}=y,p=Di(y,[Mi(i)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.discriminantValue,value:p}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocation(t){let e=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:t})&&e.push(n);return e}resolveEndpointLocationOrThrow(t){let e=this.resolveEndpointLocation(t);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`);return e}needsRequestParameter({request:t,inlinePathParameters:e,inlineFileProperties:n}){var i;return this.includePathParametersInWrappedRequest({request:t,inlinePathParameters:e})||t.queryParameters!=null&&t.queryParameters.length>0||t.headers!=null&&t.headers.length>0?!0:t.body!=null?this.includeRequestBodyInWrappedRequest({body:t.body,inlineFileProperties:n}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var n,i;return e&&((i=(n=t.metadata)==null?void 0:n.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:S(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}default:S(e)}}isSingleEnvironmentID(t){return typeof t=="string"}isMultiEnvironmentValues(t){return typeof t=="object"}validateMultiEnvironmentUrlValues(t){if(this._ir.environments==null)return this.errors.add({severity:T.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":return this.errors.add({severity:T.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=e.environments[0];if(n==null)return this.errors.add({severity:T.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(Lt(n.urls));for(let o of Lt(t))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:T.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${Lt(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:T.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:T.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:T.Critical,message:this.newTypeMismatchError({expected:"string",value:t}).message});return}return t}isOptional(t){switch(t.type){case"nullable":return this.isOptional(t.value);case"optional":return!0;case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}isNullable(t){switch(t.type){case"nullable":return!0;case"optional":return this.isNullable(t.value);case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}newAuthMismatchError({auth:t,values:e}){return new Error(`Expected auth type ${t.type}, got ${e.type}`)}newParameterNotRecognizedError(t){return new Error(`"${t}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:t,value:e}){return new Error(`Expected ${t}, got ${typeof e}`)}includeRequestBodyInWrappedRequest({body:t,inlineFileProperties:e}){switch(t.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e});default:S(t)}}includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e}){return this.fileUploadHasBodyProperties({fileUpload:t})||e&&this.fileUploadHasFileProperties({fileUpload:t})}fileUploadHasBodyProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:S(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:S(e)}})}isListTypeReference(t){return t.type==="optional"?this.isListTypeReference(t.value):t.type==="list"||t.type==="set"}parsedEndpointMatches({endpoint:t,parsedEndpoint:e}){return t.location.method===e.method&&t.location.path===e.path}};a();s();var de={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();s();a();s();function Dt(r){return B(q(r))}a();s();a();s();a();s();var Ve={};ft(Ve,{sanitizeForIdentifier:()=>Ri,sanitizeToCamelCase:()=>Ix,sanitizeToPascalCase:()=>Ax});a();s();var qf=ki(Bf(),1);a();s();function Mr(r){return B(q(r))}function Ax(r){let t=Ri(r);return Mr(t)}function Ix(r){let t=Ri(r);return q(t)}function Ri(r){if(r==="")return"empty";let t=r;if(/^\d/.test(t)){let n=Nx(t);t=n.numberAsWords+B(n.rest)}return/^[a-zA-Z][a-zA-Z0-9]*$/.test(t)||(t=t.replace(/^[^a-zA-Z0-9]+/,""),t=q(t)),/^\d/.test(t)&&(t="value"+t),t===""?"value":t}function Nx(r){let t=r.match(/^(\d+)/);if(!t||!t[1])return{numberAsWords:"",rest:r};let e=t[1],n=r.slice(e.length);try{return{numberAsWords:(0,qf.toWords)(parseInt(e,10)),rest:n}}catch(i){let o={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};return{numberAsWords:e.split("").map(f=>o[f]||f).join(""),rest:n}}}a();s();var Ut={};ft(Ut,{generateEnumCaseLabel:()=>Ox,generateName:()=>Rx,sanitizeLiteralValue:()=>Oi});a();s();function Rx(r){let t=Oi(r);return Mr(t)}function Ox(r){let t=Oi(r);return q(t)}function Oi(r){if(r==="")return"empty";let t=r;return/^[a-zA-Z][a-zA-Z0-9]*$/.test(r)||(t=t.replace(/^[^a-zA-Z0-9]+/,""),t=q(t)),/^\d/.test(t)||t===""?"value":t}var m={};ft(m,{AccessLevel:()=>Mf,Class:()=>Ge,CodeBlock:()=>F,Comment:()=>Ye,ComputedProperty:()=>Ke,DeclarationType:()=>kt,DocComment:()=>Je,EnumWithAssociatedValues:()=>Ze,EnumWithRawValues:()=>Xe,Expression:()=>Z,Extension:()=>Qe,FunctionArgument:()=>et,FunctionParameter:()=>tt,Initializer:()=>rt,LineBreak:()=>Ur,Method:()=>nt,Pattern:()=>kr,Property:()=>it,Protocol:()=>Uf,Statement:()=>He,Struct:()=>ot,Symbol:()=>O,SymbolRegistry:()=>Gr,Type:()=>_r,TypeReference:()=>Wr,class_:()=>Px,codeBlock:()=>Fx,comment:()=>Bx,computedProperty:()=>qx,docComment:()=>Mx,enumWithAssociatedValues:()=>Dx,enumWithRawValues:()=>Ux,extension:()=>kx,functionArgument:()=>$x,functionParameter:()=>_x,initializer:()=>Wx,method:()=>jx,property:()=>zx,struct:()=>Vx});a();s();a();s();a();s();var Mf={Open:"open",Public:"public",Package:"package",Internal:"internal",Fileprivate:"fileprivate",Private:"private"};a();s();a();s();a();s();a();s();var Dr=class extends Ct{toString(){return this.buffer}};var b=class extends Ie{toString(){let t=new Dr;return this.write(t),t.toString()}};var Ge=class extends b{constructor({accessLevel:e,name:n,final:i,conformances:o,properties:u,initializers:f,methods:p,docs:y}){super();d(this,"name");d(this,"final");d(this,"accessLevel");d(this,"conformances");d(this,"properties");d(this,"initializers");d(this,"methods");d(this,"docs");this.name=n,this.final=i,this.accessLevel=e,this.conformances=o!=null?o:[],this.properties=u,this.initializers=f!=null?f:[],this.methods=p!=null?p:[],this.docs=y}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.final&&e.write("final "),e.write(`class ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),e.write(" {"),e.newLine(),e.indent(),this.properties.forEach(n=>{n.write(e),e.newLine()}),this.initializers.length>0&&(e.newLine(),this.initializers.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),this.methods.length>0&&(e.newLine(),this.methods.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),e.dedent(),e.write("}")}};a();s();var F=class r extends b{constructor(e){super();d(this,"args");this.args=e}write(e){let n=new W(this.args);e.write("{"),e.newLine(),e.indent(),n.write(e),e.dedent(),e.write("}")}static empty(){return new r(gi)}static withStatements(e){return new r(n=>{e.forEach(i=>{i.write(n)})})}};a();s();var Ye=class extends b{constructor({content:e}){super();d(this,"content");this.content=e}write(e){this.content.split(`
|
|
25
|
+
`).forEach(i=>{e.write(`// ${i}`),e.newLine()})}};a();s();a();s();function Df(r){return r.replace(/\\u([0-9a-fA-F]{4})/g,"\\u{$1}").replace(new RegExp("(?<!\\\\)\\\\f","g"),"\\u{000C}").replace(new RegExp("(?<!\\\\)\\\\v","g"),"\\u{000B}").replace(new RegExp("(?<!\\\\)\\\\0","g"),"\\u{0000}").replace(new RegExp('(?<!\\\\)"',"g"),'\\"')}a();s();var Lx=["Any","as","associatedtype","break","case","catch","class","continue","default","defer","deinit","do","else","fallthrough","false","for","guard","enum","extension","fileprivate","func","if","import","in","init","inout","internal","is","let","nil","operator","private","precedencegroup","Protocol","protocol","public","repeat","rethrows","return","Self","self","static","struct","subscript","super","switch","throw","throws","true","try","Type","typealias","var","where","while"],Cx=new Set(Lx);function Ne(r){return Cx.has(r)}function U(r){return Ne(r)?`\`${r}\``:r}function ye(r){return r==="self"?"self_":r}a();s();var Z=class extends b{constructor(e){super();d(this,"internalExpression");this.internalExpression=e}isNop(){return this.internalExpression.type==="nop"}isStructInitialization(){return this.internalExpression.type==="struct-initialization"}asStructInitializationOrThrow(){if(this.internalExpression.type!=="struct-initialization")throw new Error("Internal error; swift.Expression is not a struct initialization");return this.internalExpression}write(e){switch(this.internalExpression.type){case"reference":e.write(U(this.internalExpression.unsafeName));break;case"member-access":this.internalExpression.target.write(e),this.internalExpression.optionalChain&&e.write("?"),e.write("."),e.write(this.internalExpression.memberName);break;case"equals":this.internalExpression.left.write(e),e.write(" == "),this.internalExpression.right.write(e);break;case"enum-case-shorthand":e.write("."),e.write(this.internalExpression.caseName);break;case"function-call":this.writeCallableExpression({writer:e,target:U(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"struct-initialization":this.writeCallableExpression({writer:e,target:U(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"class-initialization":this.writeCallableExpression({writer:e,target:U(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"method-call":this.internalExpression.target.write(e),e.write("."),this.writeCallableExpression({writer:e,target:this.internalExpression.methodName,arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"method-call-with-trailing-closure":this.internalExpression.target.write(e),e.write("."),e.write(this.internalExpression.methodName),e.write(" {"),this.internalExpression.multiline?(e.newLine(),e.indent()):e.write(" "),this.internalExpression.closureBody.write(e),this.internalExpression.multiline?(e.newLine(),e.dedent()):e.write(" "),e.write("}");break;case"contextual-method-call":e.write("."),this.writeCallableExpression({writer:e,target:this.internalExpression.methodName,arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"try":e.write("try "),this.internalExpression.expression.write(e);break;case"optional-try":e.write("try? "),this.internalExpression.expression.write(e);break;case"force-try":e.write("try! "),this.internalExpression.expression.write(e);break;case"await":e.write("await "),this.internalExpression.expression.write(e);break;case"string-literal":e.write(`"${this.internalExpression.value}"`);break;case"number-literal":e.write(this.internalExpression.value.toString());break;case"bool-literal":e.write(this.internalExpression.value?"true":"false");break;case"date-literal":e.write(`try! Date("${this.internalExpression.isoString}", strategy: .iso8601)`);break;case"calendar-date-literal":e.write(`CalendarDate("${this.internalExpression.isoString}")!`);break;case"uuid-literal":e.write(`UUID(uuidString: "${this.internalExpression.value}")!`);break;case"dictionary-literal":this.writeDictionaryLiteral(e,this.internalExpression);break;case"array-literal":this.writeArrayLiteral(e,this.internalExpression);break;case"data-literal":e.write(`Data("${this.internalExpression.value}".utf8)`);break;case"raw-value":e.write(this.internalExpression.value);break;case"nop":break;default:S(this.internalExpression)}}writeCallableExpression({writer:e,target:n,arguments_:i,multiline:o}){e.write(n),e.write("("),o&&(e.newLine(),e.indent()),i==null||i.forEach((u,f)=>{f>0&&(e.write(","),o?e.newLine():e.write(" ")),u.write(e)}),o&&(e.newLine(),e.dedent()),e.write(")")}writeDictionaryLiteral(e,n){var o;if(!n.entries||n.entries.length===0){e.write("[:]");return}e.write("[");let i=!!n.multiline;i&&(e.newLine(),e.indent()),(o=n.entries)==null||o.forEach(([u,f],p)=>{p>0&&(e.write(", "),i&&e.newLine()),u.write(e),e.write(": "),f.write(e)}),i&&(e.newLine(),e.dedent()),e.write("]")}writeArrayLiteral(e,n){var o;if(!n.elements||n.elements.length===0){e.write("[]");return}e.write("[");let i=!!n.multiline;i&&(e.newLine(),e.indent()),(o=n.elements)==null||o.forEach((u,f)=>{f>0&&(e.write(","),i?e.newLine():e.write(" ")),u.write(e)}),i&&(e.newLine(),e.dedent()),e.write("]")}static reference(e){return new this({type:"reference",unsafeName:e})}static memberAccess(e){return new this(N({type:"member-access"},e))}static equals(e,n){return new this({type:"equals",left:e,right:n})}static enumCaseShorthand(e){return new this({type:"enum-case-shorthand",caseName:e})}static functionCall(e){return new this(N({type:"function-call"},e))}static structInitialization(e){return new this(N({type:"struct-initialization"},e))}static classInitialization(e){return new this(N({type:"class-initialization"},e))}static stringLiteral(e){return new this({type:"string-literal",value:e})}static numberLiteral(e){return new this({type:"number-literal",value:e})}static boolLiteral(e){return new this({type:"bool-literal",value:e})}static dateLiteral(e){return new this({type:"date-literal",isoString:e})}static calendarDateLiteral(e){return new this({type:"calendar-date-literal",isoString:e})}static uuidLiteral(e){return new this({type:"uuid-literal",value:e})}static dictionaryLiteral(e){return new this(N({type:"dictionary-literal"},e))}static arrayLiteral(e){return new this(N({type:"array-literal"},e))}static dataLiteral(e){return new this({type:"data-literal",value:e})}static methodCall(e){return new this(N({type:"method-call"},e))}static methodCallWithTrailingClosure(e){return new this(N({type:"method-call-with-trailing-closure"},e))}static contextualMethodCall(e){return new this(N({type:"contextual-method-call"},e))}static try(e){return new this({type:"try",expression:e})}static optionalTry(e){return new this({type:"optional-try",expression:e})}static forceTry(e){return new this({type:"force-try",expression:e})}static await(e){return new this({type:"await",expression:e})}static rawValue(e){return new this({type:"raw-value",value:e})}static nop(){return new this({type:"nop"})}static nil(){return new this({type:"raw-value",value:"nil"})}static self(){return new this({type:"raw-value",value:"self"})}};a();s();a();s();var kt={Var:"var",Let:"let"};var He=class extends b{constructor(e){super();d(this,"internalStatement");this.internalStatement=e}write(e){var n,i,o;switch(this.internalStatement.type){case"typealias-declaration":this.internalStatement.docs!=null&&this.internalStatement.docs.write(e),this.internalStatement.accessLevel&&(e.write(this.internalStatement.accessLevel),e.write(" ")),e.write("typealias "),e.write(this.internalStatement.unsafeName),e.write(" = "),this.internalStatement.aliasedType.write(e),e.newLine();break;case"constant-declaration":e.write(kt.Let),e.write(" "),e.write(U(this.internalStatement.unsafeName)),e.write(" = "),this.internalStatement.value.write(e),this.internalStatement.noTrailingNewline||e.newLine();break;case"variable-declaration":e.write(kt.Var),e.write(" "),e.write(U(this.internalStatement.unsafeName)),e.write(" = "),this.internalStatement.value.write(e),this.internalStatement.noTrailingNewline||e.newLine();break;case"function-declaration":this.internalStatement.docs!=null&&this.internalStatement.docs.write(e),this.internalStatement.accessLevel!=null&&(e.write(this.internalStatement.accessLevel),e.write(" ")),e.write("func "),e.write(U(this.internalStatement.unsafeName)),e.write("("),(n=this.internalStatement.parameters)==null||n.forEach((u,f)=>{f>0&&e.write(", "),u.write(e)}),e.write(")"),this.internalStatement.async&&e.write(" async"),this.internalStatement.throws&&e.write(" throws"),this.internalStatement.returnType&&(e.write(" -> "),this.internalStatement.returnType.write(e)),e.write(" "),((i=this.internalStatement.body)!=null?i:F.empty()).write(e),e.newLine();break;case"variable-assignment":e.write(U(this.internalStatement.unsafeName)),e.write(" = "),this.internalStatement.value.write(e),e.newLine();break;case"self-assignment":e.write("self = "),e.write(this.internalStatement.value.toString()),e.newLine();break;case"property-assignment":e.write("self."),e.write(this.internalStatement.unsafeName),e.write(" = "),this.internalStatement.value.write(e),e.newLine();break;case"discard-assignment":e.write("_ = "),this.internalStatement.value.write(e),e.newLine();break;case"return":e.write("return "),this.internalStatement.expression.write(e),e.newLine();break;case"throw":e.write("throw "),this.internalStatement.expression.write(e),e.newLine();break;case"expression-statement":this.internalStatement.expression.write(e),e.newLine();break;case"import":e.write("import "),e.write(this.internalStatement.moduleName),e.newLine();break;case"switch":e.write("switch "),this.internalStatement.target.write(e),e.write(" {"),e.newLine();for(let u of this.internalStatement.cases)if(e.write("case "),u.pattern.write(e),e.write(":"),e.newLine(),u.body.length>0){e.indent();for(let f of u.body)f.write(e);e.dedent()}if(this.internalStatement.defaultCase&&(e.write("default:"),e.newLine(),this.internalStatement.defaultCase.length>0)){e.indent();for(let u of this.internalStatement.defaultCase)u.write(e);e.dedent()}e.write("}"),e.newLine();break;case"if":{e.write("if "),this.internalStatement.condition.write(e),e.write(" "),F.withStatements(this.internalStatement.body).write(e);for(let u of(o=this.internalStatement.elseIfs)!=null?o:[])e.write(" else if "),u.condition.write(e),e.write(" "),F.withStatements(u.body).write(e);this.internalStatement.else&&(e.write(" else "),F.withStatements(this.internalStatement.else).write(e)),e.newLine();break}case"raw":e.write(this.internalStatement.content),e.newLine();break;default:S(this.internalStatement)}}static typealiasDeclaration(e){return new this(N({type:"typealias-declaration"},e))}static constantDeclaration(e){return new this(N({type:"constant-declaration"},e))}static variableDeclaration(e){return new this(N({type:"variable-declaration"},e))}static functionDeclaration(e){return new this(N({type:"function-declaration"},e))}static variableAssignment(e,n){return new this({type:"variable-assignment",unsafeName:e,value:n})}static selfAssignment(e){return new this({type:"self-assignment",value:e})}static propertyAssignment(e,n){return new this({type:"property-assignment",unsafeName:e,value:n})}static discardAssignment(e){return new this({type:"discard-assignment",value:e})}static return(e){return new this({type:"return",expression:e})}static throw(e){return new this({type:"throw",expression:e})}static expressionStatement(e){return new this({type:"expression-statement",expression:e})}static import(e){return new this({type:"import",moduleName:e})}static switch(e){return new this(N({type:"switch"},e))}static if(e){return new this(N({type:"if"},e))}static raw(e){return new this({type:"raw",content:e})}};var Ke=class extends b{constructor({unsafeName:e,accessLevel:n,type:i,body:o,docs:u}){super();d(this,"unsafeName");d(this,"accessLevel");d(this,"type");d(this,"body");d(this,"docs");this.unsafeName=e,this.accessLevel=n,this.type=i,this.body=o,this.docs=u}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write("var "),e.write(U(this.unsafeName)),e.write(": "),this.type.write(e),e.write(" "),this.body instanceof F?this.body.write(e):this.body instanceof Z?F.withStatements([He.expressionStatement(this.body)]).write(e):S(this.body)}};a();s();var Je=class r extends b{constructor({summary:e,description:n,parameters:i,returns:o,throws:u}){super();d(this,"summary");d(this,"description");d(this,"parameters");d(this,"returns");d(this,"throws");this.summary=r.sanitizeText(e),this.description=n!=null?r.sanitizeText(n):void 0,this.parameters=(i!=null?i:[]).map(f=>({name:f.name,description:r.sanitizeText(f.description)})),this.returns=o!=null?r.sanitizeText(o):void 0,this.throws=(u!=null?u:[]).map(f=>r.sanitizeText(f))}write(e){if(this.writeMultilineText(e,this.summary),this.description!=null&&(e.write("///"),e.newLine(),this.writeMultilineText(e,this.description)),this.parameters.length>0){e.write("///"),e.newLine();for(let n of this.parameters)n.description.split(`
|
|
26
|
+
`).forEach((o,u)=>{u===0?(e.write("/// - Parameter "),e.write(n.name),e.write(": "),e.write(o)):(e.write("/// "),e.write(o)),e.newLine()})}if(this.returns!=null&&this.returns.split(`
|
|
27
|
+
`).forEach((i,o)=>{o===0?(e.write("/// - Returns: "),e.write(i)):(e.write("/// "),e.write(i)),e.newLine()}),this.throws.length>0)for(let n of this.throws)n.split(`
|
|
28
|
+
`).forEach((o,u)=>{u===0?(e.write("/// - Throws: "),e.write(o)):(e.write("/// "),e.write(o)),e.newLine()})}writeMultilineText(e,n){let i=n.split(`
|
|
29
|
+
`);for(let o of i)e.write("/// "),e.write(o),e.newLine()}static sanitizeText(e){return e=e.replace(/\r\n/g,`
|
|
30
|
+
`).replace(/\r/g,`
|
|
31
|
+
`),e=e.replace(/\x00/g,""),e}};a();s();var Ze=class extends b{constructor({accessLevel:e,name:n,conformances:i,cases:o,initializers:u,methods:f,nestedTypes:p,docs:y}){super();d(this,"name");d(this,"accessLevel");d(this,"conformances");d(this,"cases");d(this,"initializers");d(this,"methods");d(this,"nestedTypes");d(this,"docs");this.name=n,this.accessLevel=e,this.conformances=i!=null?i:[],this.cases=o,this.initializers=u!=null?u:[],this.methods=f!=null?f:[],this.nestedTypes=p!=null?p:[],this.docs=y}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write(`enum ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),e.write(" {"),e.newLine(),e.indent(),this.cases.forEach(n=>{n.docs!=null&&n.docs.write(e),e.write("case "),Ne(n.unsafeName)?e.write(`\`${n.unsafeName}\``):e.write(n.unsafeName),e.write("("),n.associatedValue.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write(")"),e.newLine()}),this.initializers.length>0&&(e.newLine(),this.initializers.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),this.methods.length>0&&(e.newLine(),this.methods.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),this.nestedTypes.length>0&&(e.newLine(),this.nestedTypes.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),e.dedent(),e.write("}")}};a();s();var Xe=class extends b{constructor({accessLevel:e,name:n,conformances:i,cases:o,docs:u}){super();d(this,"name");d(this,"accessLevel");d(this,"conformances");d(this,"cases");d(this,"docs");this.name=n,this.accessLevel=e,this.conformances=i!=null?i:[],this.cases=o,this.docs=u}write(e){if(this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write(`enum ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),this.cases.length===0){e.write(" {}");return}e.write(" {"),e.newLine(),e.indent(),this.cases.forEach(n=>{n.docs!=null&&n.docs.write(e),e.write("case "),Ne(n.unsafeName)?e.write(`\`${n.unsafeName}\``):e.write(n.unsafeName),n.rawValue!==n.unsafeName&&(e.write(" = "),e.write(`"${Df(n.rawValue)}"`)),e.newLine()}),e.dedent(),e.write("}")}};a();s();var Qe=class extends b{constructor({name:e,conformances:n,initializers:i,computedProperties:o,methods:u,nestedTypes:f,docs:p}){super();d(this,"name");d(this,"conformances");d(this,"initializers");d(this,"computedProperties");d(this,"methods");d(this,"nestedTypes");d(this,"docs");this.name=e,this.conformances=n!=null?n:[],this.initializers=i!=null?i:[],this.computedProperties=o!=null?o:[],this.methods=u!=null?u:[],this.nestedTypes=f!=null?f:[],this.docs=p}write(e){this.docs!=null&&this.docs.write(e),e.write(`extension ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),e.write(" {"),this.initializers.length>0&&(e.newLine(),e.indent(),this.initializers.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),this.computedProperties.length>0&&(e.newLine(),e.indent(),this.computedProperties.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),this.methods.length>0&&(e.newLine(),e.indent(),this.methods.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),this.nestedTypes.length>0&&(e.newLine(),e.indent(),this.nestedTypes.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),e.write("}")}};a();s();var et=class extends b{constructor({label:e,value:n}){super();d(this,"label");d(this,"value");this.label=e,this.value=n}write(e){this.label!=null&&(e.write(this.label),e.write(": ")),this.value.write(e)}};a();s();var tt=class extends b{constructor({argumentLabel:e,unsafeName:n,escaping:i,type:o,defaultValue:u,docsContent:f}){super();d(this,"argumentLabel");d(this,"unsafeName");d(this,"escaping");d(this,"type");d(this,"defaultValue");d(this,"docsContent");this.argumentLabel=e,this.unsafeName=n,this.escaping=i,this.type=o,this.defaultValue=u,this.docsContent=f}write(e){this.argumentLabel==null?e.write("_ "):this.argumentLabel!==this.unsafeName&&(e.write(this.argumentLabel),e.write(" ")),e.write(this.unsafeName),e.write(": "),this.escaping&&e.write("@escaping "),this.type.write(e),this.defaultValue!=null&&(e.write(" = "),this.defaultValue.write(e))}};a();s();var rt=class extends b{constructor({accessLevel:e,convenience:n,failable:i,throws:o,parameters:u,body:f,multiline:p,docs:y}){super();d(this,"accessLevel");d(this,"convenience");d(this,"failable");d(this,"throws");d(this,"parameters");d(this,"body");d(this,"multiline");d(this,"docs");this.accessLevel=e,this.convenience=n,this.failable=i,this.throws=o,this.parameters=u!=null?u:[],this.body=f!=null?f:F.empty(),this.multiline=p,this.docs=y}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.convenience&&e.write("convenience "),e.write("init"),this.failable&&e.write("?"),e.write("("),this.multiline&&(e.newLine(),e.indent()),this.parameters.forEach((n,i)=>{i>0&&(e.write(","),this.multiline?e.newLine():e.write(" ")),n.write(e)}),this.multiline&&(e.newLine(),e.dedent()),e.write(") "),this.throws&&e.write("throws "),this.body.write(e)}};a();s();var Ur=class r extends b{constructor({count:e=1}={}){super();d(this,"count");this.count=e}write(e){for(let n=0;n<this.count;n++)e.newLine()}static single(){return new r({count:1})}static double(){return new r({count:2})}static multiple(e){return new r({count:e})}};a();s();var nt=class extends b{constructor({attributes:e,unsafeName:n,accessLevel:i,static_:o,parameters:u,async:f,throws:p,returnType:y,body:g,docs:x}){super();d(this,"attributes");d(this,"unsafeName");d(this,"accessLevel");d(this,"static_");d(this,"parameters");d(this,"async");d(this,"throws");d(this,"returnType");d(this,"body");d(this,"docs");this.attributes=e!=null?e:[],this.unsafeName=n,this.accessLevel=i,this.static_=o,this.parameters=u!=null?u:[],this.async=f,this.throws=p,this.returnType=y,this.body=g!=null?g:F.empty(),this.docs=x}write(e){this.docs!=null&&this.docs.write(e),this.attributes.forEach(n=>{var i;(i=n.arguments)!=null&&i.length?Z.functionCall({unsafeName:`@${n.name}`,arguments_:n.arguments}).write(e):(e.write("@"),e.write(n.name)),e.write(" ")}),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.static_&&e.write("static "),e.write("func "),e.write(U(this.unsafeName)),e.write("("),this.parameters.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write(")"),this.async&&e.write(" async"),this.throws&&e.write(" throws"),e.write(" -> "),this.returnType.write(e),e.write(" "),this.body.write(e)}};a();s();var kr=class extends b{constructor(e){super();d(this,"internalPattern");this.internalPattern=e}write(e){switch(this.internalPattern.type){case"enum-case-value-binding":e.write("."),e.write(this.internalPattern.caseName),e.write("("),e.write(this.internalPattern.declarationType),e.write(" "),e.write(this.internalPattern.referenceName),e.write(")");break;default:S(this.internalPattern.type)}}static enumCaseValueBinding(e){return new this(N({type:"enum-case-value-binding"},e))}};a();s();var it=class extends b{constructor({unsafeName:e,accessLevel:n,static_:i,declarationType:o,type:u,defaultValue:f,docs:p}){super();d(this,"unsafeName");d(this,"accessLevel");d(this,"static_");d(this,"declarationType");d(this,"type");d(this,"defaultValue");d(this,"docs");this.unsafeName=e,this.accessLevel=n,this.static_=i,this.declarationType=o,this.type=u,this.defaultValue=f,this.docs=p}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.static_&&e.write("static "),e.write(this.declarationType),e.write(" "),Ne(this.unsafeName)?e.write(`\`${this.unsafeName}\``):e.write(this.unsafeName),e.write(": "),this.type.write(e),this.defaultValue!=null&&(e.write(" = "),this.defaultValue.write(e))}};a();s();var Uf={CaseIterable:"CaseIterable",Codable:"Codable",CodingKey:"CodingKey",Decodable:"Decodable",Encodable:"Encodable",Equatable:"Equatable",Error:"Error",Hashable:"Hashable",Sendable:"Sendable",MultipartFormDataConvertible:"MultipartFormDataConvertible"};a();s();var ot=class extends b{constructor({attributes:e,accessLevel:n,name:i,conformances:o,properties:u,initializers:f,methods:p,nestedTypes:y,docs:g}){super();d(this,"attributes");d(this,"name");d(this,"accessLevel");d(this,"conformances");d(this,"properties");d(this,"initializers");d(this,"methods");d(this,"nestedTypes");d(this,"docs");this.attributes=e!=null?e:[],this.name=i,this.accessLevel=n,this.conformances=o!=null?o:[],this.properties=u!=null?u:[],this.initializers=f!=null?f:[],this.methods=p!=null?p:[],this.nestedTypes=y!=null?y:[],this.docs=g}write(e){this.docs!=null&&this.docs.write(e),this.attributes.forEach(p=>{var y;(y=p.arguments)!=null&&y.length?Z.functionCall({unsafeName:`@${p.name}`,arguments_:p.arguments}).write(e):(e.write("@"),e.write(p.name)),e.write(" ")}),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write(`struct ${this.name}`),this.conformances.forEach((p,y)=>{y===0?e.write(": "):y>0&&e.write(", "),e.write(p)}),e.write(" {"),e.newLine(),e.indent();let n=this.properties.length>0,i=this.initializers.length>0,o=this.methods.length>0,u=this.nestedTypes.length>0;this.properties.forEach(p=>{p.write(e),e.newLine()});let f=n;i&&(f&&e.newLine(),this.initializers.forEach((p,y)=>{y>0&&e.newLine(),p.write(e),e.newLine()}),f=!0),o&&(f&&e.newLine(),this.methods.forEach((p,y)=>{y>0&&e.newLine(),p.write(e),e.newLine()}),f=!0),u&&(f&&e.newLine(),this.nestedTypes.forEach((p,y)=>{y>0&&e.newLine(),p.write(e),e.newLine()})),e.dedent(),e.write("}")}};a();s();var j={String:{type:"string",symbolName:"String"},Bool:{type:"bool",symbolName:"Bool"},Int:{type:"int",symbolName:"Int"},Int64:{type:"int64",symbolName:"Int64"},UInt:{type:"uint",symbolName:"UInt"},UInt64:{type:"uint64",symbolName:"UInt64"},Float:{type:"float",symbolName:"Float"},Double:{type:"double",symbolName:"Double"},Void:{type:"void",symbolName:"Void"},Any:{type:"any",symbolName:"Any"}},$r={Data:{type:"data",symbolName:"Data"},Date:{type:"date",symbolName:"Date"},UUID:{type:"uuid",symbolName:"UUID"}},_r=class r extends b{constructor(e){super();d(this,"internalType");this.internalType=e}get type(){return this.internalType.type}get nonOptionalType(){return this.internalType.type==="optional"?this.internalType.valueType.nonOptionalType:this.internalType.type}get nonNullableType(){return this.internalType.type==="nullable"?this.internalType.valueType.nonNullableType:this.internalType.type}get isOptional(){return this.internalType.type==="optional"}get isNullable(){return this.internalType.type==="nullable"}get isOptionalNullable(){return this.isOptional&&this.nonOptional().isNullable}nonOptional(){return r.nonOptional(this)}nonNullable(){return r.nonNullable(this)}equals(e){switch(this.internalType.type){case"string":case"bool":case"int":case"int64":case"uint":case"uint64":case"float":case"double":case"void":case"any":case"data":case"date":case"uuid":case"json-value":return this.internalType.type===e.internalType.type;case"tuple":{if(e.internalType.type!=="tuple"||this.internalType.elements.length!==e.internalType.elements.length)return!1;for(let n=0;n<this.internalType.elements.length;n++){let i=this.internalType.elements[n],o=e.internalType.elements[n];if(!i||!o||!i.equals(o))return!1}return!0}case"array":return e.internalType.type==="array"&&this.internalType.elementType.equals(e.internalType.elementType);case"dictionary":return e.internalType.type==="dictionary"&&this.internalType.keyType.equals(e.internalType.keyType)&&this.internalType.valueType.equals(e.internalType.valueType);case"optional":return e.internalType.type=="optional"&&this.internalType.valueType.equals(e.internalType.valueType);case"nullable":return e.internalType.type==="nullable"&&this.internalType.valueType.equals(e.internalType.valueType);case"custom":return e.internalType.type==="custom"&&this.internalType.name===e.internalType.name;case"existential-any":return e.internalType.type==="existential-any"&&this.internalType.protocolName===e.internalType.protocolName;case"calendar-date":return e.internalType.type==="calendar-date";default:S(this.internalType)}}toCaseName(){return r.toCaseName(this)}static toCaseName(e){switch(e.internalType.type){case"string":return"string";case"bool":return"bool";case"int":return"int";case"int64":return"int64";case"uint":return"uint";case"uint64":return"uint64";case"float":return"float";case"double":return"double";case"void":return"void";case"any":return"any";case"data":return"data";case"date":return"date";case"uuid":return"uuid";case"tuple":{let n=e.internalType.elements.map(i=>r.toCaseName(i)).join("And");return`tuple${B(n)}`}case"array":return`${Br(r.toCaseName(e.internalType.elementType))}Array`;case"dictionary":{let n=Br(r.toCaseName(e.internalType.keyType)),i=B(r.toCaseName(e.internalType.valueType));return`${n}To${i}Dictionary`}case"optional":return`optional${B(r.toCaseName(e.internalType.valueType))}`;case"nullable":return`nullable${B(r.toCaseName(e.internalType.valueType))}`;case"custom":return q(e.internalType.name);case"existential-any":return`any${B(e.internalType.protocolName)}`;case"calendar-date":return"calendarDate";case"json-value":return"json";default:S(e.internalType)}}write(e){switch(this.internalType.type){case"string":e.write("String");break;case"bool":e.write("Bool");break;case"int":e.write("Int");break;case"int64":e.write("Int64");break;case"uint":e.write("UInt");break;case"uint64":e.write("UInt64");break;case"float":e.write("Float");break;case"double":e.write("Double");break;case"void":e.write("Void");break;case"any":e.write("Any");break;case"data":e.write("Data");break;case"date":e.write("Date");break;case"uuid":e.write("UUID");break;case"tuple":e.write("("),this.internalType.elements.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write(")");break;case"array":e.write("["),this.internalType.elementType.write(e),e.write("]");break;case"dictionary":e.write("["),this.internalType.keyType.write(e),e.write(": "),this.internalType.valueType.write(e),e.write("]");break;case"optional":this.internalType.valueType.write(e),e.write("?");break;case"nullable":e.write("Nullable<"),this.internalType.valueType.write(e),e.write(">");break;case"custom":e.write(this.internalType.name);break;case"existential-any":e.write("any "),e.write(this.internalType.protocolName);break;case"calendar-date":e.write("CalendarDate");break;case"json-value":e.write("JSONValue");break;default:S(this.internalType)}}static primitiveSymbolNames(){return qr(j).map(e=>e.symbolName)}static foundationSymbolNames(){return qr($r).map(e=>e.symbolName)}static string(){return new this(j.String)}static bool(){return new this(j.Bool)}static int(){return new this(j.Int)}static uint(){return new this(j.UInt)}static uint64(){return new this(j.UInt64)}static int64(){return new this(j.Int64)}static float(){return new this(j.Float)}static double(){return new this(j.Double)}static void(){return new this(j.Void)}static any(){return new this(j.Any)}static data(){return new this($r.Data)}static date(){return new this($r.Date)}static uuid(){return new this($r.UUID)}static tuple(e){return new this({type:"tuple",elements:e})}static array(e){return new this({type:"array",elementType:e})}static dictionary(e,n){return new this({type:"dictionary",keyType:e,valueType:n})}static optional(e){return e.internalType.type==="optional"?e:new this({type:"optional",valueType:e})}static nullable(e){return new this({type:"nullable",valueType:e})}static nonOptional(e){return e.internalType.type==="optional"?r.nonOptional(e.internalType.valueType):e}static nonNullable(e){return e.internalType.type==="nullable"?r.nonNullable(e.internalType.valueType):e}static custom(e){return new this({type:"custom",name:e})}static existentialAny(e){return new this({type:"existential-any",protocolName:e})}static calendarDate(){return new this({type:"calendar-date"})}static jsonValue(){return new this({type:"json-value"})}};a();s();var Wr=class r extends b{constructor(e){super();d(this,"variant");this.variant=e}nonOptional(){return r.nonOptional(this)}nonNullable(){return r.nonNullable(this)}getReferenceIfSymbolType(){return this.variant.type==="symbol"?this.variant.symbol:null}write(e){let{variant:n}=this;switch(n.type){case"symbol":e.write(n.symbol);break;case"generic":{n.reference.write(e),n.arguments.length>0&&(e.write("<"),n.arguments.forEach((i,o)=>{i.write(e),o<n.arguments.length-1&&e.write(", ")}),e.write(">"));break}case"tuple":e.write("("),n.elements.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write(")");break;case"array":e.write("["),n.elementType.write(e),e.write("]");break;case"dictionary":e.write("["),n.keyType.write(e),e.write(": "),n.valueType.write(e),e.write("]");break;case"optional":n.valueType.write(e),e.write("?");break;case"nullable":e.write("Nullable<"),n.valueType.write(e),e.write(">");break;case"member-access":n.target.write(e),e.write("."),e.write(n.memberName);break;default:S(n)}}equals(e){switch(this.variant.type){case"symbol":return e.variant.type==="symbol"&&this.variant.symbol===e.variant.symbol;case"generic":return e.variant.type==="generic"&&this.variant.reference.equals(e.variant.reference)&&this.variant.arguments.every((n,i)=>e.variant.type==="generic"&&e.variant.arguments[i]&&n.equals(e.variant.arguments[i]));case"tuple":return e.variant.type==="tuple"&&this.variant.elements.every((n,i)=>e.variant.type==="tuple"&&e.variant.elements[i]&&n.equals(e.variant.elements[i]));case"array":return e.variant.type==="array"&&this.variant.elementType.equals(e.variant.elementType);case"dictionary":return e.variant.type==="dictionary"&&this.variant.keyType.equals(e.variant.keyType)&&this.variant.valueType.equals(e.variant.valueType);case"optional":return e.variant.type=="optional"&&this.variant.valueType.equals(e.variant.valueType);case"nullable":return e.variant.type==="nullable"&&this.variant.valueType.equals(e.variant.valueType);case"member-access":return e.variant.type==="member-access"&&this.variant.target.equals(e.variant.target)&&this.variant.memberName===e.variant.memberName;default:S(this.variant)}}static symbol(e){return new this({type:"symbol",symbol:e})}static generic(e,n){return new this({type:"generic",reference:e,arguments:n})}static tuple(e){return new this({type:"tuple",elements:e})}static array(e){return new this({type:"array",elementType:e})}static dictionary(e,n){return new this({type:"dictionary",keyType:e,valueType:n})}static optional(e){return e.variant.type==="optional"?e:new this({type:"optional",valueType:e})}static nullable(e){return e.variant.type==="nullable"?e:new this({type:"nullable",valueType:e})}static memberAccess(e,n){return new this({type:"member-access",target:e,memberName:n})}static nonOptional(e){return e.variant.type==="optional"?r.nonOptional(e.variant.valueType):e}static nonNullable(e){return e.variant.type==="nullable"?r.nonNullable(e.variant.valueType):e}static unqualifiedToSwiftType(e){return r.symbol(e)}static unqualifiedToFoundationType(e){return r.symbol(e)}};a();s();a();s();var w=class w{constructor(t,e,n){d(this,"id");d(this,"name");d(this,"shape");this.id=t,this.name=e,this.shape=n}static isSwiftSymbol(t){return w.SWIFT_SYMBOL_ID===t||t.startsWith(`${w.SWIFT_SYMBOL_ID}.`)}static isSwiftSymbolName(t){return t in w.swiftTypeSymbolsByName}static isFoundationSymbol(t){return w.FOUNDATION_SYMBOL_ID===t||t.startsWith(`${w.FOUNDATION_SYMBOL_ID}.`)}static isFoundationSymbolName(t){return t in w.foundationTypeSymbolsByName}static isCustomSymbol(t){return!w.isSwiftSymbol(t)&&!w.isFoundationSymbol(t)}static create(t,e,n){return new w(t,e,n)}static swiftType(t){return w.create(`${w.SWIFT_SYMBOL_ID}.${t}`,t,{type:"system"})}static foundationType(t){return w.create(`${w.FOUNDATION_SYMBOL_ID}.${t}`,t,{type:"system"})}get isSwiftSymbol(){return w.isSwiftSymbol(this.id)}get isFoundationSymbol(){return w.isFoundationSymbol(this.id)}get isCustomSymbol(){return w.isCustomSymbol(this.id)}};d(w,"SWIFT_SYMBOL_NAME","Swift"),d(w,"SWIFT_SYMBOL_ID",w.SWIFT_SYMBOL_NAME),d(w,"swiftTypeSymbolsByName",{String:w.swiftType("String"),Bool:w.swiftType("Bool"),Int:w.swiftType("Int"),Int64:w.swiftType("Int64"),UInt:w.swiftType("UInt"),UInt64:w.swiftType("UInt64"),Float:w.swiftType("Float"),Double:w.swiftType("Double"),Void:w.swiftType("Void"),Encoder:w.swiftType("Encoder"),Decoder:w.swiftType("Decoder"),Any:w.swiftType("Any")}),d(w,"swiftTypeSymbols",Object.values(w.swiftTypeSymbolsByName)),d(w,"FOUNDATION_SYMBOL_NAME","Foundation"),d(w,"FOUNDATION_SYMBOL_ID",w.FOUNDATION_SYMBOL_NAME),d(w,"foundationTypeSymbolsByName",{Data:w.foundationType("Data"),Date:w.foundationType("Date"),URLSession:w.foundationType("URLSession"),UUID:w.foundationType("UUID")}),d(w,"foundationTypeSymbols",Object.values(w.foundationTypeSymbolsByName));var O=w;a();s();a();s();a();s();a();s();var jr=class{constructor(t,e){d(this,"id");d(this,"name");d(this,"childrenByName");this.id=t,this.name=e,this.childrenByName=new Map}get children(){return Array.from(this.childrenByName.values())}addChild(t){if(this.childrenByName.has(t.name))throw new Error(`A child with the name '${t.name}' already exists in module '${this.name}'.`);this.childrenByName.set(t.name,t)}getChildByName(t){return this.childrenByName.get(t)}},zr=class extends jr{constructor(e,n){super(e,n);d(this,"kind","module");d(this,"imports");d(this,"parent",null);this.imports=[]}addImport(e){this.imports.push(e)}get qualifiedPath(){return[this.name]}get qualifiedName(){return this.name}},Vr=class extends jr{constructor(e,n,i){super(n,e);d(this,"kind","type");d(this,"shape");d(this,"parent");this.parent=null,this.shape=i}getNearestModuleAncestorOrThrow(){let e=this.parent;for(;e!==null&&e.kind!=="module";)e=e.parent;return _(e,`No module ancestor found for type symbol '${this.id}'`),e}get qualifiedPath(){var e,n;return[...(n=(e=this.parent)==null?void 0:e.qualifiedPath)!=null?n:[],this.name]}get qualifiedName(){return this.qualifiedPath.join(".")}};var $t=class{constructor(){d(this,"symbolsById",new Map)}createModuleSymbol({symbolId:t,symbolName:e}){this.validateSymbolNotExists(t);let n=new zr(t,e);return this.symbolsById.set(t,n),n}createTypeSymbol({symbolId:t,symbolName:e,shape:n}){this.validateSymbolNotExists(t);let i=new Vr(e,t,n);return this.symbolsById.set(t,i),i}addImportRelation({clientSymbolId:t,importedSymbolId:e}){let n=this.getSymbolByIdOrThrow(t),i=this.getSymbolByIdOrThrow(e);if(n.kind!=="module"||i.kind!=="module")throw new Error(`Client module '${n.id}' and imported module '${i.id}' must both be module symbols.`);n.addImport(i)}nestSymbol({parentSymbolId:t,childSymbolId:e}){let n=this.getSymbolByIdOrThrow(t),i=this.getSymbolByIdOrThrow(e);n.addChild(i),i.parent=n}reference({fromSymbolId:t,targetSymbolId:e}){let n=this.getSymbolByIdOrThrow(t),i=this.getSymbolByIdOrThrow(e),o=i.qualifiedPath;for(let u=1;u<=o.length;u++){let f=o.slice(o.length-u),p=this.resolvePath(n,f);if((p==null?void 0:p.id)===i.id)return f.join(".")}return i.qualifiedName}resolveReference({fromSymbolId:t,reference:e}){let n=this.getSymbolByIdOrThrow(t),i=e.split(".").filter(o=>o.length>0);return this.resolvePath(n,i)}resolvePath(t,e){var f;let[n,...i]=e;if(n===void 0)return null;let o=this.resolveFirstSegment(t,n);if(o===null)return null;let u=o;for(let p=0;p<i.length;p++){let y=i[p];if(Cr(y),u=(f=u.getChildByName(y))!=null?f:null,u===null)return null}return u}resolveFirstSegment(t,e){let n=t;for(;n!==null;){let u=n.getChildByName(e);if(u)return u;n=n.parent}let i=t.kind==="module"?t:t.getNearestModuleAncestorOrThrow();if(i.name===e)return i;for(let u of i.imports)if(u.name===e)return u;let o=null;for(let u of i.imports){let f=u.getChildByName(e);if(f){if(o!=null&&o.id!==f.id)return null;o=f}}return o}getSymbolByIdOrThrow(t){let e=this.symbolsById.get(t);return Cr(e,`A symbol with the ID '${t}' was not found in the registry.`),e}getSymbolById(t){var e;return(e=this.symbolsById.get(t))!=null?e:null}validateSymbolNotExists(t){if(this.symbolsById.has(t))throw new Error(`A symbol with the ID '${t}' already exists in the registry.`)}};var Gr=class r{constructor(t,e,n){d(this,"graph");d(this,"swiftSymbol");d(this,"foundationSymbol");d(this,"registeredSourceModule");d(this,"registeredTestModule");this.graph=t,this.swiftSymbol=e,this.foundationSymbol=n,this.registeredSourceModule=null,this.registeredTestModule=null}static create(){let{graph:t,swiftSymbol:e,foundationSymbol:n}=r.createGraph();return new r(t,e,n)}static createGraph(){let t=new $t,e=()=>{let u=t.createModuleSymbol({symbolId:O.SWIFT_SYMBOL_ID,symbolName:O.SWIFT_SYMBOL_NAME});return O.swiftTypeSymbols.forEach(f=>{let p=t.createTypeSymbol({symbolId:f.id,symbolName:f.name,shape:{type:"system"}});t.nestSymbol({parentSymbolId:u.id,childSymbolId:p.id})}),u},n=()=>{let u=t.createModuleSymbol({symbolId:O.FOUNDATION_SYMBOL_ID,symbolName:O.FOUNDATION_SYMBOL_NAME});return O.foundationTypeSymbols.forEach(f=>{let p=t.createTypeSymbol({symbolId:f.id,symbolName:f.name,shape:{type:"system"}});t.nestSymbol({parentSymbolId:u.id,childSymbolId:p.id})}),u},i=e(),o=n();return{graph:t,swiftSymbol:i,foundationSymbol:o}}getRegisteredSourceModuleSymbolOrThrow(){return _(this.registeredSourceModule,"Module symbol not found."),O.create(this.registeredSourceModule.id,this.registeredSourceModule.name,{type:"other"})}getRegisteredTestModuleSymbolOrThrow(){return _(this.registeredTestModule,"Module symbol not found."),O.create(this.registeredTestModule.id,this.registeredTestModule.name,{type:"other"})}getSymbolByIdOrThrow(t){let e=this.graph.getSymbolById(t);return _(e,`Symbol with ID '${t}' not found in registry.`),O.create(e.id,e.name,e.kind==="type"?e.shape:{type:"other"})}registerSourceModule(t){let e=t,n=this.graph.createModuleSymbol({symbolId:e,symbolName:t});return n.addImport(this.swiftSymbol),n.addImport(this.foundationSymbol),this.registeredSourceModule=n,O.create(n.id,n.name,{type:"other"})}registerTestModule(t){let e=t,n=this.graph.createModuleSymbol({symbolId:e,symbolName:t});return n.addImport(this.swiftSymbol),n.addImport(this.foundationSymbol),_(this.registeredSourceModule,"Cannot register a test module before registering a source module."),n.addImport(this.registeredSourceModule),this.registeredTestModule=n,O.create(n.id,n.name,{type:"other"})}registerSourceModuleType(t,e){_(this.registeredSourceModule,"Cannot register a type before registering a module.");let n=this.inferSymbolIdForSourceModuleType(t),i=this.graph.createTypeSymbol({symbolId:n,symbolName:t,shape:e});return this.graph.nestSymbol({parentSymbolId:this.registeredSourceModule.id,childSymbolId:i.id}),O.create(i.id,i.name,e)}registerTestModuleType(t,e){_(this.registeredTestModule,"Cannot register a type before registering a module.");let n=this.inferSymbolIdForTestModuleType(t),i=this.graph.createTypeSymbol({symbolId:n,symbolName:t,shape:e});return this.graph.nestSymbol({parentSymbolId:this.registeredTestModule.id,childSymbolId:i.id}),O.create(i.id,i.name,e)}registerNestedType({parentSymbol:t,symbolName:e,shape:n}){let i=typeof t=="string"?t:t.id,o=this.inferSymbolIdForNestedType(i,e),u=this.graph.createTypeSymbol({symbolId:o,symbolName:e,shape:n});return this.graph.nestSymbol({parentSymbolId:i,childSymbolId:u.id}),O.create(u.id,u.name,n)}reference({fromSymbol:t,toSymbol:e}){let n=typeof t=="string"?t:t.id,i=typeof e=="string"?e:e.id;return this.graph.reference({fromSymbolId:n,targetSymbolId:i})}resolveReference({fromSymbol:t,reference:e}){let n=typeof t=="string"?t:t.id,i=this.graph.resolveReference({fromSymbolId:n,reference:e});return i?O.create(i.id,i.name,i.kind==="type"?i.shape:{type:"other"}):null}inferSymbolIdForSourceModuleType(t){return _(this.registeredSourceModule,"Cannot get symbol id for a type before registering a module."),`${this.registeredSourceModule.id}.${t}`}inferSymbolIdForTestModuleType(t){return _(this.registeredTestModule,"Cannot get symbol id for a type before registering a module."),`${this.registeredTestModule.id}.${t}`}inferSymbolIdForNestedType(t,e){return`${t}.${e}`}};function Px(r){return new Ge(r)}function Fx(r){return new F(r)}function Bx(r){return new Ye(r)}function qx(r){return new Ke(r)}function Mx(r){return new Je(r)}function Dx(r){return new Ze(r)}function Ux(r){return new Xe(r)}function kx(r){return new Qe(r)}function $x(r){return new et(r)}function _x(r){return new tt(r)}function Wx(r){return new rt(r)}function jx(r){return new nt(r)}function zx(r){return new it(r)}function Vx(r){return new ot(r)}a();s();var at=class{constructor({context:t}){d(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return m.Type.array(this.convert({typeReference:t.typeReference.value}));case"literal":return this.convertLiteral({literal:t.typeReference.value});case"map":return m.Type.dictionary(this.convert({typeReference:t.typeReference.key}),this.convert({typeReference:t.typeReference.value}));case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?this.convertUnknown():this.convertNamed({named:e})}case"optional":return m.Type.optional(this.convert({typeReference:t.typeReference.value}));case"nullable":return m.Type.nullable(this.convert({typeReference:t.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:t.typeReference.value});case"set":return m.Type.jsonValue();case"unknown":return this.convertUnknown();default:S(t.typeReference)}}convertNamed({named:t}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return m.Type.custom(t.declaration.name.pascalCase.unsafeName);default:S(t)}}convertLiteral({literal:t}){switch(t.type){case"boolean":return m.Type.bool();case"string":return m.Type.custom(Dt(t.value))}}convertUnknown(){return m.Type.jsonValue()}convertPrimitive({primitive:t}){switch(t){case"INTEGER":return m.Type.int();case"UINT":return m.Type.int();case"LONG":return m.Type.int64();case"UINT_64":return m.Type.uint64();case"FLOAT":return m.Type.float();case"DOUBLE":return m.Type.double();case"BOOLEAN":return m.Type.bool();case"STRING":return m.Type.string();case"DATE":return m.Type.date();case"DATE_TIME":return m.Type.date();case"UUID":return m.Type.uuid();case"BASE_64":return m.Type.string();case"BIG_INTEGER":return m.Type.string();default:S(t)}}};var Yr=class{constructor({context:t}){d(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":{if(t.typeReference.value.type==="string")return m.Expression.enumCaseShorthand(Ut.generateEnumCaseLabel(t.typeReference.value.value));if(t.typeReference.value.type==="boolean")return m.Expression.nop();S(t.typeReference.value);break}case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?m.Expression.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"nullable":return this.convertNullable({nullable:t.typeReference,value:t.value,as:t.as});case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return m.Expression.nop();case"unknown":return this.convertUnknown(t.value);default:S(t.typeReference)}}convertList({list:t,value:e}){return Array.isArray(e)?m.Expression.arrayLiteral({elements:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}}),multiline:!0}):(this.context.errors.add({severity:T.Critical,message:`Expected array but got: ${typeof e}`}),m.Expression.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:T.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),m.Expression.nop()):m.Expression.dictionaryLiteral({entries:Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return[this.convert({typeReference:t.key,value:n,as:"mapKey"}),this.convert({typeReference:t.value,value:i,as:"mapValue"})]}finally{this.context.errors.unscope()}}),multiline:!0})}convertNamed({named:t,value:e,as:n}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:t,value:e});case"enum":return this.convertEnum({enum_:t,value:e});case"object":return this.convertObject({object_:t,value:e,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:S(t)}}convertNullable({nullable:t,value:e,as:n}){return e==null?m.Expression.enumCaseShorthand("null"):m.Expression.contextualMethodCall({methodName:"value",arguments_:[m.functionArgument({value:this.convert({typeReference:t.value,value:e,as:n})})]})}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(n==null)return m.Expression.nop();let i=n.singleDiscriminatedUnionType,o=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});return o==null?m.Expression.nop():m.Expression.methodCall({target:m.Expression.reference(t.declaration.name.pascalCase.unsafeName),methodName:Ve.sanitizeToCamelCase(i.discriminantValue.name.camelCase.unsafeName),arguments_:[m.functionArgument({value:m.Expression.contextualMethodCall({methodName:"init",arguments_:o,multiline:!0})})],multiline:!0})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){var i;let n=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});switch(e.type){case"samePropertiesAsObject":{let o=this.context.resolveNamedType({typeId:e.typeId});if(o==null)return;let u=this.convertNamed({named:o,value:t.value});if(!u.isStructInitialization()){this.context.errors.add({severity:T.Critical,message:"Internal error; expected union value to be a struct"});return}let f=u.asStructInitializationOrThrow();return[...n,...(i=f.arguments_)!=null?i:[]]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let o=this.context.getRecord(t.value);return o==null?[...n]:[...n,m.functionArgument({label:ye(Ve.sanitizeToCamelCase(e.discriminantValue.name.camelCase.unsafeName)),value:this.convert({typeReference:e.typeReference,value:o[e.discriminantValue.wireValue]})})]}finally{this.context.errors.unscope()}case"noProperties":return n;default:S(e)}}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i;return this.context.getExampleObjectProperties({parameters:(i=e.properties)!=null?i:[],snippetObject:t.value}).map(o=>{this.context.errors.scope(o.name.wireValue);try{return m.functionArgument({label:ye(o.name.name.camelCase.unsafeName),value:this.convert(o)})}finally{this.context.errors.unscope()}})}convertEnum({enum_:t,value:e}){let n=this.getEnumValue({enum_:t,value:e});return n==null?m.Expression.nop():m.Expression.enumCaseShorthand(n.name.camelCase.unsafeName)}getEnumValue({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:T.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let n=t.values.find(i=>i.wireValue===e);if(n==null){this.context.errors.add({severity:T.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return n}convertObject({object_:t,value:e,as:n}){return m.Expression.structInitialization({unsafeName:t.declaration.name.pascalCase.unsafeName,arguments_:this.context.getExampleObjectProperties({parameters:t.properties,snippetObject:e}).map(i=>this.convert(i).isNop()?null:m.functionArgument({label:ye(i.name.name.camelCase.unsafeName),value:this.convert(i)})).filter(i=>i!=null),multiline:!0})}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return n==null?m.Expression.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{let i=this.convert({typeReference:n,value:e}),u=new at({context:this.context}).convert({typeReference:n});return m.Expression.methodCall({target:m.Expression.reference(t.declaration.name.pascalCase.unsafeName),methodName:u.toCaseName(),arguments_:[m.functionArgument({value:i})],multiline:!0})}catch(i){continue}this.context.errors.add({severity:T.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown(t){switch(typeof t){case"boolean":return m.Expression.contextualMethodCall({methodName:"bool",arguments_:[m.functionArgument({value:m.Expression.boolLiteral(t)})]});case"string":return m.Expression.contextualMethodCall({methodName:"string",arguments_:[m.functionArgument({value:m.Expression.stringLiteral(t)})]});case"number":return m.Expression.contextualMethodCall({methodName:"number",arguments_:[m.functionArgument({value:m.Expression.numberLiteral(t)})]});case"object":return t===null?m.Expression.enumCaseShorthand("null"):Array.isArray(t)?m.Expression.contextualMethodCall({methodName:"array",arguments_:[m.functionArgument({value:m.Expression.arrayLiteral({elements:t.map(e=>this.convertUnknown(e)),multiline:!0})})]}):m.Expression.contextualMethodCall({methodName:"object",arguments_:[m.functionArgument({value:m.Expression.dictionaryLiteral({entries:Object.entries(t).map(([e,n])=>[m.Expression.stringLiteral(e),this.convertUnknown(n)]),multiline:!0})})]});default:throw new Error(`Internal error; unsupported unknown type: ${typeof t}`)}}convertPrimitive({primitive:t,value:e,as:n}){switch(t){case"INTEGER":case"UINT":case"LONG":case"UINT_64":case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e,as:n});return i==null?m.Expression.nop():m.Expression.numberLiteral(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:n});return i==null?m.Expression.nop():m.Expression.boolLiteral(i)}case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.stringLiteral(i)}case"DATE":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.calendarDateLiteral(i)}case"DATE_TIME":{let i=this.context.getValueAsString({value:e});if(i==null)return m.Expression.nop();let o=new Date(i).getTime(),u=Math.round(o/1e3),p=new Date(u*1e3).toISOString().replace(/\.\d{3}Z$/,"Z");return m.Expression.dateLiteral(p)}case"UUID":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.uuidLiteral(i)}case"BASE_64":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.stringLiteral(i)}case"BIG_INTEGER":return this.context.getValueAsString({value:e})==null?m.Expression.nop():m.Expression.nop();default:S(t)}}getValueAsNumber({value:t,as:e}){let n=e==="mapKey"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:t,as:e}){let n=(()=>{switch(e){case"mapKey":return t==="true"?!0:t==="false"?!1:t;case"mapValue":case void 0:return t;default:S(e)}})();return this.context.getValueAsBoolean({value:n})}};a();s();var Hr=class{constructor({context:t}){d(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let n={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let u of t.properties)switch(u.type){case"file":{let f=m.functionArgument({label:ye(u.name.camelCase.unsafeName),value:this.getSingleFileProperty({property:u,record:i})});n.fileFields.push(f);break}case"fileArray":{let f=m.functionArgument({label:ye(u.name.camelCase.unsafeName),value:this.getArrayFileProperty({property:u,record:i})});n.fileFields.push(f);break}case"bodyProperty":{let f=m.functionArgument({label:ye(u.name.name.camelCase.unsafeName),value:this.getBodyProperty({property:u,record:i})});n.bodyPropertyFields.push(f);break}default:S(u)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e});return m.Expression.contextualMethodCall({methodName:"init",arguments_:[m.functionArgument({label:"data",value:m.Expression.dataLiteral(n!=null?n:"")})]})}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return m.Expression.arrayLiteral({elements:(n!=null?n:[]).map(i=>m.Expression.contextualMethodCall({methodName:"init",arguments_:[m.functionArgument({label:"data",value:m.Expression.dataLiteral(i)})]})),multiline:!0})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?m.Expression.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:n})}};var Kr=class r extends Mt{constructor({ir:e,config:n,options:i}){super({ir:e,config:n,options:i});d(this,"ir");d(this,"customConfig");d(this,"dynamicTypeMapper");d(this,"dynamicTypeLiteralMapper");d(this,"filePropertyMapper");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeMapper=new at({context:this}),this.dynamicTypeLiteralMapper=new Yr({context:this}),this.filePropertyMapper=new Hr({context:this})}clone(){return new r({ir:this.ir,config:this.config,options:this.options})}getModuleName(){var e,n;return(n=(e=this.customConfig)==null?void 0:e.moduleName)!=null?n:Dt(this.getApiName())}getRootClientClassName(){var e,n;return(n=(e=this.customConfig)==null?void 0:e.clientClassName)!=null?n:`${Dt(this.getApiName())}Client`}getApiName(){return q(this.config.workspaceName)}};a();s();var kf="client",st=class{constructor({context:t}){d(this,"context");this.context=t}async generateSnippet({endpoint:t,request:e,options:n}){return this.buildCodeBlock({endpoint:t,snippetRequest:e,options:n})}generateSnippetSync({endpoint:t,request:e,options:n}){return this.buildCodeBlock({endpoint:t,snippetRequest:e,options:n})}buildCodeBlock({endpoint:t,snippetRequest:e,options:n}){return[this.generateImportFoundationStatement(),this.generateImportModuleStatement(),m.LineBreak.single(),this.generateMainFunctionDeclarationWithEndpointSnippet({endpoint:t,snippet:e}),m.LineBreak.single(),this.generateMainFunctionInvocationStatement()].map(o=>o.toString()).join("")}generateImportFoundationStatement(){return m.Statement.import("Foundation")}generateImportModuleStatement(){return m.Statement.import(this.context.getModuleName())}generateMainFunctionDeclarationWithEndpointSnippet({endpoint:t,snippet:e}){return m.Statement.functionDeclaration({unsafeName:"main",accessLevel:"private",async:!0,throws:!0,body:m.CodeBlock.withStatements([this.generateRootClientInitializationStatement({auth:t.auth,snippet:e}),m.LineBreak.single(),this.generateEndpointMethodCallStatement({endpoint:t,snippet:e})])})}generateRootClientInitializationStatement({auth:t,snippet:e,additionalArgs:n=[]}){let i=[],o=this.getRootClientBaseURLArg({snippet:e});o!=null&&i.push(o);let u=t?this.getRootClientAuthArgs({auth:t,snippet:e}):[];i.push(...u),i.push(...n);let f=i.filter(p=>!p.value.isNop());return m.Statement.constantDeclaration({unsafeName:kf,value:m.Expression.classInitialization({unsafeName:this.context.getRootClientClassName(),arguments_:f,multiline:f.length>1?!0:void 0})})}getRootClientBaseURLArg({snippet:t}){var e;return t.baseURL!=null&&t.environment!=null?(this.context.errors.add({severity:T.Critical,message:"Cannot specify both baseUrl and environment options"}),null):t.baseURL!=null?((e=this.context.ir.environments)==null?void 0:e.environments.type)==="multipleBaseUrls"?null:m.functionArgument({label:"baseURL",value:m.Expression.stringLiteral(t.baseURL)}):null}getRootClientAuthArgs({auth:t,snippet:e}){let n=[],i=e.auth;if(i==null)return n;switch(t.type){case"basic":if(i.type!=="basic"){this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message});break}n.push(m.functionArgument({label:t.username.camelCase.unsafeName,value:m.Expression.stringLiteral(i.username)}),m.functionArgument({label:t.password.camelCase.unsafeName,value:m.Expression.stringLiteral(i.password)}));break;case"bearer":if(i.type!=="bearer")return this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;n.push(m.functionArgument({label:t.token.camelCase.unsafeName,value:m.Expression.stringLiteral(i.token)}));break;case"header":if(i.type!=="header")return this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;n.push(m.functionArgument({label:t.header.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.header.typeReference,value:i.value})}));break;case"oauth":return i.type!=="oauth"&&this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;case"inferred":return i.type!=="inferred"&&this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;default:S(t)}return n}generateEndpointMethodCallStatement({endpoint:t,snippet:e}){return m.Statement.discardAssignment(this.generateEndpointMethodCallExpression({endpoint:t,snippet:e}))}generateEndpointMethodCallExpression({endpoint:t,snippet:e}){let n=this.getMethodArguments({endpoint:t,snippet:e}).filter(i=>!i.value.isNop());return m.Expression.try(m.Expression.await(m.Expression.methodCall({target:m.Expression.rawValue(kf),methodName:this.getMethodName({endpoint:t}),arguments_:n,multiline:n.length>1?!0:void 0})))}generateMainFunctionInvocationStatement(){return m.Statement.expressionStatement(m.Expression.try(m.Expression.await(m.Expression.functionCall({unsafeName:"main"}))))}getMethodName({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${`${t.declaration.fernFilepath.allParts.map(n=>n.camelCase.unsafeName).join(".")}`}.${t.declaration.name.camelCase.unsafeName}`:t.declaration.name.camelCase.unsafeName}getMethodArguments({endpoint:t,snippet:e}){switch(t.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:t.request,snippet:e});default:S(t.request)}}getMethodArgsForInlinedRequest({request:t,snippet:e}){let n=[];this.context.errors.scope(de.PathParameters);let i=[];t.pathParameters!=null&&i.push(...this.getPathParameters({namedParameters:t.pathParameters,snippet:e})),this.context.errors.unscope(),n.push(...i),this.context.errors.scope(de.QueryParameters);let o=[];t.queryParameters!=null&&o.push(...this.getQueryParameters({namedParameters:t.queryParameters,snippet:e})),this.context.errors.unscope(),n.push(...o),this.context.errors.scope(de.RequestBody);let u=this.getFilePropertyInfo({request:t,snippet:e});return this.context.errors.unscope(),t.body!=null&&n.push(m.functionArgument({label:"request",value:this.getInlinedRequestArg({request:t,snippet:e,filePropertyInfo:u})})),n}getPathParameters({namedParameters:t,snippet:e}){var n;return this.context.getExampleObjectProperties({parameters:t,snippetObject:(n=e.pathParameters)!=null?n:{}}).map(i=>m.functionArgument({label:i.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(i)}))}getQueryParameters({namedParameters:t,snippet:e}){var n;return this.context.getExampleObjectProperties({parameters:t,snippetObject:(n=e.queryParameters)!=null?n:{}}).map(i=>m.functionArgument({label:i.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(i)}))}getFilePropertyInfo({request:t,snippet:e}){return t.body==null||!this.context.isFileUploadRequestBody(t.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:t.body,value:e.requestBody})}getInlinedRequestArg({request:t,snippet:e,filePropertyInfo:n}){this.context.errors.scope(de.RequestBody);let i=t.body!=null?this.getInlinedRequestBodyObjectFields({body:t.body,value:e.requestBody,filePropertyInfo:n}):[];this.context.errors.unscope();let o=i.filter(u=>!u.value.isNop());return m.Expression.contextualMethodCall({methodName:"init",arguments_:o,multiline:o.length>1?!0:void 0})}getInlinedRequestBodyObjectFields({body:t,value:e,filePropertyInfo:n}){switch(t.type){case"fileUpload":return[...n.fileFields,...n.bodyPropertyFields];case"properties":return this.getInlinedRequestBodyPropertyObjectFields({parameters:t.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyObjectField({body:t,value:e})];default:S(t)}}getInlinedRequestBodyPropertyObjectFields({parameters:t,value:e}){return this.context.getExampleObjectProperties({parameters:t,snippetObject:e}).map(n=>m.functionArgument({label:n.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(n)}))}getReferencedRequestBodyPropertyObjectField({body:t,value:e}){return m.functionArgument({label:t.bodyKey.camelCase.unsafeName,value:this.getReferencedRequestBodyPropertyTypeLiteral({body:t.bodyType,value:e})})}getReferencedRequestBodyPropertyTypeLiteral({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:S(t)}}getBytesBodyRequestArg({value:t}){return typeof t!="string"?(this.context.errors.add({severity:T.Critical,message:`Expected bytes value to be a string, got ${typeof t}`}),m.Expression.dataLiteral("data")):m.Expression.dataLiteral(t)}getMethodArgsForBodyRequest({request:t,snippet:e}){var o,u;let n=[];this.context.errors.scope(de.PathParameters);let i=[...(o=this.context.ir.pathParameters)!=null?o:[],...(u=t.pathParameters)!=null?u:[]];return i.length>0&&n.push(...this.getPathParameters({namedParameters:i,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(de.RequestBody),t.body!=null&&n.push(this.getBodyRequestArg({body:t.body,value:e.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:t,value:e}){switch(t.type){case"bytes":return m.functionArgument({label:"request",value:this.getBytesBodyRequestArg({value:e})});case"typeReference":return m.functionArgument({label:"request",value:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e})});default:S(t)}}};var Jr=class extends Ft{constructor({ir:t,config:e,options:n={}}){super(new Kr({ir:t,config:e,options:n}))}async generate(t,e={}){return super.generate(t,e)}generateSync(t,e={}){return super.generateSync(t,e)}createSnippetGenerator(t){return new st({context:t})}};0&&(module.exports={DynamicSnippetsGenerator,EndpointSnippetGenerator});
|
|
14
32
|
/*! Bundled license information:
|
|
15
33
|
|
|
16
34
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|