@fern-api/typescript-dynamic-snippets 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +6 -6
  2. package/cjs/DynamicSnippetsGenerator.d.cts +4 -2
  3. package/cjs/{DynamicSnippetsGeneratorContext-DFkk3dho.d.cts → DynamicSnippetsGeneratorContext-CmDa2k9n.d.cts} +1 -1
  4. package/cjs/EndpointSnippetGenerator.cjs +6 -6
  5. package/cjs/EndpointSnippetGenerator.d.cts +2 -1
  6. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +11 -11
  7. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  8. package/cjs/context/DynamicTypeLiteralMapper.cjs +6 -6
  9. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  10. package/cjs/context/FilePropertyMapper.cjs +15 -15
  11. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  12. package/cjs/index.cjs +18 -18
  13. package/cjs/index.d.cts +2 -1
  14. package/esm/DynamicSnippetsGenerator.d.ts +4 -2
  15. package/esm/DynamicSnippetsGenerator.js +1 -1
  16. package/esm/{DynamicSnippetsGeneratorContext-DFkk3dho.d.ts → DynamicSnippetsGeneratorContext-CmDa2k9n.d.ts} +1 -1
  17. package/esm/EndpointSnippetGenerator.d.ts +2 -1
  18. package/esm/EndpointSnippetGenerator.js +1 -1
  19. package/esm/chunk-D7ZDXIQ6.js +1 -0
  20. package/esm/chunk-JGNWFXNM.js +1 -0
  21. package/esm/chunk-PXWPOKCJ.js +1 -0
  22. package/esm/chunk-RL2XA35J.js +27 -0
  23. package/esm/{chunk-25TNFA5L.js → chunk-T2HPPEKP.js} +1 -1
  24. package/esm/{chunk-LX5O4JB7.js → chunk-XC2QAVJY.js} +1 -1
  25. package/esm/chunk-XXAPM4QI.js +1 -0
  26. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  27. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
  28. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  29. package/esm/context/DynamicTypeLiteralMapper.js +1 -1
  30. package/esm/context/FilePropertyMapper.d.ts +1 -1
  31. package/esm/context/FilePropertyMapper.js +1 -1
  32. package/esm/index.d.ts +2 -1
  33. package/esm/index.js +10 -10
  34. package/package.json +1 -1
  35. package/esm/chunk-736FTN3M.js +0 -1
  36. package/esm/chunk-CQ55KPJT.js +0 -1
  37. package/esm/chunk-SQLJANKO.js +0 -1
  38. package/esm/chunk-V6G7NZKW.js +0 -1
  39. package/esm/chunk-YD6EIACZ.js +0 -27
