@fern-api/php-dynamic-snippets 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DynamicSnippetsGenerator.cjs +7 -7
- package/cjs/EndpointSnippetGenerator.cjs +7 -7
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +6 -6
- package/cjs/context/DynamicTypeLiteralMapper.cjs +6 -6
- package/cjs/context/FilePropertyMapper.cjs +12 -12
- package/cjs/index.cjs +11 -11
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/{chunk-5YGLJUYD.js → chunk-HG5P4KWD.js} +1 -1
- package/esm/{chunk-YELOIV6Y.js → chunk-HHDXN7HB.js} +1 -1
- package/esm/{chunk-G6X3OBKW.js → chunk-JFJ3XGKL.js} +1 -1
- package/esm/{chunk-MMCQWL5J.js → chunk-KYYOS3EX.js} +2 -2
- package/esm/chunk-LHXTVBUM.js +28 -0
- package/esm/{chunk-7HKG5U5F.js → chunk-NXDI62IP.js} +1 -1
- package/esm/{chunk-BGMLQMW7.js → chunk-ZDJ3DR2Z.js} +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeLiteralMapper.js +1 -1
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +1 -1
- package/esm/chunk-ZFTBBCKC.js +0 -28
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";var Ae=Object.defineProperty,Cr=Object.defineProperties,Ir=Object.getOwnPropertyDescriptor,Sr=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Fe=(n,t,e)=>t in n?Ae(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,se=(n,t)=>{for(var e in t||(t={}))Oe.call(t,e)&&Fe(n,e,t[e]);if(Te)for(var e of Te(t))He.call(t,e)&&Fe(n,e,t[e]);return n},fe=(n,t)=>Cr(n,Sr(t));var Ze=n=>typeof n=="symbol"?n:n+"",Je=(n,t)=>{var e={};for(var r in n)Oe.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&Te)for(var r of Te(n))t.indexOf(r)<0&&He.call(n,r)&&(e[r]=n[r]);return e};var De=(n,t)=>()=>(n&&(t=n(n=0)),t);var Ke=(n,t)=>{for(var e in t)Ae(n,e,{get:t[e],enumerable:!0})},Ur=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kr(t))!Oe.call(n,i)&&i!==e&&Ae(n,i,{get:()=>t[i],enumerable:!(r=Ir(t,i))||r.enumerable});return n};var Pr=n=>Ur(Ae({},"__esModule",{value:!0}),n);var p=(n,t,e)=>Fe(n,typeof t!="symbol"?t+"":t,e);function Xe(){throw new Error("setTimeout has not been defined")}function et(){throw new Error("clearTimeout has not been defined")}function tt(n){if(W===setTimeout)return setTimeout(n,0);if((W===Xe||!W)&&setTimeout)return W=setTimeout,setTimeout(n,0);try{return W(n,0)}catch(t){try{return W.call(null,n,0)}catch(e){return W.call(this,n,0)}}}function _r(n){if(V===clearTimeout)return clearTimeout(n);if((V===et||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(n);try{return V(n)}catch(t){try{return V.call(null,n)}catch(e){return V.call(this,n)}}}function Br(){!pe||!Z||(pe=!1,Z.length?P=Z.concat(P):be=-1,P.length&&rt())}function rt(){if(!pe){var n=tt(Br);pe=!0;for(var t=P.length;t;){for(Z=P,P=[];++be<t;)Z&&Z[be].run();be=-1,t=P.length}Z=null,pe=!1,_r(n)}}function Mr(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];P.push(new nt(n,t)),P.length===1&&!pe&&tt(rt)}function nt(n,t){this.fun=n,this.array=t}function J(){}function Xr(n){throw new Error("process.binding is not supported")}function en(){return"/"}function tn(n){throw new Error("process.chdir is not supported")}function rn(){return 0}function on(n){var t=nn.call(ue)*.001,e=Math.floor(t),r=Math.floor(t%1*1e9);return n&&(e=e-n[0],r=r-n[1],r<0&&(e--,r+=1e9)),[e,r]}function sn(){var n=new Date,t=n-an;return t/1e3}var W,V,P,pe,Z,be,Fr,Or,Dr,$r,Wr,Vr,jr,Yr,zr,Gr,qr,Hr,Zr,Jr,Kr,Qr,ue,nn,an,c,Qe,f=De(()=>{"use strict";W=Xe,V=et;typeof globalThis.setTimeout=="function"&&(W=setTimeout);typeof globalThis.clearTimeout=="function"&&(V=clearTimeout);P=[],pe=!1,be=-1;nt.prototype.run=function(){this.fun.apply(null,this.array)};Fr="browser",Or="browser",Dr=!0,$r={},Wr=[],Vr="",jr={},Yr={},zr={};Gr=J,qr=J,Hr=J,Zr=J,Jr=J,Kr=J,Qr=J;ue=globalThis.performance||{},nn=ue.now||ue.mozNow||ue.msNow||ue.oNow||ue.webkitNow||function(){return new Date().getTime()};an=new Date;c={nextTick:Mr,title:Fr,browser:Dr,env:$r,argv:Wr,version:Vr,versions:jr,on:Gr,addListener:qr,once:Hr,off:Zr,removeListener:Jr,removeAllListeners:Kr,emit:Qr,binding:Xr,cwd:en,chdir:tn,umask:rn,hrtime:on,platform:Or,release:Yr,config:zr,uptime:sn},Qe={};Object.keys(Qe).forEach(n=>{let t=n.split("."),e=c;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=Qe[n]:e=e[i]||(e[i]={})}})});function st(){We=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)S[t]=n[t],L[n.charCodeAt(t)]=t;L[45]=62,L[95]=63}function un(n){We||st();var t,e,r,i,o,a,l=n.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[l-2]==="="?2:n[l-1]==="="?1:0,a=new fn(l*3/4-o),r=o>0?l-4:l;var m=0;for(t=0,e=0;t<r;t+=4,e+=3)i=L[n.charCodeAt(t)]<<18|L[n.charCodeAt(t+1)]<<12|L[n.charCodeAt(t+2)]<<6|L[n.charCodeAt(t+3)],a[m++]=i>>16&255,a[m++]=i>>8&255,a[m++]=i&255;return o===2?(i=L[n.charCodeAt(t)]<<2|L[n.charCodeAt(t+1)]>>4,a[m++]=i&255):o===1&&(i=L[n.charCodeAt(t)]<<10|L[n.charCodeAt(t+1)]<<4|L[n.charCodeAt(t+2)]>>2,a[m++]=i>>8&255,a[m++]=i&255),a}function pn(n){return S[n>>18&63]+S[n>>12&63]+S[n>>6&63]+S[n&63]}function ln(n,t,e){for(var r,i=[],o=t;o<e;o+=3)r=(n[o]<<16)+(n[o+1]<<8)+n[o+2],i.push(pn(r));return i.join("")}function it(n){We||st();for(var t,e=n.length,r=e%3,i="",o=[],a=16383,l=0,m=e-r;l<m;l+=a)o.push(ln(n,l,l+a>m?m:l+a));return r===1?(t=n[e-1],i+=S[t>>2],i+=S[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=S[t>>10],i+=S[t>>4&63],i+=S[t<<2&63],i+="="),o.push(i),o.join("")}function Ee(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(n,t){if(Ee()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Ve(this,n)}return ft(this,n,t,e)}function ft(n,t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?dn(n,t,e,r):typeof t=="string"?mn(n,t,e):hn(n,t)}function ut(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function cn(n,t,e,r){return ut(t),t<=0?_(n,t):e!==void 0?typeof r=="string"?_(n,t).fill(e,r):_(n,t).fill(e):_(n,t)}function Ve(n,t){if(ut(t),n=_(n,t<0?0:je(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function mn(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=pt(t,e)|0;n=_(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function $e(n,t){var e=t.length<0?0:je(t.length)|0;n=_(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function dn(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=$e(n,t),n}function hn(n,t){if(k(t)){var e=je(t.length)|0;return n=_(n,e),n.length===0||t.copy(n,0,0,e),n}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||_n(t.length)?_(n,0):$e(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return $e(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function je(n){if(n>=Ee())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ee().toString(16)+" bytes");return n|0}function k(n){return!!(n!=null&&n._isBuffer)}function pt(n,t){if(k(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var e=n.length;if(e===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Re(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return yt(n).length;default:if(r)return Re(n).length;t=(""+t).toLowerCase(),r=!0}}function xn(n,t,e){var r=!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(n||(n="utf8");;)switch(n){case"hex":return Nn(this,t,e);case"utf8":case"utf-8":return mt(this,t,e);case"ascii":return En(this,t,e);case"latin1":case"binary":return Rn(this,t,e);case"base64":return An(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ln(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function K(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function lt(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),k(t))return t.length===0?-1:ot(n,t,e,r,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):ot(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function ot(n,t,e,r,i){var o=1,a=n.length,l=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;o=2,a/=2,l/=2,e/=2}function m(R,ae){return o===1?R[ae]:R.readUInt16BE(ae*o)}var h;if(i){var y=-1;for(h=e;h<a;h++)if(m(n,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 w=!0,C=0;C<l;C++)if(m(n,h+C)!==m(t,C)){w=!1;break}if(w)return h}return-1}function yn(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var l=parseInt(t.substr(a*2,2),16);if(isNaN(l))return a;n[e+a]=l}return a}function wn(n,t,e,r){return Ce(Re(t,n.length-e),n,e,r)}function ct(n,t,e,r){return Ce(Un(t),n,e,r)}function gn(n,t,e,r){return ct(n,t,e,r)}function vn(n,t,e,r){return Ce(yt(t),n,e,r)}function Tn(n,t,e,r){return Ce(Pn(t,n.length-e),n,e,r)}function An(n,t,e){return t===0&&e===n.length?it(n):it(n.slice(t,e))}function mt(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=e){var m,h,y,w;switch(l){case 1:o<128&&(a=o);break;case 2:m=n[i+1],(m&192)===128&&(w=(o&31)<<6|m&63,w>127&&(a=w));break;case 3:m=n[i+1],h=n[i+2],(m&192)===128&&(h&192)===128&&(w=(o&15)<<12|(m&63)<<6|h&63,w>2047&&(w<55296||w>57343)&&(a=w));break;case 4:m=n[i+1],h=n[i+2],y=n[i+3],(m&192)===128&&(h&192)===128&&(y&192)===128&&(w=(o&15)<<18|(m&63)<<12|(h&63)<<6|y&63,w>65535&&w<1114112&&(a=w))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=l}return bn(r)}function bn(n){var t=n.length;if(t<=at)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=at));return e}function En(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]&127);return r}function Rn(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]);return r}function Nn(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var i="",o=t;o<e;++o)i+=kn(n[o]);return i}function Ln(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}function v(n,t,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function E(n,t,e,r,i,o){if(!k(n))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+r>n.length)throw new RangeError("Index out of range")}function Ne(n,t,e,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(n.length-e,2);i<o;++i)n[e+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}function Le(n,t,e,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(n.length-e,4);i<o;++i)n[e+i]=t>>>(r?i:3-i)*8&255}function dt(n,t,e,r,i,o){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ht(n,t,e,r,i){return i||dt(n,t,e,4,34028234663852886e22,-34028234663852886e22),gt(n,t,e,r,23,4),e+4}function xt(n,t,e,r,i){return i||dt(n,t,e,8,17976931348623157e292,-17976931348623157e292),gt(n,t,e,r,52,8),e+8}function In(n){if(n=Sn(n).replace(Cn,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function Sn(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function kn(n){return n<16?"0"+n.toString(16):n.toString(16)}function Re(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],a=0;a<r;++a){if(e=n.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(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 Un(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Pn(n,t){for(var e,r,i,o=[],a=0;a<n.length&&!((t-=2)<0);++a)e=n.charCodeAt(a),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function yt(n){return un(In(n))}function Ce(n,t,e,r){for(var i=0;i<r&&!(i+e>=t.length||i>=n.length);++i)t[i+e]=n[i];return i}function _n(n){return n!==n}function Bn(n){return n!=null&&(!!n._isBuffer||wt(n)||Mn(n))}function wt(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Mn(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&wt(n.slice(0,0))}function Ie(n,t,e,r,i){var o,a,l=i*8-r-1,m=(1<<l)-1,h=m>>1,y=-7,w=e?i-1:0,C=e?-1:1,R=n[t+w];for(w+=C,o=R&(1<<-y)-1,R>>=-y,y+=l;y>0;o=o*256+n[t+w],w+=C,y-=8);for(a=o&(1<<-y)-1,o>>=-y,y+=r;y>0;a=a*256+n[t+w],w+=C,y-=8);if(o===0)o=1-h;else{if(o===m)return a?NaN:(R?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-h}return(R?-1:1)*a*Math.pow(2,o-r)}function gt(n,t,e,r,i,o){var a,l,m,h=o*8-i-1,y=(1<<h)-1,w=y>>1,C=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=r?0:o-1,ae=r?1:-1,Lr=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+w>=1?t+=C/m:t+=C*Math.pow(2,1-w),t*m>=2&&(a++,m/=2),a+w>=y?(l=0,a=y):a+w>=1?(l=(t*m-1)*Math.pow(2,i),a=a+w):(l=t*Math.pow(2,w-1)*Math.pow(2,i),a=0));i>=8;n[e+R]=l&255,R+=ae,l/=256,i-=8);for(a=a<<i|l,h+=i;h>0;n[e+R]=a&255,R+=ae,a/=256,h-=8);n[e+R-ae]|=Lr*128}var S,L,fn,We,at,Cn,vt=De(()=>{"use strict";f();u();S=[],L=[],fn=typeof Uint8Array!="undefined"?Uint8Array:Array,We=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return ft(null,n,t,e)};s.kMaxLength=Ee();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return cn(null,n,t,e)};s.allocUnsafe=function(n){return Ve(null,n)};s.allocUnsafeSlow=function(n){return Ve(null,n)};s.isBuffer=Bn;s.compare=function(t,e){if(!k(t)||!k(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,a=Math.min(r,i);o<a;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?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 r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!k(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};s.byteLength=pt;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)K(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)K(this,e,e+3),K(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)K(this,e,e+7),K(this,e+1,e+6),K(this,e+2,e+5),K(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?mt(this,0,t):xn.apply(this,arguments)};s.prototype.equals=function(t){if(!k(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,i,o){if(!k(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=r)return 0;if(i>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,l=r-e,m=Math.min(a,l),h=this.slice(i,o),y=t.slice(e,r),w=0;w<m;++w)if(h[w]!==y[w]){a=h[w],l=y[w];break}return a<l?-1:l<a?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return lt(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return lt(this,t,e,r,!1)};s.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<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 yn(this,t,e,r);case"utf8":case"utf-8":return wn(this,t,e,r);case"ascii":return ct(this,t,e,r);case"latin1":case"binary":return gn(this,t,e,r);case"base64":return vn(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tn(this,t,e,r);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)}};at=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),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,r){t=t|0,e=e|0,r||v(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,r){t=t|0,e=e|0,r||v(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||v(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||v(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||v(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||v(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||v(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||v(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,r){t=t|0,e=e|0,r||v(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||v(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.prototype.readInt32LE=function(t,e){return e||v(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||v(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||v(t,4,this.length),Ie(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||v(t,4,this.length),Ie(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||v(t,8,this.length),Ie(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||v(t,8,this.length),Ie(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;E(this,t,e,r,o,0)}var a=1,l=0;for(this[e]=t&255;++l<r&&(a*=256);)this[e+l]=t/a&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;E(this,t,e,r,o,0)}var a=r-1,l=1;for(this[e+a]=t&255;--a>=0&&(l*=256);)this[e+a]=t/l&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||E(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,r){return t=+t,e=e|0,r||E(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Ne(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||E(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Ne(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||E(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):Le(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||E(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):Le(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);E(this,t,e,r,o-1,-o)}var a=0,l=1,m=0;for(this[e]=t&255;++a<r&&(l*=256);)t<0&&m===0&&this[e+a-1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+r};s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);E(this,t,e,r,o-1,-o)}var a=r-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+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||E(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,r){return t=+t,e=e|0,r||E(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Ne(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||E(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Ne(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||E(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):Le(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||E(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):Le(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return ht(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return ht(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return xt(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return xt(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-r&&(i=t.length-e+r);var o=i-r,a;if(this===t&&r<e&&e<i)for(a=o-1;a>=0;--a)t[a+e]=this[a+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};s.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=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<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var a;if(typeof t=="number")for(a=e;a<r;++a)this[a]=t;else{var l=k(t)?t:Re(new s(t,i).toString()),m=l.length;for(a=0;a<r-e;++a)this[a+e]=l[a%m]}return this};Cn=/[^+\/0-9A-Za-z-_]/g});var u=De(()=>{"use strict";vt()});var ea={};Ke(ea,{DynamicSnippetsGeneratorContext:()=>qe});module.exports=Pr(ea);f();u();f();u();f();u();f();u();f();u();f();u();f();u();var Fn=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Tt=Fn;var On=typeof self=="object"&&self&&self.Object===Object&&self,Dn=Tt||On||Function("return this")(),At=Dn;var $n=At.Symbol,B=$n;f();u();var bt=Object.prototype,Wn=bt.hasOwnProperty,Vn=bt.toString,de=B?B.toStringTag:void 0;function jn(n){var t=Wn.call(n,de),e=n[de];try{n[de]=void 0;var r=!0}catch(o){}var i=Vn.call(n);return r&&(t?n[de]=e:delete n[de]),i}var Et=jn;f();u();var Yn=Object.prototype,zn=Yn.toString;function Gn(n){return zn.call(n)}var Rt=Gn;var qn="[object Null]",Hn="[object Undefined]",Nt=B?B.toStringTag:void 0;function Zn(n){return n==null?n===void 0?Hn:qn:Nt&&Nt in Object(n)?Et(n):Rt(n)}var Lt=Zn;f();u();function Jn(n){return n!=null&&typeof n=="object"}var Ct=Jn;var Kn="[object Symbol]";function Qn(n){return typeof n=="symbol"||Ct(n)&&Lt(n)==Kn}var It=Qn;f();u();f();u();function Xn(n,t){for(var e=-1,r=n==null?0:n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}var St=Xn;f();u();var ei=Array.isArray,kt=ei;var ti=1/0,Ut=B?B.prototype:void 0,Pt=Ut?Ut.toString:void 0;function _t(n){if(typeof n=="string")return n;if(kt(n))return St(n,_t)+"";if(It(n))return Pt?Pt.call(n):"";var t=n+"";return t=="0"&&1/n==-ti?"-0":t}var Bt=_t;f();u();function ri(n){return n==null?"":Bt(n)}var j=ri;f();u();f();u();f();u();f();u();f();u();f();u();function ni(n,t,e){var r=-1,i=n.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);++r<i;)o[r]=n[r+t];return o}var Mt=ni;function ii(n,t,e){var r=n.length;return e=e===void 0?r:e,!t&&e>=r?n:Mt(n,t,e)}var Ft=ii;f();u();var oi="\\ud800-\\udfff",ai="\\u0300-\\u036f",si="\\ufe20-\\ufe2f",fi="\\u20d0-\\u20ff",ui=ai+si+fi,pi="\\ufe0e\\ufe0f",li="\\u200d",ci=RegExp("["+li+oi+ui+pi+"]");function mi(n){return ci.test(n)}var Se=mi;f();u();f();u();function di(n){return n.split("")}var Ot=di;f();u();var Dt="\\ud800-\\udfff",hi="\\u0300-\\u036f",xi="\\ufe20-\\ufe2f",yi="\\u20d0-\\u20ff",wi=hi+xi+yi,gi="\\ufe0e\\ufe0f",vi="["+Dt+"]",Ye="["+wi+"]",ze="\\ud83c[\\udffb-\\udfff]",Ti="(?:"+Ye+"|"+ze+")",$t="[^"+Dt+"]",Wt="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ai="\\u200d",jt=Ti+"?",Yt="["+gi+"]?",bi="(?:"+Ai+"(?:"+[$t,Wt,Vt].join("|")+")"+Yt+jt+")*",Ei=Yt+jt+bi,Ri="(?:"+[$t+Ye+"?",Ye,Wt,Vt,vi].join("|")+")",Ni=RegExp(ze+"(?="+ze+")|"+Ri+Ei,"g");function Li(n){return n.match(Ni)||[]}var zt=Li;function Ci(n){return Se(n)?zt(n):Ot(n)}var Gt=Ci;function Ii(n){return function(t){t=j(t);var e=Se(t)?Gt(t):void 0,r=e?e[0]:t.charAt(0),i=e?Ft(e,1).join(""):t.slice(1);return r[n]()+i}}var qt=Ii;var Si=qt("toUpperCase"),le=Si;function ki(n){return le(j(n).toLowerCase())}var Ht=ki;f();u();f();u();function Ui(n,t,e,r){var i=-1,o=n==null?0:n.length;for(r&&o&&(e=n[++i]);++i<o;)e=t(e,n[i],i,n);return e}var Zt=Ui;f();u();f();u();f();u();function Pi(n){return function(t){return n==null?void 0:n[t]}}var Jt=Pi;var _i={\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"},Bi=Jt(_i),Kt=Bi;var Mi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fi="\\u0300-\\u036f",Oi="\\ufe20-\\ufe2f",Di="\\u20d0-\\u20ff",$i=Fi+Oi+Di,Wi="["+$i+"]",Vi=RegExp(Wi,"g");function ji(n){return n=j(n),n&&n.replace(Mi,Kt).replace(Vi,"")}var Qt=ji;f();u();f();u();var Yi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function zi(n){return n.match(Yi)||[]}var Xt=zi;f();u();var Gi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function qi(n){return Gi.test(n)}var er=qi;f();u();var or="\\ud800-\\udfff",Hi="\\u0300-\\u036f",Zi="\\ufe20-\\ufe2f",Ji="\\u20d0-\\u20ff",Ki=Hi+Zi+Ji,ar="\\u2700-\\u27bf",sr="a-z\\xdf-\\xf6\\xf8-\\xff",Qi="\\xac\\xb1\\xd7\\xf7",Xi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",eo="\\u2000-\\u206f",to=" \\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",fr="A-Z\\xc0-\\xd6\\xd8-\\xde",ro="\\ufe0e\\ufe0f",ur=Qi+Xi+eo+to,pr="['\u2019]",tr="["+ur+"]",no="["+Ki+"]",lr="\\d+",io="["+ar+"]",cr="["+sr+"]",mr="[^"+or+ur+lr+ar+sr+fr+"]",oo="\\ud83c[\\udffb-\\udfff]",ao="(?:"+no+"|"+oo+")",so="[^"+or+"]",dr="(?:\\ud83c[\\udde6-\\uddff]){2}",hr="[\\ud800-\\udbff][\\udc00-\\udfff]",ce="["+fr+"]",fo="\\u200d",rr="(?:"+cr+"|"+mr+")",uo="(?:"+ce+"|"+mr+")",nr="(?:"+pr+"(?:d|ll|m|re|s|t|ve))?",ir="(?:"+pr+"(?:D|LL|M|RE|S|T|VE))?",xr=ao+"?",yr="["+ro+"]?",po="(?:"+fo+"(?:"+[so,dr,hr].join("|")+")"+yr+xr+")*",lo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",co="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mo=yr+xr+po,ho="(?:"+[io,dr,hr].join("|")+")"+mo,xo=RegExp([ce+"?"+cr+"+"+nr+"(?="+[tr,ce,"$"].join("|")+")",uo+"+"+ir+"(?="+[tr,ce+rr,"$"].join("|")+")",ce+"?"+rr+"+"+nr,ce+"+"+ir,co,lo,lr,ho].join("|"),"g");function yo(n){return n.match(xo)||[]}var wr=yo;function wo(n,t,e){return n=j(n),t=e?void 0:t,t===void 0?er(n)?wr(n):Xt(n):n.match(t)||[]}var gr=wo;var go="['\u2019]",vo=RegExp(go,"g");function To(n){return function(t){return Zt(gr(Qt(t).replace(vo,"")),n,"")}}var vr=To;var Ao=vr(function(n,t,e){return t=t.toLowerCase(),n+(e?Ht(t):t)}),ke=Ao;f();u();f();u();function T(n){throw new Error("Unexpected value: "+JSON.stringify(n))}f();u();function he(n){return Object.keys(n)}f();u();f();u();var M=class{};f();u();f();u();var Y=class extends M{constructor(e){super();p(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var bo=4,xe=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(`
|
|
1
|
+
"use strict";var be=Object.defineProperty,Sr=Object.defineProperties,Ir=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyDescriptors,Ur=Object.getOwnPropertyNames,Ae=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Fe=(n,t,e)=>t in n?be(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,fe=(n,t)=>{for(var e in t||(t={}))Oe.call(t,e)&&Fe(n,e,t[e]);if(Ae)for(var e of Ae(t))He.call(t,e)&&Fe(n,e,t[e]);return n},ue=(n,t)=>Sr(n,kr(t));var Ze=n=>typeof n=="symbol"?n:n+"",Je=(n,t)=>{var e={};for(var r in n)Oe.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&Ae)for(var r of Ae(n))t.indexOf(r)<0&&He.call(n,r)&&(e[r]=n[r]);return e};var De=(n,t)=>()=>(n&&(t=n(n=0)),t);var Ke=(n,t)=>{for(var e in t)be(n,e,{get:t[e],enumerable:!0})},Pr=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ur(t))!Oe.call(n,i)&&i!==e&&be(n,i,{get:()=>t[i],enumerable:!(r=Ir(t,i))||r.enumerable});return n};var _r=n=>Pr(be({},"__esModule",{value:!0}),n);var p=(n,t,e)=>Fe(n,typeof t!="symbol"?t+"":t,e);function Xe(){throw new Error("setTimeout has not been defined")}function et(){throw new Error("clearTimeout has not been defined")}function tt(n){if(W===setTimeout)return setTimeout(n,0);if((W===Xe||!W)&&setTimeout)return W=setTimeout,setTimeout(n,0);try{return W(n,0)}catch(t){try{return W.call(null,n,0)}catch(e){return W.call(this,n,0)}}}function Br(n){if(V===clearTimeout)return clearTimeout(n);if((V===et||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(n);try{return V(n)}catch(t){try{return V.call(null,n)}catch(e){return V.call(this,n)}}}function Mr(){!le||!J||(le=!1,J.length?P=J.concat(P):Ee=-1,P.length&&rt())}function rt(){if(!le){var n=tt(Mr);le=!0;for(var t=P.length;t;){for(J=P,P=[];++Ee<t;)J&&J[Ee].run();Ee=-1,t=P.length}J=null,le=!1,Br(n)}}function Fr(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];P.push(new nt(n,t)),P.length===1&&!le&&tt(rt)}function nt(n,t){this.fun=n,this.array=t}function K(){}function en(n){throw new Error("process.binding is not supported")}function tn(){return"/"}function rn(n){throw new Error("process.chdir is not supported")}function nn(){return 0}function an(n){var t=on.call(pe)*.001,e=Math.floor(t),r=Math.floor(t%1*1e9);return n&&(e=e-n[0],r=r-n[1],r<0&&(e--,r+=1e9)),[e,r]}function fn(){var n=new Date,t=n-sn;return t/1e3}var W,V,P,le,J,Ee,Or,Dr,$r,Wr,Vr,jr,Yr,zr,Gr,qr,Hr,Zr,Jr,Kr,Qr,Xr,pe,on,sn,c,Qe,f=De(()=>{"use strict";W=Xe,V=et;typeof globalThis.setTimeout=="function"&&(W=setTimeout);typeof globalThis.clearTimeout=="function"&&(V=clearTimeout);P=[],le=!1,Ee=-1;nt.prototype.run=function(){this.fun.apply(null,this.array)};Or="browser",Dr="browser",$r=!0,Wr={},Vr=[],jr="",Yr={},zr={},Gr={};qr=K,Hr=K,Zr=K,Jr=K,Kr=K,Qr=K,Xr=K;pe=globalThis.performance||{},on=pe.now||pe.mozNow||pe.msNow||pe.oNow||pe.webkitNow||function(){return new Date().getTime()};sn=new Date;c={nextTick:Fr,title:Or,browser:$r,env:Wr,argv:Vr,version:jr,versions:Yr,on:qr,addListener:Hr,once:Zr,off:Jr,removeListener:Kr,removeAllListeners:Qr,emit:Xr,binding:en,cwd:tn,chdir:rn,umask:nn,hrtime:an,platform:Dr,release:zr,config:Gr,uptime:fn},Qe={};Object.keys(Qe).forEach(n=>{let t=n.split("."),e=c;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=Qe[n]:e=e[i]||(e[i]={})}})});function st(){We=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)I[t]=n[t],L[n.charCodeAt(t)]=t;L[45]=62,L[95]=63}function pn(n){We||st();var t,e,r,i,o,a,l=n.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[l-2]==="="?2:n[l-1]==="="?1:0,a=new un(l*3/4-o),r=o>0?l-4:l;var m=0;for(t=0,e=0;t<r;t+=4,e+=3)i=L[n.charCodeAt(t)]<<18|L[n.charCodeAt(t+1)]<<12|L[n.charCodeAt(t+2)]<<6|L[n.charCodeAt(t+3)],a[m++]=i>>16&255,a[m++]=i>>8&255,a[m++]=i&255;return o===2?(i=L[n.charCodeAt(t)]<<2|L[n.charCodeAt(t+1)]>>4,a[m++]=i&255):o===1&&(i=L[n.charCodeAt(t)]<<10|L[n.charCodeAt(t+1)]<<4|L[n.charCodeAt(t+2)]>>2,a[m++]=i>>8&255,a[m++]=i&255),a}function ln(n){return I[n>>18&63]+I[n>>12&63]+I[n>>6&63]+I[n&63]}function cn(n,t,e){for(var r,i=[],o=t;o<e;o+=3)r=(n[o]<<16)+(n[o+1]<<8)+n[o+2],i.push(ln(r));return i.join("")}function it(n){We||st();for(var t,e=n.length,r=e%3,i="",o=[],a=16383,l=0,m=e-r;l<m;l+=a)o.push(cn(n,l,l+a>m?m:l+a));return r===1?(t=n[e-1],i+=I[t>>2],i+=I[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=I[t>>10],i+=I[t>>4&63],i+=I[t<<2&63],i+="="),o.push(i),o.join("")}function Re(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(n,t){if(Re()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Ve(this,n)}return ft(this,n,t,e)}function ft(n,t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?hn(n,t,e,r):typeof t=="string"?dn(n,t,e):xn(n,t)}function ut(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function mn(n,t,e,r){return ut(t),t<=0?_(n,t):e!==void 0?typeof r=="string"?_(n,t).fill(e,r):_(n,t).fill(e):_(n,t)}function Ve(n,t){if(ut(t),n=_(n,t<0?0:je(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function dn(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=pt(t,e)|0;n=_(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function $e(n,t){var e=t.length<0?0:je(t.length)|0;n=_(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function hn(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=$e(n,t),n}function xn(n,t){if(k(t)){var e=je(t.length)|0;return n=_(n,e),n.length===0||t.copy(n,0,0,e),n}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Bn(t.length)?_(n,0):$e(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return $e(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function je(n){if(n>=Re())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Re().toString(16)+" bytes");return n|0}function k(n){return!!(n!=null&&n._isBuffer)}function pt(n,t){if(k(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var e=n.length;if(e===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Ne(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return yt(n).length;default:if(r)return Ne(n).length;t=(""+t).toLowerCase(),r=!0}}function yn(n,t,e){var r=!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(n||(n="utf8");;)switch(n){case"hex":return Ln(this,t,e);case"utf8":case"utf-8":return mt(this,t,e);case"ascii":return Rn(this,t,e);case"latin1":case"binary":return Nn(this,t,e);case"base64":return bn(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Cn(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function Q(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function lt(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),k(t))return t.length===0?-1:ot(n,t,e,r,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):ot(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function ot(n,t,e,r,i){var o=1,a=n.length,l=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;o=2,a/=2,l/=2,e/=2}function m(R,se){return o===1?R[se]:R.readUInt16BE(se*o)}var h;if(i){var y=-1;for(h=e;h<a;h++)if(m(n,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 w=!0,C=0;C<l;C++)if(m(n,h+C)!==m(t,C)){w=!1;break}if(w)return h}return-1}function wn(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var l=parseInt(t.substr(a*2,2),16);if(isNaN(l))return a;n[e+a]=l}return a}function gn(n,t,e,r){return Se(Ne(t,n.length-e),n,e,r)}function ct(n,t,e,r){return Se(Pn(t),n,e,r)}function vn(n,t,e,r){return ct(n,t,e,r)}function Tn(n,t,e,r){return Se(yt(t),n,e,r)}function An(n,t,e,r){return Se(_n(t,n.length-e),n,e,r)}function bn(n,t,e){return t===0&&e===n.length?it(n):it(n.slice(t,e))}function mt(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=e){var m,h,y,w;switch(l){case 1:o<128&&(a=o);break;case 2:m=n[i+1],(m&192)===128&&(w=(o&31)<<6|m&63,w>127&&(a=w));break;case 3:m=n[i+1],h=n[i+2],(m&192)===128&&(h&192)===128&&(w=(o&15)<<12|(m&63)<<6|h&63,w>2047&&(w<55296||w>57343)&&(a=w));break;case 4:m=n[i+1],h=n[i+2],y=n[i+3],(m&192)===128&&(h&192)===128&&(y&192)===128&&(w=(o&15)<<18|(m&63)<<12|(h&63)<<6|y&63,w>65535&&w<1114112&&(a=w))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=l}return En(r)}function En(n){var t=n.length;if(t<=at)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=at));return e}function Rn(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]&127);return r}function Nn(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]);return r}function Ln(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var i="",o=t;o<e;++o)i+=Un(n[o]);return i}function Cn(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}function v(n,t,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function E(n,t,e,r,i,o){if(!k(n))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+r>n.length)throw new RangeError("Index out of range")}function Le(n,t,e,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(n.length-e,2);i<o;++i)n[e+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}function Ce(n,t,e,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(n.length-e,4);i<o;++i)n[e+i]=t>>>(r?i:3-i)*8&255}function dt(n,t,e,r,i,o){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ht(n,t,e,r,i){return i||dt(n,t,e,4,34028234663852886e22,-34028234663852886e22),gt(n,t,e,r,23,4),e+4}function xt(n,t,e,r,i){return i||dt(n,t,e,8,17976931348623157e292,-17976931348623157e292),gt(n,t,e,r,52,8),e+8}function In(n){if(n=kn(n).replace(Sn,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function kn(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Un(n){return n<16?"0"+n.toString(16):n.toString(16)}function Ne(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],a=0;a<r;++a){if(e=n.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(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 Pn(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function _n(n,t){for(var e,r,i,o=[],a=0;a<n.length&&!((t-=2)<0);++a)e=n.charCodeAt(a),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function yt(n){return pn(In(n))}function Se(n,t,e,r){for(var i=0;i<r&&!(i+e>=t.length||i>=n.length);++i)t[i+e]=n[i];return i}function Bn(n){return n!==n}function Mn(n){return n!=null&&(!!n._isBuffer||wt(n)||Fn(n))}function wt(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Fn(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&wt(n.slice(0,0))}function Ie(n,t,e,r,i){var o,a,l=i*8-r-1,m=(1<<l)-1,h=m>>1,y=-7,w=e?i-1:0,C=e?-1:1,R=n[t+w];for(w+=C,o=R&(1<<-y)-1,R>>=-y,y+=l;y>0;o=o*256+n[t+w],w+=C,y-=8);for(a=o&(1<<-y)-1,o>>=-y,y+=r;y>0;a=a*256+n[t+w],w+=C,y-=8);if(o===0)o=1-h;else{if(o===m)return a?NaN:(R?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-h}return(R?-1:1)*a*Math.pow(2,o-r)}function gt(n,t,e,r,i,o){var a,l,m,h=o*8-i-1,y=(1<<h)-1,w=y>>1,C=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=r?0:o-1,se=r?1:-1,Cr=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+w>=1?t+=C/m:t+=C*Math.pow(2,1-w),t*m>=2&&(a++,m/=2),a+w>=y?(l=0,a=y):a+w>=1?(l=(t*m-1)*Math.pow(2,i),a=a+w):(l=t*Math.pow(2,w-1)*Math.pow(2,i),a=0));i>=8;n[e+R]=l&255,R+=se,l/=256,i-=8);for(a=a<<i|l,h+=i;h>0;n[e+R]=a&255,R+=se,a/=256,h-=8);n[e+R-se]|=Cr*128}var I,L,un,We,at,Sn,vt=De(()=>{"use strict";f();u();I=[],L=[],un=typeof Uint8Array!="undefined"?Uint8Array:Array,We=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return ft(null,n,t,e)};s.kMaxLength=Re();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return mn(null,n,t,e)};s.allocUnsafe=function(n){return Ve(null,n)};s.allocUnsafeSlow=function(n){return Ve(null,n)};s.isBuffer=Mn;s.compare=function(t,e){if(!k(t)||!k(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,a=Math.min(r,i);o<a;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?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 r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!k(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};s.byteLength=pt;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)Q(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)Q(this,e,e+3),Q(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)Q(this,e,e+7),Q(this,e+1,e+6),Q(this,e+2,e+5),Q(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?mt(this,0,t):yn.apply(this,arguments)};s.prototype.equals=function(t){if(!k(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,i,o){if(!k(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=r)return 0;if(i>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,l=r-e,m=Math.min(a,l),h=this.slice(i,o),y=t.slice(e,r),w=0;w<m;++w)if(h[w]!==y[w]){a=h[w],l=y[w];break}return a<l?-1:l<a?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return lt(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return lt(this,t,e,r,!1)};s.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<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 wn(this,t,e,r);case"utf8":case"utf-8":return gn(this,t,e,r);case"ascii":return ct(this,t,e,r);case"latin1":case"binary":return vn(this,t,e,r);case"base64":return Tn(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return An(this,t,e,r);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)}};at=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),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,r){t=t|0,e=e|0,r||v(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,r){t=t|0,e=e|0,r||v(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||v(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||v(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||v(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||v(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||v(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||v(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,r){t=t|0,e=e|0,r||v(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||v(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.prototype.readInt32LE=function(t,e){return e||v(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||v(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||v(t,4,this.length),Ie(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||v(t,4,this.length),Ie(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||v(t,8,this.length),Ie(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||v(t,8,this.length),Ie(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;E(this,t,e,r,o,0)}var a=1,l=0;for(this[e]=t&255;++l<r&&(a*=256);)this[e+l]=t/a&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;E(this,t,e,r,o,0)}var a=r-1,l=1;for(this[e+a]=t&255;--a>=0&&(l*=256);)this[e+a]=t/l&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||E(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,r){return t=+t,e=e|0,r||E(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Le(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||E(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Le(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||E(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):Ce(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||E(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):Ce(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);E(this,t,e,r,o-1,-o)}var a=0,l=1,m=0;for(this[e]=t&255;++a<r&&(l*=256);)t<0&&m===0&&this[e+a-1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+r};s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);E(this,t,e,r,o-1,-o)}var a=r-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+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||E(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,r){return t=+t,e=e|0,r||E(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Le(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||E(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Le(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||E(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):Ce(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||E(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):Ce(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return ht(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return ht(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return xt(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return xt(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-r&&(i=t.length-e+r);var o=i-r,a;if(this===t&&r<e&&e<i)for(a=o-1;a>=0;--a)t[a+e]=this[a+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};s.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=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<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var a;if(typeof t=="number")for(a=e;a<r;++a)this[a]=t;else{var l=k(t)?t:Ne(new s(t,i).toString()),m=l.length;for(a=0;a<r-e;++a)this[a+e]=l[a%m]}return this};Sn=/[^+\/0-9A-Za-z-_]/g});var u=De(()=>{"use strict";vt()});var ta={};Ke(ta,{DynamicSnippetsGeneratorContext:()=>qe});module.exports=_r(ta);f();u();f();u();f();u();f();u();f();u();f();u();f();u();var On=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Tt=On;var Dn=typeof self=="object"&&self&&self.Object===Object&&self,$n=Tt||Dn||Function("return this")(),At=$n;var Wn=At.Symbol,B=Wn;f();u();var bt=Object.prototype,Vn=bt.hasOwnProperty,jn=bt.toString,he=B?B.toStringTag:void 0;function Yn(n){var t=Vn.call(n,he),e=n[he];try{n[he]=void 0;var r=!0}catch(o){}var i=jn.call(n);return r&&(t?n[he]=e:delete n[he]),i}var Et=Yn;f();u();var zn=Object.prototype,Gn=zn.toString;function qn(n){return Gn.call(n)}var Rt=qn;var Hn="[object Null]",Zn="[object Undefined]",Nt=B?B.toStringTag:void 0;function Jn(n){return n==null?n===void 0?Zn:Hn:Nt&&Nt in Object(n)?Et(n):Rt(n)}var Lt=Jn;f();u();function Kn(n){return n!=null&&typeof n=="object"}var Ct=Kn;var Qn="[object Symbol]";function Xn(n){return typeof n=="symbol"||Ct(n)&&Lt(n)==Qn}var St=Xn;f();u();f();u();function ei(n,t){for(var e=-1,r=n==null?0:n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}var It=ei;f();u();var ti=Array.isArray,kt=ti;var ri=1/0,Ut=B?B.prototype:void 0,Pt=Ut?Ut.toString:void 0;function _t(n){if(typeof n=="string")return n;if(kt(n))return It(n,_t)+"";if(St(n))return Pt?Pt.call(n):"";var t=n+"";return t=="0"&&1/n==-ri?"-0":t}var Bt=_t;f();u();function ni(n){return n==null?"":Bt(n)}var j=ni;f();u();f();u();f();u();f();u();f();u();f();u();function ii(n,t,e){var r=-1,i=n.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);++r<i;)o[r]=n[r+t];return o}var Mt=ii;function oi(n,t,e){var r=n.length;return e=e===void 0?r:e,!t&&e>=r?n:Mt(n,t,e)}var Ft=oi;f();u();var ai="\\ud800-\\udfff",si="\\u0300-\\u036f",fi="\\ufe20-\\ufe2f",ui="\\u20d0-\\u20ff",pi=si+fi+ui,li="\\ufe0e\\ufe0f",ci="\\u200d",mi=RegExp("["+ci+ai+pi+li+"]");function di(n){return mi.test(n)}var ke=di;f();u();f();u();function hi(n){return n.split("")}var Ot=hi;f();u();var Dt="\\ud800-\\udfff",xi="\\u0300-\\u036f",yi="\\ufe20-\\ufe2f",wi="\\u20d0-\\u20ff",gi=xi+yi+wi,vi="\\ufe0e\\ufe0f",Ti="["+Dt+"]",Ye="["+gi+"]",ze="\\ud83c[\\udffb-\\udfff]",Ai="(?:"+Ye+"|"+ze+")",$t="[^"+Dt+"]",Wt="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",bi="\\u200d",jt=Ai+"?",Yt="["+vi+"]?",Ei="(?:"+bi+"(?:"+[$t,Wt,Vt].join("|")+")"+Yt+jt+")*",Ri=Yt+jt+Ei,Ni="(?:"+[$t+Ye+"?",Ye,Wt,Vt,Ti].join("|")+")",Li=RegExp(ze+"(?="+ze+")|"+Ni+Ri,"g");function Ci(n){return n.match(Li)||[]}var zt=Ci;function Si(n){return ke(n)?zt(n):Ot(n)}var Gt=Si;function Ii(n){return function(t){t=j(t);var e=ke(t)?Gt(t):void 0,r=e?e[0]:t.charAt(0),i=e?Ft(e,1).join(""):t.slice(1);return r[n]()+i}}var qt=Ii;var ki=qt("toUpperCase"),ce=ki;function Ui(n){return ce(j(n).toLowerCase())}var Ht=Ui;f();u();f();u();function Pi(n,t,e,r){var i=-1,o=n==null?0:n.length;for(r&&o&&(e=n[++i]);++i<o;)e=t(e,n[i],i,n);return e}var Zt=Pi;f();u();f();u();f();u();function _i(n){return function(t){return n==null?void 0:n[t]}}var Jt=_i;var Bi={\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"},Mi=Jt(Bi),Kt=Mi;var Fi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Oi="\\u0300-\\u036f",Di="\\ufe20-\\ufe2f",$i="\\u20d0-\\u20ff",Wi=Oi+Di+$i,Vi="["+Wi+"]",ji=RegExp(Vi,"g");function Yi(n){return n=j(n),n&&n.replace(Fi,Kt).replace(ji,"")}var Qt=Yi;f();u();f();u();var zi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Gi(n){return n.match(zi)||[]}var Xt=Gi;f();u();var qi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Hi(n){return qi.test(n)}var er=Hi;f();u();var or="\\ud800-\\udfff",Zi="\\u0300-\\u036f",Ji="\\ufe20-\\ufe2f",Ki="\\u20d0-\\u20ff",Qi=Zi+Ji+Ki,ar="\\u2700-\\u27bf",sr="a-z\\xdf-\\xf6\\xf8-\\xff",Xi="\\xac\\xb1\\xd7\\xf7",eo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",to="\\u2000-\\u206f",ro=" \\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",fr="A-Z\\xc0-\\xd6\\xd8-\\xde",no="\\ufe0e\\ufe0f",ur=Xi+eo+to+ro,pr="['\u2019]",tr="["+ur+"]",io="["+Qi+"]",lr="\\d+",oo="["+ar+"]",cr="["+sr+"]",mr="[^"+or+ur+lr+ar+sr+fr+"]",ao="\\ud83c[\\udffb-\\udfff]",so="(?:"+io+"|"+ao+")",fo="[^"+or+"]",dr="(?:\\ud83c[\\udde6-\\uddff]){2}",hr="[\\ud800-\\udbff][\\udc00-\\udfff]",me="["+fr+"]",uo="\\u200d",rr="(?:"+cr+"|"+mr+")",po="(?:"+me+"|"+mr+")",nr="(?:"+pr+"(?:d|ll|m|re|s|t|ve))?",ir="(?:"+pr+"(?:D|LL|M|RE|S|T|VE))?",xr=so+"?",yr="["+no+"]?",lo="(?:"+uo+"(?:"+[fo,dr,hr].join("|")+")"+yr+xr+")*",co="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ho=yr+xr+lo,xo="(?:"+[oo,dr,hr].join("|")+")"+ho,yo=RegExp([me+"?"+cr+"+"+nr+"(?="+[tr,me,"$"].join("|")+")",po+"+"+ir+"(?="+[tr,me+rr,"$"].join("|")+")",me+"?"+rr+"+"+nr,me+"+"+ir,mo,co,lr,xo].join("|"),"g");function wo(n){return n.match(yo)||[]}var wr=wo;function go(n,t,e){return n=j(n),t=e?void 0:t,t===void 0?er(n)?wr(n):Xt(n):n.match(t)||[]}var gr=go;var vo="['\u2019]",To=RegExp(vo,"g");function Ao(n){return function(t){return Zt(gr(Qt(t).replace(To,"")),n,"")}}var vr=Ao;var bo=vr(function(n,t,e){return t=t.toLowerCase(),n+(e?Ht(t):t)}),Ue=bo;f();u();f();u();function T(n){throw new Error("Unexpected value: "+JSON.stringify(n))}f();u();function xe(n){return Object.keys(n)}f();u();f();u();var M=class{};f();u();f();u();var Y=class extends M{constructor(e){super();p(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var Eo=4,ye=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
2
|
`),r=e?t.substring(0,t.length-1):t,i=this.getIndentString(),o=r.replaceAll(`
|
|
3
3
|
`,`
|
|
4
4
|
${i}`);this.isAtStartOfLine()&&(o=i+o),e&&(o+=`
|
|
5
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 Y(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new Y(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}openBlock(t,e="{",r,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(),r(),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
7
|
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:r}){if(t.length>0){let i=t[0];i!=null&&r(i);for(let o=1;o<t.length;o++){this.write(e);let a=t[o];a!=null&&r(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*bo)}};f();u();function Ge(n){return(n==null?void 0:n.name)!=null}f();u();var ye=class extends M{constructor({condition:e,true_:r,false_:i}){super();p(this,"condition");p(this,"true_");p(this,"false_");this.condition=e,this.true_=r,this.false_=i}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};f();u();f();u();f();u();f();u();var we=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 r=t.match(this.REFERENCE_REGEX);if(!(r==null||r[1]==null||r[2]==null))return{method:r[1],path:r[2]}}};f();u();var g={Critical:"CRITICAL",Warning:"WARNING"},ge=class n{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(fe(se({},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 n;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 r of t){if(typeof r=="string"){e.push(r);continue}e[e.length-1]+=`[${r.index}]`}return e}};var ve=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 ge,this.httpEndpointReferenceParser=new we}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];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;r.push({name:a.name,typeReference:a.typeReference,value:l})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){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(r)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 r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:g.Critical,message:`Expected file value to be a string, got ${typeof r}`});return}return r}}getFileArrayValues({property:t,record:e}){let r=e[t.wireValue];if(r==null)return;if(!Array.isArray(r)){this.errors.add({severity:g.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let i=[];for(let o of r){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 r=this.getRecord(e);if(r==null)return;let i=t.discriminant.wireValue,o=r[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=r,{[i]:l}=h,m=Je(h,[Ze(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 r of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t})&&e.push(r);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:r}){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:r}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,i;return e&&((i=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:T(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}default:T(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 r=e.environments[0];if(r==null)return this.errors.add({severity:g.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(he(r.urls));for(let o of he(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: [${he(r.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:T(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:T(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:T(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}};f();u();f();u();var Ue="";var d={};Ke(d,{Array:()=>Q,AstNode:()=>x,Attribute:()=>X,Class:()=>F,ClassInstantiation:()=>U,ClassReference:()=>A,CodeBlock:()=>b,DataClass:()=>te,Enum:()=>re,Field:()=>ne,Map:()=>ie,Method:()=>D,MethodInvocation:()=>$,Parameter:()=>O,Trait:()=>ee,Type:()=>I,TypeLiteral:()=>H,Writer:()=>z,array:()=>ko,assignVariable:()=>zo,attribute:()=>Uo,classReference:()=>Bo,class_:()=>Po,codeblock:()=>oe,dataClass:()=>Mo,enum_:()=>Fo,field:()=>Oo,instantiateClass:()=>Nr,invokeMethod:()=>Do,map:()=>Wo,mergeArrays:()=>Ho,method:()=>Vo,parameter:()=>jo,string:()=>qo,ternary:()=>Yo,this_:()=>Zo,throwException:()=>$o,trait:()=>_o,variable:()=>Go});f();u();f();u();f();u();f();u();f();u();function Tr(n){return{namespace:n.substring(0,n.lastIndexOf("\\")),name:n.substring(n.lastIndexOf("\\")+1)}}var z=class extends xe{constructor({namespace:e,rootNamespace:r,customConfig:i}){super();p(this,"namespace");p(this,"rootNamespace");p(this,"customConfig");p(this,"references",{});this.namespace=e,this.rootNamespace=r,this.customConfig=i}addReference(e){var a,l;if(e.namespace==null)return;if(Object.keys(this.references).filter(m=>{let h=Tr(m);return h.namespace!==e.namespace&&h.name===e.name}).length>0){e.requireFullyQualified();return}let i=e.namespace===Ue?e.name:`${e.namespace}\\${e.name}`;((l=(a=this.references)[i])!=null?l:a[i]=[]).push(e)}toString(){let e=`namespace ${this.namespace};`,r=this.stringifyImports();return r.length>0?`${e}
|
|
8
|
+
`)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*Eo)}};f();u();function Ge(n){return(n==null?void 0:n.name)!=null}f();u();var we=class extends M{constructor({condition:e,true_:r,false_:i}){super();p(this,"condition");p(this,"true_");p(this,"false_");this.condition=e,this.true_=r,this.false_=i}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};f();u();f();u();f();u();f();u();var ge=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 r=t.match(this.REFERENCE_REGEX);if(!(r==null||r[1]==null||r[2]==null))return{method:r[1],path:r[2]}}};f();u();var g={Critical:"CRITICAL",Warning:"WARNING"},ve=class n{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(ue(fe({},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 n;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 r of t){if(typeof r=="string"){e.push(r);continue}e[e.length-1]+=`[${r.index}]`}return e}};var Te=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 ve,this.httpEndpointReferenceParser=new ge}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];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;r.push({name:a.name,typeReference:a.typeReference,value:l})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){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(r)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 r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:g.Critical,message:`Expected file value to be a string, got ${typeof r}`});return}return r}}getFileArrayValues({property:t,record:e}){let r=e[t.wireValue];if(r==null)return;if(!Array.isArray(r)){this.errors.add({severity:g.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let i=[];for(let o of r){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 r=this.getRecord(e);if(r==null)return;let i=t.discriminant.wireValue,o=r[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=r,{[i]:l}=h,m=Je(h,[Ze(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 r of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t})&&e.push(r);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:r}){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:r}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,i;return e&&((i=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:T(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}default:T(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 r=e.environments[0];if(r==null)return this.errors.add({severity:g.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(xe(r.urls));for(let o of xe(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: [${xe(r.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:T(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:T(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:T(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}};f();u();f();u();var Pe="",Tr="self";var d={};Ke(d,{Access:()=>z,Array:()=>X,AstNode:()=>x,Attribute:()=>ee,Class:()=>F,ClassInstantiation:()=>U,ClassReference:()=>A,CodeBlock:()=>b,DataClass:()=>re,Enum:()=>ne,Field:()=>ie,Map:()=>oe,Method:()=>D,MethodInvocation:()=>$,Parameter:()=>O,Trait:()=>te,Type:()=>S,TypeLiteral:()=>Z,Writer:()=>G,array:()=>Uo,assignVariable:()=>Go,attribute:()=>Po,classReference:()=>Mo,class_:()=>_o,codeblock:()=>ae,dataClass:()=>Fo,enum_:()=>Oo,field:()=>Do,instantiateClass:()=>Lr,invokeMethod:()=>$o,map:()=>Vo,mergeArrays:()=>Zo,method:()=>jo,parameter:()=>Yo,string:()=>Ho,ternary:()=>zo,this_:()=>Jo,throwException:()=>Wo,trait:()=>Bo,variable:()=>qo});f();u();f();u();f();u();var z={Public:"public",PublicReadonly:"public readonly",Protected:"protected",Private:"private"};f();u();f();u();f();u();function Ar(n){return{namespace:n.substring(0,n.lastIndexOf("\\")),name:n.substring(n.lastIndexOf("\\")+1)}}var G=class extends ye{constructor({namespace:e,rootNamespace:r,customConfig:i}){super();p(this,"namespace");p(this,"rootNamespace");p(this,"customConfig");p(this,"references",{});this.namespace=e,this.rootNamespace=r,this.customConfig=i}addReference(e){var a,l;if(e.namespace==null)return;if(Object.keys(this.references).filter(m=>{let h=Ar(m);return h.namespace!==e.namespace&&h.name===e.name}).length>0){e.requireFullyQualified();return}let i=e.namespace===Pe?e.name:`${e.namespace}\\${e.name}`;((l=(a=this.references)[i])!=null?l:a[i]=[]).push(e)}toString(){let e=`namespace ${this.namespace};`,r=this.stringifyImports();return r.length>0?`${e}
|
|
9
9
|
|
|
10
10
|
${r}
|
|
11
11
|
|
|
12
12
|
${this.buffer}`:e+`
|
|
13
13
|
|
|
14
|
-
`+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(r=>
|
|
15
|
-
`)}};var x=class extends M{toString(t){if(t==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:r,customConfig:i}=t,o=new
|
|
14
|
+
`+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(r=>Ar(r).namespace!==this.namespace).map(r=>`use ${r};`).join(`
|
|
15
|
+
`)}};var x=class extends M{toString(t){if(t==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:r,customConfig:i}=t,o=new G({namespace:e,rootNamespace:r,customConfig:i});return this.write(o),o.toString()}async toStringAsync({namespace:t,rootNamespace:e,customConfig:r}){let i=new G({namespace:t,rootNamespace:e,customConfig:r});return this.write(i),i.toString()}};var X=class extends x{constructor({entries:e}){super();p(this,"entries");this.entries=e!=null?e:[]}write(e){e.write("["),this.entries.forEach((r,i)=>{i>0&&e.write(", "),r.write(e)}),e.write("]")}};f();u();var ee=class extends x{constructor(e){var r;super();p(this,"reference");p(this,"arguments");this.reference=e.reference,this.arguments=(r=e.arguments)!=null?r:[]}write(e){e.addReference(this.reference),e.write(`${this.reference.name}`),this.arguments.length>0&&(e.write("("),this.arguments.forEach((r,i)=>{i>0&&e.write(","),typeof r=="string"?e.write(r):r.write(e)}),e.write(")"))}};f();u();f();u();var A=class extends x{constructor({name:e,namespace:r}){super();p(this,"name");p(this,"namespace");p(this,"fullyQualified");this.name=e,this.namespace=r,this.fullyQualified=!1}requireFullyQualified(){this.fullyQualified=!0}write(e){e.addReference(this);let r=this.fullyQualified?`\\${this.namespace}\\${this.name}`:this.name;e.write(`${r}`)}};f();u();f();u();function q(n){return n.startsWith("$")?n:`$${n}`}var N=class extends x{constructor({docs:e}={}){super();p(this,"docs");p(this,"tags",[]);this.docs=e}addTag(e){this.tags.push(ue(fe({},e),{name:e.name!=null?q(e.name):void 0}))}write(e){e.writeLine("/**"),this.docs!=null&&(this.docs.split(`
|
|
16
16
|
`).forEach(r=>{e.writeLine(` * ${r}`)}),this.tags.length>0&&e.writeLine(" *"));for(let r of this.tags)this.writeTag({writer:e,tag:r});e.writeLine(" */")}writeTag({writer:e,tag:r}){let i=r.docs!=null?r.docs.split(`
|
|
17
|
-
`):void 0;i!=null&&i.length>1&&(i.forEach(o=>{e.writeLine(` * ${o}`)}),e.writeLine(" *")),e.write(` * @${r.tagType} `),r.type.write(e,{comment:!0}),r.name!=null&&e.write(` ${r.name}`),i!=null&&i.length===1&&e.write(` ${i[0]}`),e.newLine()}};f();u();f();u();var Pe={Public:"public",Private:"private",Protected:"protected"};function q(n){return Eo(n,[Pe.Public,Pe.Protected,Pe.Private])}function Eo(n,t){return t.reduce((e,r)=>[...e,...n.filter(i=>i.access===r)],[])}var F=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"abstract");p(this,"docs");p(this,"parentClassReference");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);p(this,"constructor_");this.name=e,this.namespace=r,this.abstract=i!=null?i:!1,this.docs=o,this.parentClassReference=a,this.traits=l!=null?l:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new A({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:q(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:q(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new N({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:r}){var i;this.writeConstructorComment({writer:e,constructor:r}),r.access!=null&&e.write(`${r.access} `),e.write("function __construct("),e.indent(),r.parameters.forEach((o,a)=>{a===0&&e.newLine(),o.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(i=r.body)==null||i.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:r}){if(r.parameters.length===0)return;let i=new N;for(let o of r.parameters)i.addTag(o.getCommentTag());i.write(e)}writeFields({writer:e,fields:r}){r.filter(i=>!i.inherited).forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};f();u();var ee=class extends x{constructor({name:e,namespace:r,docs:i,traits:o}){super();p(this,"name");p(this,"namespace");p(this,"docs");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);this.name=e,this.namespace=r,this.docs=i,this.traits=o!=null?o:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:q(this.fields)}),this.writeMethods({writer:e,methods:q(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new N({docs:this.docs}).write(e)}writeFields({writer:e,fields:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};f();u();f();u();function me({writer:n,arguments_:t,multiline:e}){if(t.length===0){n.write("()");return}if(e){Ro({writer:n,arguments_:t});return}No({writer:n,arguments_:t})}function Ro({writer:n,arguments_:t}){n.writeLine("("),n.indent();for(let e of t)Ar({writer:n,argument:e}),n.writeLine(",");n.dedent(),n.write(")")}function No({writer:n,arguments_:t}){n.write("("),t.forEach((e,r)=>{r>0&&n.write(", "),Ar({writer:n,argument:e})}),n.write(")")}function Ar({writer:n,argument:t}){Ge(t)?(n.write(`${t.name}: `),n.writeNodeOrString(t.assignment)):t.write(n)}var U=class extends x{constructor({classReference:e,arguments_:r,multiline:i}){super();p(this,"classReference");p(this,"arguments_");p(this,"multiline");this.classReference=e,this.arguments_=r,this.multiline=i!=null?i:!1}write(e){e.write("new "),e.writeNode(this.classReference),me({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};f();u();var b=class extends x{constructor(e){super();p(this,"arg");this.arg=e}write(e){return new Y(this.arg).write(e)}};f();u();f();u();var O=class extends x{constructor({name:e,type:r,docs:i,initializer:o,access:a,readonly_:l}){super();p(this,"name");p(this,"type");p(this,"docs");p(this,"initializer");p(this,"access");p(this,"readonly_");this.name=G(e),this.type=r,this.docs=i,this.initializer=o,this.access=a,this.readonly_=l!=null?l:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};f();u();var I=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e,{comment:r}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(br),e.write("DateTime");break;case"dateTime":e.addReference(br),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!r){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:r}),e.write(">");break;case"map":{if(!r){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:r}),e.write(", "),this.internalType.valueType.write(e,{comment:r}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!r){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");for(let i of this.internalType.entries)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:i,comment:r}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((i,o)=>{o>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:i,comment:r})}),e.write("}");break}case"union":{this.getUniqueTypes({types:this.internalType.types,comment:r,writer:e}).forEach((o,a)=>{a>0&&e.write("|"),o.write(e,{comment:r}),a++});break}case"optional":{let i=this.internalType.value.internalType.type==="mixed",o=this.internalType.value.internalType.type==="union";!o&&!i&&e.write("?"),this.internalType.value.write(e,{comment:r}),o&&(e.write("|"),e.writeNode(n.null()));break}case"reference":e.writeNode(this.internalType.value);break;case"enumString":r?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;default:T(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:n.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static typeDict(e,{multiline:r}={}){return new this({type:"typeDict",entries:e,multiline:r})}static union(e){return new this({type:"union",types:e})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeTypeDictEntry({writer:e,entry:r,comment:i}){e.write(r.key),r.optional&&e.write("?"),e.write(": "),r.valueType.write(e,{comment:i})}getUniqueTypes({writer:e,types:r,comment:i}){let o=new Set;return r.filter(a=>{if(i)return!0;let l=a.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig});return o.has(l)?!1:(o.add(l),!0)})}},br=new A({namespace:Ue,name:"DateTime"});f();u();function Er(n){return n.startsWith("$")?n.slice(1):n}var Rr="values",te=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"class_");this.name=e,this.namespace=r,this.class_=new F({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let r=q(this.class_.fields).map(i=>fe(se({},i),{name:Er(i.name)}));r.length>0&&this.class_.addConstructor({access:"public",parameters:this.getConstructorParameters({orderedFields:r}),body:d.codeblock(i=>{for(let o of r)i.write(`$this->${o.name} = $${Rr}['${o.name}']`),o.type.isOptional()&&i.write(" ?? null"),i.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new O({name:Rr,type:I.typeDict(e.map(r=>({key:r.name,valueType:r.type,optional:r.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new b("[]"):void 0})]}};f();u();f();u();var D=class extends x{constructor({name:e,access:r,parameters:i,throws:o,return_:a,body:l,docs:m,classReference:h}){super();p(this,"name");p(this,"access");p(this,"parameters");p(this,"throws");p(this,"return_");p(this,"body");p(this,"docs");p(this,"classReference");this.name=e,this.access=r,this.parameters=i,this.throws=o!=null?o:[],this.return_=a,this.body=l,this.docs=m,this.classReference=h}write(e){var r;this.writeComment(e),e.write(`${this.access} function ${this.name}(`),this.parameters.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write("): "),this.return_!=null?this.return_.write(e):e.write("void"),e.writeLine(" {"),e.indent(),(r=this.body)==null||r.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let r=new N({docs:this.docs});for(let i of this.parameters)r.addTag({tagType:"param",type:i.type,name:i.name,docs:i.docs});this.return_!=null&&r.addTag({tagType:"return",type:this.return_});for(let i of this.throws)r.addTag({tagType:"throws",type:I.reference(i)});e.writeNode(r)}};var re=class extends x{constructor({name:e,namespace:r,backing:i,docs:o,serializable:a}){super();p(this,"name");p(this,"namespace");p(this,"backing");p(this,"docs");p(this,"members",[]);p(this,"serializable");this.name=e,this.namespace=r,this.backing=i,this.docs=o,this.serializable=a!=null?a:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new A({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let r of this.members)e.write(`case ${r.name}`),r.value!=null&&(typeof r.value=="string"?e.write(` = "${r.value}"`):e.write(` = ${r.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new D({name:"jsonSerialize",return_:I.string(),access:"public",parameters:[],body:new b("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new N({docs:this.docs}).write(e)}};f();u();var ne=class extends x{constructor({name:e,type:r,access:i,readonly_:o,initializer:a,docs:l,inlineDocs:m,attributes:h,inherited:y}){super();p(this,"name");p(this,"type");p(this,"access");p(this,"readonly_");p(this,"initializer");p(this,"docs");p(this,"inlineDocs");p(this,"attributes");p(this,"inherited");this.name=G(e),this.type=r,this.access=i,this.readonly_=o!=null?o:!1,this.initializer=a,this.docs=l,this.inlineDocs=m,this.attributes=h!=null?h:[],this.inherited=y!=null?y:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let r=new N;r.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),r.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((r,i)=>{i>0&&e.write(", "),r.write(e)}),e.writeLine("]"))}};f();u();var ie=class extends x{constructor({entries:e,multiline:r}){super();p(this,"entries");p(this,"multiline");this.entries=e!=null?e:[],this.multiline=r!=null?r:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:r,value:i}of this.entries)r.write(e),e.write(" => "),i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[r,{key:i,value:o}]of this.entries.entries())r>0&&e.write(", "),i.write(e),e.write(" => "),o.write(e);e.write("]")}};f();u();var $=class extends x{constructor({method:e,arguments_:r,static_:i,multiline:o,on:a}){super();p(this,"method");p(this,"arguments_");p(this,"multiline");p(this,"static_");p(this,"on");this.method=e,this.arguments_=r,this.static_=i!=null?i:!1,this.multiline=o!=null?o:!1,this.on=a}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),me({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};f();u();f();u();var H=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(Co({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(Lo({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
|
|
18
|
-
`)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}e.write(`'${this.internalType.value.replaceAll("'","\\'")}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:T(this.internalType)}}writeStringWithHeredoc({writer:e,value:r}){e.writeLine("<<<EOT"),e.writeNoIndent(r),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:r}){e.writeNode(new U({classReference:r.reference,arguments_:[n.map({entries:r.fields.map(i=>({key:n.string(i.name),value:i.value}))})]}))}writeList({writer:e,list:r}){let i=So({values:r.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("]")}writeMap({writer:e,map:r}){let i=Io({entries:r.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("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:r}){return new this({type:"class",reference:e,fields:r})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value: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:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(r.includes('"')?`\`${r}\``:`"${r}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownMap({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of r)e.writeNode(n.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[o,a]of i)e.write(`'${o}' => `),e.writeNode(n.unknown(a)),e.writeLine(",");e.dedent(),e.write("]")}};function Lo({writer:n,value:t}){return new U({classReference:new A({name:"DateTime",namespace:""}),arguments_:[new b(`'${t}'`)]})}function Co({writer:n,value:t}){return new $({on:new A({name:"File",namespace:`${n.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new b(`"${t}"`)]})}function Io({entries:n}){return n.filter(t=>!H.isNop(t.key)&&!H.isNop(t.value))}function So({values:n}){return n.filter(t=>!H.isNop(t))}f();u();var _e=class extends x{constructor(e){super();p(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),me({writer:e,arguments_:this.arrays.map(r=>oe(i=>{if(typeof r=="string"||r instanceof x){i.writeNodeOrString(r);return}i.writeNodeOrString(r.ref),r.fallback&&(i.write(" ?? "),i.writeNodeOrString(r.fallback))}))})}};function ko(n){return new Q(n)}function Uo(n){return new X(n)}function Po(n){return new F(n)}function _o(n){return new ee(n)}function Bo(n){return new A(n)}function oe(n){return new b(n)}function Mo(n){return new te(n)}function Fo(n){return new re(n)}function Oo(n){return new ne(n)}function Nr(n){return new U(n)}function Do(n){return new $(n)}function $o(n){return oe(t=>{t.write("throw "),t.writeNode(Nr(n))})}function Wo(n){return new ie(n)}function Vo(n){return new D(n)}function jo(n){return new O(n)}function Yo(n){return new ye(n)}function zo(n,t){return oe(e=>{e.writeNodeOrString(n),e.write(" = "),e.writeNodeOrString(t)})}function Go(n){return oe(G(n))}function qo(n){return oe(`"${n}"`)}function Ho(...n){return new _e(n)}function Zo(){return new b(n=>{n.write("$this")})}f();u();var Be=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":case"set":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"unknown":return this.convertUnknown({value:t.value});default:T(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.string(r)}default:T(t)}}convertList({list:t,value:e}){return Array.isArray(e)?d.TypeLiteral.list({values:e.map((r,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:r})}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.map({entries:Object.entries(e).map(([r,i])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:r}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r});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:T(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){return d.TypeLiteral.string("todo")}convertObject({object_:t,value:e}){var i;let r=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return d.TypeLiteral.class_({reference:d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),fields:r.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 r=this.getEnumValueName({enum_:t,value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.reference(d.codeblock(i=>{i.writeNode(d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)})),i.write("::"),i.write(r),i.write("->value")}))}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:g.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(i=>i.wireValue===e);if(r==null){this.context.errors.add({severity:g.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return r==null?d.TypeLiteral.nop():r}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let r of t.types)try{return this.convert({typeReference:r,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:r}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.number(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(i)}case"DATE":case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.datetime(i)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.string(i)}default:T(t)}}getValueAsNumber({value:t,as:e}){let r=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:t,as:e}){let r=e==="key"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:r})}};f();u();var Me=class{constructor({context:t}){p(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let r={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let a of t.properties)switch(a.type){case"file":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getSingleFileProperty({property:a,record:i})});break;case"fileArray":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getArrayFileProperty({property:a,record:i})});break;case"bodyProperty":r.bodyPropertyFields.push({name:this.context.getPropertyName(a.name.name),value:this.getBodyProperty({property:a,record:i})});break;default:T(a)}return r}getSingleFileProperty({property:t,record:e}){let r=this.context.getSingleFileValue({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.file(r)}getArrayFileProperty({property:t,record:e}){let r=this.context.getFileArrayValues({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.list({values:r.map(i=>d.TypeLiteral.file(i))})}getBodyProperty({property:t,record:e}){let r=e[t.name.wireValue];return r==null?d.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:r})}};var Jo=["use","clone","list"],Ko="Requests",Qo="Types",qe=class n extends ve{constructor({ir:e,config:r}){var i;super({ir:e,config:r});p(this,"ir");p(this,"customConfig");p(this,"dynamicTypeLiteralMapper");p(this,"filePropertyMapper");p(this,"rootNamespace");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeLiteralMapper=new Be({context:this}),this.filePropertyMapper=new Me({context:this}),this.rootNamespace=Xo({organization:r.organization,namespaceOverride:(i=this.customConfig)==null?void 0:i.namespace})}clone(){return new n({ir:this.ir,config:this.config})}getParameterName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getPropertyName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getMethodName(e){let r=e.camelCase.unsafeName;return Jo.includes(r)?r:e.camelCase.safeName}getClassName(e){return e.pascalCase.safeName}getRootClientClassName(){var e,r,i;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((r=this.customConfig)==null?void 0:r["client-class-name"])!=null?(i=this.customConfig)==null?void 0:i["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return d.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,Ko)}getTypesNamespace(e){return this.getNamespace(e,Qo)}getNamespace(e,r){let i=e.allParts.map(o=>o.pascalCase.safeName);return i=r!=null?[...i,r]:i,[this.rootNamespace,...i].join("\\")}getEnvironmentClassAccessFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return d.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference(r)),i.write("::"),i.write(this.getClassName(r))})}getEnvironmentClassReference(e){return d.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${le(ke(this.config.organization))}`}};function Xo({organization:n,namespaceOverride:t}){return t!=null?t:`${le(ke(n))}`}0&&(module.exports={DynamicSnippetsGeneratorContext});
|
|
17
|
+
`):void 0;i!=null&&i.length>1&&(i.forEach(o=>{e.writeLine(` * ${o}`)}),e.writeLine(" *")),e.write(` * @${r.tagType} `),r.type.write(e,{comment:!0}),r.name!=null&&e.write(` ${r.name}`),i!=null&&i.length===1&&e.write(` ${i[0]}`),e.newLine()}};f();u();function H(n){return Ro(n,[z.Public,z.PublicReadonly,z.Protected,z.Private])}function Ro(n,t){return t.reduce((e,r)=>[...e,...n.filter(i=>i.access===r)],[])}var F=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"abstract");p(this,"docs");p(this,"parentClassReference");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);p(this,"constructor_");this.name=e,this.namespace=r,this.abstract=i!=null?i:!1,this.docs=o,this.parentClassReference=a,this.traits=l!=null?l:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new A({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:H(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:H(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new N({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:r}){var i;this.writeConstructorComment({writer:e,constructor:r}),r.access!=null&&e.write(`${r.access} `),e.write("function __construct("),e.indent(),r.parameters.forEach((o,a)=>{a===0&&e.newLine(),o.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(i=r.body)==null||i.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:r}){if(r.parameters.length===0)return;let i=new N;for(let o of r.parameters)i.addTag(o.getCommentTag());i.write(e)}writeFields({writer:e,fields:r}){r.filter(i=>!i.inherited).forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};f();u();var te=class extends x{constructor({name:e,namespace:r,docs:i,traits:o}){super();p(this,"name");p(this,"namespace");p(this,"docs");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);this.name=e,this.namespace=r,this.docs=i,this.traits=o!=null?o:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:H(this.fields)}),this.fields.length>0&&this.methods.length>0&&e.newLine(),this.writeMethods({writer:e,methods:H(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){let r=new N({docs:this.docs});for(let i of this.fields)r.addTag({tagType:"property",type:i.type,name:i.name});r.write(e)}writeFields({writer:e,fields:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};f();u();f();u();function de({writer:n,arguments_:t,multiline:e}){if(t.length===0){n.write("()");return}if(e){No({writer:n,arguments_:t});return}Lo({writer:n,arguments_:t})}function No({writer:n,arguments_:t}){n.writeLine("("),n.indent();for(let e of t)br({writer:n,argument:e}),n.writeLine(",");n.dedent(),n.write(")")}function Lo({writer:n,arguments_:t}){n.write("("),t.forEach((e,r)=>{r>0&&n.write(", "),br({writer:n,argument:e})}),n.write(")")}function br({writer:n,argument:t}){Ge(t)?(n.write(`${t.name}: `),n.writeNodeOrString(t.assignment)):t.write(n)}var U=class extends x{constructor({classReference:e,arguments_:r,multiline:i}){super();p(this,"classReference");p(this,"arguments_");p(this,"multiline");this.classReference=e,this.arguments_=r,this.multiline=i!=null?i:!1}write(e){e.write("new "),e.writeNode(this.classReference),de({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};f();u();var b=class extends x{constructor(e){super();p(this,"arg");this.arg=e}write(e){return new Y(this.arg).write(e)}};f();u();f();u();var O=class extends x{constructor({name:e,type:r,docs:i,initializer:o,access:a,readonly_:l}){super();p(this,"name");p(this,"type");p(this,"docs");p(this,"initializer");p(this,"access");p(this,"readonly_");this.name=q(e),this.type=r,this.docs=i,this.initializer=o,this.access=a,this.readonly_=l!=null?l:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};f();u();var S=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e,{comment:r}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(Er),e.write("DateTime");break;case"dateTime":e.addReference(Er),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!r){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:r}),e.write(">");break;case"map":{if(!r){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:r}),e.write(", "),this.internalType.valueType.write(e,{comment:r}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!r){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");for(let i of this.internalType.entries)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:i,comment:r}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((i,o)=>{o>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:i,comment:r})}),e.write("}");break}case"union":{this.getUniqueTypes({types:this.internalType.types,comment:r,writer:e}).forEach((o,a)=>{a>0&&e.write("|"),o.write(e,{comment:r}),a++});break}case"optional":{let i=this.internalType.value.internalType.type==="mixed",o=this.internalType.value.internalType.type==="union";!o&&!i&&e.write("?"),this.internalType.value.write(e,{comment:r}),o&&(e.write("|"),e.writeNode(n.null()));break}case"reference":e.writeNode(this.internalType.value);break;case"enumString":r?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;default:T(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:n.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static typeDict(e,{multiline:r}={}){return new this({type:"typeDict",entries:e,multiline:r})}static union(e){return new this({type:"union",types:e})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeTypeDictEntry({writer:e,entry:r,comment:i}){e.write(r.key),r.optional&&e.write("?"),e.write(": "),r.valueType.write(e,{comment:i})}getUniqueTypes({writer:e,types:r,comment:i}){let o=new Set;return r.filter(a=>{if(i)return!0;let l=a.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig});return o.has(l)?!1:(o.add(l),!0)})}},Er=new A({namespace:Pe,name:"DateTime"});f();u();function Rr(n){return n.startsWith("$")?n.slice(1):n}var Nr="values",re=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"class_");this.name=e,this.namespace=r,this.class_=new F({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let r=H(this.class_.fields).map(i=>ue(fe({},i),{name:Rr(i.name)}));r.length>0&&this.class_.addConstructor({access:"public",parameters:this.getConstructorParameters({orderedFields:r}),body:d.codeblock(i=>{for(let o of r)i.write(`$this->${o.name} = $${Nr}['${o.name}']`),o.type.isOptional()&&i.write(" ?? null"),i.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new O({name:Nr,type:S.typeDict(e.map(r=>({key:r.name,valueType:r.type,optional:r.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new b("[]"):void 0})]}};f();u();f();u();var D=class extends x{constructor({name:e,access:r,parameters:i,throws:o,return_:a,body:l,docs:m,classReference:h}){super();p(this,"name");p(this,"access");p(this,"parameters");p(this,"throws");p(this,"return_");p(this,"body");p(this,"docs");p(this,"classReference");this.name=e,this.access=r,this.parameters=i,this.throws=o!=null?o:[],this.return_=a,this.body=l,this.docs=m,this.classReference=h}write(e){var r;this.writeComment(e),e.write(`${this.access} function ${this.name}(`),this.parameters.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write("): "),this.return_!=null?e.writeNodeOrString(this.return_):e.write("void"),e.writeLine(" {"),e.indent(),(r=this.body)==null||r.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let r=new N({docs:this.docs});for(let i of this.parameters)r.addTag({tagType:"param",type:i.type,name:i.name,docs:i.docs});this.return_!=null&&this.return_!==Tr&&r.addTag({tagType:"return",type:this.return_});for(let i of this.throws)r.addTag({tagType:"throws",type:S.reference(i)});e.writeNode(r)}};var ne=class extends x{constructor({name:e,namespace:r,backing:i,docs:o,serializable:a}){super();p(this,"name");p(this,"namespace");p(this,"backing");p(this,"docs");p(this,"members",[]);p(this,"serializable");this.name=e,this.namespace=r,this.backing=i,this.docs=o,this.serializable=a!=null?a:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new A({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let r of this.members)e.write(`case ${r.name}`),r.value!=null&&(typeof r.value=="string"?e.write(` = "${r.value}"`):e.write(` = ${r.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new D({name:"jsonSerialize",return_:S.string(),access:"public",parameters:[],body:new b("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new N({docs:this.docs}).write(e)}};f();u();var ie=class extends x{constructor({name:e,type:r,access:i,readonly_:o,initializer:a,docs:l,inlineDocs:m,attributes:h,inherited:y}){super();p(this,"name");p(this,"type");p(this,"access");p(this,"readonly_");p(this,"initializer");p(this,"docs");p(this,"inlineDocs");p(this,"attributes");p(this,"inherited");this.name=q(e),this.type=r,this.access=i,this.readonly_=o!=null?o:!1,this.initializer=a,this.docs=l,this.inlineDocs=m,this.attributes=h!=null?h:[],this.inherited=y!=null?y:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let r=new N;r.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),r.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((r,i)=>{i>0&&e.write(", "),r.write(e)}),e.writeLine("]"))}};f();u();var oe=class extends x{constructor({entries:e,multiline:r}){super();p(this,"entries");p(this,"multiline");this.entries=e!=null?e:[],this.multiline=r!=null?r:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:r,value:i}of this.entries)r.write(e),e.write(" => "),i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[r,{key:i,value:o}]of this.entries.entries())r>0&&e.write(", "),i.write(e),e.write(" => "),o.write(e);e.write("]")}};f();u();var $=class extends x{constructor({method:e,arguments_:r,static_:i,multiline:o,on:a}){super();p(this,"method");p(this,"arguments_");p(this,"multiline");p(this,"static_");p(this,"on");this.method=e,this.arguments_=r,this.static_=i!=null?i:!1,this.multiline=o!=null?o:!1,this.on=a}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),de({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};f();u();f();u();var Z=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(So({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(Co({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
|
|
18
|
+
`)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}e.write(`'${this.internalType.value.replaceAll("'","\\'")}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:T(this.internalType)}}writeStringWithHeredoc({writer:e,value:r}){e.writeLine("<<<EOT"),e.writeNoIndent(r),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:r}){e.writeNode(new U({classReference:r.reference,arguments_:[n.map({entries:r.fields.map(i=>({key:n.string(i.name),value:i.value}))})]}))}writeList({writer:e,list:r}){let i=ko({values:r.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("]")}writeMap({writer:e,map:r}){let i=Io({entries:r.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("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:r}){return new this({type:"class",reference:e,fields:r})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value: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:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(r.includes('"')?`\`${r}\``:`"${r}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownMap({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of r)e.writeNode(n.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[o,a]of i)e.write(`'${o}' => `),e.writeNode(n.unknown(a)),e.writeLine(",");e.dedent(),e.write("]")}};function Co({writer:n,value:t}){return new U({classReference:new A({name:"DateTime",namespace:""}),arguments_:[new b(`'${t}'`)]})}function So({writer:n,value:t}){return new $({on:new A({name:"File",namespace:`${n.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new b(`"${t}"`)]})}function Io({entries:n}){return n.filter(t=>!Z.isNop(t.key)&&!Z.isNop(t.value))}function ko({values:n}){return n.filter(t=>!Z.isNop(t))}f();u();var _e=class extends x{constructor(e){super();p(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),de({writer:e,arguments_:this.arrays.map(r=>ae(i=>{if(typeof r=="string"||r instanceof x){i.writeNodeOrString(r);return}i.writeNodeOrString(r.ref),r.fallback&&(i.write(" ?? "),i.writeNodeOrString(r.fallback))}))})}};function Uo(n){return new X(n)}function Po(n){return new ee(n)}function _o(n){return new F(n)}function Bo(n){return new te(n)}function Mo(n){return new A(n)}function ae(n){return new b(n)}function Fo(n){return new re(n)}function Oo(n){return new ne(n)}function Do(n){return new ie(n)}function Lr(n){return new U(n)}function $o(n){return new $(n)}function Wo(n){return ae(t=>{t.write("throw "),t.writeNode(Lr(n))})}function Vo(n){return new oe(n)}function jo(n){return new D(n)}function Yo(n){return new O(n)}function zo(n){return new we(n)}function Go(n,t){return ae(e=>{e.writeNodeOrString(n),e.write(" = "),e.writeNodeOrString(t)})}function qo(n){return ae(q(n))}function Ho(n){return ae(`"${n}"`)}function Zo(...n){return new _e(n)}function Jo(){return new b(n=>{n.write("$this")})}f();u();var Be=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":case"set":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"unknown":return this.convertUnknown({value:t.value});default:T(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.string(r)}default:T(t)}}convertList({list:t,value:e}){return Array.isArray(e)?d.TypeLiteral.list({values:e.map((r,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:r})}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.map({entries:Object.entries(e).map(([r,i])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:r}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r});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:T(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){return d.TypeLiteral.string("todo")}convertObject({object_:t,value:e}){var i;let r=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return d.TypeLiteral.class_({reference:d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),fields:r.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 r=this.getEnumValueName({enum_:t,value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.reference(d.codeblock(i=>{i.writeNode(d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)})),i.write("::"),i.write(r),i.write("->value")}))}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:g.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(i=>i.wireValue===e);if(r==null){this.context.errors.add({severity:g.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return r==null?d.TypeLiteral.nop():r}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let r of t.types)try{return this.convert({typeReference:r,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:r}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.number(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(i)}case"DATE":case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.datetime(i)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.string(i)}default:T(t)}}getValueAsNumber({value:t,as:e}){let r=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:t,as:e}){let r=e==="key"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:r})}};f();u();var Me=class{constructor({context:t}){p(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let r={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let a of t.properties)switch(a.type){case"file":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getSingleFileProperty({property:a,record:i})});break;case"fileArray":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getArrayFileProperty({property:a,record:i})});break;case"bodyProperty":r.bodyPropertyFields.push({name:this.context.getPropertyName(a.name.name),value:this.getBodyProperty({property:a,record:i})});break;default:T(a)}return r}getSingleFileProperty({property:t,record:e}){let r=this.context.getSingleFileValue({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.file(r)}getArrayFileProperty({property:t,record:e}){let r=this.context.getFileArrayValues({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.list({values:r.map(i=>d.TypeLiteral.file(i))})}getBodyProperty({property:t,record:e}){let r=e[t.name.wireValue];return r==null?d.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:r})}};var Ko=["use","clone","list"],Qo="Requests",Xo="Types",qe=class n extends Te{constructor({ir:e,config:r}){var i;super({ir:e,config:r});p(this,"ir");p(this,"customConfig");p(this,"dynamicTypeLiteralMapper");p(this,"filePropertyMapper");p(this,"rootNamespace");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeLiteralMapper=new Be({context:this}),this.filePropertyMapper=new Me({context:this}),this.rootNamespace=ea({organization:r.organization,namespaceOverride:(i=this.customConfig)==null?void 0:i.namespace})}clone(){return new n({ir:this.ir,config:this.config})}getParameterName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getPropertyName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getMethodName(e){let r=e.camelCase.unsafeName;return Ko.includes(r)?r:e.camelCase.safeName}getClassName(e){return e.pascalCase.safeName}getRootClientClassName(){var e,r,i;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((r=this.customConfig)==null?void 0:r["client-class-name"])!=null?(i=this.customConfig)==null?void 0:i["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return d.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,Qo)}getTypesNamespace(e){return this.getNamespace(e,Xo)}getNamespace(e,r){let i=e.allParts.map(o=>o.pascalCase.safeName);return i=r!=null?[...i,r]:i,[this.rootNamespace,...i].join("\\")}getEnvironmentClassAccessFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return d.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference(r)),i.write("::"),i.write(this.getClassName(r))})}getEnvironmentClassReference(e){return d.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${ce(Ue(this.config.organization))}`}};function ea({organization:n,namespaceOverride:t}){return t!=null?t:`${ce(Ue(n))}`}0&&(module.exports={DynamicSnippetsGeneratorContext});
|
|
19
19
|
/*! Bundled license information:
|
|
20
20
|
|
|
21
21
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|