@fern-api/typescript-dynamic-snippets 0.0.7 → 0.0.8
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 +6 -6
- package/cjs/DynamicSnippetsGenerator.d.cts +4 -2
- package/cjs/{DynamicSnippetsGeneratorContext-DFkk3dho.d.cts → DynamicSnippetsGeneratorContext-CmDa2k9n.d.cts} +1 -1
- package/cjs/EndpointSnippetGenerator.cjs +6 -6
- package/cjs/EndpointSnippetGenerator.d.cts +1 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +11 -11
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
- package/cjs/context/DynamicTypeLiteralMapper.cjs +6 -6
- package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
- package/cjs/context/FilePropertyMapper.cjs +15 -15
- package/cjs/context/FilePropertyMapper.d.cts +1 -1
- package/cjs/index.cjs +18 -18
- package/cjs/index.d.cts +2 -1
- package/esm/DynamicSnippetsGenerator.d.ts +4 -2
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/{DynamicSnippetsGeneratorContext-DFkk3dho.d.ts → DynamicSnippetsGeneratorContext-CmDa2k9n.d.ts} +1 -1
- package/esm/EndpointSnippetGenerator.d.ts +1 -1
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/chunk-3SA25SVX.js +1 -0
- package/esm/chunk-D7ZDXIQ6.js +1 -0
- package/esm/{chunk-V6G7NZKW.js → chunk-DJQMPRPJ.js} +1 -1
- package/esm/chunk-JGNWFXNM.js +1 -0
- package/esm/chunk-RL2XA35J.js +27 -0
- package/esm/{chunk-25TNFA5L.js → chunk-T2HPPEKP.js} +1 -1
- package/esm/{chunk-LX5O4JB7.js → chunk-XC2QAVJY.js} +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
- package/esm/context/DynamicTypeLiteralMapper.js +1 -1
- package/esm/context/FilePropertyMapper.d.ts +1 -1
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.js +10 -10
- package/package.json +1 -1
- package/esm/chunk-736FTN3M.js +0 -1
- package/esm/chunk-CQ55KPJT.js +0 -1
- package/esm/chunk-SQLJANKO.js +0 -1
- package/esm/chunk-YD6EIACZ.js +0 -27
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";var te=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var We=(n,t,e)=>t in n?te(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var le=(n,t)=>()=>(n&&(t=n(n=0)),t);var ye=(n,t)=>{for(var e in t)te(n,e,{get:t[e],enumerable:!0})},Ge=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of je(t))!Ve.call(n,i)&&i!==e&&te(n,i,{get:()=>t[i],enumerable:!(r=$e(t,i))||r.enumerable});return n};var Je=n=>Ge(te({},"__esModule",{value:!0}),n);var f=(n,t,e)=>We(n,typeof t!="symbol"?t+"":t,e);function xe(){throw new Error("setTimeout has not been defined")}function ve(){throw new Error("clearTimeout has not been defined")}function Te(n){if(S===setTimeout)return setTimeout(n,0);if((S===xe||!S)&&setTimeout)return S=setTimeout,setTimeout(n,0);try{return S(n,0)}catch(t){try{return S.call(null,n,0)}catch(e){return S.call(this,n,0)}}}function ze(n){if(_===clearTimeout)return clearTimeout(n);if((_===ve||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(n);try{return _(n)}catch(t){try{return _.call(null,n)}catch(e){return _.call(this,n)}}}function Qe(){!W||!D||(W=!1,D.length?R=D.concat(R):re=-1,R.length&&ge())}function ge(){if(!W){var n=Te(Qe);W=!0;for(var t=R.length;t;){for(D=R,R=[];++re<t;)D&&D[re].run();re=-1,t=R.length}D=null,W=!1,ze(n)}}function He(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];R.push(new Ae(n,t)),R.length===1&&!W&&Te(ge)}function Ae(n,t){this.fun=n,this.array=t}function C(){}function ft(n){throw new Error("process.binding is not supported")}function ht(){return"/"}function mt(n){throw new Error("process.chdir is not supported")}function dt(){return 0}function wt(n){var t=yt.call(V)*.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 vt(){var n=new Date,t=n-xt;return t/1e3}var S,_,R,W,D,re,Xe,Ze,qe,Ke,et,tt,rt,nt,it,ot,st,at,ut,ct,lt,pt,V,yt,xt,w,we,l=le(()=>{"use strict";S=xe,_=ve;typeof globalThis.setTimeout=="function"&&(S=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);R=[],W=!1,re=-1;Ae.prototype.run=function(){this.fun.apply(null,this.array)};Xe="browser",Ze="browser",qe=!0,Ke={},et=[],tt="",rt={},nt={},it={};ot=C,st=C,at=C,ut=C,ct=C,lt=C,pt=C;V=globalThis.performance||{},yt=V.now||V.mozNow||V.msNow||V.oNow||V.webkitNow||function(){return new Date().getTime()};xt=new Date;w={nextTick:He,title:Xe,browser:qe,env:Ke,argv:et,version:tt,versions:rt,on:ot,addListener:st,once:at,off:ut,removeListener:ct,removeAllListeners:lt,emit:pt,binding:ft,cwd:ht,chdir:mt,umask:dt,hrtime:wt,platform:Ze,release:nt,config:it,uptime:vt},we={};Object.keys(we).forEach(n=>{let t=n.split("."),e=w;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=we[n]:e=e[i]||(e[i]={})}})});function Ne(){fe=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)b[t]=n[t],E[n.charCodeAt(t)]=t;E[45]=62,E[95]=63}function gt(n){fe||Ne();var t,e,r,i,o,s,u=n.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[u-2]==="="?2:n[u-1]==="="?1:0,s=new Tt(u*3/4-o),r=o>0?u-4:u;var c=0;for(t=0,e=0;t<r;t+=4,e+=3)i=E[n.charCodeAt(t)]<<18|E[n.charCodeAt(t+1)]<<12|E[n.charCodeAt(t+2)]<<6|E[n.charCodeAt(t+3)],s[c++]=i>>16&255,s[c++]=i>>8&255,s[c++]=i&255;return o===2?(i=E[n.charCodeAt(t)]<<2|E[n.charCodeAt(t+1)]>>4,s[c++]=i&255):o===1&&(i=E[n.charCodeAt(t)]<<10|E[n.charCodeAt(t+1)]<<4|E[n.charCodeAt(t+2)]>>2,s[c++]=i>>8&255,s[c++]=i&255),s}function At(n){return b[n>>18&63]+b[n>>12&63]+b[n>>6&63]+b[n&63]}function Et(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(At(r));return i.join("")}function Ee(n){fe||Ne();for(var t,e=n.length,r=e%3,i="",o=[],s=16383,u=0,c=e-r;u<c;u+=s)o.push(Et(n,u,u+s>c?c:u+s));return r===1?(t=n[e-1],i+=b[t>>2],i+=b[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=b[t>>10],i+=b[t>>4&63],i+=b[t<<2&63],i+="="),o.push(i),o.join("")}function ne(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(n,t){if(ne()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=a.prototype):(n===null&&(n=new a(t)),n.length=t),n}function a(n,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 he(this,n)}return Le(this,n,t,e)}function Le(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?Nt(n,t,e,r):typeof t=="string"?bt(n,t,e):Lt(n,t)}function Re(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 It(n,t,e,r){return Re(t),t<=0?k(n,t):e!==void 0?typeof r=="string"?k(n,t).fill(e,r):k(n,t).fill(e):k(n,t)}function he(n,t){if(Re(t),n=k(n,t<0?0:me(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function bt(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=ke(t,e)|0;n=k(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function pe(n,t){var e=t.length<0?0:me(t.length)|0;n=k(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function Nt(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),a.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=a.prototype):n=pe(n,t),n}function Lt(n,t){if(N(t)){var e=me(t.length)|0;return n=k(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"||Jt(t.length)?k(n,0):pe(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return pe(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function me(n){if(n>=ne())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ne().toString(16)+" bytes");return n|0}function N(n){return!!(n!=null&&n._isBuffer)}function ke(n,t){if(N(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 ie(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ce(n).length;default:if(r)return ie(n).length;t=(""+t).toLowerCase(),r=!0}}function Rt(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 Mt(this,t,e);case"utf8":case"utf-8":return _e(this,t,e);case"ascii":return Ct(this,t,e);case"latin1":case"binary":return Pt(this,t,e);case"base64":return Ft(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ot(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function P(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function Ue(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=a.from(t,r)),N(t))return t.length===0?-1:Ie(n,t,e,r,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):Ie(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function Ie(n,t,e,r,i){var o=1,s=n.length,u=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,s/=2,u/=2,e/=2}function c(A,j){return o===1?A[j]:A.readUInt16BE(j*o)}var d;if(i){var y=-1;for(d=e;d<s;d++)if(c(n,d)===c(t,y===-1?0:d-y)){if(y===-1&&(y=d),d-y+1===u)return y*o}else y!==-1&&(d-=d-y),y=-1}else for(e+u>s&&(e=s-u),d=e;d>=0;d--){for(var m=!0,v=0;v<u;v++)if(c(n,d+v)!==c(t,v)){m=!1;break}if(m)return d}return-1}function kt(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 s=0;s<r;++s){var u=parseInt(t.substr(s*2,2),16);if(isNaN(u))return s;n[e+s]=u}return s}function Ut(n,t,e,r){return ae(ie(t,n.length-e),n,e,r)}function Se(n,t,e,r){return ae(Wt(t),n,e,r)}function St(n,t,e,r){return Se(n,t,e,r)}function _t(n,t,e,r){return ae(Ce(t),n,e,r)}function Bt(n,t,e,r){return ae(Gt(t,n.length-e),n,e,r)}function Ft(n,t,e){return t===0&&e===n.length?Ee(n):Ee(n.slice(t,e))}function _e(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],s=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=e){var c,d,y,m;switch(u){case 1:o<128&&(s=o);break;case 2:c=n[i+1],(c&192)===128&&(m=(o&31)<<6|c&63,m>127&&(s=m));break;case 3:c=n[i+1],d=n[i+2],(c&192)===128&&(d&192)===128&&(m=(o&15)<<12|(c&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:c=n[i+1],d=n[i+2],y=n[i+3],(c&192)===128&&(d&192)===128&&(y&192)===128&&(m=(o&15)<<18|(c&63)<<12|(d&63)<<6|y&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=u}return Dt(r)}function Dt(n){var t=n.length;if(t<=be)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=be));return e}function Ct(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 Pt(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 Mt(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+=Vt(n[o]);return i}function Ot(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 T(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 g(n,t,e,r,i,o){if(!N(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 oe(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 se(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 Be(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 Fe(n,t,e,r,i){return i||Be(n,t,e,4,34028234663852886e22,-34028234663852886e22),Me(n,t,e,r,23,4),e+4}function De(n,t,e,r,i){return i||Be(n,t,e,8,17976931348623157e292,-17976931348623157e292),Me(n,t,e,r,52,8),e+8}function $t(n){if(n=jt(n).replace(Yt,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function jt(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Vt(n){return n<16?"0"+n.toString(16):n.toString(16)}function ie(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],s=0;s<r;++s){if(e=n.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+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 Wt(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Gt(n,t){for(var e,r,i,o=[],s=0;s<n.length&&!((t-=2)<0);++s)e=n.charCodeAt(s),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function Ce(n){return gt($t(n))}function ae(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 Jt(n){return n!==n}function zt(n){return n!=null&&(!!n._isBuffer||Pe(n)||Qt(n))}function Pe(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Qt(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&Pe(n.slice(0,0))}function ue(n,t,e,r,i){var o,s,u=i*8-r-1,c=(1<<u)-1,d=c>>1,y=-7,m=e?i-1:0,v=e?-1:1,A=n[t+m];for(m+=v,o=A&(1<<-y)-1,A>>=-y,y+=u;y>0;o=o*256+n[t+m],m+=v,y-=8);for(s=o&(1<<-y)-1,o>>=-y,y+=r;y>0;s=s*256+n[t+m],m+=v,y-=8);if(o===0)o=1-d;else{if(o===c)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-d}return(A?-1:1)*s*Math.pow(2,o-r)}function Me(n,t,e,r,i,o){var s,u,c,d=o*8-i-1,y=(1<<d)-1,m=y>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:o-1,j=r?1:-1,Ye=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=y):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+m>=1?t+=v/c:t+=v*Math.pow(2,1-m),t*c>=2&&(s++,c/=2),s+m>=y?(u=0,s=y):s+m>=1?(u=(t*c-1)*Math.pow(2,i),s=s+m):(u=t*Math.pow(2,m-1)*Math.pow(2,i),s=0));i>=8;n[e+A]=u&255,A+=j,u/=256,i-=8);for(s=s<<i|u,d+=i;d>0;n[e+A]=s&255,A+=j,s/=256,d-=8);n[e+A-j]|=Ye*128}var b,E,Tt,fe,be,Yt,Oe=le(()=>{"use strict";l();p();b=[],E=[],Tt=typeof Uint8Array!="undefined"?Uint8Array:Array,fe=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(n){return n.__proto__=a.prototype,n};a.from=function(n,t,e){return Le(null,n,t,e)};a.kMaxLength=ne();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(n,t,e){return It(null,n,t,e)};a.allocUnsafe=function(n){return he(null,n)};a.allocUnsafeSlow=function(n){return he(null,n)};a.isBuffer=zt;a.compare=function(t,e){if(!N(t)||!N(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,s=Math.min(r,i);o<s;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?1:0};a.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}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!N(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=ke;a.prototype._isBuffer=!0;a.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)P(this,e,e+1);return this};a.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)P(this,e,e+3),P(this,e+1,e+2);return this};a.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)P(this,e,e+7),P(this,e+1,e+6),P(this,e+2,e+5),P(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?_e(this,0,t):Rt.apply(this,arguments)};a.prototype.equals=function(t){if(!N(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,r,i,o){if(!N(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 s=o-i,u=r-e,c=Math.min(s,u),d=this.slice(i,o),y=t.slice(e,r),m=0;m<c;++m)if(d[m]!==y[m]){s=d[m],u=y[m];break}return s<u?-1:u<s?1:0};a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};a.prototype.indexOf=function(t,e,r){return Ue(this,t,e,r,!0)};a.prototype.lastIndexOf=function(t,e,r){return Ue(this,t,e,r,!1)};a.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 s=!1;;)switch(i){case"hex":return kt(this,t,e,r);case"utf8":case"utf-8":return Ut(this,t,e,r);case"ascii":return Se(this,t,e,r);case"latin1":case"binary":return St(this,t,e,r);case"base64":return _t(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};be=4096;a.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(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var o=e-t;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+t]}return i};a.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return i};a.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=e,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),ue(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),ue(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),ue(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),ue(this,t,!1,52,8)};a.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;g(this,t,e,r,o,0)}var s=1,u=0;for(this[e]=t&255;++u<r&&(s*=256);)this[e+u]=t/s&255;return e+r};a.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;g(this,t,e,r,o,0)}var s=r-1,u=1;for(this[e+s]=t&255;--s>=0&&(u*=256);)this[e+s]=t/u&255;return e+r};a.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):oe(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):oe(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):se(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):se(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);g(this,t,e,r,o-1,-o)}var s=0,u=1,c=0;for(this[e]=t&255;++s<r&&(u*=256);)t<0&&c===0&&this[e+s-1]!==0&&(c=1),this[e+s]=(t/u>>0)-c&255;return e+r};a.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);g(this,t,e,r,o-1,-o)}var s=r-1,u=1,c=0;for(this[e+s]=t&255;--s>=0&&(u*=256);)t<0&&c===0&&this[e+s+1]!==0&&(c=1),this[e+s]=(t/u>>0)-c&255;return e+r};a.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):oe(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):oe(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):se(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):se(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,r){return Fe(this,t,e,!0,r)};a.prototype.writeFloatBE=function(t,e,r){return Fe(this,t,e,!1,r)};a.prototype.writeDoubleLE=function(t,e,r){return De(this,t,e,!0,r)};a.prototype.writeDoubleBE=function(t,e,r){return De(this,t,e,!1,r)};a.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,s;if(this===t&&r<e&&e<i)for(s=o-1;s>=0;--s)t[s+e]=this[s+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};a.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"&&!a.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 s;if(typeof t=="number")for(s=e;s<r;++s)this[s]=t;else{var u=N(t)?t:ie(new a(t,i).toString()),c=u.length;for(s=0;s<r-e;++s)this[s+e]=u[s%c]}return this};Yt=/[^+\/0-9A-Za-z-_]/g});var p=le(()=>{"use strict";Oe()});var cr={};ye(cr,{DynamicTypeLiteralMapper:()=>de});module.exports=Je(cr);l();p();l();p();l();p();function I(n){throw new Error("Unexpected value: "+JSON.stringify(n))}l();p();l();p();var M=class{};l();p();l();p();var B=class extends M{constructor(e){super();f(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var Ht=4,q=class{constructor(){f(this,"buffer","");f(this,"indentLevel",0);f(this,"hasWrittenAnything",!1);f(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
1
|
+
"use strict";var te=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var We=(n,t,e)=>t in n?te(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var le=(n,t)=>()=>(n&&(t=n(n=0)),t);var ye=(n,t)=>{for(var e in t)te(n,e,{get:t[e],enumerable:!0})},Ge=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of je(t))!Ve.call(n,i)&&i!==e&&te(n,i,{get:()=>t[i],enumerable:!(r=$e(t,i))||r.enumerable});return n};var Je=n=>Ge(te({},"__esModule",{value:!0}),n);var f=(n,t,e)=>We(n,typeof t!="symbol"?t+"":t,e);function xe(){throw new Error("setTimeout has not been defined")}function ve(){throw new Error("clearTimeout has not been defined")}function Te(n){if(_===setTimeout)return setTimeout(n,0);if((_===xe||!_)&&setTimeout)return _=setTimeout,setTimeout(n,0);try{return _(n,0)}catch(t){try{return _.call(null,n,0)}catch(e){return _.call(this,n,0)}}}function ze(n){if(B===clearTimeout)return clearTimeout(n);if((B===ve||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(n);try{return B(n)}catch(t){try{return B.call(null,n)}catch(e){return B.call(this,n)}}}function Qe(){!W||!C||(W=!1,C.length?k=C.concat(k):re=-1,k.length&&ge())}function ge(){if(!W){var n=Te(Qe);W=!0;for(var t=k.length;t;){for(C=k,k=[];++re<t;)C&&C[re].run();re=-1,t=k.length}C=null,W=!1,ze(n)}}function He(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];k.push(new Ae(n,t)),k.length===1&&!W&&Te(ge)}function Ae(n,t){this.fun=n,this.array=t}function D(){}function ft(n){throw new Error("process.binding is not supported")}function ht(){return"/"}function mt(n){throw new Error("process.chdir is not supported")}function dt(){return 0}function wt(n){var t=yt.call(V)*.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 vt(){var n=new Date,t=n-xt;return t/1e3}var _,B,k,W,C,re,Xe,Ze,qe,Ke,et,tt,rt,nt,it,ot,st,at,ut,ct,lt,pt,V,yt,xt,w,we,l=le(()=>{"use strict";_=xe,B=ve;typeof globalThis.setTimeout=="function"&&(_=setTimeout);typeof globalThis.clearTimeout=="function"&&(B=clearTimeout);k=[],W=!1,re=-1;Ae.prototype.run=function(){this.fun.apply(null,this.array)};Xe="browser",Ze="browser",qe=!0,Ke={},et=[],tt="",rt={},nt={},it={};ot=D,st=D,at=D,ut=D,ct=D,lt=D,pt=D;V=globalThis.performance||{},yt=V.now||V.mozNow||V.msNow||V.oNow||V.webkitNow||function(){return new Date().getTime()};xt=new Date;w={nextTick:He,title:Xe,browser:qe,env:Ke,argv:et,version:tt,versions:rt,on:ot,addListener:st,once:at,off:ut,removeListener:ct,removeAllListeners:lt,emit:pt,binding:ft,cwd:ht,chdir:mt,umask:dt,hrtime:wt,platform:Ze,release:nt,config:it,uptime:vt},we={};Object.keys(we).forEach(n=>{let t=n.split("."),e=w;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=we[n]:e=e[i]||(e[i]={})}})});function Ne(){fe=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)b[t]=n[t],E[n.charCodeAt(t)]=t;E[45]=62,E[95]=63}function gt(n){fe||Ne();var t,e,r,i,o,s,u=n.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[u-2]==="="?2:n[u-1]==="="?1:0,s=new Tt(u*3/4-o),r=o>0?u-4:u;var c=0;for(t=0,e=0;t<r;t+=4,e+=3)i=E[n.charCodeAt(t)]<<18|E[n.charCodeAt(t+1)]<<12|E[n.charCodeAt(t+2)]<<6|E[n.charCodeAt(t+3)],s[c++]=i>>16&255,s[c++]=i>>8&255,s[c++]=i&255;return o===2?(i=E[n.charCodeAt(t)]<<2|E[n.charCodeAt(t+1)]>>4,s[c++]=i&255):o===1&&(i=E[n.charCodeAt(t)]<<10|E[n.charCodeAt(t+1)]<<4|E[n.charCodeAt(t+2)]>>2,s[c++]=i>>8&255,s[c++]=i&255),s}function At(n){return b[n>>18&63]+b[n>>12&63]+b[n>>6&63]+b[n&63]}function Et(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(At(r));return i.join("")}function Ee(n){fe||Ne();for(var t,e=n.length,r=e%3,i="",o=[],s=16383,u=0,c=e-r;u<c;u+=s)o.push(Et(n,u,u+s>c?c:u+s));return r===1?(t=n[e-1],i+=b[t>>2],i+=b[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=b[t>>10],i+=b[t>>4&63],i+=b[t<<2&63],i+="="),o.push(i),o.join("")}function ne(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(n,t){if(ne()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=a.prototype):(n===null&&(n=new a(t)),n.length=t),n}function a(n,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 he(this,n)}return Le(this,n,t,e)}function Le(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?Nt(n,t,e,r):typeof t=="string"?bt(n,t,e):Lt(n,t)}function Re(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 It(n,t,e,r){return Re(t),t<=0?U(n,t):e!==void 0?typeof r=="string"?U(n,t).fill(e,r):U(n,t).fill(e):U(n,t)}function he(n,t){if(Re(t),n=U(n,t<0?0:me(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function bt(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=ke(t,e)|0;n=U(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function pe(n,t){var e=t.length<0?0:me(t.length)|0;n=U(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function Nt(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),a.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=a.prototype):n=pe(n,t),n}function Lt(n,t){if(N(t)){var e=me(t.length)|0;return n=U(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"||Jt(t.length)?U(n,0):pe(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return pe(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function me(n){if(n>=ne())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ne().toString(16)+" bytes");return n|0}function N(n){return!!(n!=null&&n._isBuffer)}function ke(n,t){if(N(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 ie(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return De(n).length;default:if(r)return ie(n).length;t=(""+t).toLowerCase(),r=!0}}function Rt(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 Mt(this,t,e);case"utf8":case"utf-8":return _e(this,t,e);case"ascii":return Dt(this,t,e);case"latin1":case"binary":return Pt(this,t,e);case"base64":return Ft(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ot(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function P(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function Ue(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=a.from(t,r)),N(t))return t.length===0?-1:Ie(n,t,e,r,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):Ie(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function Ie(n,t,e,r,i){var o=1,s=n.length,u=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,s/=2,u/=2,e/=2}function c(A,j){return o===1?A[j]:A.readUInt16BE(j*o)}var d;if(i){var y=-1;for(d=e;d<s;d++)if(c(n,d)===c(t,y===-1?0:d-y)){if(y===-1&&(y=d),d-y+1===u)return y*o}else y!==-1&&(d-=d-y),y=-1}else for(e+u>s&&(e=s-u),d=e;d>=0;d--){for(var m=!0,v=0;v<u;v++)if(c(n,d+v)!==c(t,v)){m=!1;break}if(m)return d}return-1}function kt(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 s=0;s<r;++s){var u=parseInt(t.substr(s*2,2),16);if(isNaN(u))return s;n[e+s]=u}return s}function Ut(n,t,e,r){return ae(ie(t,n.length-e),n,e,r)}function Se(n,t,e,r){return ae(Wt(t),n,e,r)}function St(n,t,e,r){return Se(n,t,e,r)}function _t(n,t,e,r){return ae(De(t),n,e,r)}function Bt(n,t,e,r){return ae(Gt(t,n.length-e),n,e,r)}function Ft(n,t,e){return t===0&&e===n.length?Ee(n):Ee(n.slice(t,e))}function _e(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],s=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=e){var c,d,y,m;switch(u){case 1:o<128&&(s=o);break;case 2:c=n[i+1],(c&192)===128&&(m=(o&31)<<6|c&63,m>127&&(s=m));break;case 3:c=n[i+1],d=n[i+2],(c&192)===128&&(d&192)===128&&(m=(o&15)<<12|(c&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:c=n[i+1],d=n[i+2],y=n[i+3],(c&192)===128&&(d&192)===128&&(y&192)===128&&(m=(o&15)<<18|(c&63)<<12|(d&63)<<6|y&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=u}return Ct(r)}function Ct(n){var t=n.length;if(t<=be)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=be));return e}function Dt(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 Pt(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 Mt(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+=Vt(n[o]);return i}function Ot(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 T(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 g(n,t,e,r,i,o){if(!N(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 oe(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 se(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 Be(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 Fe(n,t,e,r,i){return i||Be(n,t,e,4,34028234663852886e22,-34028234663852886e22),Me(n,t,e,r,23,4),e+4}function Ce(n,t,e,r,i){return i||Be(n,t,e,8,17976931348623157e292,-17976931348623157e292),Me(n,t,e,r,52,8),e+8}function $t(n){if(n=jt(n).replace(Yt,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function jt(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Vt(n){return n<16?"0"+n.toString(16):n.toString(16)}function ie(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],s=0;s<r;++s){if(e=n.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+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 Wt(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Gt(n,t){for(var e,r,i,o=[],s=0;s<n.length&&!((t-=2)<0);++s)e=n.charCodeAt(s),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function De(n){return gt($t(n))}function ae(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 Jt(n){return n!==n}function zt(n){return n!=null&&(!!n._isBuffer||Pe(n)||Qt(n))}function Pe(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Qt(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&Pe(n.slice(0,0))}function ue(n,t,e,r,i){var o,s,u=i*8-r-1,c=(1<<u)-1,d=c>>1,y=-7,m=e?i-1:0,v=e?-1:1,A=n[t+m];for(m+=v,o=A&(1<<-y)-1,A>>=-y,y+=u;y>0;o=o*256+n[t+m],m+=v,y-=8);for(s=o&(1<<-y)-1,o>>=-y,y+=r;y>0;s=s*256+n[t+m],m+=v,y-=8);if(o===0)o=1-d;else{if(o===c)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-d}return(A?-1:1)*s*Math.pow(2,o-r)}function Me(n,t,e,r,i,o){var s,u,c,d=o*8-i-1,y=(1<<d)-1,m=y>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:o-1,j=r?1:-1,Ye=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=y):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+m>=1?t+=v/c:t+=v*Math.pow(2,1-m),t*c>=2&&(s++,c/=2),s+m>=y?(u=0,s=y):s+m>=1?(u=(t*c-1)*Math.pow(2,i),s=s+m):(u=t*Math.pow(2,m-1)*Math.pow(2,i),s=0));i>=8;n[e+A]=u&255,A+=j,u/=256,i-=8);for(s=s<<i|u,d+=i;d>0;n[e+A]=s&255,A+=j,s/=256,d-=8);n[e+A-j]|=Ye*128}var b,E,Tt,fe,be,Yt,Oe=le(()=>{"use strict";l();p();b=[],E=[],Tt=typeof Uint8Array!="undefined"?Uint8Array:Array,fe=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(n){return n.__proto__=a.prototype,n};a.from=function(n,t,e){return Le(null,n,t,e)};a.kMaxLength=ne();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(n,t,e){return It(null,n,t,e)};a.allocUnsafe=function(n){return he(null,n)};a.allocUnsafeSlow=function(n){return he(null,n)};a.isBuffer=zt;a.compare=function(t,e){if(!N(t)||!N(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,s=Math.min(r,i);o<s;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?1:0};a.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}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!N(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=ke;a.prototype._isBuffer=!0;a.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)P(this,e,e+1);return this};a.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)P(this,e,e+3),P(this,e+1,e+2);return this};a.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)P(this,e,e+7),P(this,e+1,e+6),P(this,e+2,e+5),P(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?_e(this,0,t):Rt.apply(this,arguments)};a.prototype.equals=function(t){if(!N(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,r,i,o){if(!N(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 s=o-i,u=r-e,c=Math.min(s,u),d=this.slice(i,o),y=t.slice(e,r),m=0;m<c;++m)if(d[m]!==y[m]){s=d[m],u=y[m];break}return s<u?-1:u<s?1:0};a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};a.prototype.indexOf=function(t,e,r){return Ue(this,t,e,r,!0)};a.prototype.lastIndexOf=function(t,e,r){return Ue(this,t,e,r,!1)};a.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 s=!1;;)switch(i){case"hex":return kt(this,t,e,r);case"utf8":case"utf-8":return Ut(this,t,e,r);case"ascii":return Se(this,t,e,r);case"latin1":case"binary":return St(this,t,e,r);case"base64":return _t(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};be=4096;a.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(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var o=e-t;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+t]}return i};a.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return i};a.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=e,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),ue(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),ue(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),ue(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),ue(this,t,!1,52,8)};a.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;g(this,t,e,r,o,0)}var s=1,u=0;for(this[e]=t&255;++u<r&&(s*=256);)this[e+u]=t/s&255;return e+r};a.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;g(this,t,e,r,o,0)}var s=r-1,u=1;for(this[e+s]=t&255;--s>=0&&(u*=256);)this[e+s]=t/u&255;return e+r};a.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):oe(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):oe(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):se(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):se(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);g(this,t,e,r,o-1,-o)}var s=0,u=1,c=0;for(this[e]=t&255;++s<r&&(u*=256);)t<0&&c===0&&this[e+s-1]!==0&&(c=1),this[e+s]=(t/u>>0)-c&255;return e+r};a.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);g(this,t,e,r,o-1,-o)}var s=r-1,u=1,c=0;for(this[e+s]=t&255;--s>=0&&(u*=256);)t<0&&c===0&&this[e+s+1]!==0&&(c=1),this[e+s]=(t/u>>0)-c&255;return e+r};a.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):oe(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):oe(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):se(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||g(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):se(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,r){return Fe(this,t,e,!0,r)};a.prototype.writeFloatBE=function(t,e,r){return Fe(this,t,e,!1,r)};a.prototype.writeDoubleLE=function(t,e,r){return Ce(this,t,e,!0,r)};a.prototype.writeDoubleBE=function(t,e,r){return Ce(this,t,e,!1,r)};a.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,s;if(this===t&&r<e&&e<i)for(s=o-1;s>=0;--s)t[s+e]=this[s+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};a.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"&&!a.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 s;if(typeof t=="number")for(s=e;s<r;++s)this[s]=t;else{var u=N(t)?t:ie(new a(t,i).toString()),c=u.length;for(s=0;s<r-e;++s)this[s+e]=u[s%c]}return this};Yt=/[^+\/0-9A-Za-z-_]/g});var p=le(()=>{"use strict";Oe()});var cr={};ye(cr,{DynamicTypeLiteralMapper:()=>de});module.exports=Je(cr);l();p();l();p();l();p();function I(n){throw new Error("Unexpected value: "+JSON.stringify(n))}l();p();l();p();var M=class{};l();p();l();p();var L=class extends M{constructor(e){super();f(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var Ht=4,q=class{constructor(){f(this,"buffer","");f(this,"indentLevel",0);f(this,"hasWrittenAnything",!1);f(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
|
-
`),this.writeInternal(o)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new
|
|
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 L(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new L(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new L(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new L(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",r,i="}"){let o=t.filter(s=>s!==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 s=t[o];s!=null&&r(s)}}}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*Ht)}};l();p();var ce=class{},K=class extends ce{async format(t){return t}formatSync(t){return t}};l();p();l();p();var
|
|
8
|
+
`)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*Ht)}};l();p();var ce=class{},K=class extends ce{async format(t){return t}formatSync(t){return t}};l();p();l();p();var R={Critical:"CRITICAL",Warning:"WARNING"};l();p();var h={};ye(h,{AstNode:()=>x,ClassInstantiation:()=>Z,CodeBlock:()=>G,Comment:()=>F,Function:()=>Q,FunctionInvocation:()=>H,MethodInvocation:()=>X,Parameter:()=>z,Reference:()=>$,Type:()=>Y,TypeLiteral:()=>S,Types:()=>Y,Variable:()=>J,Writer:()=>O,codeblock:()=>er,function_:()=>tr,instantiateClass:()=>rr,invokeFunction:()=>nr,invokeMethod:()=>ir,parameter:()=>or,reference:()=>sr,variable:()=>ar});l();p();l();p();l();p();l();p();l();p();l();p();var O=class extends q{constructor({customConfig:e,formatter:r}){super();f(this,"customConfig");f(this,"formatter");f(this,"imports",{});f(this,"defaultImports",{});f(this,"starImportAliases",{});f(this,"starImportAliasesInverse",{});this.customConfig=e,this.formatter=r!=null?r:new K}addImport(e){var r,i,o;if(e.importFrom!=null){switch(e.importFrom.type){case"default":{this.validateDefault(e);break}case"named":{this.validateNamed(e);break}case"star":{this.validateStar(e);break}}let s=(o=(r=this.imports)[i=e.importFrom.moduleName])!=null?o:r[i]=[];s.map(c=>c.name).includes(e.name)||s.push(e)}}validateDefault(e){var i,o,s,u;if(((i=e.importFrom)==null?void 0:i.type)!=="default")return;let r=(u=(o=this.defaultImports)[s=e.importFrom.moduleName])!=null?u:o[s]=e;if(r.name!==e.name)throw new Error(`Cannot have multiple default imports for module ${e.importFrom.moduleName}: got ${e.name} but already had ${r.name}`)}validateNamed(e){var s,u,c,d,y;if(((s=e.importFrom)==null?void 0:s.type)!=="named")return;let i=((u=this.imports[e.importFrom.moduleName])!=null?u:[]).filter(m=>{var v;return((v=m.importFrom)==null?void 0:v.type)==="star"});if(i.length>0)throw new Error(`Cannot add named import ${e.name} because non-named imports ${i.map(m=>m.name)} already exist`);let o=[];for(let m of Object.values(this.imports))for(let v of m)((c=v.importFrom)==null?void 0:c.type)==="named"&&v.importFrom.moduleName!==e.importFrom.moduleName&&v.name===e.name&&o.push(v);if(o.length>0)throw new Error(`Cannot add named import from module ${e.importFrom.moduleName} because it is already imported from ${(y=(d=o[0])==null?void 0:d.importFrom)==null?void 0:y.moduleName}`)}validateStar(e){var o,s,u,c,d,y,m;if(((o=e.importFrom)==null?void 0:o.type)!=="star")return;let r=(c=(s=this.starImportAliases)[u=e.importFrom.moduleName])!=null?c:s[u]=e.importFrom.starImportAlias;if(r!==e.importFrom.starImportAlias)throw new Error(`Cannot have more than one alias for non-named imports from a module: got ${e.importFrom.starImportAlias} but already have ${r}.`);if(((m=(d=this.starImportAliasesInverse)[y=e.importFrom.starImportAlias])!=null?m:d[y]=e.importFrom.moduleName)!==e.importFrom.moduleName)throw new Error(`Attempted to use alias ${e.importFrom.starImportAlias} for more than one module in the same file`)}};var ee=class extends O{constructor({customConfig:t,formatter:e}){super({customConfig:t,formatter:e})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
|
|
9
9
|
${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
|
|
10
10
|
${t}`)}return t}getContent(){let t=this.stringifyImports();return t.length>0?t+`
|
|
11
11
|
`+this.buffer:this.buffer}stringifyImports(){let t="";for(let[e,r]of Object.entries(this.imports)){let i=this.defaultImports[e],o="",s=r.filter(c=>{var d;return((d=c.importFrom)==null?void 0:d.type)==="named"}),u=this.starImportAliases[e];if(s.length>0||i!=null||u!=null){if(t+="import",i!=null&&(t+=` ${i.name}`),s.length>0){for(let d of s.slice(0,-1))o+=`${d.name}, `;let c=s[s.length-1];c!=null&&(o+=`${c.name}`),i!=null&&(t+=","),t+=` { ${o} }`}u!=null&&((i!=null||s.length>0)&&(t+=", "),t+=` * as ${u}`),t+=` from "${e}";
|
|
12
|
-
`}}return t}};var x=class extends M{async toStringAsync({customConfig:t,formatter:e}){let r=new ee({customConfig:t,formatter:e});return this.write(r),await r.toStringAsync()}toString({customConfig:t,formatter:e}){let r=new ee({customConfig:t,formatter:e});return this.write(r),r.toString()}};l();p();var G=class extends x{constructor(e){super();f(this,"args");this.args=e}write(e){return new
|
|
12
|
+
`}}return t}};var x=class extends M{async toStringAsync({customConfig:t,formatter:e}){let r=new ee({customConfig:t,formatter:e});return this.write(r),await r.toStringAsync()}toString({customConfig:t,formatter:e}){let r=new ee({customConfig:t,formatter:e});return this.write(r),r.toString()}};l();p();var G=class extends x{constructor(e){super();f(this,"args");this.args=e}write(e){return new L(this.args).write(e)}};l();p();var Y=class extends x{constructor(e){super();f(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"string":e.write("string");break;case"number":e.write("number");break;case"bigint":e.write("bigint");break;case"boolean":e.write("boolean");break;case"array":this.internalType.valueType.write(e),e.write("[]");break;case"map":e.write("Record<"),this.internalType.keyType.write(e),e.write(", "),this.internalType.valueType.write(e),e.write(">");break;case"object":e.write("{"),e.indent();for(let[r,i]of Object.entries(this.internalType.fields))e.write(`${r}: `),i.write(e),e.writeLine(",");e.dedent(),e.write("}");break;case"enum":e.write("enum");break;case"any":e.write("any");break;case"promise":e.write("Promise<"),this.internalType.value.write(e),e.write(">");break;case"unknown":e.write("unknown");break;case"void":e.write("void");break;case"undefined":e.write("undefined");break;case"null":e.write("null");break;case"never":e.write("never");break;case"nop":break;default:I(this.internalType)}}static string(){return new this({type:"string"})}static number(){return new this({type:"number"})}static bigint(){return new this({type:"bigint"})}static boolean(){return new this({type:"boolean"})}static array(e){return new this({type:"array",valueType:e})}static object(e){return new this({type:"object",fields:e})}static enum(e){return new this({type:"enum",values:e})}static any(){return new this({type:"any"})}static promise(e){return e.internalType.type==="promise"?e:new this({type:"promise",value:e})}static unknown(){return new this({type:"unknown"})}static void(){return new this({type:"void"})}static undefined(){return new this({type:"undefined"})}static null(){return new this({type:"null"})}static never(){return new this({type:"never"})}static nop(){return new this({type:"nop"})}};l();p();var S=class n extends x{constructor(e){super();f(this,"internalType");this.internalType=e}write(e){var o,s;let r=!!((o=e.customConfig)!=null&&o.noSerdeLayer),i=!!((s=e.customConfig)!=null&&s.useBigInt);switch(this.internalType.type){case"array":{this.writeIterable({writer:e,iterable:this.internalType});break}case"blob":{if(r){e.writeNode(n.string(this.internalType.value));return}e.write("new Blob(["),e.writeNode(n.string(this.internalType.value)),e.write("])");break}case"boolean":{e.write(this.internalType.value.toString());break}case"bigint":{if(i){e.write(`BigInt("${this.internalType.value.toString()}")`);return}e.write(`"${this.internalType.value.toString()}"`);return}case"datetime":{if(r){e.writeNode(n.string(this.internalType.value));return}e.write("new Date("),e.writeNode(n.string(this.internalType.value)),e.write(")");break}case"number":{e.write(this.internalType.value.toString());break}case"object":{this.writeObject({writer:e,object:this.internalType});break}case"record":{this.writeRecord({writer:e,record:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"set":{if(r||this.isSetOfObjects()){e.writeNode(n.array({values:this.internalType.values}));return}e.write("new Set("),this.writeIterable({writer:e,iterable:this.internalType}),e.write(")");break}case"string":{this.internalType.value.includes(`
|
|
13
13
|
`)?this.writeStringWithBackticks({writer:e,value:this.internalType.value}):e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}case"tuple":{this.writeIterable({writer:e,iterable:this.internalType});break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:I(this.internalType)}}isObject(){return this.internalType.type==="object"}asObjectOrThrow(){if(this.isObject())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not an object")}isSet(){return this.internalType.type==="set"}asSetOrThrow(){if(this.isSet())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a set")}isSetOfObjects(){return this.isSet()&&this.asSetOrThrow().values.every(e=>e.isObject())}writeStringWithBackticks({writer:e,value:r}){e.write("`");let i=r.split(`
|
|
14
14
|
`),o=i[0]+`
|
|
15
15
|
`,s=i.slice(1).join(`
|
|
16
|
-
`);e.write(o.replaceAll("`","\\`")),e.writeNoIndent(s.replaceAll("`","\\`")),e.write("`")}writeIterable({writer:e,iterable:r}){let i=qt({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("]")}writeRecord({writer:e,record:r}){let i=Zt({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("}")}writeObject({writer:e,object:r}){let i=Xt({fields:r.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}static array({values:e}){return new this({type:"array",values:e})}static bigint(e){return new this({type:"bigint",value:e})}static blob(e){return new this({type:"blob",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static object({fields:e}){return new this({type:"object",fields:e})}static record({entries:e}){return new this({type:"record",entries:e})}static reference(e){return new this({type:"reference",value:e})}static set({values:e}){return new this({type:"set",values:e})}static string(e){return new this({type:"string",value:e})}static tuple({values:e}){return new this({type:"tuple",values:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value: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.writeUnknownObject({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("]")}writeUnknownObject({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,s]of i)e.write(`${o}: `),e.writeNode(n.unknown(s)),e.writeLine(",");e.dedent(),e.write("}")}};function Xt({fields:n}){return n.filter(t=>!
|
|
17
|
-
`).forEach(r=>{e.writeLine(` * ${r}`)}),e.writeLine("*/"))}};var z=class extends x{constructor({name:e,type:r,docs:i}){super();f(this,"name");f(this,"type");f(this,"docs");this.name=e,this.type=r,this.docs=i}write(e){this.docs!=null&&e.writeNode(new F({docs:this.docs})),e.write(`${this.name}: `),this.type.write(e)}};l();p();var Q=class extends x{constructor({name:e,parameters:r,async:i,body:o,return_:s,docs:u}){super();f(this,"name");f(this,"parameters");f(this,"async");f(this,"body");f(this,"return_");f(this,"docs");this.name=e,this.parameters=r,this.async=i!=null?i:!1,this.body=o,this.return_=s,this.docs=u}write(e){var r;e.writeNode(new F({docs:this.docs})),this.async&&e.write("async "),e.write("function "),e.write(`${this.name}`),this.writeParameters(e),this.return_!=null&&(e.write(": "),e.writeNode(this.async?Y.promise(this.return_):this.return_)),e.writeLine(" {"),e.indent(),(r=this.body)==null||r.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeParameters(e){if(this.parameters.length===0){e.write("()");return}e.indent(),e.writeLine("(");for(let r of this.parameters)e.writeNode(r),e.writeLine(",");e.dedent(),e.write(")")}};l();p();var H=class extends x{constructor({function_:e,arguments_:r}){super();f(this,"function_");f(this,"arguments_");this.function_=e,this.arguments_=r}write(e){e.writeNode(this.function_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(e)}),e.write(")")}};l();p();var X=class extends x{constructor({on:e,method:r,arguments_:i,async:o}){super();f(this,"on");f(this,"method");f(this,"arguments_");f(this,"async");this.on=e,this.method=r,this.arguments_=i,this.async=o}write(e){this.async&&e.write("await "),this.on.write(e),e.write("."),e.write(this.method),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(e)}),e.write(")")}};l();p();var Z=class extends x{constructor({class_:e,arguments_:r}){super();f(this,"class_");f(this,"arguments_");this.class_=e,this.arguments_=r}write(e){e.write("new "),e.writeNode(this.class_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(e)}),e.write(")")}};function er(n){return new G(n)}function tr(n){return new Q(n)}function rr(n){return new Z(n)}function nr(n){return new H(n)}function ir(n){return new X(n)}function or(n){return new z(n)}function sr(n){return new $(n)}function ar(n){return new J(n)}var ur="value",de=class{constructor({context:t}){f(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?h.TypeLiteral.null():(this.context.errors.add({severity:L.Critical,message:"Expected non-null value, but got null"}),h.TypeLiteral.nop());if(t.value===void 0)return h.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literalType:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?h.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"nullable":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return this.convertUnknown({value:t.value});default:I(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.string(r)}default:I(t)}}convertList({list:t,value:e}){return Array.isArray(e)?h.TypeLiteral.array({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:L.Critical,message:`Expected array but got: ${typeof e}`}),h.TypeLiteral.nop())}convertSet({set:t,value:e}){return Array.isArray(e)?h.TypeLiteral.set({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:L.Critical,message:`Expected array but got: ${typeof e}`}),h.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:L.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),h.TypeLiteral.nop()):h.TypeLiteral.record({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}){var i;switch(t.type){case"alias":return(i=this.context.customConfig)!=null&&i.useBrandedStringAliases?h.TypeLiteral.reference(h.codeblock(o=>{o.writeNode(h.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:t.declaration})})),o.write("("),o.writeNode(this.convert({typeReference:t.typeReference,value:e,as:r})),o.write(")")})):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.convertUndicriminatedUnion({undicriminatedUnion:t,value:e});default:I(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){var u;let r=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(r==null)return h.TypeLiteral.nop();let i=r.singleDiscriminatedUnionType,o=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:r,unionVariant:i});if(o==null)return h.TypeLiteral.nop();if((u=this.context.customConfig)!=null&&u.includeUtilsOnUnionMembers)return h.TypeLiteral.reference(h.codeblock(c=>{c.writeNode(h.invokeMethod({on:h.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:t.declaration})}),method:this.context.getMethodName(i.discriminantValue.name),arguments_:this.convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:r,unionVariant:i,unionProperties:o})}))}));let s={name:this.context.getPropertyName(t.discriminant.name),value:h.TypeLiteral.string(i.discriminantValue.wireValue)};return h.TypeLiteral.object({fields:[s,...o]})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){let r=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});switch(e.type){case"samePropertiesAsObject":{let i=this.context.resolveNamedType({typeId:e.typeId});if(i==null)return;let o=this.convertNamed({named:i,value:t.value});if(!o.isObject()){this.context.errors.add({severity:L.Critical,message:"Internal error; expected union value to be an object"});return}let s=o.asObjectOrThrow();return[...r,...s.fields]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let i=this.context.getRecord(t.value);return i==null?[...r,{name:ur,value:this.convert({typeReference:e.typeReference,value:t.value})}]:[...r,{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:i[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return r;default:I(e)}}convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:t,unionVariant:e,unionProperties:r}){return e.type==="singleProperty"&&this.context.getRecord(t.value)==null&&r.length===1?[this.convert({typeReference:e.typeReference,value:t.value})]:r.length>0?[h.TypeLiteral.object({fields:r})]:[]}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i,o;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(o=this.context.getRecord(t.value))!=null?o:{},ignoreMissingParameters:!0}).map(s=>{this.context.errors.scope(s.name.wireValue);try{return{name:this.context.getPropertyName(s.name.name),value:this.convert(s)}}finally{this.context.errors.unscope()}})}convertObject({object_:t,value:e}){var i;let r=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return h.TypeLiteral.object({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.getEnumValue({enum_:t,value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.string(r)}getEnumValue({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:L.Critical,message:`Expected enum value string, got: ${typeof e}`});return}if(t.values.find(i=>i.wireValue===e)==null){this.context.errors.add({severity:L.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return e}convertUndicriminatedUnion({undicriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undicriminatedUnion:t,value:e});return r==null?h.TypeLiteral.nop():r}findMatchingUndiscriminatedUnionType({undicriminatedUnion: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:L.Critical,message:`None of the types in the undicriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return h.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){var i,o;switch(t){case"INTEGER":case"UINT":{let s=this.getValueAsNumber({value:e,as:r});return s==null?h.TypeLiteral.nop():h.TypeLiteral.number(s)}case"LONG":case"UINT_64":{let s=this.getValueAsNumber({value:e,as:r});return s==null?h.TypeLiteral.nop():(i=this.context.customConfig)!=null&&i.useBigInt?h.TypeLiteral.bigint(BigInt(s)):h.TypeLiteral.number(s)}case"FLOAT":case"DOUBLE":{let s=this.getValueAsNumber({value:e});return s==null?h.TypeLiteral.nop():h.TypeLiteral.number(s)}case"BOOLEAN":{let s=this.getValueAsBoolean({value:e,as:r});return s==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(s)}case"BASE_64":case"DATE":case"UUID":case"STRING":{let s=this.context.getValueAsString({value:e});return s==null?h.TypeLiteral.nop():h.TypeLiteral.string(s)}case"DATE_TIME":{let s=this.context.getValueAsString({value:e});return s==null?h.TypeLiteral.nop():h.TypeLiteral.datetime(s)}case"BIG_INTEGER":{let s=this.context.getValueAsString({value:e});return s==null?h.TypeLiteral.nop():(o=this.context.customConfig)!=null&&o.useBigInt?h.TypeLiteral.bigint(BigInt(s)):h.TypeLiteral.string(s)}default:I(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})}};0&&(module.exports={DynamicTypeLiteralMapper});
|
|
16
|
+
`);e.write(o.replaceAll("`","\\`")),e.writeNoIndent(s.replaceAll("`","\\`")),e.write("`")}writeIterable({writer:e,iterable:r}){let i=qt({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("]")}writeRecord({writer:e,record:r}){let i=Zt({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("}")}writeObject({writer:e,object:r}){let i=Xt({fields:r.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}static array({values:e}){return new this({type:"array",values:e})}static bigint(e){return new this({type:"bigint",value:e})}static blob(e){return new this({type:"blob",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static object({fields:e}){return new this({type:"object",fields:e})}static record({entries:e}){return new this({type:"record",entries:e})}static reference(e){return new this({type:"reference",value:e})}static set({values:e}){return new this({type:"set",values:e})}static string(e){return new this({type:"string",value:e})}static tuple({values:e}){return new this({type:"tuple",values:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value: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.writeUnknownObject({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("]")}writeUnknownObject({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,s]of i)e.write(`${o}: `),e.writeNode(n.unknown(s)),e.writeLine(",");e.dedent(),e.write("}")}};function Xt({fields:n}){return n.filter(t=>!S.isNop(t.value))}function Zt({entries:n}){return n.filter(t=>!S.isNop(t.key)&&!S.isNop(t.value))}function qt({values:n}){return n.filter(t=>!S.isNop(t))}l();p();var $=class extends x{constructor({name:e,importFrom:r,memberName:i}){super();f(this,"name");f(this,"importFrom");f(this,"memberName");this.name=e,this.importFrom=r,this.memberName=i}write(e){var o;this.importFrom!=null&&e.addImport(this);let r=((o=this.importFrom)==null?void 0:o.type)==="star"?`${this.importFrom.starImportAlias}.`:"",i=this.memberName!=null?`.${this.memberName}`:"";e.write(`${r}${this.name}${i}`)}};l();p();var J=class extends x{constructor(e){super();f(this,"args");this.args=e}write(e){this.args.export&&e.write("export "),this.args.const?e.write("const "):e.write("let "),e.write(`${this.args.name} = `),e.writeNode(this.args.initializer)}};l();p();l();p();var F=class extends x{constructor({docs:e}={docs:void 0}){super();f(this,"docs");this.docs=e}write(e){this.docs!=null&&(e.writeLine("/**"),this.docs.split(`
|
|
17
|
+
`).forEach(r=>{e.writeLine(` * ${r}`)}),e.writeLine("*/"))}};var z=class extends x{constructor({name:e,type:r,docs:i}){super();f(this,"name");f(this,"type");f(this,"docs");this.name=e,this.type=r,this.docs=i}write(e){this.docs!=null&&e.writeNode(new F({docs:this.docs})),e.write(`${this.name}: `),this.type.write(e)}};l();p();var Q=class extends x{constructor({name:e,parameters:r,async:i,body:o,return_:s,docs:u}){super();f(this,"name");f(this,"parameters");f(this,"async");f(this,"body");f(this,"return_");f(this,"docs");this.name=e,this.parameters=r,this.async=i!=null?i:!1,this.body=o,this.return_=s,this.docs=u}write(e){var r;e.writeNode(new F({docs:this.docs})),this.async&&e.write("async "),e.write("function "),e.write(`${this.name}`),this.writeParameters(e),this.return_!=null&&(e.write(": "),e.writeNode(this.async?Y.promise(this.return_):this.return_)),e.writeLine(" {"),e.indent(),(r=this.body)==null||r.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeParameters(e){if(this.parameters.length===0){e.write("()");return}e.indent(),e.writeLine("(");for(let r of this.parameters)e.writeNode(r),e.writeLine(",");e.dedent(),e.write(")")}};l();p();var H=class extends x{constructor({function_:e,arguments_:r}){super();f(this,"function_");f(this,"arguments_");this.function_=e,this.arguments_=r}write(e){e.writeNode(this.function_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(e)}),e.write(")")}};l();p();var X=class extends x{constructor({on:e,method:r,arguments_:i,async:o}){super();f(this,"on");f(this,"method");f(this,"arguments_");f(this,"async");this.on=e,this.method=r,this.arguments_=i,this.async=o}write(e){this.async&&e.write("await "),this.on.write(e),e.write("."),e.write(this.method),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(e)}),e.write(")")}};l();p();var Z=class extends x{constructor({class_:e,arguments_:r}){super();f(this,"class_");f(this,"arguments_");this.class_=e,this.arguments_=r}write(e){e.write("new "),e.writeNode(this.class_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(e)}),e.write(")")}};function er(n){return new G(n)}function tr(n){return new Q(n)}function rr(n){return new Z(n)}function nr(n){return new H(n)}function ir(n){return new X(n)}function or(n){return new z(n)}function sr(n){return new $(n)}function ar(n){return new J(n)}var ur="value",de=class{constructor({context:t}){f(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?h.TypeLiteral.null():(this.context.errors.add({severity:R.Critical,message:"Expected non-null value, but got null"}),h.TypeLiteral.nop());if(t.value===void 0)return h.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literalType:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?h.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"nullable":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return this.convertUnknown({value:t.value});default:I(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.string(r)}default:I(t)}}convertList({list:t,value:e}){return Array.isArray(e)?h.TypeLiteral.array({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:R.Critical,message:`Expected array but got: ${typeof e}`}),h.TypeLiteral.nop())}convertSet({set:t,value:e}){return Array.isArray(e)?h.TypeLiteral.set({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:R.Critical,message:`Expected array but got: ${typeof e}`}),h.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:R.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),h.TypeLiteral.nop()):h.TypeLiteral.record({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}){var i;switch(t.type){case"alias":return(i=this.context.customConfig)!=null&&i.useBrandedStringAliases?h.TypeLiteral.reference(h.codeblock(o=>{o.writeNode(h.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:t.declaration})})),o.write("("),o.writeNode(this.convert({typeReference:t.typeReference,value:e,as:r})),o.write(")")})):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:I(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){var u;let r=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(r==null)return h.TypeLiteral.nop();let i=r.singleDiscriminatedUnionType,o=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:r,unionVariant:i});if(o==null)return h.TypeLiteral.nop();if((u=this.context.customConfig)!=null&&u.includeUtilsOnUnionMembers)return h.TypeLiteral.reference(h.codeblock(c=>{c.writeNode(h.invokeMethod({on:h.reference({name:this.context.namespaceExport,importFrom:this.context.getModuleImport(),memberName:this.context.getFullyQualifiedReference({declaration:t.declaration})}),method:this.context.getMethodName(i.discriminantValue.name),arguments_:this.convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:r,unionVariant:i,unionProperties:o})}))}));let s={name:this.context.getPropertyName(t.discriminant.name),value:h.TypeLiteral.string(i.discriminantValue.wireValue)};return h.TypeLiteral.object({fields:[s,...o]})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){let r=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});switch(e.type){case"samePropertiesAsObject":{let i=this.context.resolveNamedType({typeId:e.typeId});if(i==null)return;let o=this.convertNamed({named:i,value:t.value});if(!o.isObject()){this.context.errors.add({severity:R.Critical,message:"Internal error; expected union value to be an object"});return}let s=o.asObjectOrThrow();return[...r,...s.fields]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let i=this.context.getRecord(t.value);return i==null?[...r,{name:ur,value:this.convert({typeReference:e.typeReference,value:t.value})}]:[...r,{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:i[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return r;default:I(e)}}convertDiscriminatedUnionUtilsArgs({discriminatedUnionTypeInstance:t,unionVariant:e,unionProperties:r}){return e.type==="singleProperty"&&this.context.getRecord(t.value)==null&&r.length===1?[this.convert({typeReference:e.typeReference,value:t.value})]:r.length>0?[h.TypeLiteral.object({fields:r})]:[]}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i,o;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(o=this.context.getRecord(t.value))!=null?o:{},ignoreMissingParameters:!0}).map(s=>{this.context.errors.scope(s.name.wireValue);try{return{name:this.context.getPropertyName(s.name.name),value:this.convert(s)}}finally{this.context.errors.unscope()}})}convertObject({object_:t,value:e}){var i;let r=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return h.TypeLiteral.object({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.getEnumValue({enum_:t,value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.string(r)}getEnumValue({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:R.Critical,message:`Expected enum value string, got: ${typeof e}`});return}if(t.values.find(i=>i.wireValue===e)==null){this.context.errors.add({severity:R.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return e}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return r==null?h.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:R.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return h.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){var i,o;switch(t){case"INTEGER":case"UINT":{let s=this.getValueAsNumber({value:e,as:r});return s==null?h.TypeLiteral.nop():h.TypeLiteral.number(s)}case"LONG":case"UINT_64":{let s=this.getValueAsNumber({value:e,as:r});return s==null?h.TypeLiteral.nop():(i=this.context.customConfig)!=null&&i.useBigInt?h.TypeLiteral.bigint(BigInt(s)):h.TypeLiteral.number(s)}case"FLOAT":case"DOUBLE":{let s=this.getValueAsNumber({value:e});return s==null?h.TypeLiteral.nop():h.TypeLiteral.number(s)}case"BOOLEAN":{let s=this.getValueAsBoolean({value:e,as:r});return s==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(s)}case"BASE_64":case"DATE":case"UUID":case"STRING":{let s=this.context.getValueAsString({value:e});return s==null?h.TypeLiteral.nop():h.TypeLiteral.string(s)}case"DATE_TIME":{let s=this.context.getValueAsString({value:e});return s==null?h.TypeLiteral.nop():h.TypeLiteral.datetime(s)}case"BIG_INTEGER":{let s=this.context.getValueAsString({value:e});return s==null?h.TypeLiteral.nop():(o=this.context.customConfig)!=null&&o.useBigInt?h.TypeLiteral.bigint(BigInt(s)):h.TypeLiteral.string(s)}default:I(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})}};0&&(module.exports={DynamicTypeLiteralMapper});
|
|
18
18
|
/*! Bundled license information:
|
|
19
19
|
|
|
20
20
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@fern-api/dynamic-ir-sdk';
|
|
2
2
|
import '@fern-api/typescript-ast';
|
|
3
|
-
export { a as DynamicTypeLiteralMapper } from '../DynamicSnippetsGeneratorContext-
|
|
3
|
+
export { a as DynamicTypeLiteralMapper } from '../DynamicSnippetsGeneratorContext-CmDa2k9n.cjs';
|
|
4
4
|
import '@fern-api/browser-compatible-base-generator';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";var rr=Object.defineProperty;var $r=Object.getOwnPropertyDescriptor;var Or=Object.getOwnPropertyNames;var Wr=Object.prototype.hasOwnProperty;var jr=(t,e,r)=>e in t?rr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var fr=(t,e)=>()=>(t&&(e=t(t=0)),e);var wr=(t,e)=>{for(var r in e)rr(t,r,{get:e[r],enumerable:!0})},Vr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Or(e))!Wr.call(t,i)&&i!==r&&rr(t,i,{get:()=>e[i],enumerable:!(n=$r(e,i))||n.enumerable});return t};var Gr=t=>Vr(rr({},"__esModule",{value:!0}),t);var c=(t,e,r)=>jr(t,typeof e!="symbol"?e+"":e,r);function xr(){throw new Error("setTimeout has not been defined")}function yr(){throw new Error("clearTimeout has not been defined")}function gr(t){if(S===setTimeout)return setTimeout(t,0);if((S===xr||!S)&&setTimeout)return S=setTimeout,setTimeout(t,0);try{return S(t,0)}catch(e){try{return S.call(null,t,0)}catch(r){return S.call(this,t,0)}}}function Jr(t){if(_===clearTimeout)return clearTimeout(t);if((_===yr||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(t);try{return _(t)}catch(e){try{return _.call(null,t)}catch(r){return _.call(this,t)}}}function qr(){!j||!U||(j=!1,U.length?N=U.concat(N):er=-1,N.length&&Tr())}function Tr(){if(!j){var t=gr(qr);j=!0;for(var e=N.length;e;){for(U=N,N=[];++er<e;)U&&U[er].run();er=-1,e=N.length}U=null,j=!1,Jr(t)}}function zr(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];N.push(new Ar(t,e)),N.length===1&&!j&&gr(Tr)}function Ar(t,e){this.fun=t,this.array=e}function F(){}function pe(t){throw new Error("process.binding is not supported")}function ce(){return"/"}function he(t){throw new Error("process.chdir is not supported")}function me(){return 0}function de(t){var e=we.call(W)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}function ye(){var t=new Date,e=t-xe;return e/1e3}var S,_,N,j,U,er,Hr,Qr,Xr,Zr,Kr,re,ee,te,ne,ie,oe,se,ae,ue,fe,le,W,we,xe,d,dr,l=fr(()=>{"use strict";S=xr,_=yr;typeof globalThis.setTimeout=="function"&&(S=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);N=[],j=!1,er=-1;Ar.prototype.run=function(){this.fun.apply(null,this.array)};Hr="browser",Qr="browser",Xr=!0,Zr={},Kr=[],re="",ee={},te={},ne={};ie=F,oe=F,se=F,ae=F,ue=F,fe=F,le=F;W=globalThis.performance||{},we=W.now||W.mozNow||W.msNow||W.oNow||W.webkitNow||function(){return new Date().getTime()};xe=new Date;d={nextTick:zr,title:Hr,browser:Xr,env:Zr,argv:Kr,version:re,versions:ee,on:ie,addListener:oe,once:se,off:ae,removeListener:ue,removeAllListeners:fe,emit:le,binding:pe,cwd:ce,chdir:he,umask:me,hrtime:de,platform:Qr,release:te,config:ne,uptime:ye},dr={};Object.keys(dr).forEach(t=>{let e=t.split("."),r=d;for(let n=0;n<e.length;n++){let i=e[n];n===e.length-1?r[i]=dr[t]:r=r[i]||(r[i]={})}})});function br(){pr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)E[e]=t[e],v[t.charCodeAt(e)]=e;v[45]=62,v[95]=63}function Te(t){pr||br();var e,r,n,i,o,s,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[u-2]==="="?2:t[u-1]==="="?1:0,s=new ge(u*3/4-o),n=o>0?u-4:u;var f=0;for(e=0,r=0;e<n;e+=4,r+=3)i=v[t.charCodeAt(e)]<<18|v[t.charCodeAt(e+1)]<<12|v[t.charCodeAt(e+2)]<<6|v[t.charCodeAt(e+3)],s[f++]=i>>16&255,s[f++]=i>>8&255,s[f++]=i&255;return o===2?(i=v[t.charCodeAt(e)]<<2|v[t.charCodeAt(e+1)]>>4,s[f++]=i&255):o===1&&(i=v[t.charCodeAt(e)]<<10|v[t.charCodeAt(e+1)]<<4|v[t.charCodeAt(e+2)]>>2,s[f++]=i>>8&255,s[f++]=i&255),s}function Ae(t){return E[t>>18&63]+E[t>>12&63]+E[t>>6&63]+E[t&63]}function ve(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Ae(n));return i.join("")}function vr(t){pr||br();for(var e,r=t.length,n=r%3,i="",o=[],s=16383,u=0,f=r-n;u<f;u+=s)o.push(ve(t,u,u+s>f?f:u+s));return n===1?(e=t[r-1],i+=E[e>>2],i+=E[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=E[e>>10],i+=E[e>>4&63],i+=E[e<<2&63],i+="="),o.push(i),o.join("")}function tr(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(t,e){if(tr()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):(t===null&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return cr(this,t)}return Nr(this,t,e,r)}function Nr(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?be(t,e,r,n):typeof e=="string"?Ie(t,e,r):Ne(t,e)}function kr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ee(t,e,r,n){return kr(e),e<=0?k(t,e):r!==void 0?typeof n=="string"?k(t,e).fill(r,n):k(t,e).fill(r):k(t,e)}function cr(t,e){if(kr(e),t=k(t,e<0?0:hr(e)|0),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function Ie(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Rr(e,r)|0;t=k(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function lr(t,e){var r=e.length<0?0:hr(e.length)|0;t=k(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function be(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),a.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=a.prototype):t=lr(t,e),t}function Ne(t,e){if(I(e)){var r=hr(e.length)|0;return t=k(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Ge(e.length)?k(t,0):lr(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return lr(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function hr(t){if(t>=tr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+tr().toString(16)+" bytes");return t|0}function I(t){return!!(t!=null&&t._isBuffer)}function Rr(t,e){if(I(t))return t.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return nr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Pr(t).length;default:if(n)return nr(t).length;e=(""+e).toLowerCase(),n=!0}}function ke(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ye(this,e,r);case"utf8":case"utf-8":return Br(this,e,r);case"ascii":return Pe(this,e,r);case"latin1":case"binary":return Ce(this,e,r);case"base64":return Ue(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function P(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Sr(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=a.from(e,n)),I(e))return e.length===0?-1:Er(t,e,r,n,i);if(typeof e=="number")return e=e&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Er(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Er(t,e,r,n,i){var o=1,s=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,u/=2,r/=2}function f(A,O){return o===1?A[O]:A.readUInt16BE(O*o)}var m;if(i){var w=-1;for(m=r;m<s;m++)if(f(t,m)===f(e,w===-1?0:m-w)){if(w===-1&&(w=m),m-w+1===u)return w*o}else w!==-1&&(m-=m-w),w=-1}else for(r+u>s&&(r=s-u),m=r;m>=0;m--){for(var h=!0,y=0;y<u;y++)if(f(t,m+y)!==f(e,y)){h=!1;break}if(h)return m}return-1}function Re(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(s*2,2),16);if(isNaN(u))return s;t[r+s]=u}return s}function Se(t,e,r,n){return sr(nr(e,t.length-r),t,r,n)}function _r(t,e,r,n){return sr(je(e),t,r,n)}function _e(t,e,r,n){return _r(t,e,r,n)}function Be(t,e,r,n){return sr(Pr(e),t,r,n)}function Le(t,e,r,n){return sr(Ve(e,t.length-r),t,r,n)}function Ue(t,e,r){return e===0&&r===t.length?vr(t):vr(t.slice(e,r))}function Br(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],s=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=r){var f,m,w,h;switch(u){case 1:o<128&&(s=o);break;case 2:f=t[i+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(s=h));break;case 3:f=t[i+1],m=t[i+2],(f&192)===128&&(m&192)===128&&(h=(o&15)<<12|(f&63)<<6|m&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:f=t[i+1],m=t[i+2],w=t[i+3],(f&192)===128&&(m&192)===128&&(w&192)===128&&(h=(o&15)<<18|(f&63)<<12|(m&63)<<6|w&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=u}return Fe(n)}function Fe(t){var e=t.length;if(e<=Ir)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Ir));return r}function Pe(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Ce(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Ye(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=We(t[o]);return i}function Me(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function g(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,n,i,o){if(!I(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function ir(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function or(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}function Lr(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ur(t,e,r,n,i){return i||Lr(t,e,r,4,34028234663852886e22,-34028234663852886e22),Yr(t,e,r,n,23,4),r+4}function Fr(t,e,r,n,i){return i||Lr(t,e,r,8,17976931348623157e292,-17976931348623157e292),Yr(t,e,r,n,52,8),r+8}function $e(t){if(t=Oe(t).replace(De,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Oe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function We(t){return t<16?"0"+t.toString(16):t.toString(16)}function nr(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function je(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Ve(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function Pr(t){return Te($e(t))}function sr(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Ge(t){return t!==t}function Je(t){return t!=null&&(!!t._isBuffer||Cr(t)||qe(t))}function Cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function qe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Cr(t.slice(0,0))}function ar(t,e,r,n,i){var o,s,u=i*8-n-1,f=(1<<u)-1,m=f>>1,w=-7,h=r?i-1:0,y=r?-1:1,A=t[e+h];for(h+=y,o=A&(1<<-w)-1,A>>=-w,w+=u;w>0;o=o*256+t[e+h],h+=y,w-=8);for(s=o&(1<<-w)-1,o>>=-w,w+=n;w>0;s=s*256+t[e+h],h+=y,w-=8);if(o===0)o=1-m;else{if(o===f)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-m}return(A?-1:1)*s*Math.pow(2,o-n)}function Yr(t,e,r,n,i,o){var s,u,f,m=o*8-i-1,w=(1<<m)-1,h=w>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,O=n?1:-1,Dr=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=w):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+h>=1?e+=y/f:e+=y*Math.pow(2,1-h),e*f>=2&&(s++,f/=2),s+h>=w?(u=0,s=w):s+h>=1?(u=(e*f-1)*Math.pow(2,i),s=s+h):(u=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+A]=u&255,A+=O,u/=256,i-=8);for(s=s<<i|u,m+=i;m>0;t[r+A]=s&255,A+=O,s/=256,m-=8);t[r+A-O]|=Dr*128}var E,v,ge,pr,Ir,De,Mr=fr(()=>{"use strict";l();p();E=[],v=[],ge=typeof Uint8Array!="undefined"?Uint8Array:Array,pr=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};a.from=function(t,e,r){return Nr(null,t,e,r)};a.kMaxLength=tr();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(t,e,r){return Ee(null,t,e,r)};a.allocUnsafe=function(t){return cr(null,t)};a.allocUnsafeSlow=function(t){return cr(null,t)};a.isBuffer=Je;a.compare=function(e,r){if(!I(e)||!I(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=a.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!I(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Rr;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)P(this,r,r+1);return this};a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)P(this,r,r+3),P(this,r+1,r+2);return this};a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)P(this,r,r+7),P(this,r+1,r+6),P(this,r+2,r+5),P(this,r+3,r+4);return this};a.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Br(this,0,e):ke.apply(this,arguments)};a.prototype.equals=function(e){if(!I(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0};a.prototype.compare=function(e,r,n,i,o){if(!I(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,u=n-r,f=Math.min(s,u),m=this.slice(i,o),w=e.slice(r,n),h=0;h<f;++h)if(m[h]!==w[h]){s=m[h],u=w[h];break}return s<u?-1:u<s?1:0};a.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};a.prototype.indexOf=function(e,r,n){return Sr(this,e,r,n,!0)};a.prototype.lastIndexOf=function(e,r,n){return Sr(this,e,r,n,!1)};a.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return Re(this,e,r,n);case"utf8":case"utf-8":return Se(this,e,r,n);case"ascii":return _r(this,e,r,n);case"latin1":case"binary":return _e(this,e,r,n);case"base64":return Be(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ir=4096;a.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=a.prototype;else{var o=r-e;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i};a.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||g(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i};a.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||g(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};a.prototype.readUInt8=function(e,r){return r||g(e,1,this.length),this[e]};a.prototype.readUInt16LE=function(e,r){return r||g(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUInt16BE=function(e,r){return r||g(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUInt32LE=function(e,r){return r||g(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUInt32BE=function(e,r){return r||g(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||g(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};a.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||g(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};a.prototype.readInt8=function(e,r){return r||g(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,r){r||g(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(e,r){r||g(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(e,r){return r||g(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,r){return r||g(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readFloatLE=function(e,r){return r||g(e,4,this.length),ar(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,r){return r||g(e,4,this.length),ar(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,r){return r||g(e,8,this.length),ar(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,r){return r||g(e,8,this.length),ar(this,e,!1,52,8)};a.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,e,r,n,o,0)}var s=1,u=0;for(this[r]=e&255;++u<n&&(s*=256);)this[r+u]=e/s&255;return r+n};a.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,e,r,n,o,0)}var s=n-1,u=1;for(this[r+s]=e&255;--s>=0&&(u*=256);)this[r+s]=e/u&255;return r+n};a.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};a.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ir(this,e,r,!0),r+2};a.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ir(this,e,r,!1),r+2};a.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):or(this,e,r,!0),r+4};a.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):or(this,e,r,!1),r+4};a.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);T(this,e,r,n,o-1,-o)}var s=0,u=1,f=0;for(this[r]=e&255;++s<n&&(u*=256);)e<0&&f===0&&this[r+s-1]!==0&&(f=1),this[r+s]=(e/u>>0)-f&255;return r+n};a.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);T(this,e,r,n,o-1,-o)}var s=n-1,u=1,f=0;for(this[r+s]=e&255;--s>=0&&(u*=256);)e<0&&f===0&&this[r+s+1]!==0&&(f=1),this[r+s]=(e/u>>0)-f&255;return r+n};a.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};a.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ir(this,e,r,!0),r+2};a.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ir(this,e,r,!1),r+2};a.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):or(this,e,r,!0),r+4};a.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):or(this,e,r,!1),r+4};a.prototype.writeFloatLE=function(e,r,n){return Ur(this,e,r,!0,n)};a.prototype.writeFloatBE=function(e,r,n){return Ur(this,e,r,!1,n)};a.prototype.writeDoubleLE=function(e,r,n){return Fr(this,e,r,!0,n)};a.prototype.writeDoubleBE=function(e,r,n){return Fr(this,e,r,!1,n)};a.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,s;if(this===e&&n<r&&r<i)for(s=o-1;s>=0;--s)e[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};a.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<n;++s)this[s]=e;else{var u=I(e)?e:nr(new a(e,i).toString()),f=u.length;for(s=0;s<n-r;++s)this[s+r]=u[s%f]}return this};De=/[^+\/0-9A-Za-z-_]/g});var p=fr(()=>{"use strict";Mr()});var at={};wr(at,{FilePropertyMapper:()=>mr});module.exports=Gr(at);l();p();l();p();l();p();function C(t){throw new Error("Unexpected value: "+JSON.stringify(t))}l();p();var b={};wr(b,{AstNode:()=>x,ClassInstantiation:()=>Q,CodeBlock:()=>V,Comment:()=>L,Function:()=>q,FunctionInvocation:()=>z,MethodInvocation:()=>H,Parameter:()=>J,Reference:()=>$,Type:()=>D,TypeLiteral:()=>R,Types:()=>D,Variable:()=>G,Writer:()=>M,codeblock:()=>Ke,function_:()=>rt,instantiateClass:()=>et,invokeFunction:()=>tt,invokeMethod:()=>nt,parameter:()=>it,reference:()=>ot,variable:()=>st});l();p();l();p();l();p();l();p();l();p();l();p();var Y=class{};l();p();l();p();var B=class extends Y{constructor(r){super();c(this,"value");this.value=r}write(r){typeof this.value=="string"?r.write(this.value):this.value(r)}};var ze=4,X=class{constructor(){c(this,"buffer","");c(this,"indentLevel",0);c(this,"hasWrittenAnything",!1);c(this,"lastCharacterIsNewline",!1)}write(e){let r=e.length>0&&e.endsWith(`
|
|
2
|
-
`),
|
|
1
|
+
"use strict";var ee=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var We=Object.prototype.hasOwnProperty;var je=(r,t,e)=>t in r?ee(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var fe=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{for(var e in t)ee(r,e,{get:t[e],enumerable:!0})},Ve=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Oe(t))!We.call(r,n)&&n!==e&&ee(r,n,{get:()=>t[n],enumerable:!(i=$e(t,n))||i.enumerable});return r};var Ge=r=>Ve(ee({},"__esModule",{value:!0}),r);var p=(r,t,e)=>je(r,typeof t!="symbol"?t+"":t,e);function xe(){throw new Error("setTimeout has not been defined")}function ye(){throw new Error("clearTimeout has not been defined")}function ge(r){if(_===setTimeout)return setTimeout(r,0);if((_===xe||!_)&&setTimeout)return _=setTimeout,setTimeout(r,0);try{return _(r,0)}catch(t){try{return _.call(null,r,0)}catch(e){return _.call(this,r,0)}}}function Je(r){if(L===clearTimeout)return clearTimeout(r);if((L===ye||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(r);try{return L(r)}catch(t){try{return L.call(null,r)}catch(e){return L.call(this,r)}}}function qe(){!j||!F||(j=!1,F.length?k=F.concat(k):te=-1,k.length&&Te())}function Te(){if(!j){var r=ge(qe);j=!0;for(var t=k.length;t;){for(F=k,k=[];++te<t;)F&&F[te].run();te=-1,t=k.length}F=null,j=!1,Je(r)}}function ze(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];k.push(new Ae(r,t)),k.length===1&&!j&&ge(Te)}function Ae(r,t){this.fun=r,this.array=t}function U(){}function ct(r){throw new Error("process.binding is not supported")}function pt(){return"/"}function ht(r){throw new Error("process.chdir is not supported")}function mt(){return 0}function dt(r){var t=wt.call(W)*.001,e=Math.floor(t),i=Math.floor(t%1*1e9);return r&&(e=e-r[0],i=i-r[1],i<0&&(e--,i+=1e9)),[e,i]}function yt(){var r=new Date,t=r-xt;return t/1e3}var _,L,k,j,F,te,He,Qe,Xe,Ze,Ke,et,tt,rt,it,nt,ot,st,at,ut,ft,lt,W,wt,xt,d,de,l=fe(()=>{"use strict";_=xe,L=ye;typeof globalThis.setTimeout=="function"&&(_=setTimeout);typeof globalThis.clearTimeout=="function"&&(L=clearTimeout);k=[],j=!1,te=-1;Ae.prototype.run=function(){this.fun.apply(null,this.array)};He="browser",Qe="browser",Xe=!0,Ze={},Ke=[],et="",tt={},rt={},it={};nt=U,ot=U,st=U,at=U,ut=U,ft=U,lt=U;W=globalThis.performance||{},wt=W.now||W.mozNow||W.msNow||W.oNow||W.webkitNow||function(){return new Date().getTime()};xt=new Date;d={nextTick:ze,title:He,browser:Xe,env:Ze,argv:Ke,version:et,versions:tt,on:nt,addListener:ot,once:st,off:at,removeListener:ut,removeAllListeners:ft,emit:lt,binding:ct,cwd:pt,chdir:ht,umask:mt,hrtime:dt,platform:Qe,release:rt,config:it,uptime:yt},de={};Object.keys(de).forEach(r=>{let t=r.split("."),e=d;for(let i=0;i<t.length;i++){let n=t[i];i===t.length-1?e[n]=de[r]:e=e[n]||(e[n]={})}})});function Ne(){ce=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)E[t]=r[t],v[r.charCodeAt(t)]=t;v[45]=62,v[95]=63}function Tt(r){ce||Ne();var t,e,i,n,o,s,u=r.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[u-2]==="="?2:r[u-1]==="="?1:0,s=new gt(u*3/4-o),i=o>0?u-4:u;var f=0;for(t=0,e=0;t<i;t+=4,e+=3)n=v[r.charCodeAt(t)]<<18|v[r.charCodeAt(t+1)]<<12|v[r.charCodeAt(t+2)]<<6|v[r.charCodeAt(t+3)],s[f++]=n>>16&255,s[f++]=n>>8&255,s[f++]=n&255;return o===2?(n=v[r.charCodeAt(t)]<<2|v[r.charCodeAt(t+1)]>>4,s[f++]=n&255):o===1&&(n=v[r.charCodeAt(t)]<<10|v[r.charCodeAt(t+1)]<<4|v[r.charCodeAt(t+2)]>>2,s[f++]=n>>8&255,s[f++]=n&255),s}function At(r){return E[r>>18&63]+E[r>>12&63]+E[r>>6&63]+E[r&63]}function vt(r,t,e){for(var i,n=[],o=t;o<e;o+=3)i=(r[o]<<16)+(r[o+1]<<8)+r[o+2],n.push(At(i));return n.join("")}function ve(r){ce||Ne();for(var t,e=r.length,i=e%3,n="",o=[],s=16383,u=0,f=e-i;u<f;u+=s)o.push(vt(r,u,u+s>f?f:u+s));return i===1?(t=r[e-1],n+=E[t>>2],n+=E[t<<4&63],n+="=="):i===2&&(t=(r[e-2]<<8)+r[e-1],n+=E[t>>10],n+=E[t>>4&63],n+=E[t<<2&63],n+="="),o.push(n),o.join("")}function re(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(r,t){if(re()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=a.prototype):(r===null&&(r=new a(t)),r.length=t),r}function a(r,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return pe(this,r)}return be(this,r,t,e)}function be(r,t,e,i){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Nt(r,t,e,i):typeof t=="string"?It(r,t,e):bt(r,t)}function ke(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Et(r,t,e,i){return ke(t),t<=0?R(r,t):e!==void 0?typeof i=="string"?R(r,t).fill(e,i):R(r,t).fill(e):R(r,t)}function pe(r,t){if(ke(t),r=R(r,t<0?0:he(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function It(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=Re(t,e)|0;r=R(r,i);var n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}function le(r,t){var e=t.length<0?0:he(t.length)|0;r=R(r,e);for(var i=0;i<e;i+=1)r[i]=t[i]&255;return r}function Nt(r,t,e,i){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?t=new Uint8Array(t):i===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,i),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=le(r,t),r}function bt(r,t){if(I(t)){var e=he(t.length)|0;return r=R(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Gt(t.length)?R(r,0):le(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return le(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function he(r){if(r>=re())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re().toString(16)+" bytes");return r|0}function I(r){return!!(r!=null&&r._isBuffer)}function Re(r,t){if(I(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return ie(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Pe(r).length;default:if(i)return ie(r).length;t=(""+t).toLowerCase(),i=!0}}function kt(r,t,e){var i=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Yt(this,t,e);case"utf8":case"utf-8":return Le(this,t,e);case"ascii":return Pt(this,t,e);case"latin1":case"binary":return Ct(this,t,e);case"base64":return Ft(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mt(this,t,e);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}function P(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}function Se(r,t,e,i,n){if(r.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(n)return-1;e=r.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,i)),I(t))return t.length===0?-1:Ee(r,t,e,i,n);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ee(r,[t],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Ee(r,t,e,i,n){var o=1,s=r.length,u=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,u/=2,e/=2}function f(A,O){return o===1?A[O]:A.readUInt16BE(O*o)}var m;if(n){var w=-1;for(m=e;m<s;m++)if(f(r,m)===f(t,w===-1?0:m-w)){if(w===-1&&(w=m),m-w+1===u)return w*o}else w!==-1&&(m-=m-w),w=-1}else for(e+u>s&&(e=s-u),m=e;m>=0;m--){for(var h=!0,y=0;y<u;y++)if(f(r,m+y)!==f(t,y)){h=!1;break}if(h)return m}return-1}function Rt(r,t,e,i){e=Number(e)||0;var n=r.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var u=parseInt(t.substr(s*2,2),16);if(isNaN(u))return s;r[e+s]=u}return s}function St(r,t,e,i){return se(ie(t,r.length-e),r,e,i)}function _e(r,t,e,i){return se(jt(t),r,e,i)}function _t(r,t,e,i){return _e(r,t,e,i)}function Lt(r,t,e,i){return se(Pe(t),r,e,i)}function Bt(r,t,e,i){return se(Vt(t,r.length-e),r,e,i)}function Ft(r,t,e){return t===0&&e===r.length?ve(r):ve(r.slice(t,e))}function Le(r,t,e){e=Math.min(r.length,e);for(var i=[],n=t;n<e;){var o=r[n],s=null,u=o>239?4:o>223?3:o>191?2:1;if(n+u<=e){var f,m,w,h;switch(u){case 1:o<128&&(s=o);break;case 2:f=r[n+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(s=h));break;case 3:f=r[n+1],m=r[n+2],(f&192)===128&&(m&192)===128&&(h=(o&15)<<12|(f&63)<<6|m&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:f=r[n+1],m=r[n+2],w=r[n+3],(f&192)===128&&(m&192)===128&&(w&192)===128&&(h=(o&15)<<18|(f&63)<<12|(m&63)<<6|w&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=u}return Ut(i)}function Ut(r){var t=r.length;if(t<=Ie)return String.fromCharCode.apply(String,r);for(var e="",i=0;i<t;)e+=String.fromCharCode.apply(String,r.slice(i,i+=Ie));return e}function Pt(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]&127);return i}function Ct(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]);return i}function Yt(r,t,e){var i=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=t;o<e;++o)n+=Wt(r[o]);return n}function Mt(r,t,e){for(var i=r.slice(t,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}function g(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function T(r,t,e,i,n,o){if(!I(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(e+i>r.length)throw new RangeError("Index out of range")}function ne(r,t,e,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(r.length-e,2);n<o;++n)r[e+n]=(t&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}function oe(r,t,e,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(r.length-e,4);n<o;++n)r[e+n]=t>>>(i?n:3-n)*8&255}function Be(r,t,e,i,n,o){if(e+i>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Fe(r,t,e,i,n){return n||Be(r,t,e,4,34028234663852886e22,-34028234663852886e22),Ye(r,t,e,i,23,4),e+4}function Ue(r,t,e,i,n){return n||Be(r,t,e,8,17976931348623157e292,-17976931348623157e292),Ye(r,t,e,i,52,8),e+8}function $t(r){if(r=Ot(r).replace(Dt,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Ot(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Wt(r){return r<16?"0"+r.toString(16):r.toString(16)}function ie(r,t){t=t||1/0;for(var e,i=r.length,n=null,o=[],s=0;s<i;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=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 jt(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Vt(r,t){for(var e,i,n,o=[],s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function Pe(r){return Tt($t(r))}function se(r,t,e,i){for(var n=0;n<i&&!(n+e>=t.length||n>=r.length);++n)t[n+e]=r[n];return n}function Gt(r){return r!==r}function Jt(r){return r!=null&&(!!r._isBuffer||Ce(r)||qt(r))}function Ce(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function qt(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ce(r.slice(0,0))}function ae(r,t,e,i,n){var o,s,u=n*8-i-1,f=(1<<u)-1,m=f>>1,w=-7,h=e?n-1:0,y=e?-1:1,A=r[t+h];for(h+=y,o=A&(1<<-w)-1,A>>=-w,w+=u;w>0;o=o*256+r[t+h],h+=y,w-=8);for(s=o&(1<<-w)-1,o>>=-w,w+=i;w>0;s=s*256+r[t+h],h+=y,w-=8);if(o===0)o=1-m;else{if(o===f)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-m}return(A?-1:1)*s*Math.pow(2,o-i)}function Ye(r,t,e,i,n,o){var s,u,f,m=o*8-n-1,w=(1<<m)-1,h=w>>1,y=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:o-1,O=i?1:-1,De=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=w):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+h>=1?t+=y/f:t+=y*Math.pow(2,1-h),t*f>=2&&(s++,f/=2),s+h>=w?(u=0,s=w):s+h>=1?(u=(t*f-1)*Math.pow(2,n),s=s+h):(u=t*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;r[e+A]=u&255,A+=O,u/=256,n-=8);for(s=s<<n|u,m+=n;m>0;r[e+A]=s&255,A+=O,s/=256,m-=8);r[e+A-O]|=De*128}var E,v,gt,ce,Ie,Dt,Me=fe(()=>{"use strict";l();c();E=[],v=[],gt=typeof Uint8Array!="undefined"?Uint8Array:Array,ce=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return be(null,r,t,e)};a.kMaxLength=re();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(r,t,e){return Et(null,r,t,e)};a.allocUnsafe=function(r){return pe(null,r)};a.allocUnsafeSlow=function(r){return pe(null,r)};a.isBuffer=Jt;a.compare=function(t,e){if(!I(t)||!I(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,o=0,s=Math.min(i,n);o<s;++o)if(t[o]!==e[o]){i=t[o],n=e[o];break}return i<n?-1:n<i?1:0};a.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}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var i;if(e===void 0)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<t.length;++i){var s=t[i];if(!I(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n};a.byteLength=Re;a.prototype._isBuffer=!0;a.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)P(this,e,e+1);return this};a.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)P(this,e,e+3),P(this,e+1,e+2);return this};a.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)P(this,e,e+7),P(this,e+1,e+6),P(this,e+2,e+5),P(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?Le(this,0,t):kt.apply(this,arguments)};a.prototype.equals=function(t){if(!I(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,i,n,o){if(!I(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=t?t.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var s=o-n,u=i-e,f=Math.min(s,u),m=this.slice(n,o),w=t.slice(e,i),h=0;h<f;++h)if(m[h]!==w[h]){s=m[h],u=w[h];break}return s<u?-1:u<s?1:0};a.prototype.includes=function(t,e,i){return this.indexOf(t,e,i)!==-1};a.prototype.indexOf=function(t,e,i){return Se(this,t,e,i,!0)};a.prototype.lastIndexOf=function(t,e,i){return Se(this,t,e,i,!1)};a.prototype.write=function(t,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return Rt(this,t,e,i);case"utf8":case"utf-8":return St(this,t,e,i);case"ascii":return _e(this,t,e,i);case"latin1":case"binary":return _t(this,t,e,i);case"base64":return Lt(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ie=4096;a.prototype.slice=function(t,e){var i=this.length;t=~~t,e=e===void 0?i:~~e,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<t&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=a.prototype;else{var o=e-t;n=new a(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+t]}return n};a.prototype.readUIntLE=function(t,e,i){t=t|0,e=e|0,i||g(t,e,this.length);for(var n=this[t],o=1,s=0;++s<e&&(o*=256);)n+=this[t+s]*o;return n};a.prototype.readUIntBE=function(t,e,i){t=t|0,e=e|0,i||g(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n};a.prototype.readUInt8=function(t,e){return e||g(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||g(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||g(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||g(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,i){t=t|0,e=e|0,i||g(t,e,this.length);for(var n=this[t],o=1,s=0;++s<e&&(o*=256);)n+=this[t+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(t,e,i){t=t|0,e=e|0,i||g(t,e,this.length);for(var n=e,o=1,s=this[t+--n];n>0&&(o*=256);)s+=this[t+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||g(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||g(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(t,e){e||g(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(t,e){return e||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||g(t,4,this.length),ae(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||g(t,4,this.length),ae(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||g(t,8,this.length),ae(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||g(t,8,this.length),ae(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;T(this,t,e,i,o,0)}var s=1,u=0;for(this[e]=t&255;++u<i&&(s*=256);)this[e+u]=t/s&255;return e+i};a.prototype.writeUIntBE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;T(this,t,e,i,o,0)}var s=i-1,u=1;for(this[e+s]=t&255;--s>=0&&(u*=256);)this[e+s]=t/u&255;return e+i};a.prototype.writeUInt8=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ne(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ne(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):oe(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):oe(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e=e|0,!n){var o=Math.pow(2,8*i-1);T(this,t,e,i,o-1,-o)}var s=0,u=1,f=0;for(this[e]=t&255;++s<i&&(u*=256);)t<0&&f===0&&this[e+s-1]!==0&&(f=1),this[e+s]=(t/u>>0)-f&255;return e+i};a.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e=e|0,!n){var o=Math.pow(2,8*i-1);T(this,t,e,i,o-1,-o)}var s=i-1,u=1,f=0;for(this[e+s]=t&255;--s>=0&&(u*=256);)t<0&&f===0&&this[e+s+1]!==0&&(f=1),this[e+s]=(t/u>>0)-f&255;return e+i};a.prototype.writeInt8=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ne(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ne(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):oe(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,i){return t=+t,e=e|0,i||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):oe(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,i){return Fe(this,t,e,!0,i)};a.prototype.writeFloatBE=function(t,e,i){return Fe(this,t,e,!1,i)};a.prototype.writeDoubleLE=function(t,e,i){return Ue(this,t,e,!0,i)};a.prototype.writeDoubleBE=function(t,e,i){return Ue(this,t,e,!1,i)};a.prototype.copy=function(t,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var o=n-i,s;if(this===t&&i<e&&e<n)for(s=o-1;s>=0;--s)t[s+e]=this[s+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o};a.prototype.fill=function(t,e,i,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<i;++s)this[s]=t;else{var u=I(t)?t:ie(new a(t,n).toString()),f=u.length;for(s=0;s<i-e;++s)this[s+e]=u[s%f]}return this};Dt=/[^+\/0-9A-Za-z-_]/g});var c=fe(()=>{"use strict";Me()});var ar={};we(ar,{FilePropertyMapper:()=>me});module.exports=Ge(ar);l();c();l();c();l();c();function C(r){throw new Error("Unexpected value: "+JSON.stringify(r))}l();c();var b={};we(b,{AstNode:()=>x,ClassInstantiation:()=>Q,CodeBlock:()=>V,Comment:()=>B,Function:()=>q,FunctionInvocation:()=>z,MethodInvocation:()=>H,Parameter:()=>J,Reference:()=>$,Type:()=>D,TypeLiteral:()=>S,Types:()=>D,Variable:()=>G,Writer:()=>M,codeblock:()=>Kt,function_:()=>er,instantiateClass:()=>tr,invokeFunction:()=>rr,invokeMethod:()=>ir,parameter:()=>nr,reference:()=>or,variable:()=>sr});l();c();l();c();l();c();l();c();l();c();l();c();var Y=class{};l();c();l();c();var N=class extends Y{constructor(e){super();p(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var zt=4,X=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
|
+
`),i=e?t.substring(0,t.length-1):t,n=this.getIndentString(),o=i.replaceAll(`
|
|
3
3
|
`,`
|
|
4
|
-
${
|
|
5
|
-
`),this.writeInternal(o)}writeNoIndent(
|
|
4
|
+
${n}`);this.isAtStartOfLine()&&(o=n+o),e&&(o+=`
|
|
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 N(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new N(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new N(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new N(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",i,n="}"){let o=t.filter(s=>s!==void 0).join(" ");o?this.write(`${o} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),i(),this.dedent()}finally{this.write(n!=null?n:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
6
6
|
`)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
7
|
-
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:
|
|
8
|
-
`)),this.buffer+=
|
|
9
|
-
${
|
|
10
|
-
${
|
|
11
|
-
`+this.buffer:this.buffer}stringifyImports(){let
|
|
12
|
-
`}}return
|
|
13
|
-
`)?this.writeStringWithBackticks({writer:
|
|
14
|
-
`),o=
|
|
15
|
-
`,s=
|
|
16
|
-
`);
|
|
17
|
-
`).forEach(
|
|
7
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:i}){if(t.length>0){let n=t[0];n!=null&&i(n);for(let o=1;o<t.length;o++){this.write(e);let s=t[o];s!=null&&i(s)}}}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*zt)}};l();c();var ue=class{},Z=class extends ue{async format(t){return t}formatSync(t){return t}};l();c();l();c();var M=class extends X{constructor({customConfig:e,formatter:i}){super();p(this,"customConfig");p(this,"formatter");p(this,"imports",{});p(this,"defaultImports",{});p(this,"starImportAliases",{});p(this,"starImportAliasesInverse",{});this.customConfig=e,this.formatter=i!=null?i:new Z}addImport(e){var i,n,o;if(e.importFrom!=null){switch(e.importFrom.type){case"default":{this.validateDefault(e);break}case"named":{this.validateNamed(e);break}case"star":{this.validateStar(e);break}}let s=(o=(i=this.imports)[n=e.importFrom.moduleName])!=null?o:i[n]=[];s.map(f=>f.name).includes(e.name)||s.push(e)}}validateDefault(e){var n,o,s,u;if(((n=e.importFrom)==null?void 0:n.type)!=="default")return;let i=(u=(o=this.defaultImports)[s=e.importFrom.moduleName])!=null?u:o[s]=e;if(i.name!==e.name)throw new Error(`Cannot have multiple default imports for module ${e.importFrom.moduleName}: got ${e.name} but already had ${i.name}`)}validateNamed(e){var s,u,f,m,w;if(((s=e.importFrom)==null?void 0:s.type)!=="named")return;let n=((u=this.imports[e.importFrom.moduleName])!=null?u:[]).filter(h=>{var y;return((y=h.importFrom)==null?void 0:y.type)==="star"});if(n.length>0)throw new Error(`Cannot add named import ${e.name} because non-named imports ${n.map(h=>h.name)} already exist`);let o=[];for(let h of Object.values(this.imports))for(let y of h)((f=y.importFrom)==null?void 0:f.type)==="named"&&y.importFrom.moduleName!==e.importFrom.moduleName&&y.name===e.name&&o.push(y);if(o.length>0)throw new Error(`Cannot add named import from module ${e.importFrom.moduleName} because it is already imported from ${(w=(m=o[0])==null?void 0:m.importFrom)==null?void 0:w.moduleName}`)}validateStar(e){var o,s,u,f,m,w,h;if(((o=e.importFrom)==null?void 0:o.type)!=="star")return;let i=(f=(s=this.starImportAliases)[u=e.importFrom.moduleName])!=null?f:s[u]=e.importFrom.starImportAlias;if(i!==e.importFrom.starImportAlias)throw new Error(`Cannot have more than one alias for non-named imports from a module: got ${e.importFrom.starImportAlias} but already have ${i}.`);if(((h=(m=this.starImportAliasesInverse)[w=e.importFrom.starImportAlias])!=null?h:m[w]=e.importFrom.moduleName)!==e.importFrom.moduleName)throw new Error(`Attempted to use alias ${e.importFrom.starImportAlias} for more than one module in the same file`)}};var K=class extends M{constructor({customConfig:t,formatter:e}){super({customConfig:t,formatter:e})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
|
|
9
|
+
${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format TypeScript file: ${e}
|
|
10
|
+
${t}`)}return t}getContent(){let t=this.stringifyImports();return t.length>0?t+`
|
|
11
|
+
`+this.buffer:this.buffer}stringifyImports(){let t="";for(let[e,i]of Object.entries(this.imports)){let n=this.defaultImports[e],o="",s=i.filter(f=>{var m;return((m=f.importFrom)==null?void 0:m.type)==="named"}),u=this.starImportAliases[e];if(s.length>0||n!=null||u!=null){if(t+="import",n!=null&&(t+=` ${n.name}`),s.length>0){for(let m of s.slice(0,-1))o+=`${m.name}, `;let f=s[s.length-1];f!=null&&(o+=`${f.name}`),n!=null&&(t+=","),t+=` { ${o} }`}u!=null&&((n!=null||s.length>0)&&(t+=", "),t+=` * as ${u}`),t+=` from "${e}";
|
|
12
|
+
`}}return t}};var x=class extends Y{async toStringAsync({customConfig:t,formatter:e}){let i=new K({customConfig:t,formatter:e});return this.write(i),await i.toStringAsync()}toString({customConfig:t,formatter:e}){let i=new K({customConfig:t,formatter:e});return this.write(i),i.toString()}};l();c();var V=class extends x{constructor(e){super();p(this,"args");this.args=e}write(e){return new N(this.args).write(e)}};l();c();var D=class extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"string":e.write("string");break;case"number":e.write("number");break;case"bigint":e.write("bigint");break;case"boolean":e.write("boolean");break;case"array":this.internalType.valueType.write(e),e.write("[]");break;case"map":e.write("Record<"),this.internalType.keyType.write(e),e.write(", "),this.internalType.valueType.write(e),e.write(">");break;case"object":e.write("{"),e.indent();for(let[i,n]of Object.entries(this.internalType.fields))e.write(`${i}: `),n.write(e),e.writeLine(",");e.dedent(),e.write("}");break;case"enum":e.write("enum");break;case"any":e.write("any");break;case"promise":e.write("Promise<"),this.internalType.value.write(e),e.write(">");break;case"unknown":e.write("unknown");break;case"void":e.write("void");break;case"undefined":e.write("undefined");break;case"null":e.write("null");break;case"never":e.write("never");break;case"nop":break;default:C(this.internalType)}}static string(){return new this({type:"string"})}static number(){return new this({type:"number"})}static bigint(){return new this({type:"bigint"})}static boolean(){return new this({type:"boolean"})}static array(e){return new this({type:"array",valueType:e})}static object(e){return new this({type:"object",fields:e})}static enum(e){return new this({type:"enum",values:e})}static any(){return new this({type:"any"})}static promise(e){return e.internalType.type==="promise"?e:new this({type:"promise",value:e})}static unknown(){return new this({type:"unknown"})}static void(){return new this({type:"void"})}static undefined(){return new this({type:"undefined"})}static null(){return new this({type:"null"})}static never(){return new this({type:"never"})}static nop(){return new this({type:"nop"})}};l();c();var S=class r extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){var o,s;let i=!!((o=e.customConfig)!=null&&o.noSerdeLayer),n=!!((s=e.customConfig)!=null&&s.useBigInt);switch(this.internalType.type){case"array":{this.writeIterable({writer:e,iterable:this.internalType});break}case"blob":{if(i){e.writeNode(r.string(this.internalType.value));return}e.write("new Blob(["),e.writeNode(r.string(this.internalType.value)),e.write("])");break}case"boolean":{e.write(this.internalType.value.toString());break}case"bigint":{if(n){e.write(`BigInt("${this.internalType.value.toString()}")`);return}e.write(`"${this.internalType.value.toString()}"`);return}case"datetime":{if(i){e.writeNode(r.string(this.internalType.value));return}e.write("new Date("),e.writeNode(r.string(this.internalType.value)),e.write(")");break}case"number":{e.write(this.internalType.value.toString());break}case"object":{this.writeObject({writer:e,object:this.internalType});break}case"record":{this.writeRecord({writer:e,record:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"set":{if(i||this.isSetOfObjects()){e.writeNode(r.array({values:this.internalType.values}));return}e.write("new Set("),this.writeIterable({writer:e,iterable:this.internalType}),e.write(")");break}case"string":{this.internalType.value.includes(`
|
|
13
|
+
`)?this.writeStringWithBackticks({writer:e,value:this.internalType.value}):e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}case"tuple":{this.writeIterable({writer:e,iterable:this.internalType});break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:C(this.internalType)}}isObject(){return this.internalType.type==="object"}asObjectOrThrow(){if(this.isObject())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not an object")}isSet(){return this.internalType.type==="set"}asSetOrThrow(){if(this.isSet())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a set")}isSetOfObjects(){return this.isSet()&&this.asSetOrThrow().values.every(e=>e.isObject())}writeStringWithBackticks({writer:e,value:i}){e.write("`");let n=i.split(`
|
|
14
|
+
`),o=n[0]+`
|
|
15
|
+
`,s=n.slice(1).join(`
|
|
16
|
+
`);e.write(o.replaceAll("`","\\`")),e.writeNoIndent(s.replaceAll("`","\\`")),e.write("`")}writeIterable({writer:e,iterable:i}){let n=Xt({values:i.values});if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of n)o.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeRecord({writer:e,record:i}){let n=Qt({entries:i.entries});if(n.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of n)o.key.write(e),e.write(": "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeObject({writer:e,object:i}){let n=Ht({fields:i.fields});if(n.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of n)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}static array({values:e}){return new this({type:"array",values:e})}static bigint(e){return new this({type:"bigint",value:e})}static blob(e){return new this({type:"blob",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static object({fields:e}){return new this({type:"object",fields:e})}static record({entries:e}){return new this({type:"record",entries:e})}static reference(e){return new this({type:"reference",value:e})}static set({values:e}){return new this({type:"set",values:e})}static string(e){return new this({type:"string",value:e})}static tuple({values:e}){return new this({type:"tuple",values:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:i}){switch(typeof i){case"boolean":e.write(i.toString());return;case"string":e.write(i.includes('"')?`\`${i}\``:`"${i}"`);return;case"number":e.write(i.toString());return;case"object":if(i==null){e.write("null");return}if(Array.isArray(i)){this.writeUnknownArray({writer:e,value:i});return}this.writeUnknownObject({writer:e,value:i});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof i}`)}}writeUnknownArray({writer:e,value:i}){if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let n of i)e.writeNode(r.unknown(n)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownObject({writer:e,value:i}){let n=Object.entries(i);if(n.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,s]of n)e.write(`${o}: `),e.writeNode(r.unknown(s)),e.writeLine(",");e.dedent(),e.write("}")}};function Ht({fields:r}){return r.filter(t=>!S.isNop(t.value))}function Qt({entries:r}){return r.filter(t=>!S.isNop(t.key)&&!S.isNop(t.value))}function Xt({values:r}){return r.filter(t=>!S.isNop(t))}l();c();var $=class extends x{constructor({name:e,importFrom:i,memberName:n}){super();p(this,"name");p(this,"importFrom");p(this,"memberName");this.name=e,this.importFrom=i,this.memberName=n}write(e){var o;this.importFrom!=null&&e.addImport(this);let i=((o=this.importFrom)==null?void 0:o.type)==="star"?`${this.importFrom.starImportAlias}.`:"",n=this.memberName!=null?`.${this.memberName}`:"";e.write(`${i}${this.name}${n}`)}};l();c();var G=class extends x{constructor(e){super();p(this,"args");this.args=e}write(e){this.args.export&&e.write("export "),this.args.const?e.write("const "):e.write("let "),e.write(`${this.args.name} = `),e.writeNode(this.args.initializer)}};l();c();l();c();var B=class extends x{constructor({docs:e}={docs:void 0}){super();p(this,"docs");this.docs=e}write(e){this.docs!=null&&(e.writeLine("/**"),this.docs.split(`
|
|
17
|
+
`).forEach(i=>{e.writeLine(` * ${i}`)}),e.writeLine("*/"))}};var J=class extends x{constructor({name:e,type:i,docs:n}){super();p(this,"name");p(this,"type");p(this,"docs");this.name=e,this.type=i,this.docs=n}write(e){this.docs!=null&&e.writeNode(new B({docs:this.docs})),e.write(`${this.name}: `),this.type.write(e)}};l();c();var q=class extends x{constructor({name:e,parameters:i,async:n,body:o,return_:s,docs:u}){super();p(this,"name");p(this,"parameters");p(this,"async");p(this,"body");p(this,"return_");p(this,"docs");this.name=e,this.parameters=i,this.async=n!=null?n:!1,this.body=o,this.return_=s,this.docs=u}write(e){var i;e.writeNode(new B({docs:this.docs})),this.async&&e.write("async "),e.write("function "),e.write(`${this.name}`),this.writeParameters(e),this.return_!=null&&(e.write(": "),e.writeNode(this.async?D.promise(this.return_):this.return_)),e.writeLine(" {"),e.indent(),(i=this.body)==null||i.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeParameters(e){if(this.parameters.length===0){e.write("()");return}e.indent(),e.writeLine("(");for(let i of this.parameters)e.writeNode(i),e.writeLine(",");e.dedent(),e.write(")")}};l();c();var z=class extends x{constructor({function_:e,arguments_:i}){super();p(this,"function_");p(this,"arguments_");this.function_=e,this.arguments_=i}write(e){e.writeNode(this.function_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:i=>i.write(e)}),e.write(")")}};l();c();var H=class extends x{constructor({on:e,method:i,arguments_:n,async:o}){super();p(this,"on");p(this,"method");p(this,"arguments_");p(this,"async");this.on=e,this.method=i,this.arguments_=n,this.async=o}write(e){this.async&&e.write("await "),this.on.write(e),e.write("."),e.write(this.method),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:i=>i.write(e)}),e.write(")")}};l();c();var Q=class extends x{constructor({class_:e,arguments_:i}){super();p(this,"class_");p(this,"arguments_");this.class_=e,this.arguments_=i}write(e){e.write("new "),e.writeNode(this.class_),e.write("("),e.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:i=>i.write(e)}),e.write(")")}};function Kt(r){return new V(r)}function er(r){return new q(r)}function tr(r){return new Q(r)}function rr(r){return new z(r)}function ir(r){return new H(r)}function nr(r){return new J(r)}function or(r){return new $(r)}function sr(r){return new G(r)}var me=class{constructor({context:t}){p(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let i={fileFields:[],bodyPropertyFields:[]},n=(o=this.context.getRecord(e))!=null?o:{};for(let s of t.properties)switch(s.type){case"file":i.fileFields.push({name:this.context.getPropertyName(s.name),value:this.getSingleFileProperty({property:s,record:n})});break;case"fileArray":i.fileFields.push({name:this.context.getPropertyName(s.name),value:this.getArrayFileProperty({property:s,record:n})});break;case"bodyProperty":i.bodyPropertyFields.push({name:this.context.getPropertyName(s.name.name),value:this.getBodyProperty({property:s,record:n})});break;default:C(s)}return i}getSingleFileProperty({property:t,record:e}){let i=this.context.getSingleFileValue({property:t,record:e});return i==null?b.TypeLiteral.nop():b.TypeLiteral.blob(i)}getArrayFileProperty({property:t,record:e}){let i=this.context.getFileArrayValues({property:t,record:e});return i==null?b.TypeLiteral.nop():b.TypeLiteral.array({values:i.map(n=>b.TypeLiteral.blob(n))})}getBodyProperty({property:t,record:e}){let i=e[t.name.wireValue];return i==null?b.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:i})}};0&&(module.exports={FilePropertyMapper});
|
|
18
18
|
/*! Bundled license information:
|
|
19
19
|
|
|
20
20
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@fern-api/dynamic-ir-sdk';
|
|
2
2
|
import '@fern-api/typescript-ast';
|
|
3
|
-
export { F as FilePropertyInfo, b as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-
|
|
3
|
+
export { F as FilePropertyInfo, b as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-CmDa2k9n.cjs';
|
|
4
4
|
import '@fern-api/browser-compatible-base-generator';
|