@@ -1,20 +1,20 @@
1
- "use strict";var pe=Object.defineProperty,ct=Object.defineProperties,mt=Object.getOwnPropertyDescriptor,dt=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols;var Re=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var Ee=(t,r,e)=>r in t?pe(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,Oe=(t,r)=>{for(var e in r||(r={}))Re.call(r,e)&&Ee(t,e,r[e]);if(le)for(var e of le(r))_e.call(r,e)&&Ee(t,e,r[e]);return t},Me=(t,r)=>ct(t,dt(r));var De=t=>typeof t=="symbol"?t:t+"",je=(t,r)=>{var e={};for(var n in t)Re.call(t,n)&&r.indexOf(n)<0&&(e[n]=t[n]);if(t!=null&&le)for(var n of le(t))r.indexOf(n)<0&&_e.call(t,n)&&(e[n]=t[n]);return e};var Ie=(t,r)=>()=>(t&&(r=t(t=0)),r);var $e=(t,r)=>{for(var e in r)pe(t,e,{get:r[e],enumerable:!0})},xt=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ht(r))!Re.call(t,i)&&i!==e&&pe(t,i,{get:()=>r[i],enumerable:!(n=mt(r,i))||n.enumerable});return t};var yt=t=>xt(pe({},"__esModule",{value:!0}),t);var p=(t,r,e)=>Ee(t,typeof r!="symbol"?r+"":r,e);function We(){throw new Error("setTimeout has not been defined")}function Ye(){throw new Error("clearTimeout has not been defined")}function ze(t){if(C===setTimeout)return setTimeout(t,0);if((C===We||!C)&&setTimeout)return C=setTimeout,setTimeout(t,0);try{return C(t,0)}catch(r){try{return C.call(null,t,0)}catch(e){return C.call(this,t,0)}}}function gt(t){if(F===clearTimeout)return clearTimeout(t);if((F===Ye||!F)&&clearTimeout)return F=clearTimeout,clearTimeout(t);try{return F(t)}catch(r){try{return F.call(null,t)}catch(e){return F.call(this,t)}}}function wt(){!G||!O||(G=!1,O.length?S=O.concat(S):ce=-1,S.length&&Ge())}function Ge(){if(!G){var t=ze(wt);G=!0;for(var r=S.length;r;){for(O=S,S=[];++ce<r;)O&&O[ce].run();ce=-1,r=S.length}O=null,G=!1,gt(t)}}function vt(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];S.push(new qe(t,r)),S.length===1&&!G&&ze(Ge)}function qe(t,r){this.fun=t,this.array=r}function M(){}function Ot(t){throw new Error("process.binding is not supported")}function Mt(){return"/"}function Dt(t){throw new Error("process.chdir is not supported")}function jt(){return 0}function Vt(t){var r=$t.call(z)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}function Yt(){var t=new Date,r=t-Wt;return r/1e3}var C,F,S,G,O,ce,bt,Tt,At,Et,Rt,It,Nt,St,Lt,Ut,kt,Ct,Ft,Pt,Bt,_t,z,$t,Wt,c,Ve,u=Ie(()=>{"use strict";C=We,F=Ye;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(F=clearTimeout);S=[],G=!1,ce=-1;qe.prototype.run=function(){this.fun.apply(null,this.array)};bt="browser",Tt="browser",At=!0,Et={},Rt=[],It="",Nt={},St={},Lt={};Ut=M,kt=M,Ct=M,Ft=M,Pt=M,Bt=M,_t=M;z=globalThis.performance||{},$t=z.now||z.mozNow||z.msNow||z.oNow||z.webkitNow||function(){return new Date().getTime()};Wt=new Date;c={nextTick:vt,title:bt,browser:At,env:Et,argv:Rt,version:It,versions:Nt,on:Ut,addListener:kt,once:Ct,off:Ft,removeListener:Pt,removeAllListeners:Bt,emit:_t,binding:Ot,cwd:Mt,chdir:Dt,umask:jt,hrtime:Vt,platform:Tt,release:St,config:Lt,uptime:Yt},Ve={};Object.keys(Ve).forEach(t=>{let r=t.split("."),e=c;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=Ve[t]:e=e[i]||(e[i]={})}})});function Ke(){Se=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)I[r]=t[r],R[t.charCodeAt(r)]=r;R[45]=62,R[95]=63}function Gt(t){Se||Ke();var r,e,n,i,o,a,l=t.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[l-2]==="="?2:t[l-1]==="="?1:0,a=new zt(l*3/4-o),n=o>0?l-4:l;var m=0;for(r=0,e=0;r<n;r+=4,e+=3)i=R[t.charCodeAt(r)]<<18|R[t.charCodeAt(r+1)]<<12|R[t.charCodeAt(r+2)]<<6|R[t.charCodeAt(r+3)],a[m++]=i>>16&255,a[m++]=i>>8&255,a[m++]=i&255;return o===2?(i=R[t.charCodeAt(r)]<<2|R[t.charCodeAt(r+1)]>>4,a[m++]=i&255):o===1&&(i=R[t.charCodeAt(r)]<<10|R[t.charCodeAt(r+1)]<<4|R[t.charCodeAt(r+2)]>>2,a[m++]=i>>8&255,a[m++]=i&255),a}function qt(t){return I[t>>18&63]+I[t>>12&63]+I[t>>6&63]+I[t&63]}function Ht(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(qt(n));return i.join("")}function He(t){Se||Ke();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,l=0,m=e-n;l<m;l+=a)o.push(Ht(t,l,l+a>m?m:l+a));return n===1?(r=t[e-1],i+=I[r>>2],i+=I[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=I[r>>10],i+=I[r>>4&63],i+=I[r<<2&63],i+="="),o.push(i),o.join("")}function me(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function L(t,r){if(me()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Le(this,t)}return Xe(this,t,r,e)}function Xe(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?Kt(t,r,e,n):typeof r=="string"?Jt(t,r,e):Xt(t,r)}function Qe(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 Zt(t,r,e,n){return Qe(r),r<=0?L(t,r):e!==void 0?typeof n=="string"?L(t,r).fill(e,n):L(t,r).fill(e):L(t,r)}function Le(t,r){if(Qe(r),t=L(t,r<0?0:Ue(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function Jt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=er(r,e)|0;t=L(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function Ne(t,r){var e=r.length<0?0:Ue(r.length)|0;t=L(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Kt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=Ne(t,r),t}function Xt(t,r){if(N(r)){var e=Ue(r.length)|0;return t=L(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||gn(r.length)?L(t,0):Ne(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return Ne(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ue(t){if(t>=me())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+me().toString(16)+" bytes");return t|0}function N(t){return!!(t!=null&&t._isBuffer)}function er(t,r){if(N(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 e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return de(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return sr(t).length;default:if(n)return de(t).length;r=(""+r).toLowerCase(),n=!0}}function Qt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ln(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return un(this,r,e);case"latin1":case"binary":return fn(this,r,e);case"base64":return an(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pn(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function rr(t,r,e,n,i){if(t.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:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),N(r))return r.length===0?-1:Ze(t,r,e,n,i);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ze(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ze(t,r,e,n,i){var o=1,a=t.length,l=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,l/=2,e/=2}function m(E,Y){return o===1?E[Y]:E.readUInt16BE(Y*o)}var h;if(i){var y=-1;for(h=e;h<a;h++)if(m(t,h)===m(r,y===-1?0:h-y)){if(y===-1&&(y=h),h-y+1===l)return y*o}else y!==-1&&(h-=h-y),y=-1}else for(e+l>a&&(e=a-l),h=e;h>=0;h--){for(var x=!0,v=0;v<l;v++)if(m(t,h+v)!==m(r,v)){x=!1;break}if(x)return h}return-1}function en(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var l=parseInt(r.substr(a*2,2),16);if(isNaN(l))return a;t[e+a]=l}return a}function rn(t,r,e,n){return ye(de(r,t.length-e),t,e,n)}function tr(t,r,e,n){return ye(xn(r),t,e,n)}function tn(t,r,e,n){return tr(t,r,e,n)}function nn(t,r,e,n){return ye(sr(r),t,e,n)}function on(t,r,e,n){return ye(yn(r,t.length-e),t,e,n)}function an(t,r,e){return r===0&&e===t.length?He(t):He(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=e){var m,h,y,x;switch(l){case 1:o<128&&(a=o);break;case 2:m=t[i+1],(m&192)===128&&(x=(o&31)<<6|m&63,x>127&&(a=x));break;case 3:m=t[i+1],h=t[i+2],(m&192)===128&&(h&192)===128&&(x=(o&15)<<12|(m&63)<<6|h&63,x>2047&&(x<55296||x>57343)&&(a=x));break;case 4:m=t[i+1],h=t[i+2],y=t[i+3],(m&192)===128&&(h&192)===128&&(y&192)===128&&(x=(o&15)<<18|(m&63)<<12|(h&63)<<6|y&63,x>65535&&x<1114112&&(a=x))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=l}return sn(n)}function sn(t){var r=t.length;if(r<=Je)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Je));return e}function un(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function fn(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ln(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=hn(t[o]);return i}function pn(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function T(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function A(t,r,e,n,i,o){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function he(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function xe(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}function ir(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function or(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,n,23,4),e+4}function ar(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,n,52,8),e+8}function mn(t){if(t=dn(t).replace(cn,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function dn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function hn(t){return t<16?"0"+t.toString(16):t.toString(16)}function de(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=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 xn(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function yn(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function sr(t){return Gt(mn(t))}function ye(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function gn(t){return t!==t}function wn(t){return t!=null&&(!!t._isBuffer||ur(t)||vn(t))}function ur(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function vn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ur(t.slice(0,0))}function ge(t,r,e,n,i){var o,a,l=i*8-n-1,m=(1<<l)-1,h=m>>1,y=-7,x=e?i-1:0,v=e?-1:1,E=t[r+x];for(x+=v,o=E&(1<<-y)-1,E>>=-y,y+=l;y>0;o=o*256+t[r+x],x+=v,y-=8);for(a=o&(1<<-y)-1,o>>=-y,y+=n;y>0;a=a*256+t[r+x],x+=v,y-=8);if(o===0)o=1-h;else{if(o===m)return a?NaN:(E?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-h}return(E?-1:1)*a*Math.pow(2,o-n)}function fr(t,r,e,n,i,o){var a,l,m,h=o*8-i-1,y=(1<<h)-1,x=y>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:o-1,Y=n?1:-1,pt=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=y):(a=Math.floor(Math.log(r)/Math.LN2),r*(m=Math.pow(2,-a))<1&&(a--,m*=2),a+x>=1?r+=v/m:r+=v*Math.pow(2,1-x),r*m>=2&&(a++,m/=2),a+x>=y?(l=0,a=y):a+x>=1?(l=(r*m-1)*Math.pow(2,i),a=a+x):(l=r*Math.pow(2,x-1)*Math.pow(2,i),a=0));i>=8;t[e+E]=l&255,E+=Y,l/=256,i-=8);for(a=a<<i|l,h+=i;h>0;t[e+E]=a&255,E+=Y,a/=256,h-=8);t[e+E-Y]|=pt*128}var I,R,zt,Se,Je,cn,lr=Ie(()=>{"use strict";u();f();I=[],R=[],zt=typeof Uint8Array!="undefined"?Uint8Array:Array,Se=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};s.from=function(t,r,e){return Xe(null,t,r,e)};s.kMaxLength=me();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(t,r,e){return Zt(null,t,r,e)};s.allocUnsafe=function(t){return Le(null,t)};s.allocUnsafeSlow=function(t){return Le(null,t)};s.isBuffer=wn;s.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(r){switch(String(r).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}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=s.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};s.byteLength=er;s.prototype._isBuffer=!0;s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)D(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Qt.apply(this,arguments)};s.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,i,o){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.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===r)return 0;for(var a=o-i,l=n-e,m=Math.min(a,l),h=this.slice(i,o),y=r.slice(e,n),x=0;x<m;++x)if(h[x]!==y[x]){a=h[x],l=y[x];break}return a<l?-1:l<a?1:0};s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return rr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return rr(this,r,e,n,!1)};s.prototype.write=function(r,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),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return en(this,r,e,n);case"utf8":case"utf-8":return rn(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return tn(this,r,e,n);case"base64":return nn(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return on(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Je=4096;s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=s.prototype;else{var o=e-r;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||T(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||T(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};s.prototype.readUInt8=function(r,e){return e||T(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||T(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||T(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||T(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||T(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||T(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||T(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||T(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||T(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||T(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||T(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||T(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||T(r,4,this.length),ge(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||T(r,4,this.length),ge(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||T(r,8,this.length),ge(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||T(r,8,this.length),ge(this,r,!1,52,8)};s.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;A(this,r,e,n,o,0)}var a=1,l=0;for(this[e]=r&255;++l<n&&(a*=256);)this[e+l]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;A(this,r,e,n,o,0)}var a=n-1,l=1;for(this[e+a]=r&255;--a>=0&&(l*=256);)this[e+a]=r/l&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):he(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):he(this,r,e,!1),e+2};s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):xe(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):xe(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);A(this,r,e,n,o-1,-o)}var a=0,l=1,m=0;for(this[e]=r&255;++a<n&&(l*=256);)r<0&&m===0&&this[e+a-1]!==0&&(m=1),this[e+a]=(r/l>>0)-m&255;return e+n};s.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);A(this,r,e,n,o-1,-o)}var a=n-1,l=1,m=0;for(this[e+a]=r&255;--a>=0&&(l*=256);)r<0&&m===0&&this[e+a+1]!==0&&(m=1),this[e+a]=(r/l>>0)-m&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):he(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):he(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):xe(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):xe(this,r,e,!1),e+4};s.prototype.writeFloatLE=function(r,e,n){return or(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return or(this,r,e,!1,n)};s.prototype.writeDoubleLE=function(r,e,n){return ar(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return ar(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.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),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};s.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&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,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var l=N(r)?r:de(new s(r,i).toString()),m=l.length;for(a=0;a<n-e;++a)this[a+e]=l[a%m]}return this};cn=/[^+\/0-9A-Za-z-_]/g});var f=Ie(()=>{"use strict";lr()});var To={};$e(To,{DynamicSnippetsGeneratorContext:()=>Be});module.exports=yt(To);u();f();u();f();u();f();function b(t){throw new Error("Unexpected value: "+JSON.stringify(t))}u();f();function te(t){return Object.keys(t)}u();f();u();f();u();f();u();f();u();f();u();f();var bn=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,pr=bn;var Tn=typeof self=="object"&&self&&self.Object===Object&&self,An=pr||Tn||Function("return this")(),cr=An;var En=cr.Symbol,U=En;u();f();var mr=Object.prototype,Rn=mr.hasOwnProperty,In=mr.toString,ne=U?U.toStringTag:void 0;function Nn(t){var r=Rn.call(t,ne),e=t[ne];try{t[ne]=void 0;var n=!0}catch(o){}var i=In.call(t);return n&&(r?t[ne]=e:delete t[ne]),i}var dr=Nn;u();f();var Sn=Object.prototype,Ln=Sn.toString;function Un(t){return Ln.call(t)}var hr=Un;var kn="[object Null]",Cn="[object Undefined]",xr=U?U.toStringTag:void 0;function Fn(t){return t==null?t===void 0?Cn:kn:xr&&xr in Object(t)?dr(t):hr(t)}var yr=Fn;u();f();function Pn(t){return t!=null&&typeof t=="object"}var gr=Pn;var Bn="[object Symbol]";function _n(t){return typeof t=="symbol"||gr(t)&&yr(t)==Bn}var wr=_n;u();f();u();f();function On(t,r){for(var e=-1,n=t==null?0:t.length,i=Array(n);++e<n;)i[e]=r(t[e],e,t);return i}var vr=On;u();f();var Mn=Array.isArray,br=Mn;var Dn=1/0,Tr=U?U.prototype:void 0,Ar=Tr?Tr.toString:void 0;function Er(t){if(typeof t=="string")return t;if(br(t))return vr(t,Er)+"";if(wr(t))return Ar?Ar.call(t):"";var r=t+"";return r=="0"&&1/t==-Dn?"-0":r}var Rr=Er;u();f();function jn(t){return t==null?"":Rr(t)}var P=jn;u();f();u();f();u();f();u();f();u();f();u();f();function $n(t,r,e){var n=-1,i=t.length;r<0&&(r=-r>i?0:i+r),e=e>i?i:e,e<0&&(e+=i),i=r>e?0:e-r>>>0,r>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+r];return o}var Ir=$n;function Vn(t,r,e){var n=t.length;return e=e===void 0?n:e,!r&&e>=n?t:Ir(t,r,e)}var Nr=Vn;u();f();var Wn="\\ud800-\\udfff",Yn="\\u0300-\\u036f",zn="\\ufe20-\\ufe2f",Gn="\\u20d0-\\u20ff",qn=Yn+zn+Gn,Hn="\\ufe0e\\ufe0f",Zn="\\u200d",Jn=RegExp("["+Zn+Wn+qn+Hn+"]");function Kn(t){return Jn.test(t)}var we=Kn;u();f();u();f();function Xn(t){return t.split("")}var Sr=Xn;u();f();var Lr="\\ud800-\\udfff",Qn="\\u0300-\\u036f",ei="\\ufe20-\\ufe2f",ri="\\u20d0-\\u20ff",ti=Qn+ei+ri,ni="\\ufe0e\\ufe0f",ii="["+Lr+"]",ke="["+ti+"]",Ce="\\ud83c[\\udffb-\\udfff]",oi="(?:"+ke+"|"+Ce+")",Ur="[^"+Lr+"]",kr="(?:\\ud83c[\\udde6-\\uddff]){2}",Cr="[\\ud800-\\udbff][\\udc00-\\udfff]",ai="\\u200d",Fr=oi+"?",Pr="["+ni+"]?",si="(?:"+ai+"(?:"+[Ur,kr,Cr].join("|")+")"+Pr+Fr+")*",ui=Pr+Fr+si,fi="(?:"+[Ur+ke+"?",ke,kr,Cr,ii].join("|")+")",li=RegExp(Ce+"(?="+Ce+")|"+fi+ui,"g");function pi(t){return t.match(li)||[]}var Br=pi;function ci(t){return we(t)?Br(t):Sr(t)}var _r=ci;function mi(t){return function(r){r=P(r);var e=we(r)?_r(r):void 0,n=e?e[0]:r.charAt(0),i=e?Nr(e,1).join(""):r.slice(1);return n[t]()+i}}var Or=mi;var di=Or("toUpperCase"),q=di;function hi(t){return q(P(t).toLowerCase())}var Mr=hi;u();f();u();f();function xi(t,r,e,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(e=t[++i]);++i<o;)e=r(e,t[i],i,t);return e}var Dr=xi;u();f();u();f();u();f();function yi(t){return function(r){return t==null?void 0:t[r]}}var jr=yi;var gi={\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"},wi=jr(gi),$r=wi;var vi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bi="\\u0300-\\u036f",Ti="\\ufe20-\\ufe2f",Ai="\\u20d0-\\u20ff",Ei=bi+Ti+Ai,Ri="["+Ei+"]",Ii=RegExp(Ri,"g");function Ni(t){return t=P(t),t&&t.replace(vi,$r).replace(Ii,"")}var Vr=Ni;u();f();u();f();var Si=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Li(t){return t.match(Si)||[]}var Wr=Li;u();f();var Ui=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ki(t){return Ui.test(t)}var Yr=ki;u();f();var Zr="\\ud800-\\udfff",Ci="\\u0300-\\u036f",Fi="\\ufe20-\\ufe2f",Pi="\\u20d0-\\u20ff",Bi=Ci+Fi+Pi,Jr="\\u2700-\\u27bf",Kr="a-z\\xdf-\\xf6\\xf8-\\xff",_i="\\xac\\xb1\\xd7\\xf7",Oi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mi="\\u2000-\\u206f",Di=" \\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",Xr="A-Z\\xc0-\\xd6\\xd8-\\xde",ji="\\ufe0e\\ufe0f",Qr=_i+Oi+Mi+Di,et="['\u2019]",zr="["+Qr+"]",$i="["+Bi+"]",rt="\\d+",Vi="["+Jr+"]",tt="["+Kr+"]",nt="[^"+Zr+Qr+rt+Jr+Kr+Xr+"]",Wi="\\ud83c[\\udffb-\\udfff]",Yi="(?:"+$i+"|"+Wi+")",zi="[^"+Zr+"]",it="(?:\\ud83c[\\udde6-\\uddff]){2}",ot="[\\ud800-\\udbff][\\udc00-\\udfff]",H="["+Xr+"]",Gi="\\u200d",Gr="(?:"+tt+"|"+nt+")",qi="(?:"+H+"|"+nt+")",qr="(?:"+et+"(?:d|ll|m|re|s|t|ve))?",Hr="(?:"+et+"(?:D|LL|M|RE|S|T|VE))?",at=Yi+"?",st="["+ji+"]?",Hi="(?:"+Gi+"(?:"+[zi,it,ot].join("|")+")"+st+at+")*",Zi="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ji="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ki=st+at+Hi,Xi="(?:"+[Vi,it,ot].join("|")+")"+Ki,Qi=RegExp([H+"?"+tt+"+"+qr+"(?="+[zr,H,"$"].join("|")+")",qi+"+"+Hr+"(?="+[zr,H+Gr,"$"].join("|")+")",H+"?"+Gr+"+"+qr,H+"+"+Hr,Ji,Zi,rt,Xi].join("|"),"g");function eo(t){return t.match(Qi)||[]}var ut=eo;function ro(t,r,e){return t=P(t),r=e?void 0:r,r===void 0?Yr(t)?ut(t):Wr(t):t.match(r)||[]}var ft=ro;var to="['\u2019]",no=RegExp(to,"g");function io(t){return function(r){return Dr(ft(Vr(r).replace(no,"")),t,"")}}var lt=io;var oo=lt(function(t,r,e){return r=r.toLowerCase(),t+(e?Mr(r):r)}),ve=oo;u();f();u();f();var j=class{};u();f();u();f();var B=class extends j{constructor(e){super();p(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var ao=4,ie=class{constructor(){p(this,"buffer","");p(this,"indentLevel",0);p(this,"hasWrittenAnything",!1);p(this,"lastCharacterIsNewline",!1)}write(r){let e=r.length>0&&r.endsWith(`
2
- `),n=e?r.substring(0,r.length-1):r,i=this.getIndentString(),o=n.replaceAll(`
1
+ "use strict";var pe=Object.defineProperty,cr=Object.defineProperties,mr=Object.getOwnPropertyDescriptor,dr=Object.getOwnPropertyDescriptors,hr=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols;var Re=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var Ee=(r,t,e)=>t in r?pe(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Oe=(r,t)=>{for(var e in t||(t={}))Re.call(t,e)&&Ee(r,e,t[e]);if(le)for(var e of le(t))_e.call(t,e)&&Ee(r,e,t[e]);return r},Me=(r,t)=>cr(r,dr(t));var De=r=>typeof r=="symbol"?r:r+"",je=(r,t)=>{var e={};for(var n in r)Re.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&le)for(var n of le(r))t.indexOf(n)<0&&_e.call(r,n)&&(e[n]=r[n]);return e};var Ie=(r,t)=>()=>(r&&(t=r(r=0)),t);var $e=(r,t)=>{for(var e in t)pe(r,e,{get:t[e],enumerable:!0})},xr=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hr(t))!Re.call(r,i)&&i!==e&&pe(r,i,{get:()=>t[i],enumerable:!(n=mr(t,i))||n.enumerable});return r};var yr=r=>xr(pe({},"__esModule",{value:!0}),r);var p=(r,t,e)=>Ee(r,typeof t!="symbol"?t+"":t,e);function We(){throw new Error("setTimeout has not been defined")}function Ye(){throw new Error("clearTimeout has not been defined")}function ze(r){if(F===setTimeout)return setTimeout(r,0);if((F===We||!F)&&setTimeout)return F=setTimeout,setTimeout(r,0);try{return F(r,0)}catch(t){try{return F.call(null,r,0)}catch(e){return F.call(this,r,0)}}}function gr(r){if(B===clearTimeout)return clearTimeout(r);if((B===Ye||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(r);try{return B(r)}catch(t){try{return B.call(null,r)}catch(e){return B.call(this,r)}}}function wr(){!G||!O||(G=!1,O.length?L=O.concat(L):ce=-1,L.length&&Ge())}function Ge(){if(!G){var r=ze(wr);G=!0;for(var t=L.length;t;){for(O=L,L=[];++ce<t;)O&&O[ce].run();ce=-1,t=L.length}O=null,G=!1,gr(r)}}function vr(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];L.push(new qe(r,t)),L.length===1&&!G&&ze(Ge)}function qe(r,t){this.fun=r,this.array=t}function M(){}function Or(r){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Dr(r){throw new Error("process.chdir is not supported")}function jr(){return 0}function Vr(r){var t=$r.call(z)*.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 Yr(){var r=new Date,t=r-Wr;return t/1e3}var F,B,L,G,O,ce,br,Tr,Ar,Er,Rr,Ir,Nr,Sr,Lr,kr,Ur,Cr,Fr,Br,Pr,_r,z,$r,Wr,c,Ve,u=Ie(()=>{"use strict";F=We,B=Ye;typeof globalThis.setTimeout=="function"&&(F=setTimeout);typeof globalThis.clearTimeout=="function"&&(B=clearTimeout);L=[],G=!1,ce=-1;qe.prototype.run=function(){this.fun.apply(null,this.array)};br="browser",Tr="browser",Ar=!0,Er={},Rr=[],Ir="",Nr={},Sr={},Lr={};kr=M,Ur=M,Cr=M,Fr=M,Br=M,Pr=M,_r=M;z=globalThis.performance||{},$r=z.now||z.mozNow||z.msNow||z.oNow||z.webkitNow||function(){return new Date().getTime()};Wr=new Date;c={nextTick:vr,title:br,browser:Ar,env:Er,argv:Rr,version:Ir,versions:Nr,on:kr,addListener:Ur,once:Cr,off:Fr,removeListener:Br,removeAllListeners:Pr,emit:_r,binding:Or,cwd:Mr,chdir:Dr,umask:jr,hrtime:Vr,platform:Tr,release:Sr,config:Lr,uptime:Yr},Ve={};Object.keys(Ve).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]=Ve[r]:e=e[i]||(e[i]={})}})});function Ke(){Se=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)I[t]=r[t],R[r.charCodeAt(t)]=t;R[45]=62,R[95]=63}function Gr(r){Se||Ke();var t,e,n,i,o,a,l=r.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[l-2]==="="?2:r[l-1]==="="?1:0,a=new zr(l*3/4-o),n=o>0?l-4:l;var m=0;for(t=0,e=0;t<n;t+=4,e+=3)i=R[r.charCodeAt(t)]<<18|R[r.charCodeAt(t+1)]<<12|R[r.charCodeAt(t+2)]<<6|R[r.charCodeAt(t+3)],a[m++]=i>>16&255,a[m++]=i>>8&255,a[m++]=i&255;return o===2?(i=R[r.charCodeAt(t)]<<2|R[r.charCodeAt(t+1)]>>4,a[m++]=i&255):o===1&&(i=R[r.charCodeAt(t)]<<10|R[r.charCodeAt(t+1)]<<4|R[r.charCodeAt(t+2)]>>2,a[m++]=i>>8&255,a[m++]=i&255),a}function qr(r){return I[r>>18&63]+I[r>>12&63]+I[r>>6&63]+I[r&63]}function Hr(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(qr(n));return i.join("")}function He(r){Se||Ke();for(var t,e=r.length,n=e%3,i="",o=[],a=16383,l=0,m=e-n;l<m;l+=a)o.push(Hr(r,l,l+a>m?m:l+a));return n===1?(t=r[e-1],i+=I[t>>2],i+=I[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=I[t>>10],i+=I[t>>4&63],i+=I[t<<2&63],i+="="),o.push(i),o.join("")}function me(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(r,t){if(me()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=s.prototype):(r===null&&(r=new s(t)),r.length=t),r}function s(r,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(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 Le(this,r)}return Xe(this,r,t,e)}function Xe(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?Kr(r,t,e,n):typeof t=="string"?Jr(r,t,e):Xr(r,t)}function Qe(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 Zr(r,t,e,n){return Qe(t),t<=0?k(r,t):e!==void 0?typeof n=="string"?k(r,t).fill(e,n):k(r,t).fill(e):k(r,t)}function Le(r,t){if(Qe(t),r=k(r,t<0?0:ke(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Jr(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=et(t,e)|0;r=k(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function Ne(r,t){var e=t.length<0?0:ke(t.length)|0;r=k(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Kr(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),s.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=s.prototype):r=Ne(r,t),r}function Xr(r,t){if(N(t)){var e=ke(t.length)|0;return r=k(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"||gn(t.length)?k(r,0):Ne(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ne(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ke(r){if(r>=me())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+me().toString(16)+" bytes");return r|0}function N(r){return!!(r!=null&&r._isBuffer)}function et(r,t){if(N(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 de(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return st(r).length;default:if(n)return de(r).length;t=(""+t).toLowerCase(),n=!0}}function Qr(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 ln(this,t,e);case"utf8":case"utf-8":return nt(this,t,e);case"ascii":return un(this,t,e);case"latin1":case"binary":return fn(this,t,e);case"base64":return an(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pn(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function D(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function tt(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=s.from(t,n)),N(t))return t.length===0?-1:Ze(r,t,e,n,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ze(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ze(r,t,e,n,i){var o=1,a=r.length,l=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,a/=2,l/=2,e/=2}function m(E,Y){return o===1?E[Y]:E.readUInt16BE(Y*o)}var h;if(i){var y=-1;for(h=e;h<a;h++)if(m(r,h)===m(t,y===-1?0:h-y)){if(y===-1&&(y=h),h-y+1===l)return y*o}else y!==-1&&(h-=h-y),y=-1}else for(e+l>a&&(e=a-l),h=e;h>=0;h--){for(var x=!0,v=0;v<l;v++)if(m(r,h+v)!==m(t,v)){x=!1;break}if(x)return h}return-1}function en(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 a=0;a<n;++a){var l=parseInt(t.substr(a*2,2),16);if(isNaN(l))return a;r[e+a]=l}return a}function tn(r,t,e,n){return ye(de(t,r.length-e),r,e,n)}function rt(r,t,e,n){return ye(xn(t),r,e,n)}function rn(r,t,e,n){return rt(r,t,e,n)}function nn(r,t,e,n){return ye(st(t),r,e,n)}function on(r,t,e,n){return ye(yn(t,r.length-e),r,e,n)}function an(r,t,e){return t===0&&e===r.length?He(r):He(r.slice(t,e))}function nt(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=e){var m,h,y,x;switch(l){case 1:o<128&&(a=o);break;case 2:m=r[i+1],(m&192)===128&&(x=(o&31)<<6|m&63,x>127&&(a=x));break;case 3:m=r[i+1],h=r[i+2],(m&192)===128&&(h&192)===128&&(x=(o&15)<<12|(m&63)<<6|h&63,x>2047&&(x<55296||x>57343)&&(a=x));break;case 4:m=r[i+1],h=r[i+2],y=r[i+3],(m&192)===128&&(h&192)===128&&(y&192)===128&&(x=(o&15)<<18|(m&63)<<12|(h&63)<<6|y&63,x>65535&&x<1114112&&(a=x))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=l}return sn(n)}function sn(r){var t=r.length;if(t<=Je)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Je));return e}function un(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 fn(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 ln(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+=hn(r[o]);return i}function pn(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 T(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 A(r,t,e,n,i,o){if(!N(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 he(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 xe(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 it(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 ot(r,t,e,n,i){return i||it(r,t,e,4,34028234663852886e22,-34028234663852886e22),ft(r,t,e,n,23,4),e+4}function at(r,t,e,n,i){return i||it(r,t,e,8,17976931348623157e292,-17976931348623157e292),ft(r,t,e,n,52,8),e+8}function mn(r){if(r=dn(r).replace(cn,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function dn(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function hn(r){return r<16?"0"+r.toString(16):r.toString(16)}function de(r,t){t=t||1/0;for(var e,n=r.length,i=null,o=[],a=0;a<n;++a){if(e=r.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+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 xn(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function yn(r,t){for(var e,n,i,o=[],a=0;a<r.length&&!((t-=2)<0);++a)e=r.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function st(r){return Gr(mn(r))}function ye(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 gn(r){return r!==r}function wn(r){return r!=null&&(!!r._isBuffer||ut(r)||vn(r))}function ut(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function vn(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&ut(r.slice(0,0))}function ge(r,t,e,n,i){var o,a,l=i*8-n-1,m=(1<<l)-1,h=m>>1,y=-7,x=e?i-1:0,v=e?-1:1,E=r[t+x];for(x+=v,o=E&(1<<-y)-1,E>>=-y,y+=l;y>0;o=o*256+r[t+x],x+=v,y-=8);for(a=o&(1<<-y)-1,o>>=-y,y+=n;y>0;a=a*256+r[t+x],x+=v,y-=8);if(o===0)o=1-h;else{if(o===m)return a?NaN:(E?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-h}return(E?-1:1)*a*Math.pow(2,o-n)}function ft(r,t,e,n,i,o){var a,l,m,h=o*8-i-1,y=(1<<h)-1,x=y>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:o-1,Y=n?1:-1,pr=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=y):(a=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-a))<1&&(a--,m*=2),a+x>=1?t+=v/m:t+=v*Math.pow(2,1-x),t*m>=2&&(a++,m/=2),a+x>=y?(l=0,a=y):a+x>=1?(l=(t*m-1)*Math.pow(2,i),a=a+x):(l=t*Math.pow(2,x-1)*Math.pow(2,i),a=0));i>=8;r[e+E]=l&255,E+=Y,l/=256,i-=8);for(a=a<<i|l,h+=i;h>0;r[e+E]=a&255,E+=Y,a/=256,h-=8);r[e+E-Y]|=pr*128}var I,R,zr,Se,Je,cn,lt=Ie(()=>{"use strict";u();f();I=[],R=[],zr=typeof Uint8Array!="undefined"?Uint8Array:Array,Se=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(r){return r.__proto__=s.prototype,r};s.from=function(r,t,e){return Xe(null,r,t,e)};s.kMaxLength=me();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(r,t,e){return Zr(null,r,t,e)};s.allocUnsafe=function(r){return Le(null,r)};s.allocUnsafeSlow=function(r){return Le(null,r)};s.isBuffer=wn;s.compare=function(t,e){if(!N(t)||!N(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};s.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}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=s.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var a=t[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};s.byteLength=et;s.prototype._isBuffer=!0;s.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)D(this,e,e+1);return this};s.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)D(this,e,e+3),D(this,e+1,e+2);return this};s.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)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?nt(this,0,t):Qr.apply(this,arguments)};s.prototype.equals=function(t){if(!N(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,n,i,o){if(!N(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 a=o-i,l=n-e,m=Math.min(a,l),h=this.slice(i,o),y=t.slice(e,n),x=0;x<m;++x)if(h[x]!==y[x]){a=h[x],l=y[x];break}return a<l?-1:l<a?1:0};s.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};s.prototype.indexOf=function(t,e,n){return tt(this,t,e,n,!0)};s.prototype.lastIndexOf=function(t,e,n){return tt(this,t,e,n,!1)};s.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 a=!1;;)switch(i){case"hex":return en(this,t,e,n);case"utf8":case"utf-8":return tn(this,t,e,n);case"ascii":return rt(this,t,e,n);case"latin1":case"binary":return rn(this,t,e,n);case"base64":return nn(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return on(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Je=4096;s.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(s.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=s.prototype;else{var o=e-t;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};s.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return i};s.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};s.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};s.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=e,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};s.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};s.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),ge(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),ge(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),ge(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),ge(this,t,!1,52,8)};s.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;A(this,t,e,n,o,0)}var a=1,l=0;for(this[e]=t&255;++l<n&&(a*=256);)this[e+l]=t/a&255;return e+n};s.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;A(this,t,e,n,o,0)}var a=n-1,l=1;for(this[e+a]=t&255;--a>=0&&(l*=256);)this[e+a]=t/l&255;return e+n};s.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):he(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):he(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):xe(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):xe(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);A(this,t,e,n,o-1,-o)}var a=0,l=1,m=0;for(this[e]=t&255;++a<n&&(l*=256);)t<0&&m===0&&this[e+a-1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+n};s.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);A(this,t,e,n,o-1,-o)}var a=n-1,l=1,m=0;for(this[e+a]=t&255;--a>=0&&(l*=256);)t<0&&m===0&&this[e+a+1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+n};s.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):he(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):he(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):xe(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):xe(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,n){return ot(this,t,e,!0,n)};s.prototype.writeFloatBE=function(t,e,n){return ot(this,t,e,!1,n)};s.prototype.writeDoubleLE=function(t,e,n){return at(this,t,e,!0,n)};s.prototype.writeDoubleBE=function(t,e,n){return at(this,t,e,!1,n)};s.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,a;if(this===t&&n<e&&e<i)for(a=o-1;a>=0;--a)t[a+e]=this[a+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o};s.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"&&!s.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 a;if(typeof t=="number")for(a=e;a<n;++a)this[a]=t;else{var l=N(t)?t:de(new s(t,i).toString()),m=l.length;for(a=0;a<n-e;++a)this[a+e]=l[a%m]}return this};cn=/[^+\/0-9A-Za-z-_]/g});var f=Ie(()=>{"use strict";lt()});var To={};$e(To,{DynamicSnippetsGeneratorContext:()=>Pe});module.exports=yr(To);u();f();u();f();u();f();function b(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();f();function re(r){return Object.keys(r)}u();f();u();f();u();f();u();f();u();f();u();f();var bn=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,pt=bn;var Tn=typeof self=="object"&&self&&self.Object===Object&&self,An=pt||Tn||Function("return this")(),ct=An;var En=ct.Symbol,U=En;u();f();var mt=Object.prototype,Rn=mt.hasOwnProperty,In=mt.toString,ne=U?U.toStringTag:void 0;function Nn(r){var t=Rn.call(r,ne),e=r[ne];try{r[ne]=void 0;var n=!0}catch(o){}var i=In.call(r);return n&&(t?r[ne]=e:delete r[ne]),i}var dt=Nn;u();f();var Sn=Object.prototype,Ln=Sn.toString;function kn(r){return Ln.call(r)}var ht=kn;var Un="[object Null]",Cn="[object Undefined]",xt=U?U.toStringTag:void 0;function Fn(r){return r==null?r===void 0?Cn:Un:xt&&xt in Object(r)?dt(r):ht(r)}var yt=Fn;u();f();function Bn(r){return r!=null&&typeof r=="object"}var gt=Bn;var Pn="[object Symbol]";function _n(r){return typeof r=="symbol"||gt(r)&&yt(r)==Pn}var wt=_n;u();f();u();f();function On(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 vt=On;u();f();var Mn=Array.isArray,bt=Mn;var Dn=1/0,Tt=U?U.prototype:void 0,At=Tt?Tt.toString:void 0;function Et(r){if(typeof r=="string")return r;if(bt(r))return vt(r,Et)+"";if(wt(r))return At?At.call(r):"";var t=r+"";return t=="0"&&1/r==-Dn?"-0":t}var Rt=Et;u();f();function jn(r){return r==null?"":Rt(r)}var P=jn;u();f();u();f();u();f();u();f();u();f();u();f();function $n(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 It=$n;function Vn(r,t,e){var n=r.length;return e=e===void 0?n:e,!t&&e>=n?r:It(r,t,e)}var Nt=Vn;u();f();var Wn="\\ud800-\\udfff",Yn="\\u0300-\\u036f",zn="\\ufe20-\\ufe2f",Gn="\\u20d0-\\u20ff",qn=Yn+zn+Gn,Hn="\\ufe0e\\ufe0f",Zn="\\u200d",Jn=RegExp("["+Zn+Wn+qn+Hn+"]");function Kn(r){return Jn.test(r)}var we=Kn;u();f();u();f();function Xn(r){return r.split("")}var St=Xn;u();f();var Lt="\\ud800-\\udfff",Qn="\\u0300-\\u036f",ei="\\ufe20-\\ufe2f",ti="\\u20d0-\\u20ff",ri=Qn+ei+ti,ni="\\ufe0e\\ufe0f",ii="["+Lt+"]",Ue="["+ri+"]",Ce="\\ud83c[\\udffb-\\udfff]",oi="(?:"+Ue+"|"+Ce+")",kt="[^"+Lt+"]",Ut="(?:\\ud83c[\\udde6-\\uddff]){2}",Ct="[\\ud800-\\udbff][\\udc00-\\udfff]",ai="\\u200d",Ft=oi+"?",Bt="["+ni+"]?",si="(?:"+ai+"(?:"+[kt,Ut,Ct].join("|")+")"+Bt+Ft+")*",ui=Bt+Ft+si,fi="(?:"+[kt+Ue+"?",Ue,Ut,Ct,ii].join("|")+")",li=RegExp(Ce+"(?="+Ce+")|"+fi+ui,"g");function pi(r){return r.match(li)||[]}var Pt=pi;function ci(r){return we(r)?Pt(r):St(r)}var _t=ci;function mi(r){return function(t){t=P(t);var e=we(t)?_t(t):void 0,n=e?e[0]:t.charAt(0),i=e?Nt(e,1).join(""):t.slice(1);return n[r]()+i}}var Ot=mi;var di=Ot("toUpperCase"),q=di;function hi(r){return q(P(r).toLowerCase())}var Mt=hi;u();f();u();f();function xi(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 Dt=xi;u();f();u();f();u();f();function yi(r){return function(t){return r==null?void 0:r[t]}}var jt=yi;var gi={\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"},wi=jt(gi),$t=wi;var vi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bi="\\u0300-\\u036f",Ti="\\ufe20-\\ufe2f",Ai="\\u20d0-\\u20ff",Ei=bi+Ti+Ai,Ri="["+Ei+"]",Ii=RegExp(Ri,"g");function Ni(r){return r=P(r),r&&r.replace(vi,$t).replace(Ii,"")}var Vt=Ni;u();f();u();f();var Si=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Li(r){return r.match(Si)||[]}var Wt=Li;u();f();var ki=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ui(r){return ki.test(r)}var Yt=Ui;u();f();var Zt="\\ud800-\\udfff",Ci="\\u0300-\\u036f",Fi="\\ufe20-\\ufe2f",Bi="\\u20d0-\\u20ff",Pi=Ci+Fi+Bi,Jt="\\u2700-\\u27bf",Kt="a-z\\xdf-\\xf6\\xf8-\\xff",_i="\\xac\\xb1\\xd7\\xf7",Oi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mi="\\u2000-\\u206f",Di=" \\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",Xt="A-Z\\xc0-\\xd6\\xd8-\\xde",ji="\\ufe0e\\ufe0f",Qt=_i+Oi+Mi+Di,er="['\u2019]",zt="["+Qt+"]",$i="["+Pi+"]",tr="\\d+",Vi="["+Jt+"]",rr="["+Kt+"]",nr="[^"+Zt+Qt+tr+Jt+Kt+Xt+"]",Wi="\\ud83c[\\udffb-\\udfff]",Yi="(?:"+$i+"|"+Wi+")",zi="[^"+Zt+"]",ir="(?:\\ud83c[\\udde6-\\uddff]){2}",or="[\\ud800-\\udbff][\\udc00-\\udfff]",H="["+Xt+"]",Gi="\\u200d",Gt="(?:"+rr+"|"+nr+")",qi="(?:"+H+"|"+nr+")",qt="(?:"+er+"(?:d|ll|m|re|s|t|ve))?",Ht="(?:"+er+"(?:D|LL|M|RE|S|T|VE))?",ar=Yi+"?",sr="["+ji+"]?",Hi="(?:"+Gi+"(?:"+[zi,ir,or].join("|")+")"+sr+ar+")*",Zi="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ji="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ki=sr+ar+Hi,Xi="(?:"+[Vi,ir,or].join("|")+")"+Ki,Qi=RegExp([H+"?"+rr+"+"+qt+"(?="+[zt,H,"$"].join("|")+")",qi+"+"+Ht+"(?="+[zt,H+Gt,"$"].join("|")+")",H+"?"+Gt+"+"+qt,H+"+"+Ht,Ji,Zi,tr,Xi].join("|"),"g");function eo(r){return r.match(Qi)||[]}var ur=eo;function to(r,t,e){return r=P(r),t=e?void 0:t,t===void 0?Yt(r)?ur(r):Wt(r):r.match(t)||[]}var fr=to;var ro="['\u2019]",no=RegExp(ro,"g");function io(r){return function(t){return Dt(fr(Vt(t).replace(no,"")),r,"")}}var lr=io;var oo=lr(function(r,t,e){return t=t.toLowerCase(),r+(e?Mt(t):t)}),ve=oo;u();f();u();f();var j=class{};u();f();u();f();var S=class extends j{constructor(e){super();p(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var ao=4,ie=class{constructor(){p(this,"buffer","");p(this,"indentLevel",0);p(this,"hasWrittenAnything",!1);p(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
2
+ `),n=e?t.substring(0,t.length-1):t,i=this.getIndentString(),o=n.replaceAll(`
3
3
  `,`
4
4
  ${i}`);this.isAtStartOfLine()&&(o=i+o),e&&(o+=`
5
- `),this.writeInternal(o)}writeNoIndent(r){let e=this.indentLevel;this.indentLevel=0,this.write(r),this.indentLevel=e}writeNode(r){r.write(this)}writeNodeStatement(r){r.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(r){new B(r).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(r,e){new B(r).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}openBlock(r,e="{",n,i="}"){let o=r.filter(a=>a!==void 0).join(" ");o?this.write(`${o} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),n(),this.dedent()}finally{this.write(i!=null?i:"")}}writeLine(r=""){this.write(r),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
5
+ `),this.writeInternal(o)}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 S(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new S(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new S(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new S(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",n,i="}"){let o=t.filter(a=>a!==void 0).join(" ");o?this.write(`${o} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),n(),this.dedent()}finally{this.write(i!=null?i:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
6
  `)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:r,delimiter:e,writeFunction:n}){if(r.length>0){let i=r[0];i!=null&&n(i);for(let o=1;o<r.length;o++){this.write(e);let a=r[o];a!=null&&n(a)}}}toString(){return this.buffer}writeInternal(r){return r.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=r.endsWith(`
8
- `)),this.buffer+=r}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*ao)}};u();f();var be=class{},oe=class extends be{async format(r){return r}formatSync(r){return r}};u();f();u();f();u();f();u();f();var ae=class{constructor(){p(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}validate(r){return this.REFERENCE_REGEX.test(r)?{type:"valid"}:{type:"invalid"}}tryParse(r){if(this.validate(r).type==="invalid")return;let n=r.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};u();f();var g={Critical:"CRITICAL",Warning:"WARNING"},se=class t{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(r){this.errors.push(Me(Oe({},r),{path:[...this.path]}))}scope(r){this.path.push(r)}unscope(){this.path.pop()}getBySeverity(r){return this.errors.filter(e=>e.severity===r)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let r=new t;return r.errors=[...this.errors],r.path=[...this.path],r}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(r=>({severity:r.severity,path:r.path!=null?this.pathToStringArray(r.path):void 0,message:r.message}))}pathToStringArray(r){let e=[];for(let n of r){if(typeof n=="string"){e.push(n);continue}e[e.length-1]+=`[${n.index}]`}return e}};var ue=class{constructor({ir:r,config:e}){p(this,"config");p(this,"errors");p(this,"_ir");p(this,"httpEndpointReferenceParser");this._ir=r,this.config=e,this.errors=new se,this.httpEndpointReferenceParser=new ae}associateQueryParametersByWireValue({parameters:r,values:e}){let n=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let a=r.find(m=>m.name.wireValue===i);if(a==null)throw this.newParameterNotRecognizedError(i);let l=this.isListTypeReference(a.typeReference)&&!Array.isArray(o)?[o]:o;n.push({name:a.name,typeReference:a.typeReference,value:l})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:r,values:e,ignoreMissingParameters:n}){let i=[];for(let[o,a]of Object.entries(e)){this.errors.scope(o);try{let l=r.find(m=>m.name.wireValue===o);if(l==null){if(n)continue;this.errors.add({severity:g.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:l.name,typeReference:l.typeReference,value:a})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:r,record:e}){let n=e[r.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:g.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:r,record:e}){let n=e[r.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:g.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:g.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(r){if(typeof r!="object"||Array.isArray(r)){this.errors.add({severity:g.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(r)?"array":typeof r}`});return}return r==null?{}:r}resolveNamedType({typeId:r}){let e=this._ir.types[r];if(e==null){this.errors.add({severity:g.Critical,message:`Type identified by "${r}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:r,value:e}){let n=this.getRecord(e);if(n==null)return;let i=r.discriminant.wireValue,o=n[i];if(o==null){this.errors.add({severity:g.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:g.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let a=r.types[o];if(a==null){this.errors.add({severity:g.Critical,message:`No type found for discriminant value "${o}"`});return}let h=n,{[i]:l}=h,m=je(h,[De(i)]);return{singleDiscriminatedUnionType:a,discriminantValue:a.discriminantValue,value:m}}resolveEndpointOrThrow(r){let e=this.httpEndpointReferenceParser.tryParse(r);if(e==null)throw new Error(`Failed to parse endpoint reference "${r}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocationOrThrow(r){let e=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:r})&&e.push(n);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${r.method} ${r.path}"`);return e}needsRequestParameter({request:r,inlinePathParameters:e,inlineFileProperties:n}){var i;return this.includePathParametersInWrappedRequest({request:r,inlinePathParameters:e})||r.queryParameters!=null&&r.queryParameters.length>0||r.headers!=null&&r.headers.length>0?!0:r.body!=null?this.includeRequestBodyInWrappedRequest({body:r.body,inlineFileProperties:n}):!((i=r.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:r,inlinePathParameters:e}){var n,i;return e&&((i=(n=r.metadata)==null?void 0:n.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(r){switch(r.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:b(r)}}resolveEnvironmentName(r){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===r);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=e.environments.find(i=>i.id===r);return n==null?void 0:n.name}default:b(e)}}isSingleEnvironmentID(r){return typeof r=="string"}isMultiEnvironmentValues(r){return typeof r=="object"}validateMultiEnvironmentUrlValues(r){if(this._ir.environments==null)return this.errors.add({severity:g.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:g.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:g.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(te(n.urls));for(let o of te(r))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:g.Critical,message:`The provided environments are invalid; got: [${Object.keys(r).join(", ")}], expected: [${te(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:r}){if(typeof r!="number"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"number",value:r}).message});return}return r}getValueAsBoolean({value:r}){if(typeof r!="boolean"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"boolean",value:r}).message});return}return r}getValueAsString({value:r}){if(typeof r!="string"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"string",value:r}).message});return}return r}isOptional(r){switch(r.type){case"nullable":return this.isOptional(r.value);case"optional":return!0;case"named":{let e=this.resolveNamedType({typeId:r.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}isNullable(r){switch(r.type){case"nullable":return!0;case"optional":return this.isNullable(r.value);case"named":{let e=this.resolveNamedType({typeId:r.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}newAuthMismatchError({auth:r,values:e}){return new Error(`Expected auth type ${r.type}, got ${e.type}`)}newParameterNotRecognizedError(r){return new Error(`"${r}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:r,value:e}){return new Error(`Expected ${r}, got ${typeof e}`)}includeRequestBodyInWrappedRequest({body:r,inlineFileProperties:e}){switch(r.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:r,inlineFileProperties:e});default:b(r)}}includeFileUploadBodyInWrappedRequest({fileUpload:r,inlineFileProperties:e}){return this.fileUploadHasBodyProperties({fileUpload:r})||e&&this.fileUploadHasFileProperties({fileUpload:r})}fileUploadHasBodyProperties({fileUpload:r}){return r.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:b(e)}})}fileUploadHasFileProperties({fileUpload:r}){return r.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:b(e)}})}isListTypeReference(r){return r.type==="optional"?this.isListTypeReference(r.value):r.type==="list"||r.type==="set"}parsedEndpointMatches({endpoint:r,parsedEndpoint:e}){return r.location.method===e.method&&r.location.path===e.path}};u();f();var d={};$e(d,{AstNode:()=>w,ClassInstantiation:()=>re,CodeBlock:()=>Z,Comment:()=>_,Function:()=>X,FunctionInvocation:()=>Q,MethodInvocation:()=>ee,Parameter:()=>K,Reference:()=>W,Type:()=>V,TypeLiteral:()=>k,Types:()=>V,Variable:()=>J,Writer:()=>$,codeblock:()=>po,function_:()=>co,instantiateClass:()=>mo,invokeFunction:()=>ho,invokeMethod:()=>xo,parameter:()=>yo,reference:()=>go,variable:()=>wo});u();f();u();f();u();f();u();f();u();f();u();f();var $=class extends ie{constructor({customConfig:e,formatter:n}){super();p(this,"customConfig");p(this,"formatter");p(this,"imports",{});p(this,"defaultImports",{});p(this,"starImportAliases",{});p(this,"starImportAliasesInverse",{});this.customConfig=e,this.formatter=n!=null?n:new oe}addImport(e){var n,i,o;if(e.importFrom!=null){switch(e.importFrom.type){case"default":{this.validateDefault(e);break}case"named":{this.validateNamed(e);break}case"star":{this.validateStar(e);break}}let a=(o=(n=this.imports)[i=e.importFrom.moduleName])!=null?o:n[i]=[];a.map(m=>m.name).includes(e.name)||a.push(e)}}validateDefault(e){var i,o,a,l;if(((i=e.importFrom)==null?void 0:i.type)!=="default")return;let n=(l=(o=this.defaultImports)[a=e.importFrom.moduleName])!=null?l:o[a]=e;if(n.name!==e.name)throw new Error(`Cannot have multiple default imports for module ${e.importFrom.moduleName}: got ${e.name} but already had ${n.name}`)}validateNamed(e){var a,l,m,h,y;if(((a=e.importFrom)==null?void 0:a.type)!=="named")return;let i=((l=this.imports[e.importFrom.moduleName])!=null?l:[]).filter(x=>{var v;return((v=x.importFrom)==null?void 0:v.type)==="star"});if(i.length>0)throw new Error(`Cannot add named import ${e.name} because non-named imports ${i.map(x=>x.name)} already exist`);let o=[];for(let x of Object.values(this.imports))for(let v of x)((m=v.importFrom)==null?void 0:m.type)==="named"&&v.importFrom.moduleName!==e.importFrom.moduleName&&v.name===e.name&&o.push(v);if(o.length>0)throw new Error(`Cannot add named import from module ${e.importFrom.moduleName} because it is already imported from ${(y=(h=o[0])==null?void 0:h.importFrom)==null?void 0:y.moduleName}`)}validateStar(e){var o,a,l,m,h,y,x;if(((o=e.importFrom)==null?void 0:o.type)!=="star")return;let n=(m=(a=this.starImportAliases)[l=e.importFrom.moduleName])!=null?m:a[l]=e.importFrom.starImportAlias;if(n!==e.importFrom.starImportAlias)throw new Error(`Cannot have more than one alias for non-named imports from a module: got ${e.importFrom.starImportAlias} but already have ${n}.`);if(((x=(h=this.starImportAliasesInverse)[y=e.importFrom.starImportAlias])!=null?x:h[y]=e.importFrom.moduleName)!==e.importFrom.moduleName)throw new Error(`Attempted to use alias ${e.importFrom.starImportAlias} for more than one module in the same file`)}};var fe=class extends ${constructor({customConfig:r,formatter:e}){super({customConfig:r,formatter:e})}async toStringAsync(){let r=this.getContent();if(this.formatter!=null)try{return this.formatter.format(r)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
9
- ${r}`)}return r}toString(){let r=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(r)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
10
- ${r}`)}return r}getContent(){let r=this.stringifyImports();return r.length>0?r+`
11
- `+this.buffer:this.buffer}stringifyImports(){let r="";for(let[e,n]of Object.entries(this.imports)){let i=this.defaultImports[e],o="",a=n.filter(m=>{var h;return((h=m.importFrom)==null?void 0:h.type)==="named"}),l=this.starImportAliases[e];if(a.length>0||i!=null||l!=null){if(r+="import",i!=null&&(r+=` ${i.name}`),a.length>0){for(let h of a.slice(0,-1))o+=`${h.name}, `;let m=a[a.length-1];m!=null&&(o+=`${m.name}`),i!=null&&(r+=","),r+=` { ${o} }`}l!=null&&((i!=null||a.length>0)&&(r+=", "),r+=` * as ${l}`),r+=` from "${e}";
12
- `}}return r}};var w=class extends j{async toStringAsync({customConfig:r,formatter:e}){let n=new fe({customConfig:r,formatter:e});return this.write(n),await n.toStringAsync()}toString({customConfig:r,formatter:e}){let n=new fe({customConfig:r,formatter:e});return this.write(n),n.toString()}};u();f();var Z=class extends w{constructor(e){super();p(this,"args");this.args=e}write(e){return new B(this.args).write(e)}};u();f();var V=class extends w{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"string":e.write("string");break;case"number":e.write("number");break;case"bigint":e.write("bigint");break;case"boolean":e.write("boolean");break;case"array":this.internalType.valueType.write(e),e.write("[]");break;case"map":e.write("Record<"),this.internalType.keyType.write(e),e.write(", "),this.internalType.valueType.write(e),e.write(">");break;case"object":e.write("{"),e.indent();for(let[n,i]of Object.entries(this.internalType.fields))e.write(`${n}: `),i.write(e),e.writeLine(",");e.dedent(),e.write("}");break;case"enum":e.write("enum");break;case"any":e.write("any");break;case"promise":e.write("Promise<"),this.internalType.value.write(e),e.write(">");break;case"unknown":e.write("unknown");break;case"void":e.write("void");break;case"undefined":e.write("undefined");break;case"null":e.write("null");break;case"never":e.write("never");break;case"nop":break;default:b(this.internalType)}}static string(){return new this({type:"string"})}static number(){return new this({type:"number"})}static bigint(){return new this({type:"bigint"})}static boolean(){return new this({type:"boolean"})}static array(e){return new this({type:"array",valueType:e})}static object(e){return new this({type:"object",fields:e})}static enum(e){return new this({type:"enum",values:e})}static any(){return new this({type:"any"})}static promise(e){return e.internalType.type==="promise"?e:new this({type:"promise",value:e})}static unknown(){return new this({type:"unknown"})}static void(){return new this({type:"void"})}static undefined(){return new this({type:"undefined"})}static null(){return new this({type:"null"})}static never(){return new this({type:"never"})}static nop(){return new this({type:"nop"})}};u();f();var k=class t extends w{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){var o,a;let n=!!((o=e.customConfig)!=null&&o.noSerdeLayer),i=!!((a=e.customConfig)!=null&&a.useBigInt);switch(this.internalType.type){case"array":{this.writeIterable({writer:e,iterable:this.internalType});break}case"blob":{if(n){e.writeNode(t.string(this.internalType.value));return}e.write("new Blob(["),e.writeNode(t.string(this.internalType.value)),e.write("])");break}case"boolean":{e.write(this.internalType.value.toString());break}case"bigint":{if(i){e.write(`BigInt(${this.internalType.value.toString()})`);return}e.write(`"${this.internalType.value.toString()}"`);return}case"datetime":{if(n){e.writeNode(t.string(this.internalType.value));return}e.write("new Date("),e.writeNode(t.string(this.internalType.value)),e.write(")");break}case"number":{e.write(this.internalType.value.toString());break}case"object":{this.writeObject({writer:e,object:this.internalType});break}case"record":{this.writeRecord({writer:e,record:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"set":{if(n||this.isSetOfObjects()){e.writeNode(t.array({values:this.internalType.values}));return}e.write("new Set("),this.writeIterable({writer:e,iterable:this.internalType}),e.write(")");break}case"string":{this.internalType.value.includes(`
7
+ `)}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 a=t[o];a!=null&&n(a)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
8
+ `)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*ao)}};u();f();var be=class{},oe=class extends be{async format(t){return t}formatSync(t){return t}};u();f();u();f();u();f();u();f();var ae=class{constructor(){p(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}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]}}};u();f();var g={Critical:"CRITICAL",Warning:"WARNING"},se=class r{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(Me(Oe({},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 ue=class{constructor({ir:t,config:e}){p(this,"config");p(this,"errors");p(this,"_ir");p(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.errors=new se,this.httpEndpointReferenceParser=new ae}associateQueryParametersByWireValue({parameters:t,values:e}){let n=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let a=t.find(m=>m.name.wireValue===i);if(a==null)throw this.newParameterNotRecognizedError(i);let l=this.isListTypeReference(a.typeReference)&&!Array.isArray(o)?[o]:o;n.push({name:a.name,typeReference:a.typeReference,value:l})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:n}){let i=[];for(let[o,a]of Object.entries(e)){this.errors.scope(o);try{let l=t.find(m=>m.name.wireValue===o);if(l==null){if(n)continue;this.errors.add({severity:g.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:l.name,typeReference:l.typeReference,value:a})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:t,record:e}){let n=e[t.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:g.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:g.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:g.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:g.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:g.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:g.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:g.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let a=t.types[o];if(a==null){this.errors.add({severity:g.Critical,message:`No type found for discriminant value "${o}"`});return}let h=n,{[i]:l}=h,m=je(h,[De(i)]);return{singleDiscriminatedUnionType:a,discriminantValue:a.discriminantValue,value:m}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocationOrThrow(t){let e=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:t})&&e.push(n);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:b(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:b(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:g.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:g.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:g.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(re(n.urls));for(let o of re(t))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:g.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${re(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:g.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:b(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:b(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:b(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}};u();f();var d={};$e(d,{AstNode:()=>w,ClassInstantiation:()=>te,CodeBlock:()=>Z,Comment:()=>_,Function:()=>X,FunctionInvocation:()=>Q,MethodInvocation:()=>ee,Parameter:()=>K,Reference:()=>W,Type:()=>V,TypeLiteral:()=>C,Types:()=>V,Variable:()=>J,Writer:()=>$,codeblock:()=>po,function_:()=>co,instantiateClass:()=>mo,invokeFunction:()=>ho,invokeMethod:()=>xo,parameter:()=>yo,reference:()=>go,variable:()=>wo});u();f();u();f();u();f();u();f();u();f();u();f();var $=class extends ie{constructor({customConfig:e,formatter:n}){super();p(this,"customConfig");p(this,"formatter");p(this,"imports",{});p(this,"defaultImports",{});p(this,"starImportAliases",{});p(this,"starImportAliasesInverse",{});this.customConfig=e,this.formatter=n!=null?n:new oe}addImport(e){var n,i,o;if(e.importFrom!=null){switch(e.importFrom.type){case"default":{this.validateDefault(e);break}case"named":{this.validateNamed(e);break}case"star":{this.validateStar(e);break}}let a=(o=(n=this.imports)[i=e.importFrom.moduleName])!=null?o:n[i]=[];a.map(m=>m.name).includes(e.name)||a.push(e)}}validateDefault(e){var i,o,a,l;if(((i=e.importFrom)==null?void 0:i.type)!=="default")return;let n=(l=(o=this.defaultImports)[a=e.importFrom.moduleName])!=null?l:o[a]=e;if(n.name!==e.name)throw new Error(`Cannot have multiple default imports for module ${e.importFrom.moduleName}: got ${e.name} but already had ${n.name}`)}validateNamed(e){var a,l,m,h,y;if(((a=e.importFrom)==null?void 0:a.type)!=="named")return;let i=((l=this.imports[e.importFrom.moduleName])!=null?l:[]).filter(x=>{var v;return((v=x.importFrom)==null?void 0:v.type)==="star"});if(i.length>0)throw new Error(`Cannot add named import ${e.name} because non-named imports ${i.map(x=>x.name)} already exist`);let o=[];for(let x of Object.values(this.imports))for(let v of x)((m=v.importFrom)==null?void 0:m.type)==="named"&&v.importFrom.moduleName!==e.importFrom.moduleName&&v.name===e.name&&o.push(v);if(o.length>0)throw new Error(`Cannot add named import from module ${e.importFrom.moduleName} because it is already imported from ${(y=(h=o[0])==null?void 0:h.importFrom)==null?void 0:y.moduleName}`)}validateStar(e){var o,a,l,m,h,y,x;if(((o=e.importFrom)==null?void 0:o.type)!=="star")return;let n=(m=(a=this.starImportAliases)[l=e.importFrom.moduleName])!=null?m:a[l]=e.importFrom.starImportAlias;if(n!==e.importFrom.starImportAlias)throw new Error(`Cannot have more than one alias for non-named imports from a module: got ${e.importFrom.starImportAlias} but already have ${n}.`);if(((x=(h=this.starImportAliasesInverse)[y=e.importFrom.starImportAlias])!=null?x:h[y]=e.importFrom.moduleName)!==e.importFrom.moduleName)throw new Error(`Attempted to use alias ${e.importFrom.starImportAlias} for more than one module in the same file`)}};var fe=class extends ${constructor({customConfig:t,formatter:e}){super({customConfig:t,formatter:e})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
9
+ ${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
10
+ ${t}`)}return t}getContent(){let t=this.stringifyImports();return t.length>0?t+`
11
+ `+this.buffer:this.buffer}stringifyImports(){let t="";for(let[e,n]of Object.entries(this.imports)){let i=this.defaultImports[e],o="",a=n.filter(m=>{var h;return((h=m.importFrom)==null?void 0:h.type)==="named"}),l=this.starImportAliases[e];if(a.length>0||i!=null||l!=null){if(t+="import",i!=null&&(t+=` ${i.name}`),a.length>0){for(let h of a.slice(0,-1))o+=`${h.name}, `;let m=a[a.length-1];m!=null&&(o+=`${m.name}`),i!=null&&(t+=","),t+=` { ${o} }`}l!=null&&((i!=null||a.length>0)&&(t+=", "),t+=` * as ${l}`),t+=` from "${e}";
12
+ `}}return t}};var w=class extends j{async toStringAsync({customConfig:t,formatter:e}){let n=new fe({customConfig:t,formatter:e});return this.write(n),await n.toStringAsync()}toString({customConfig:t,formatter:e}){let n=new fe({customConfig:t,formatter:e});return this.write(n),n.toString()}};u();f();var Z=class extends w{constructor(e){super();p(this,"args");this.args=e}write(e){return new S(this.args).write(e)}};u();f();var V=class extends w{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"string":e.write("string");break;case"number":e.write("number");break;case"bigint":e.write("bigint");break;case"boolean":e.write("boolean");break;case"array":this.internalType.valueType.write(e),e.write("[]");break;case"map":e.write("Record<"),this.internalType.keyType.write(e),e.write(", "),this.internalType.valueType.write(e),e.write(">");break;case"object":e.write("{"),e.indent();for(let[n,i]of Object.entries(this.internalType.fields))e.write(`${n}: `),i.write(e),e.writeLine(",");e.dedent(),e.write("}");break;case"enum":e.write("enum");break;case"any":e.write("any");break;case"promise":e.write("Promise<"),this.internalType.value.write(e),e.write(">");break;case"unknown":e.write("unknown");break;case"void":e.write("void");break;case"undefined":e.write("undefined");break;case"null":e.write("null");break;case"never":e.write("never");break;case"nop":break;default:b(this.internalType)}}static string(){return new this({type:"string"})}static number(){return new this({type:"number"})}static bigint(){return new this({type:"bigint"})}static boolean(){return new this({type:"boolean"})}static array(e){return new this({type:"array",valueType:e})}static object(e){return new this({type:"object",fields:e})}static enum(e){return new this({type:"enum",values:e})}static any(){return new this({type:"any"})}static promise(e){return e.internalType.type==="promise"?e:new this({type:"promise",value:e})}static unknown(){return new this({type:"unknown"})}static void(){return new this({type:"void"})}static undefined(){return new this({type:"undefined"})}static null(){return new this({type:"null"})}static never(){return new this({type:"never"})}static nop(){return new this({type:"nop"})}};u();f();var C=class r extends w{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){var o,a;let n=!!((o=e.customConfig)!=null&&o.noSerdeLayer),i=!!((a=e.customConfig)!=null&&a.useBigInt);switch(this.internalType.type){case"array":{this.writeIterable({writer:e,iterable:this.internalType});break}case"blob":{if(n){e.writeNode(r.string(this.internalType.value));return}e.write("new Blob(["),e.writeNode(r.string(this.internalType.value)),e.write("])");break}case"boolean":{e.write(this.internalType.value.toString());break}case"bigint":{if(i){e.write(`BigInt("${this.internalType.value.toString()}")`);return}e.write(`"${this.internalType.value.toString()}"`);return}case"datetime":{if(n){e.writeNode(r.string(this.internalType.value));return}e.write("new Date("),e.writeNode(r.string(this.internalType.value)),e.write(")");break}case"number":{e.write(this.internalType.value.toString());break}case"object":{this.writeObject({writer:e,object:this.internalType});break}case"record":{this.writeRecord({writer:e,record:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"set":{if(n||this.isSetOfObjects()){e.writeNode(r.array({values:this.internalType.values}));return}e.write("new Set("),this.writeIterable({writer:e,iterable:this.internalType}),e.write(")");break}case"string":{this.internalType.value.includes(`
13
13
  `)?this.writeStringWithBackticks({writer:e,value:this.internalType.value}):e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}case"tuple":{this.writeIterable({writer:e,iterable:this.internalType});break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:b(this.internalType)}}isObject(){return this.internalType.type==="object"}asObjectOrThrow(){if(this.isObject())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not an object")}isSet(){return this.internalType.type==="set"}asSetOrThrow(){if(this.isSet())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a set")}isSetOfObjects(){return this.isSet()&&this.asSetOrThrow().values.every(e=>e.isObject())}writeStringWithBackticks({writer:e,value:n}){e.write("`");let i=n.split(`
14
14
  `),o=i[0]+`
15
15
  `,a=i.slice(1).join(`
16
- `);e.write(o.replaceAll("`","\\`")),e.writeNoIndent(a.replaceAll("`","\\`")),e.write("`")}writeIterable({writer:e,iterable:n}){let i=fo({values:n.values});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeRecord({writer:e,record:n}){let i=uo({entries:n.entries});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.key.write(e),e.write(": "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeObject({writer:e,object:n}){let i=so({fields:n.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}static array({values:e}){return new this({type:"array",values:e})}static bigint(e){return new this({type:"bigint",value:e})}static blob(e){return new this({type:"blob",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static object({fields:e}){return new this({type:"object",fields:e})}static record({entries:e}){return new this({type:"record",entries:e})}static reference(e){return new this({type:"reference",value:e})}static set({values:e}){return new this({type:"set",values:e})}static string(e){return new this({type:"string",value:e})}static tuple({values:e}){return new this({type:"tuple",values:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:e,value:n});return}this.writeUnknownObject({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:e,value:n}){if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of n)e.writeNode(t.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownObject({writer:e,value:n}){let i=Object.entries(n);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,a]of i)e.write(`${o}: `),e.writeNode(t.unknown(a)),e.writeLine(",");e.dedent(),e.write("}")}};function so({fields:t}){return t.filter(r=>!k.isNop(r.value))}function uo({entries:t}){return t.filter(r=>!k.isNop(r.key)&&!k.isNop(r.value))}function fo({values:t}){return t.filter(r=>!k.isNop(r))}u();f();var W=class extends w{constructor({name:e,importFrom:n,memberName:i}){super();p(this,"name");p(this,"importFrom");p(this,"memberName");this.name=e,this.importFrom=n,this.memberName=i}write(e){var o;this.importFrom!=null&&e.addImport(this);let n=((o=this.importFrom)==null?void 0:o.type)==="star"?`${this.importFrom.starImportAlias}.`:"",i=this.memberName!=null?`.${this.memberName}`:"";e.write(`${n}${this.name}${i}`)}};u();f();var J=class extends w{constructor(e){super();p(this,"args");this.args=e}write(e){this.args.export&&e.write("export "),this.args.const?e.write("const "):e.write("let "),e.write(`${this.args.name} = `),e.writeNode(this.args.initializer)}};u();f();u();f();var _=class extends w{constructor({docs:e}={docs:void 0}){super();p(this,"docs");this.docs=e}write(e){this.docs!=null&&(e.writeLine("/**"),this.docs.split(`
17
- `).forEach(n=>{e.writeLine(` * ${n}`)}),e.writeLine("*/"))}};var K=class extends w{constructor({name:e,type:n,docs:i}){super();p(this,"name");p(this,"type");p(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){this.docs!=null&&e.writeNode(new _({docs:this.docs})),e.write(`${this.name}: `),this.type.write(e)}};u();f();var X=class extends w{constructor({name:e,parameters:n,async:i,body:o,return_:a,docs:l}){super();p(this,"name");p(this,"parameters");p(this,"async");p(this,"body");p(this,"return_");p(this,"docs");this.name=e,this.parameters=n,this.async=i!=null?i:!1,this.body=o,this.return_=a,this.docs=l}write(e){var n;e.writeNode(new _({docs:this.docs})),this.async&&e.write("async "),e.write("function "),e.write(`${this.name}`),this.writeParameters(e),this.return_!=null&&(e.write(": "),e.writeNode(this.async?V.promise(this.return_):this.return_)),e.writeLine(" {"),e.indent(),(n=this.body)==null||n.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeParameters(e){if(this.parameters.length===0){e.write("()");return}e.indent(),e.writeLine("(");for(let n of this.parameters)e.writeNode(n),e.writeLine(",");e.dedent(),e.write(")")}};u();f();var Q=class extends w{constructor({function_:e,arguments_:n}){super();p(this,"function_");p(this,"arguments_");this.function_=e,this.arguments_=n}write(e){e.writeNode(this.function_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:n=>n.write(e)}),e.write(")")}};u();f();var ee=class extends w{constructor({on:e,method:n,arguments_:i,async:o}){super();p(this,"on");p(this,"method");p(this,"arguments_");p(this,"async");this.on=e,this.method=n,this.arguments_=i,this.async=o}write(e){this.async&&e.write("await "),this.on.write(e),e.write("."),e.write(this.method),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:n=>n.write(e)}),e.write(")")}};u();f();var re=class extends w{constructor({class_:e,arguments_:n}){super();p(this,"class_");p(this,"arguments_");this.class_=e,this.arguments_=n}write(e){e.write("new "),e.writeNode(this.class_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:n=>n.write(e)}),e.write(")")}};function po(t){return new Z(t)}function co(t){return new X(t)}function mo(t){return new re(t)}function ho(t){return new Q(t)}function xo(t){return new ee(t)}function yo(t){return new K(t)}function go(t){return new W(t)}function wo(t){return new J(t)}u();f();u();f();function Fe({generatorConfig:t,isPackagePrivate:r}){var n;let e=t.output.mode;switch(e.type){case"downloadFiles":return;case"publish":return{packageName:e.registriesV2.npm.packageName,version:e.version,private:r,publishInfo:{registryUrl:e.registriesV2.npm.registryUrl,token:e.registriesV2.npm.token},license:void 0,repoUrl:void 0};case"github":if(e.publishInfo!=null&&e.publishInfo.type!=="npm")throw new Error(`Expected to receive npm publish info but received ${e.publishInfo.type} instead`);return{packageName:e.publishInfo!=null?e.publishInfo.packageName:"",version:e.version,private:r,publishInfo:void 0,repoUrl:e.repoUrl,license:(n=t.license)==null?void 0:n._visit({basic:i=>i.id,custom:i=>`See ${i.filename}`,_other:()=>{}})};default:throw new Error(`Encountered unknown output mode: ${e}`)}}u();f();function Pe({organization:t,workspaceName:r,namespaceExport:e}){return e!=null?e:`${q(ve(t))}${q(ve(r))}`}u();f();var vo="value",Te=class{constructor({context:r}){p(this,"context");this.context=r}convert(r){if(r.value===null)return this.context.isNullable(r.typeReference)?d.TypeLiteral.null():(this.context.errors.add({severity:g.Critical,message:"Expected non-null value, but got null"}),d.TypeLiteral.nop());if(r.value===void 0)return d.TypeLiteral.nop();switch(r.typeReference.type){case"list":return this.convertList({list:r.typeReference.value,value:r.value});case"literal":return this.convertLiteral({literalType:r.typeReference.value,value:r.value});case"map":return this.convertMap({map:r.typeReference,value:r.value});case"named":{let e=this.context.resolveNamedType({typeId:r.typeReference.value});return e==null?d.TypeLiteral.nop():this.convertNamed({named:e,value:r.value,as:r.as})}case"optional":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"nullable":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"primitive":return this.convertPrimitive({primitive:r.typeReference.value,value:r.value,as:r.as});case"set":return this.convertSet({set:r.typeReference.value,value:r.value});case"unknown":return this.convertUnknown({value:r.value});default:b(r.typeReference)}}convertLiteral({literalType:r,value:e}){switch(r.type){case"boolean":{let n=this.context.getValueAsBoolean({value:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.string(n)}default:b(r)}}convertList({list:r,value:e}){return Array.isArray(e)?d.TypeLiteral.array({values:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:r,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:g.Critical,message:`Expected array but got: ${typeof e}`}),d.TypeLiteral.nop())}convertSet({set:r,value:e}){return Array.isArray(e)?d.TypeLiteral.set({values:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:r,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:g.Critical,message:`Expected array but got: ${typeof e}`}),d.TypeLiteral.nop())}convertMap({map:r,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:g.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),d.TypeLiteral.nop()):d.TypeLiteral.record({entries:Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:r.key,value:n,as:"key"}),value:this.convert({typeReference:r.value,value:i})}}finally{this.context.errors.unscope()}})})}convertNamed({named:r,value:e,as:n}){var i;switch(r.type){case"alias":return(i=this.context.customConfig)!=null&&i.useBrandedStringAliases?d.TypeLiteral.reference(d.codeblock(o=>{o.writeNode(d.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:r.declaration})})),o.write("("),o.writeNode(this.convert({typeReference:r.typeReference,value:e,as:n})),o.write(")")})):this.convert({typeReference:r.typeReference,value:e,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:r,value:e});case"enum":return this.convertEnum({enum_:r,value:e});case"object":return this.convertObject({object_:r,value:e});case"undiscriminatedUnion":return this.convertUndicriminatedUnion({undicriminatedUnion:r,value:e});default:b(r)}}convertDiscriminatedUnion({discriminatedUnion:r,value:e}){var l;let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:r,value:e});if(n==null)return d.TypeLiteral.nop();let i=n.singleDiscriminatedUnionType,o=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});if(o==null)return d.TypeLiteral.nop();if((l=this.context.customConfig)!=null&&l.includeUtilsOnUnionMembers)return d.TypeLiteral.reference(d.codeblock(m=>{m.writeNode(d.invokeMethod({on:d.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:r.declaration})}),method:this.context.getMethodName(i.discriminantValue.name),arguments_:this.convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:n,unionVariant:i,unionProperties:o})}))}));let a={name:this.context.getPropertyName(r.discriminant.name),value:d.TypeLiteral.string(i.discriminantValue.wireValue)};return d.TypeLiteral.object({fields:[a,...o]})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:r,unionVariant:e}){let n=this.getBaseFields({discriminatedUnionTypeInstance:r,singleDiscriminatedUnionType:e});switch(e.type){case"samePropertiesAsObject":{let i=this.context.resolveNamedType({typeId:e.typeId});if(i==null)return;let o=this.convertNamed({named:i,value:r.value});if(!o.isObject()){this.context.errors.add({severity:g.Critical,message:"Internal error; expected union value to be an object"});return}let a=o.asObjectOrThrow();return[...n,...a.fields]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let i=this.context.getRecord(r.value);return i==null?[...n,{name:vo,value:this.convert({typeReference:e.typeReference,value:r.value})}]:[...n,{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:i[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return n;default:b(e)}}convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:r,unionVariant:e,unionProperties:n}){return e.type==="singleProperty"&&this.context.getRecord(r.value)==null&&n.length===1?[this.convert({typeReference:e.typeReference,value:r.value})]:n.length>0?[d.TypeLiteral.object({fields:n})]:[]}getBaseFields({discriminatedUnionTypeInstance:r,singleDiscriminatedUnionType:e}){var i,o;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(o=this.context.getRecord(r.value))!=null?o:{},ignoreMissingParameters:!0}).map(a=>{this.context.errors.scope(a.name.wireValue);try{return{name:this.context.getPropertyName(a.name.name),value:this.convert(a)}}finally{this.context.errors.unscope()}})}convertObject({object_:r,value:e}){var i;let n=this.context.associateByWireValue({parameters:r.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return d.TypeLiteral.object({fields:n.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getPropertyName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:r,value:e}){let n=this.getEnumValue({enum_:r,value:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.string(n)}getEnumValue({enum_:r,value:e}){if(typeof e!="string"){this.context.errors.add({severity:g.Critical,message:`Expected enum value string, got: ${typeof e}`});return}if(r.values.find(i=>i.wireValue===e)==null){this.context.errors.add({severity:g.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return e}convertUndicriminatedUnion({undicriminatedUnion:r,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undicriminatedUnion:r,value:e});return n==null?d.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undicriminatedUnion:r,value:e}){for(let n of r.types)try{return this.convert({typeReference:n,value:e})}catch(i){continue}this.context.errors.add({severity:g.Critical,message:`None of the types in the undicriminated union matched the given "${typeof e}" value`})}convertUnknown({value:r}){return d.TypeLiteral.unknown(r)}convertPrimitive({primitive:r,value:e,as:n}){var i,o;switch(r){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:e,as:n});return a==null?d.TypeLiteral.nop():d.TypeLiteral.number(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:e,as:n});return a==null?d.TypeLiteral.nop():(i=this.context.customConfig)!=null&&i.useBigInt?d.TypeLiteral.bigint(BigInt(a)):d.TypeLiteral.number(a)}case"FLOAT":case"DOUBLE":{let a=this.getValueAsNumber({value:e});return a==null?d.TypeLiteral.nop():d.TypeLiteral.number(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:e,as:n});return a==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(a)}case"BASE_64":case"DATE":case"UUID":case"STRING":{let a=this.context.getValueAsString({value:e});return a==null?d.TypeLiteral.nop():d.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:e});return a==null?d.TypeLiteral.nop():d.TypeLiteral.datetime(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:e});return a==null?d.TypeLiteral.nop():(o=this.context.customConfig)!=null&&o.useBigInt?d.TypeLiteral.bigint(BigInt(a)):d.TypeLiteral.string(a)}default:b(r)}}getValueAsNumber({value:r,as:e}){let n=e==="key"&&typeof r=="string"?Number(r):r;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:r,as:e}){let n=e==="key"?typeof r=="string"?r==="true":r==="false"?!1:r:r;return this.context.getValueAsBoolean({value:n})}};u();f();var Ae=class{constructor({context:r}){p(this,"context");this.context=r}getFilePropertyInfo({body:r,value:e}){var o;let n={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let a of r.properties)switch(a.type){case"file":n.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getSingleFileProperty({property:a,record:i})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getArrayFileProperty({property:a,record:i})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(a.name.name),value:this.getBodyProperty({property:a,record:i})});break;default:b(a)}return n}getSingleFileProperty({property:r,record:e}){let n=this.context.getSingleFileValue({property:r,record:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.blob(n)}getArrayFileProperty({property:r,record:e}){let n=this.context.getFileArrayValues({property:r,record:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.array({values:n.map(i=>d.TypeLiteral.blob(i))})}getBodyProperty({property:r,record:e}){let n=e[r.name.wireValue];return n==null?d.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:r.typeReference,value:n})}};var Be=class t extends ue{constructor({ir:e,config:n}){var i;super({ir:e,config:n});p(this,"ir");p(this,"customConfig");p(this,"dynamicTypeLiteralMapper");p(this,"filePropertyMapper");p(this,"moduleName");p(this,"namespaceExport");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new Te({context:this}),this.filePropertyMapper=new Ae({context:this}),this.moduleName=bo({config:n,customConfig:this.customConfig}),this.namespaceExport=Pe({organization:n.organization,workspaceName:n.workspaceName,namespaceExport:(i=this.customConfig)==null?void 0:i.namespaceExport})}clone(){return new t({ir:this.ir,config:this.config})}getModuleImport(){return{type:"named",moduleName:this.moduleName}}getRootClientName(){return`${this.namespaceExport}Client`}getPropertyName(e){var n,i;return(n=this.customConfig)!=null&&n.retainOriginalCasing||(i=this.customConfig)!=null&&i.noSerdeLayer?this.formatOriginalPropertyName(e.originalName):e.camelCase.unsafeName}getMethodName(e){return e.camelCase.unsafeName}getTypeName(e){return e.pascalCase.unsafeName}getEnvironmentTypeReferenceFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return this.getEnvironmentsTypeReference(n)}getFullyQualifiedReference({declaration:e}){return e.fernFilepath.allParts.length>0?`${e.fernFilepath.allParts.map(n=>n.camelCase.unsafeName).join(".")}.${this.getTypeName(e.name)}`:`${this.getTypeName(e.name)}`}getEnvironmentsTypeReference(e){return d.reference({name:`${this.namespaceExport}Environments`,importFrom:this.getModuleImport(),memberName:this.getTypeName(e)})}formatOriginalPropertyName(e){return e.includes("-")?`"${e}"`:e}};function bo({config:t,customConfig:r}){var e,n,i;return(i=(n=Fe({generatorConfig:t,isPackagePrivate:(e=r==null?void 0:r.private)!=null?e:!1}))==null?void 0:n.packageName)!=null?i:t.organization}0&&(module.exports={DynamicSnippetsGeneratorContext});
16
+ `);e.write(o.replaceAll("`","\\`")),e.writeNoIndent(a.replaceAll("`","\\`")),e.write("`")}writeIterable({writer:e,iterable:n}){let i=fo({values:n.values});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeRecord({writer:e,record:n}){let i=uo({entries:n.entries});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.key.write(e),e.write(": "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeObject({writer:e,object:n}){let i=so({fields:n.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}static array({values:e}){return new this({type:"array",values:e})}static bigint(e){return new this({type:"bigint",value:e})}static blob(e){return new this({type:"blob",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static object({fields:e}){return new this({type:"object",fields:e})}static record({entries:e}){return new this({type:"record",entries:e})}static reference(e){return new this({type:"reference",value:e})}static set({values:e}){return new this({type:"set",values:e})}static string(e){return new this({type:"string",value:e})}static tuple({values:e}){return new this({type:"tuple",values:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:e,value:n});return}this.writeUnknownObject({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:e,value:n}){if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of n)e.writeNode(r.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownObject({writer:e,value:n}){let i=Object.entries(n);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,a]of i)e.write(`${o}: `),e.writeNode(r.unknown(a)),e.writeLine(",");e.dedent(),e.write("}")}};function so({fields:r}){return r.filter(t=>!C.isNop(t.value))}function uo({entries:r}){return r.filter(t=>!C.isNop(t.key)&&!C.isNop(t.value))}function fo({values:r}){return r.filter(t=>!C.isNop(t))}u();f();var W=class extends w{constructor({name:e,importFrom:n,memberName:i}){super();p(this,"name");p(this,"importFrom");p(this,"memberName");this.name=e,this.importFrom=n,this.memberName=i}write(e){var o;this.importFrom!=null&&e.addImport(this);let n=((o=this.importFrom)==null?void 0:o.type)==="star"?`${this.importFrom.starImportAlias}.`:"",i=this.memberName!=null?`.${this.memberName}`:"";e.write(`${n}${this.name}${i}`)}};u();f();var J=class extends w{constructor(e){super();p(this,"args");this.args=e}write(e){this.args.export&&e.write("export "),this.args.const?e.write("const "):e.write("let "),e.write(`${this.args.name} = `),e.writeNode(this.args.initializer)}};u();f();u();f();var _=class extends w{constructor({docs:e}={docs:void 0}){super();p(this,"docs");this.docs=e}write(e){this.docs!=null&&(e.writeLine("/**"),this.docs.split(`
17
+ `).forEach(n=>{e.writeLine(` * ${n}`)}),e.writeLine("*/"))}};var K=class extends w{constructor({name:e,type:n,docs:i}){super();p(this,"name");p(this,"type");p(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){this.docs!=null&&e.writeNode(new _({docs:this.docs})),e.write(`${this.name}: `),this.type.write(e)}};u();f();var X=class extends w{constructor({name:e,parameters:n,async:i,body:o,return_:a,docs:l}){super();p(this,"name");p(this,"parameters");p(this,"async");p(this,"body");p(this,"return_");p(this,"docs");this.name=e,this.parameters=n,this.async=i!=null?i:!1,this.body=o,this.return_=a,this.docs=l}write(e){var n;e.writeNode(new _({docs:this.docs})),this.async&&e.write("async "),e.write("function "),e.write(`${this.name}`),this.writeParameters(e),this.return_!=null&&(e.write(": "),e.writeNode(this.async?V.promise(this.return_):this.return_)),e.writeLine(" {"),e.indent(),(n=this.body)==null||n.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeParameters(e){if(this.parameters.length===0){e.write("()");return}e.indent(),e.writeLine("(");for(let n of this.parameters)e.writeNode(n),e.writeLine(",");e.dedent(),e.write(")")}};u();f();var Q=class extends w{constructor({function_:e,arguments_:n}){super();p(this,"function_");p(this,"arguments_");this.function_=e,this.arguments_=n}write(e){e.writeNode(this.function_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:n=>n.write(e)}),e.write(")")}};u();f();var ee=class extends w{constructor({on:e,method:n,arguments_:i,async:o}){super();p(this,"on");p(this,"method");p(this,"arguments_");p(this,"async");this.on=e,this.method=n,this.arguments_=i,this.async=o}write(e){this.async&&e.write("await "),this.on.write(e),e.write("."),e.write(this.method),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:n=>n.write(e)}),e.write(")")}};u();f();var te=class extends w{constructor({class_:e,arguments_:n}){super();p(this,"class_");p(this,"arguments_");this.class_=e,this.arguments_=n}write(e){e.write("new "),e.writeNode(this.class_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:n=>n.write(e)}),e.write(")")}};function po(r){return new Z(r)}function co(r){return new X(r)}function mo(r){return new te(r)}function ho(r){return new Q(r)}function xo(r){return new ee(r)}function yo(r){return new K(r)}function go(r){return new W(r)}function wo(r){return new J(r)}u();f();u();f();function Fe({generatorConfig:r,isPackagePrivate:t}){var n;let e=r.output.mode;switch(e.type){case"downloadFiles":return;case"publish":return{packageName:e.registriesV2.npm.packageName,version:e.version,private:t,publishInfo:{registryUrl:e.registriesV2.npm.registryUrl,token:e.registriesV2.npm.token},license:void 0,repoUrl:void 0};case"github":if(e.publishInfo!=null&&e.publishInfo.type!=="npm")throw new Error(`Expected to receive npm publish info but received ${e.publishInfo.type} instead`);return{packageName:e.publishInfo!=null?e.publishInfo.packageName:"",version:e.version,private:t,publishInfo:void 0,repoUrl:e.repoUrl,license:(n=r.license)==null?void 0:n._visit({basic:i=>i.id,custom:i=>`See ${i.filename}`,_other:()=>{}})};default:throw new Error(`Encountered unknown output mode: ${e}`)}}u();f();function Be({organization:r,workspaceName:t,namespaceExport:e}){return e!=null?e:`${q(ve(r))}${q(ve(t))}`}u();f();var vo="value",Te=class{constructor({context:t}){p(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?d.TypeLiteral.null():(this.context.errors.add({severity:g.Critical,message:"Expected non-null value, but got null"}),d.TypeLiteral.nop());if(t.value===void 0)return d.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literalType:t.typeReference.value,value:t.value});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?d.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"nullable":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 this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return this.convertUnknown({value:t.value});default:b(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let n=this.context.getValueAsBoolean({value:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.string(n)}default:b(t)}}convertList({list:t,value:e}){return Array.isArray(e)?d.TypeLiteral.array({values:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:g.Critical,message:`Expected array but got: ${typeof e}`}),d.TypeLiteral.nop())}convertSet({set:t,value:e}){return Array.isArray(e)?d.TypeLiteral.set({values:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:g.Critical,message:`Expected array but got: ${typeof e}`}),d.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:g.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),d.TypeLiteral.nop()):d.TypeLiteral.record({entries:Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:t.key,value:n,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:n}){var i;switch(t.type){case"alias":return(i=this.context.customConfig)!=null&&i.useBrandedStringAliases?d.TypeLiteral.reference(d.codeblock(o=>{o.writeNode(d.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:t.declaration})})),o.write("("),o.writeNode(this.convert({typeReference:t.typeReference,value:e,as:n})),o.write(")")})):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});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:b(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){var l;let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(n==null)return d.TypeLiteral.nop();let i=n.singleDiscriminatedUnionType,o=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});if(o==null)return d.TypeLiteral.nop();if((l=this.context.customConfig)!=null&&l.includeUtilsOnUnionMembers)return d.TypeLiteral.reference(d.codeblock(m=>{m.writeNode(d.invokeMethod({on:d.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:t.declaration})}),method:this.context.getMethodName(i.discriminantValue.name),arguments_:this.convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:n,unionVariant:i,unionProperties:o})}))}));let a={name:this.context.getPropertyName(t.discriminant.name),value:d.TypeLiteral.string(i.discriminantValue.wireValue)};return d.TypeLiteral.object({fields:[a,...o]})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){let n=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});switch(e.type){case"samePropertiesAsObject":{let i=this.context.resolveNamedType({typeId:e.typeId});if(i==null)return;let o=this.convertNamed({named:i,value:t.value});if(!o.isObject()){this.context.errors.add({severity:g.Critical,message:"Internal error; expected union value to be an object"});return}let a=o.asObjectOrThrow();return[...n,...a.fields]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let i=this.context.getRecord(t.value);return i==null?[...n,{name:vo,value:this.convert({typeReference:e.typeReference,value:t.value})}]:[...n,{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:i[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return n;default:b(e)}}convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:t,unionVariant:e,unionProperties:n}){return e.type==="singleProperty"&&this.context.getRecord(t.value)==null&&n.length===1?[this.convert({typeReference:e.typeReference,value:t.value})]:n.length>0?[d.TypeLiteral.object({fields:n})]:[]}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i,o;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(o=this.context.getRecord(t.value))!=null?o:{},ignoreMissingParameters:!0}).map(a=>{this.context.errors.scope(a.name.wireValue);try{return{name:this.context.getPropertyName(a.name.name),value:this.convert(a)}}finally{this.context.errors.unscope()}})}convertObject({object_:t,value:e}){var i;let n=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return d.TypeLiteral.object({fields:n.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getPropertyName(o.name.name),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?d.TypeLiteral.nop():d.TypeLiteral.string(n)}getEnumValue({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:g.Critical,message:`Expected enum value string, got: ${typeof e}`});return}if(t.values.find(i=>i.wireValue===e)==null){this.context.errors.add({severity:g.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return e}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return n==null?d.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{return this.convert({typeReference:n,value:e})}catch(i){continue}this.context.errors.add({severity:g.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return d.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:n}){var i,o;switch(t){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:e,as:n});return a==null?d.TypeLiteral.nop():d.TypeLiteral.number(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:e,as:n});return a==null?d.TypeLiteral.nop():(i=this.context.customConfig)!=null&&i.useBigInt?d.TypeLiteral.bigint(BigInt(a)):d.TypeLiteral.number(a)}case"FLOAT":case"DOUBLE":{let a=this.getValueAsNumber({value:e});return a==null?d.TypeLiteral.nop():d.TypeLiteral.number(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:e,as:n});return a==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(a)}case"BASE_64":case"DATE":case"UUID":case"STRING":{let a=this.context.getValueAsString({value:e});return a==null?d.TypeLiteral.nop():d.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:e});return a==null?d.TypeLiteral.nop():d.TypeLiteral.datetime(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:e});return a==null?d.TypeLiteral.nop():(o=this.context.customConfig)!=null&&o.useBigInt?d.TypeLiteral.bigint(BigInt(a)):d.TypeLiteral.string(a)}default:b(t)}}getValueAsNumber({value:t,as:e}){let n=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:t,as:e}){let n=e==="key"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:n})}};u();f();var Ae=class{constructor({context:t}){p(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 a of t.properties)switch(a.type){case"file":n.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getSingleFileProperty({property:a,record:i})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getArrayFileProperty({property:a,record:i})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(a.name.name),value:this.getBodyProperty({property:a,record:i})});break;default:b(a)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.blob(n)}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return n==null?d.TypeLiteral.nop():d.TypeLiteral.array({values:n.map(i=>d.TypeLiteral.blob(i))})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?d.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:n})}};var Pe=class r extends ue{constructor({ir:e,config:n}){var i;super({ir:e,config:n});p(this,"ir");p(this,"customConfig");p(this,"dynamicTypeLiteralMapper");p(this,"filePropertyMapper");p(this,"moduleName");p(this,"namespaceExport");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new Te({context:this}),this.filePropertyMapper=new Ae({context:this}),this.moduleName=bo({config:n,customConfig:this.customConfig}),this.namespaceExport=Be({organization:n.organization,workspaceName:n.workspaceName,namespaceExport:(i=this.customConfig)==null?void 0:i.namespaceExport})}clone(){return new r({ir:this.ir,config:this.config})}getModuleImport(){return{type:"named",moduleName:this.moduleName}}getRootClientName(){return`${this.namespaceExport}Client`}getPropertyName(e){var n,i;return(n=this.customConfig)!=null&&n.retainOriginalCasing||(i=this.customConfig)!=null&&i.noSerdeLayer?this.formatOriginalPropertyName(e.originalName):e.camelCase.unsafeName}getMethodName(e){return e.camelCase.unsafeName}getTypeName(e){return e.pascalCase.unsafeName}getEnvironmentTypeReferenceFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return this.getEnvironmentsTypeReference(n)}getFullyQualifiedReference({declaration:e}){return e.fernFilepath.allParts.length>0?`${e.fernFilepath.allParts.map(n=>n.camelCase.unsafeName).join(".")}.${this.getTypeName(e.name)}`:`${this.getTypeName(e.name)}`}getEnvironmentsTypeReference(e){return d.reference({name:`${this.namespaceExport}Environment`,importFrom:this.getModuleImport(),memberName:this.getTypeName(e)})}formatOriginalPropertyName(e){return e.includes("-")?`"${e}"`:e}};function bo({config:r,customConfig:t}){var e,n,i;return(i=(n=Fe({generatorConfig:r,isPackagePrivate:(e=t==null?void 0:t.private)!=null?e:!1}))==null?void 0:n.packageName)!=null?i:r.organization}0&&(module.exports={DynamicSnippetsGeneratorContext});
18
18
  /*! Bundled license information:
19
19
 
20
20
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -1,4 +1,4 @@
1
1
  import '@fern-api/browser-compatible-base-generator';
2
2
  import '@fern-api/dynamic-ir-sdk';
3
3
  import '@fern-api/typescript-ast';
4
- export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-DFkk3dho.cjs';
4
+ export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-CmDa2k9n.cjs';