@fern-api/ruby-dynamic-snippets 0.0.1 → 0.0.2
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 +29 -10
- package/cjs/DynamicSnippetsGenerator.cjs.map +1 -0
- package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
- package/cjs/{DynamicSnippetsGeneratorContext-BGmCyT7y.d.cts → DynamicSnippetsGeneratorContext-Kt0XtRvQ.d.cts} +1 -1
- package/cjs/EndpointSnippetGenerator.cjs +18 -10
- package/cjs/EndpointSnippetGenerator.cjs.map +1 -0
- package/cjs/EndpointSnippetGenerator.d.cts +3 -2
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +29 -10
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -0
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
- package/cjs/context/DynamicToLiteralMapper.cjs +18 -10
- package/cjs/context/DynamicToLiteralMapper.cjs.map +1 -0
- package/cjs/context/DynamicToLiteralMapper.d.cts +1 -1
- package/cjs/index.cjs +32 -25
- package/cjs/index.cjs.map +1 -0
- package/cjs/index.d.cts +2 -2
- package/esm/DynamicSnippetsGenerator.d.ts +1 -1
- package/esm/DynamicSnippetsGenerator.js +2 -1
- package/esm/DynamicSnippetsGenerator.js.map +1 -0
- package/esm/{DynamicSnippetsGeneratorContext-BGmCyT7y.d.ts → DynamicSnippetsGeneratorContext-Kt0XtRvQ.d.ts} +1 -1
- package/esm/EndpointSnippetGenerator.d.ts +3 -2
- package/esm/EndpointSnippetGenerator.js +2 -1
- package/esm/EndpointSnippetGenerator.js.map +1 -0
- package/esm/chunk-DC7MOL5X.js +15 -0
- package/esm/chunk-DC7MOL5X.js.map +1 -0
- package/esm/chunk-HW2BPM3B.js +2 -0
- package/esm/chunk-HW2BPM3B.js.map +1 -0
- package/esm/chunk-NOLMTKNR.js +2 -0
- package/esm/chunk-NOLMTKNR.js.map +1 -0
- package/esm/chunk-RKBBW5DU.js +34 -0
- package/esm/chunk-RKBBW5DU.js.map +1 -0
- package/esm/chunk-WLYQ7USA.js +2 -0
- package/esm/chunk-WLYQ7USA.js.map +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js +2 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js.map +1 -0
- package/esm/context/DynamicToLiteralMapper.d.ts +1 -1
- package/esm/context/DynamicToLiteralMapper.js +2 -1
- package/esm/context/DynamicToLiteralMapper.js.map +1 -0
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -13
- package/esm/index.js.map +1 -0
- package/package.json +1 -1
- package/esm/chunk-2EUGHB6H.js +0 -26
- package/esm/chunk-5MYTC5XX.js +0 -1
- package/esm/chunk-JE27KH5P.js +0 -1
- package/esm/chunk-P72WBQKD.js +0 -1
- package/esm/chunk-T3CDT3YD.js +0 -1
package/cjs/index.cjs
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
"use strict";var Nu=Object.create;var Ge=Object.defineProperty,Cu=Object.defineProperties,Fu=Object.getOwnPropertyDescriptor,Ou=Object.getOwnPropertyDescriptors,qu=Object.getOwnPropertyNames,Er=Object.getOwnPropertySymbols,Lu=Object.getPrototypeOf,Tt=Object.prototype.hasOwnProperty,Wn=Object.prototype.propertyIsEnumerable;var Et=(t,e,r)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zn=(t,e)=>{for(var r in e||(e={}))Tt.call(e,r)&&Et(t,r,e[r]);if(Er)for(var r of Er(e))Wn.call(e,r)&&Et(t,r,e[r]);return t},Vn=(t,e)=>Cu(t,Ou(e));var Yn=t=>typeof t=="symbol"?t:t+"",jn=(t,e)=>{var r={};for(var n in t)Tt.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Er)for(var n of Er(t))e.indexOf(n)<0&&Wn.call(t,n)&&(r[n]=t[n]);return r};var Ee=(t,e)=>()=>(t&&(e=t(t=0)),e);var h=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Rt=(t,e)=>{for(var r in e)Ge(t,r,{get:e[r],enumerable:!0})},Hn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qu(e))!Tt.call(t,i)&&i!==r&&Ge(t,i,{get:()=>e[i],enumerable:!(n=Fu(e,i))||n.enumerable});return t};var $u=(t,e,r)=>(r=t!=null?Nu(Lu(t)):{},Hn(e||!t||!t.__esModule?Ge(r,"default",{value:t,enumerable:!0}):r,t)),Kn=t=>Hn(Ge({},"__esModule",{value:!0}),t);var y=(t,e,r)=>Et(t,typeof e!="symbol"?e+"":e,r);function Xn(){throw new Error("setTimeout has not been defined")}function Qn(){throw new Error("clearTimeout has not been defined")}function Zn(t){if(X===setTimeout)return setTimeout(t,0);if((X===Xn||!X)&&setTimeout)return X=setTimeout,setTimeout(t,0);try{return X(t,0)}catch(e){try{return X.call(null,t,0)}catch(r){return X.call(this,t,0)}}}function ku(t){if(Q===clearTimeout)return clearTimeout(t);if((Q===Qn||!Q)&&clearTimeout)return Q=clearTimeout,clearTimeout(t);try{return Q(t)}catch(e){try{return Q.call(null,t)}catch(r){return Q.call(this,t)}}}function Bu(){!Re||!ie||(Re=!1,ie.length?z=ie.concat(z):Tr=-1,z.length&&ei())}function ei(){if(!Re){var t=Zn(Bu);Re=!0;for(var e=z.length;e;){for(ie=z,z=[];++Tr<e;)ie&&ie[Tr].run();Tr=-1,e=z.length}ie=null,Re=!1,ku(t)}}function Du(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];z.push(new ri(t,e)),z.length===1&&!Re&&Zn(ei)}function ri(t,e){this.fun=t,this.array=e}function oe(){}function rl(t){throw new Error("process.binding is not supported")}function tl(){return"/"}function nl(t){throw new Error("process.chdir is not supported")}function il(){return 0}function al(t){var e=ol.call(Te)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}function ul(){var t=new Date,e=t-sl;return e/1e3}var X,Q,z,Re,ie,Tr,_u,Mu,Uu,Gu,Wu,zu,Vu,Yu,ju,Hu,Ku,Ju,Xu,Qu,Zu,el,Te,ol,sl,f,Jn,s=Ee(()=>{"use strict";X=Xn,Q=Qn;typeof globalThis.setTimeout=="function"&&(X=setTimeout);typeof globalThis.clearTimeout=="function"&&(Q=clearTimeout);z=[],Re=!1,Tr=-1;ri.prototype.run=function(){this.fun.apply(null,this.array)};_u="browser",Mu="browser",Uu=!0,Gu={},Wu=[],zu="",Vu={},Yu={},ju={};Hu=oe,Ku=oe,Ju=oe,Xu=oe,Qu=oe,Zu=oe,el=oe;Te=globalThis.performance||{},ol=Te.now||Te.mozNow||Te.msNow||Te.oNow||Te.webkitNow||function(){return new Date().getTime()};sl=new Date;f={nextTick:Du,title:_u,browser:Uu,env:Gu,argv:Wu,version:zu,versions:Vu,on:Hu,addListener:Ku,once:Ju,off:Xu,removeListener:Qu,removeAllListeners:Zu,emit:el,binding:rl,cwd:tl,chdir:nl,umask:il,hrtime:al,platform:Mu,release:Yu,config:ju,uptime:ul},Jn={};Object.keys(Jn).forEach(t=>{let e=t.split("."),r=f;for(let n=0;n<e.length;n++){let i=e[n];n===e.length-1?r[i]=Jn[t]:r=r[i]||(r[i]={})}})});function oi(){Pt=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)B[e]=t[e],L[t.charCodeAt(e)]=e;L[45]=62,L[95]=63}function cl(t){Pt||oi();var e,r,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new ll(c*3/4-o),n=o>0?c-4:c;var p=0;for(e=0,r=0;e<n;e+=4,r+=3)i=L[t.charCodeAt(e)]<<18|L[t.charCodeAt(e+1)]<<12|L[t.charCodeAt(e+2)]<<6|L[t.charCodeAt(e+3)],a[p++]=i>>16&255,a[p++]=i>>8&255,a[p++]=i&255;return o===2?(i=L[t.charCodeAt(e)]<<2|L[t.charCodeAt(e+1)]>>4,a[p++]=i&255):o===1&&(i=L[t.charCodeAt(e)]<<10|L[t.charCodeAt(e+1)]<<4|L[t.charCodeAt(e+2)]>>2,a[p++]=i>>8&255,a[p++]=i&255),a}function pl(t){return B[t>>18&63]+B[t>>12&63]+B[t>>6&63]+B[t&63]}function fl(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(pl(n));return i.join("")}function ti(t){Pt||oi();for(var e,r=t.length,n=r%3,i="",o=[],a=16383,c=0,p=r-n;c<p;c+=a)o.push(fl(t,c,c+a>p?p:c+a));return n===1?(e=t[r-1],i+=B[e>>2],i+=B[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=B[e>>10],i+=B[e>>4&63],i+=B[e<<2&63],i+="="),o.push(i),o.join("")}function Rr(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function V(t,e){if(Rr()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=l.prototype):(t===null&&(t=new l(e)),t.length=e),t}function l(t,e,r){if(!l.TYPED_ARRAY_SUPPORT&&!(this instanceof l))return new l(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 Nt(this,t)}return ai(this,t,e,r)}function ai(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?dl(t,e,r,n):typeof e=="string"?hl(t,e,r):ml(t,e)}function si(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 yl(t,e,r,n){return si(e),e<=0?V(t,e):r!==void 0?typeof n=="string"?V(t,e).fill(r,n):V(t,e).fill(r):V(t,e)}function Nt(t,e){if(si(e),t=V(t,e<0?0:Ct(e)|0),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function hl(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=ui(e,r)|0;t=V(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function It(t,e){var r=e.length<0?0:Ct(e.length)|0;t=V(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function dl(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),l.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=l.prototype):t=It(t,e),t}function ml(t,e){if(D(e)){var r=Ct(e.length)|0;return t=V(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"||$l(e.length)?V(t,0):It(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return It(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ct(t){if(t>=Rr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Rr().toString(16)+" bytes");return t|0}function D(t){return!!(t!=null&&t._isBuffer)}function ui(t,e){if(D(t))return t.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Ir(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return di(t).length;default:if(n)return Ir(t).length;e=(""+e).toLowerCase(),n=!0}}function gl(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 Il(this,e,r);case"utf8":case"utf-8":return pi(this,e,r);case"ascii":return Tl(this,e,r);case"latin1":case"binary":return Rl(this,e,r);case"base64":return Sl(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pl(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function ae(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function li(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=l.from(e,n)),D(e))return e.length===0?-1:ni(t,e,r,n,i);if(typeof e=="number")return e=e&255,l.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):ni(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ni(t,e,r,n,i){var o=1,a=t.length,c=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,a/=2,c/=2,r/=2}function p(A,T){return o===1?A[T]:A.readUInt16BE(T*o)}var d;if(i){var v=-1;for(d=r;d<a;d++)if(p(t,d)===p(e,v===-1?0:d-v)){if(v===-1&&(v=d),d-v+1===c)return v*o}else v!==-1&&(d-=d-v),v=-1}else for(r+c>a&&(r=a-c),d=r;d>=0;d--){for(var m=!0,w=0;w<c;w++)if(p(t,d+w)!==p(e,w)){m=!1;break}if(m)return d}return-1}function vl(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 a=0;a<n;++a){var c=parseInt(e.substr(a*2,2),16);if(isNaN(c))return a;t[r+a]=c}return a}function wl(t,e,r,n){return Cr(Ir(e,t.length-r),t,r,n)}function ci(t,e,r,n){return Cr(ql(e),t,r,n)}function xl(t,e,r,n){return ci(t,e,r,n)}function Al(t,e,r,n){return Cr(di(e),t,r,n)}function bl(t,e,r,n){return Cr(Ll(e,t.length-r),t,r,n)}function Sl(t,e,r){return e===0&&r===t.length?ti(t):ti(t.slice(e,r))}function pi(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var p,d,v,m;switch(c){case 1:o<128&&(a=o);break;case 2:p=t[i+1],(p&192)===128&&(m=(o&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[i+1],d=t[i+2],(p&192)===128&&(d&192)===128&&(m=(o&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[i+1],d=t[i+2],v=t[i+3],(p&192)===128&&(d&192)===128&&(v&192)===128&&(m=(o&15)<<18|(p&63)<<12|(d&63)<<6|v&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return El(n)}function El(t){var e=t.length;if(e<=ii)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=ii));return r}function Tl(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 Rl(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 Il(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+=Ol(t[o]);return i}function Pl(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 I(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 O(t,e,r,n,i,o){if(!D(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 Pr(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 Nr(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 fi(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 yi(t,e,r,n,i){return i||fi(t,e,r,4,34028234663852886e22,-34028234663852886e22),gi(t,e,r,n,23,4),r+4}function hi(t,e,r,n,i){return i||fi(t,e,r,8,17976931348623157e292,-17976931348623157e292),gi(t,e,r,n,52,8),r+8}function Cl(t){if(t=Fl(t).replace(Nl,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Fl(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ol(t){return t<16?"0"+t.toString(16):t.toString(16)}function Ir(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+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 ql(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Ll(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function di(t){return cl(Cl(t))}function Cr(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 $l(t){return t!==t}function kl(t){return t!=null&&(!!t._isBuffer||mi(t)||Bl(t))}function mi(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Bl(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&mi(t.slice(0,0))}function Fr(t,e,r,n,i){var o,a,c=i*8-n-1,p=(1<<c)-1,d=p>>1,v=-7,m=r?i-1:0,w=r?-1:1,A=t[e+m];for(m+=w,o=A&(1<<-v)-1,A>>=-v,v+=c;v>0;o=o*256+t[e+m],m+=w,v-=8);for(a=o&(1<<-v)-1,o>>=-v,v+=n;v>0;a=a*256+t[e+m],m+=w,v-=8);if(o===0)o=1-d;else{if(o===p)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-d}return(A?-1:1)*a*Math.pow(2,o-n)}function gi(t,e,r,n,i,o){var a,c,p,d=o*8-i-1,v=(1<<d)-1,m=v>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,T=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=v):(a=Math.floor(Math.log(e)/Math.LN2),e*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?e+=w/p:e+=w*Math.pow(2,1-m),e*p>=2&&(a++,p/=2),a+m>=v?(c=0,a=v):a+m>=1?(c=(e*p-1)*Math.pow(2,i),a=a+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),a=0));i>=8;t[r+A]=c&255,A+=T,c/=256,i-=8);for(a=a<<i|c,d+=i;d>0;t[r+A]=a&255,A+=T,a/=256,d-=8);t[r+A-T]|=E*128}var B,L,ll,Pt,ii,Nl,vi=Ee(()=>{"use strict";s();u();B=[],L=[],ll=typeof Uint8Array!="undefined"?Uint8Array:Array,Pt=!1;l.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;l.poolSize=8192;l._augment=function(t){return t.__proto__=l.prototype,t};l.from=function(t,e,r){return ai(null,t,e,r)};l.kMaxLength=Rr();l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&l[Symbol.species]);l.alloc=function(t,e,r){return yl(null,t,e,r)};l.allocUnsafe=function(t){return Nt(null,t)};l.allocUnsafeSlow=function(t){return Nt(null,t)};l.isBuffer=kl;l.compare=function(e,r){if(!D(e)||!D(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};l.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}};l.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return l.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=l.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!D(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};l.byteLength=ui;l.prototype._isBuffer=!0;l.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)ae(this,r,r+1);return this};l.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)ae(this,r,r+3),ae(this,r+1,r+2);return this};l.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)ae(this,r,r+7),ae(this,r+1,r+6),ae(this,r+2,r+5),ae(this,r+3,r+4);return this};l.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?pi(this,0,e):gl.apply(this,arguments)};l.prototype.equals=function(e){if(!D(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:l.compare(this,e)===0};l.prototype.compare=function(e,r,n,i,o){if(!D(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),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 a=o-i,c=n-r,p=Math.min(a,c),d=this.slice(i,o),v=e.slice(r,n),m=0;m<p;++m)if(d[m]!==v[m]){a=d[m],c=v[m];break}return a<c?-1:c<a?1:0};l.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};l.prototype.indexOf=function(e,r,n){return li(this,e,r,n,!0)};l.prototype.lastIndexOf=function(e,r,n){return li(this,e,r,n,!1)};l.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 a=!1;;)switch(i){case"hex":return vl(this,e,r,n);case"utf8":case"utf-8":return wl(this,e,r,n);case"ascii":return ci(this,e,r,n);case"latin1":case"binary":return xl(this,e,r,n);case"base64":return Al(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bl(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};ii=4096;l.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(l.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=l.prototype;else{var o=r-e;i=new l(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+e]}return i};l.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};l.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};l.prototype.readUInt8=function(e,r){return r||I(e,1,this.length),this[e]};l.prototype.readUInt16LE=function(e,r){return r||I(e,2,this.length),this[e]|this[e+1]<<8};l.prototype.readUInt16BE=function(e,r){return r||I(e,2,this.length),this[e]<<8|this[e+1]};l.prototype.readUInt32LE=function(e,r){return r||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};l.prototype.readUInt32BE=function(e,r){return r||I(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};l.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};l.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};l.prototype.readInt8=function(e,r){return r||I(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};l.prototype.readInt16LE=function(e,r){r||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function(e,r){r||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function(e,r){return r||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};l.prototype.readInt32BE=function(e,r){return r||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};l.prototype.readFloatLE=function(e,r){return r||I(e,4,this.length),Fr(this,e,!0,23,4)};l.prototype.readFloatBE=function(e,r){return r||I(e,4,this.length),Fr(this,e,!1,23,4)};l.prototype.readDoubleLE=function(e,r){return r||I(e,8,this.length),Fr(this,e,!0,52,8)};l.prototype.readDoubleBE=function(e,r){return r||I(e,8,this.length),Fr(this,e,!1,52,8)};l.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;O(this,e,r,n,o,0)}var a=1,c=0;for(this[r]=e&255;++c<n&&(a*=256);)this[r+c]=e/a&255;return r+n};l.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;O(this,e,r,n,o,0)}var a=n-1,c=1;for(this[r+a]=e&255;--a>=0&&(c*=256);)this[r+a]=e/c&255;return r+n};l.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};l.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):Pr(this,e,r,!0),r+2};l.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):Pr(this,e,r,!1),r+2};l.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):Nr(this,e,r,!0),r+4};l.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):Nr(this,e,r,!1),r+4};l.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);O(this,e,r,n,o-1,-o)}var a=0,c=1,p=0;for(this[r]=e&255;++a<n&&(c*=256);)e<0&&p===0&&this[r+a-1]!==0&&(p=1),this[r+a]=(e/c>>0)-p&255;return r+n};l.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);O(this,e,r,n,o-1,-o)}var a=n-1,c=1,p=0;for(this[r+a]=e&255;--a>=0&&(c*=256);)e<0&&p===0&&this[r+a+1]!==0&&(p=1),this[r+a]=(e/c>>0)-p&255;return r+n};l.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};l.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):Pr(this,e,r,!0),r+2};l.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):Pr(this,e,r,!1),r+2};l.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):Nr(this,e,r,!0),r+4};l.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||O(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):Nr(this,e,r,!1),r+4};l.prototype.writeFloatLE=function(e,r,n){return yi(this,e,r,!0,n)};l.prototype.writeFloatBE=function(e,r,n){return yi(this,e,r,!1,n)};l.prototype.writeDoubleLE=function(e,r,n){return hi(this,e,r,!0,n)};l.prototype.writeDoubleBE=function(e,r,n){return hi(this,e,r,!1,n)};l.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,a;if(this===e&&n<r&&r<i)for(a=o-1;a>=0;--a)e[a+r]=this[a+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};l.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"&&!l.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 a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var c=D(e)?e:Ir(new l(e,i).toString()),p=c.length;for(a=0;a<n-r;++a)this[a+r]=c[a%p]}return this};Nl=/[^+\/0-9A-Za-z-_]/g});var u=Ee(()=>{"use strict";vi()});var Ft=h((Eh,wi)=>{"use strict";s();u();wi.exports=Object});var Ai=h((Ih,xi)=>{"use strict";s();u();xi.exports=Error});var Si=h((Ch,bi)=>{"use strict";s();u();bi.exports=EvalError});var Ti=h((qh,Ei)=>{"use strict";s();u();Ei.exports=RangeError});var Ii=h((kh,Ri)=>{"use strict";s();u();Ri.exports=ReferenceError});var Ot=h((_h,Pi)=>{"use strict";s();u();Pi.exports=SyntaxError});var N=h((Gh,Ni)=>{"use strict";s();u();Ni.exports=TypeError});var Fi=h((Vh,Ci)=>{"use strict";s();u();Ci.exports=URIError});var qt=h((Hh,Oi)=>{"use strict";s();u();Oi.exports=Math.abs});var Lt=h((Xh,qi)=>{"use strict";s();u();qi.exports=Math.floor});var $i=h((ed,Li)=>{"use strict";s();u();Li.exports=Math.max});var $t=h((nd,ki)=>{"use strict";s();u();ki.exports=Math.min});var Di=h((ad,Bi)=>{"use strict";s();u();Bi.exports=Math.pow});var Mi=h((ld,_i)=>{"use strict";s();u();_i.exports=Math.round});var Or=h((fd,Ui)=>{"use strict";s();u();Ui.exports=Number.isNaN||function(e){return e!==e}});var Wi=h((dd,Gi)=>{"use strict";s();u();var Dl=Or();Gi.exports=function(e){return Dl(e)||e===0?e:e<0?-1:1}});var Vi=h((vd,zi)=>{"use strict";s();u();zi.exports=Object.getOwnPropertyDescriptor});var Ie=h((Ad,Yi)=>{"use strict";s();u();var qr=Vi();if(qr)try{qr([],"length")}catch(t){qr=null}Yi.exports=qr});var We=h((Ed,ji)=>{"use strict";s();u();var Lr=Object.defineProperty||!1;if(Lr)try{Lr({},"a",{value:1})}catch(t){Lr=!1}ji.exports=Lr});var kt=h((Id,Hi)=>{"use strict";s();u();Hi.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(e,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0}});var Bt=h((Cd,Ji)=>{"use strict";s();u();var Ki=typeof Symbol!="undefined"&&Symbol,_l=kt();Ji.exports=function(){return typeof Ki!="function"||typeof Symbol!="function"||typeof Ki("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_l()}});var Dt=h((qd,Xi)=>{"use strict";s();u();Xi.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var _t=h((kd,Qi)=>{"use strict";s();u();var Ml=Ft();Qi.exports=Ml.getPrototypeOf||null});var ro=h((_d,eo)=>{"use strict";s();u();var Ul="Function.prototype.bind called on incompatible ",Gl=Object.prototype.toString,Wl=Math.max,zl="[object Function]",Zi=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var o=0;o<r.length;o+=1)n[o+e.length]=r[o];return n},Vl=function(e,r){for(var n=[],i=r||0,o=0;i<e.length;i+=1,o+=1)n[o]=e[i];return n},Yl=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};eo.exports=function(e){var r=this;if(typeof r!="function"||Gl.apply(r)!==zl)throw new TypeError(Ul+r);for(var n=Vl(arguments,1),i,o=function(){if(this instanceof i){var v=r.apply(this,Zi(n,arguments));return Object(v)===v?v:this}return r.apply(e,Zi(n,arguments))},a=Wl(0,r.length-n.length),c=[],p=0;p<a;p++)c[p]="$"+p;if(i=Function("binder","return function ("+Yl(c,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var d=function(){};d.prototype=r.prototype,i.prototype=new d,d.prototype=null}return i}});var Pe=h((Gd,to)=>{"use strict";s();u();var jl=ro();to.exports=Function.prototype.bind||jl});var $r=h((Vd,no)=>{"use strict";s();u();no.exports=Function.prototype.call});var kr=h((Hd,io)=>{"use strict";s();u();io.exports=Function.prototype.apply});var ao=h((Xd,oo)=>{"use strict";s();u();oo.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var Mt=h((em,so)=>{"use strict";s();u();var Hl=Pe(),Kl=kr(),Jl=$r(),Xl=ao();so.exports=Xl||Hl.call(Jl,Kl)});var Br=h((nm,uo)=>{"use strict";s();u();var Ql=Pe(),Zl=N(),ec=$r(),rc=Mt();uo.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new Zl("a function is required");return rc(Ql,ec,e)}});var ho=h((am,yo)=>{"use strict";s();u();var tc=Br(),lo=Ie(),po;try{po=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ut=!!po&&lo&&lo(Object.prototype,"__proto__"),fo=Object,co=fo.getPrototypeOf;yo.exports=Ut&&typeof Ut.get=="function"?tc([Ut.get]):typeof co=="function"?function(e){return co(e==null?e:fo(e))}:!1});var xo=h((lm,wo)=>{"use strict";s();u();var mo=Dt(),go=_t(),vo=ho();wo.exports=mo?function(e){return mo(e)}:go?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return go(e)}:vo?function(e){return vo(e)}:null});var Gt=h((fm,Ao)=>{"use strict";s();u();var nc=Function.prototype.call,ic=Object.prototype.hasOwnProperty,oc=Pe();Ao.exports=oc.call(nc,ic)});var Y=h((dm,Io)=>{"use strict";s();u();var x,ac=Ft(),sc=Ai(),uc=Si(),lc=Ti(),cc=Ii(),Oe=Ot(),Fe=N(),pc=Fi(),fc=qt(),yc=Lt(),hc=$i(),dc=$t(),mc=Di(),gc=Mi(),vc=Wi(),To=Function,Wt=function(t){try{return To('"use strict"; return ('+t+").constructor;")()}catch(e){}},ze=Ie(),wc=We(),zt=function(){throw new Fe},xc=ze?function(){try{return arguments.callee,zt}catch(t){try{return ze(arguments,"callee").get}catch(e){return zt}}}():zt,Ne=Bt()(),P=xo(),Ac=_t(),bc=Dt(),Ro=kr(),Ve=$r(),Ce={},Sc=typeof Uint8Array=="undefined"||!P?x:P(Uint8Array),se={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?x:ArrayBuffer,"%ArrayIteratorPrototype%":Ne&&P?P([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":Ce,"%AsyncGenerator%":Ce,"%AsyncGeneratorFunction%":Ce,"%AsyncIteratorPrototype%":Ce,"%Atomics%":typeof Atomics=="undefined"?x:Atomics,"%BigInt%":typeof BigInt=="undefined"?x:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?x:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?x:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":sc,"%eval%":eval,"%EvalError%":uc,"%Float16Array%":typeof Float16Array=="undefined"?x:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?x:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?x:FinalizationRegistry,"%Function%":To,"%GeneratorFunction%":Ce,"%Int8Array%":typeof Int8Array=="undefined"?x:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?x:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ne&&P?P(P([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map=="undefined"?x:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Ne||!P?x:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ac,"%Object.getOwnPropertyDescriptor%":ze,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?x:Promise,"%Proxy%":typeof Proxy=="undefined"?x:Proxy,"%RangeError%":lc,"%ReferenceError%":cc,"%Reflect%":typeof Reflect=="undefined"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?x:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Ne||!P?x:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ne&&P?P(""[Symbol.iterator]()):x,"%Symbol%":Ne?Symbol:x,"%SyntaxError%":Oe,"%ThrowTypeError%":xc,"%TypedArray%":Sc,"%TypeError%":Fe,"%Uint8Array%":typeof Uint8Array=="undefined"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?x:Uint32Array,"%URIError%":pc,"%WeakMap%":typeof WeakMap=="undefined"?x:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?x:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?x:WeakSet,"%Function.prototype.call%":Ve,"%Function.prototype.apply%":Ro,"%Object.defineProperty%":wc,"%Object.getPrototypeOf%":Ac,"%Math.abs%":fc,"%Math.floor%":yc,"%Math.max%":hc,"%Math.min%":dc,"%Math.pow%":mc,"%Math.round%":gc,"%Math.sign%":vc,"%Reflect.getPrototypeOf%":bc};if(P)try{null.error}catch(t){bo=P(P(t)),se["%Error.prototype%"]=bo}var bo,Ec=function t(e){var r;if(e==="%AsyncFunction%")r=Wt("async function () {}");else if(e==="%GeneratorFunction%")r=Wt("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Wt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&P&&(r=P(i.prototype))}return se[e]=r,r},So={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ye=Pe(),Dr=Gt(),Tc=Ye.call(Ve,Array.prototype.concat),Rc=Ye.call(Ro,Array.prototype.splice),Eo=Ye.call(Ve,String.prototype.replace),_r=Ye.call(Ve,String.prototype.slice),Ic=Ye.call(Ve,RegExp.prototype.exec),Pc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Nc=/\\(\\)?/g,Cc=function(e){var r=_r(e,0,1),n=_r(e,-1);if(r==="%"&&n!=="%")throw new Oe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Oe("invalid intrinsic syntax, expected opening `%`");var i=[];return Eo(e,Pc,function(o,a,c,p){i[i.length]=c?Eo(p,Nc,"$1"):a||o}),i},Fc=function(e,r){var n=e,i;if(Dr(So,n)&&(i=So[n],n="%"+i[0]+"%"),Dr(se,n)){var o=se[n];if(o===Ce&&(o=Ec(n)),typeof o=="undefined"&&!r)throw new Fe("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new Oe("intrinsic "+e+" does not exist!")};Io.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Fe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Fe('"allowMissing" argument must be a boolean');if(Ic(/^%?[^%]*%?$/,e)===null)throw new Oe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Cc(e),i=n.length>0?n[0]:"",o=Fc("%"+i+"%",r),a=o.name,c=o.value,p=!1,d=o.alias;d&&(i=d[0],Rc(n,Tc([0,1],d)));for(var v=1,m=!0;v<n.length;v+=1){var w=n[v],A=_r(w,0,1),T=_r(w,-1);if((A==='"'||A==="'"||A==="`"||T==='"'||T==="'"||T==="`")&&A!==T)throw new Oe("property names with quotes must have matching quotes");if((w==="constructor"||!m)&&(p=!0),i+="."+w,a="%"+i+"%",Dr(se,a))c=se[a];else if(c!=null){if(!(w in c)){if(!r)throw new Fe("base intrinsic for "+e+" exists, but the property is not available.");return}if(ze&&v+1>=n.length){var E=ze(c,w);m=!!E,m&&"get"in E&&!("originalValue"in E.get)?c=E.get:c=c[w]}else m=Dr(c,w),c=c[w];m&&!p&&(se[a]=c)}}return c}});var Mr=h((vm,Co)=>{"use strict";s();u();var Po=We(),Oc=Ot(),qe=N(),No=Ie();Co.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new qe("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new qe("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new qe("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new qe("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new qe("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new qe("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,p=!!No&&No(e,r);if(Po)Po(e,r,{configurable:a===null&&p?p.configurable:!a,enumerable:i===null&&p?p.enumerable:!i,value:n,writable:o===null&&p?p.writable:!o});else if(c||!i&&!o&&!a)e[r]=n;else throw new Oc("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ur=h((Am,Oo)=>{"use strict";s();u();var Vt=We(),Fo=function(){return!!Vt};Fo.hasArrayLengthDefineBug=function(){if(!Vt)return null;try{return Vt([],"length",{value:1}).length!==1}catch(e){return!0}};Oo.exports=Fo});var Bo=h((Em,ko)=>{"use strict";s();u();var qc=Y(),qo=Mr(),Lc=Ur()(),Lo=Ie(),$o=N(),$c=qc("%Math.floor%");ko.exports=function(e,r){if(typeof e!="function")throw new $o("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||$c(r)!==r)throw new $o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&Lo){var a=Lo(e,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!n)&&(Lc?qo(e,"length",r,!0,!0):qo(e,"length",r)),e}});var _o=h((Im,Do)=>{"use strict";s();u();var kc=Pe(),Bc=kr(),Dc=Mt();Do.exports=function(){return Dc(kc,Bc,arguments)}});var Wr=h((Cm,Gr)=>{"use strict";s();u();var _c=Bo(),Mo=We(),Mc=Br(),Uo=_o();Gr.exports=function(e){var r=Mc(arguments),n=e.length-(arguments.length-1);return _c(r,1+(n>0?n:0),!0)};Mo?Mo(Gr.exports,"apply",{value:Uo}):Gr.exports.apply=Uo});var Yt=h((qm,Wo)=>{"use strict";s();u();var Go=Object.prototype.toString;Wo.exports=function(e){var r=Go.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Go.call(e.callee)==="[object Function]"),n}});var Qo=h((km,Xo)=>{"use strict";s();u();var Jo;Object.keys||(je=Object.prototype.hasOwnProperty,jt=Object.prototype.toString,zo=Yt(),Ht=Object.prototype.propertyIsEnumerable,Vo=!Ht.call({toString:null},"toString"),Yo=Ht.call(function(){},"prototype"),He=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],zr=function(t){var e=t.constructor;return e&&e.prototype===t},jo={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Ho=function(){if(typeof window=="undefined")return!1;for(var t in window)try{if(!jo["$"+t]&&je.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{zr(window[t])}catch(e){return!0}}catch(e){return!0}return!1}(),Ko=function(t){if(typeof window=="undefined"||!Ho)return zr(t);try{return zr(t)}catch(e){return!1}},Jo=function(e){var r=e!==null&&typeof e=="object",n=jt.call(e)==="[object Function]",i=zo(e),o=r&&jt.call(e)==="[object String]",a=[];if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var c=Yo&&n;if(o&&e.length>0&&!je.call(e,0))for(var p=0;p<e.length;++p)a.push(String(p));if(i&&e.length>0)for(var d=0;d<e.length;++d)a.push(String(d));else for(var v in e)!(c&&v==="prototype")&&je.call(e,v)&&a.push(String(v));if(Vo)for(var m=Ko(e),w=0;w<He.length;++w)!(m&&He[w]==="constructor")&&je.call(e,He[w])&&a.push(He[w]);return a});var je,jt,zo,Ht,Vo,Yo,He,zr,jo,Ho,Ko;Xo.exports=Jo});var ta=h((_m,ra)=>{"use strict";s();u();var Uc=Array.prototype.slice,Gc=Yt(),Zo=Object.keys,Vr=Zo?function(e){return Zo(e)}:Qo(),ea=Object.keys;Vr.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return Gc(n)?ea(Uc.call(n)):ea(n)})}else Object.keys=Vr;return Object.keys||Vr};ra.exports=Vr});var Yr=h((Gm,aa)=>{"use strict";s();u();var Wc=ta(),zc=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Vc=Object.prototype.toString,Yc=Array.prototype.concat,na=Mr(),jc=function(t){return typeof t=="function"&&Vc.call(t)==="[object Function]"},ia=Ur()(),Hc=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!jc(n)||!n())return}ia?na(t,e,r,!0):na(t,e,r)},oa=function(t,e){var r=arguments.length>2?arguments[2]:{},n=Wc(e);zc&&(n=Yc.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)Hc(t,n[i],e[n[i]],r[n[i]])};oa.supportsDescriptors=!!ia;aa.exports=oa});var _=h((Vm,la)=>{"use strict";s();u();var sa=Y(),ua=Br(),Kc=ua([sa("%String.prototype.indexOf%")]);la.exports=function(e,r){var n=sa(e,!!r);return typeof n=="function"&&Kc(e,".prototype.")>-1?ua([n]):n}});var fa=h((Hm,pa)=>{"use strict";s();u();var Jc=Y(),ca=Jc("%Array%"),Xc=!ca.isArray&&_()("Object.prototype.toString");pa.exports=ca.isArray||function(e){return Xc(e)==="[object Array]"}});var Kt=h((Xm,ya)=>{"use strict";s();u();ya.exports=fa()});var da=h((eg,ha)=>{"use strict";s();u();var Qc=Y(),Zc=_(),ep=N(),rp=Kt(),tp=Qc("%Reflect.apply%",!0)||Zc("Function.prototype.apply");ha.exports=function(e,r){var n=arguments.length>2?arguments[2]:[];if(!rp(n))throw new ep("Assertion failed: optional `argumentsList`, if provided, must be a List");return tp(e,r,n)}});function ma(){throw new Error("setTimeout has not been defined")}function ga(){throw new Error("clearTimeout has not been defined")}function va(t){if(Z===setTimeout)return setTimeout(t,0);if((Z===ma||!Z)&&setTimeout)return Z=setTimeout,setTimeout(t,0);try{return Z(t,0)}catch(e){try{return Z.call(null,t,0)}catch(r){return Z.call(this,t,0)}}}function np(t){if(ee===clearTimeout)return clearTimeout(t);if((ee===ga||!ee)&&clearTimeout)return ee=clearTimeout,clearTimeout(t);try{return ee(t)}catch(e){try{return ee.call(null,t)}catch(r){return ee.call(this,t)}}}function ip(){!$e||!ue||($e=!1,ue.length?j=ue.concat(j):jr=-1,j.length&&wa())}function wa(){if(!$e){var t=va(ip);$e=!0;for(var e=j.length;e;){for(ue=j,j=[];++jr<e;)ue&&ue[jr].run();jr=-1,e=j.length}ue=null,$e=!1,np(t)}}function op(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];j.push(new xa(t,e)),j.length===1&&!$e&&va(wa)}function xa(t,e){this.fun=t,this.array=e}function le(){}function bp(t){throw new Error("process.binding is not supported")}function Sp(){return"/"}function Ep(t){throw new Error("process.chdir is not supported")}function Tp(){return 0}function Ip(t){var e=Rp.call(Le)*.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 Np(){var t=new Date,e=t-Pp;return e/1e3}var Z,ee,j,$e,ue,jr,ap,sp,up,lp,cp,pp,fp,yp,hp,dp,mp,gp,vp,wp,xp,Ap,Le,Rp,Pp,Cp,Ke,Aa=Ee(()=>{"use strict";s();u();Z=ma,ee=ga;typeof globalThis.setTimeout=="function"&&(Z=setTimeout);typeof globalThis.clearTimeout=="function"&&(ee=clearTimeout);j=[],$e=!1,jr=-1;xa.prototype.run=function(){this.fun.apply(null,this.array)};ap="browser",sp="browser",up=!0,lp={},cp=[],pp="",fp={},yp={},hp={};dp=le,mp=le,gp=le,vp=le,wp=le,xp=le,Ap=le;Le=globalThis.performance||{},Rp=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};Pp=new Date;Cp={nextTick:op,title:ap,browser:up,env:lp,argv:cp,version:pp,versions:fp,on:dp,addListener:mp,once:gp,off:vp,removeListener:wp,removeAllListeners:xp,emit:Ap,binding:bp,cwd:Sp,chdir:Ep,umask:Tp,hrtime:Ip,platform:sp,release:yp,config:hp,uptime:Np},Ke=Cp});var Jt,Xt,ba=Ee(()=>{"use strict";s();u();typeof Object.create=="function"?Jt=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Jt=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};Xt=Jt});var Ca={};Rt(Ca,{_extend:()=>sn,debuglog:()=>Sa,default:()=>Mp,deprecate:()=>tn,format:()=>Xr,inherits:()=>Xt,inspect:()=>U,isArray:()=>nn,isBoolean:()=>Qr,isBuffer:()=>Ia,isDate:()=>Jr,isError:()=>Xe,isFunction:()=>Qe,isNull:()=>Ze,isNullOrUndefined:()=>Ea,isNumber:()=>on,isObject:()=>ce,isPrimitive:()=>Ra,isRegExp:()=>Je,isString:()=>er,isSymbol:()=>Ta,isUndefined:()=>M,log:()=>Pa});function Xr(t){if(!er(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(U(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(Fp,function(c){if(c==="%%")return"%";if(r>=i)return c;switch(c){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(p){return"[Circular]"}default:return c}}),a=n[r];r<i;a=n[++r])Ze(a)||!ce(a)?o+=" "+a:o+=" "+U(a);return o}function tn(t,e){if(M(globalThis.process))return function(){return tn(t,e).apply(this,arguments)};if(Ke.noDeprecation===!0)return t;var r=!1;function n(){if(!r){if(Ke.throwDeprecation)throw new Error(e);Ke.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n}function Sa(t){if(M(Qt)&&(Qt=Ke.env.NODE_DEBUG||""),t=t.toUpperCase(),!Hr[t])if(new RegExp("\\b"+t+"\\b","i").test(Qt)){var e=0;Hr[t]=function(){var r=Xr.apply(null,arguments);console.error("%s %d: %s",t,e,r)}}else Hr[t]=function(){};return Hr[t]}function U(t,e){var r={seen:[],stylize:qp};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Qr(e)?r.showHidden=e:e&&sn(r,e),M(r.showHidden)&&(r.showHidden=!1),M(r.depth)&&(r.depth=2),M(r.colors)&&(r.colors=!1),M(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Op),Kr(r,t,r.depth)}function Op(t,e){var r=U.styles[e];return r?"\x1B["+U.colors[r][0]+"m"+t+"\x1B["+U.colors[r][1]+"m":t}function qp(t,e){return t}function Lp(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Kr(t,e,r){if(t.customInspect&&e&&Qe(e.inspect)&&e.inspect!==U&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return er(n)||(n=Kr(t,n,r)),n}var i=$p(t,e);if(i)return i;var o=Object.keys(e),a=Lp(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Xe(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Zt(e);if(o.length===0){if(Qe(e)){var c=e.name?": "+e.name:"";return t.stylize("[Function"+c+"]","special")}if(Je(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Jr(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Xe(e))return Zt(e)}var p="",d=!1,v=["{","}"];if(nn(e)&&(d=!0,v=["[","]"]),Qe(e)){var m=e.name?": "+e.name:"";p=" [Function"+m+"]"}if(Je(e)&&(p=" "+RegExp.prototype.toString.call(e)),Jr(e)&&(p=" "+Date.prototype.toUTCString.call(e)),Xe(e)&&(p=" "+Zt(e)),o.length===0&&(!d||e.length==0))return v[0]+p+v[1];if(r<0)return Je(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var w;return d?w=kp(t,e,r,a,o):w=o.map(function(A){return rn(t,e,r,a,A,d)}),t.seen.pop(),Bp(w,p,v)}function $p(t,e){if(M(e))return t.stylize("undefined","undefined");if(er(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(on(e))return t.stylize(""+e,"number");if(Qr(e))return t.stylize(""+e,"boolean");if(Ze(e))return t.stylize("null","null")}function Zt(t){return"["+Error.prototype.toString.call(t)+"]"}function kp(t,e,r,n,i){for(var o=[],a=0,c=e.length;a<c;++a)Na(e,String(a))?o.push(rn(t,e,r,n,String(a),!0)):o.push("");return i.forEach(function(p){p.match(/^\d+$/)||o.push(rn(t,e,r,n,p,!0))}),o}function rn(t,e,r,n,i,o){var a,c,p;if(p=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},p.get?p.set?c=t.stylize("[Getter/Setter]","special"):c=t.stylize("[Getter]","special"):p.set&&(c=t.stylize("[Setter]","special")),Na(n,i)||(a="["+i+"]"),c||(t.seen.indexOf(p.value)<0?(Ze(r)?c=Kr(t,p.value,null):c=Kr(t,p.value,r-1),c.indexOf(`
|
|
2
|
-
`)
|
|
3
|
-
`).
|
|
4
|
-
`).
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`)
|
|
8
|
-
`)>=0&&n++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(e===""?"":e+`
|
|
9
|
-
`)+" "+t.join(`,
|
|
10
|
-
`)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function nn(t){return Array.isArray(t)}function Qr(t){return typeof t=="boolean"}function Ze(t){return t===null}function Ea(t){return t==null}function on(t){return typeof t=="number"}function er(t){return typeof t=="string"}function Ta(t){return typeof t=="symbol"}function M(t){return t===void 0}function Je(t){return ce(t)&&an(t)==="[object RegExp]"}function ce(t){return typeof t=="object"&&t!==null}function Jr(t){return ce(t)&&an(t)==="[object Date]"}function Xe(t){return ce(t)&&(an(t)==="[object Error]"||t instanceof Error)}function Qe(t){return typeof t=="function"}function Ra(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t=="undefined"}function Ia(t){return l.isBuffer(t)}function an(t){return Object.prototype.toString.call(t)}function en(t){return t<10?"0"+t.toString(10):t.toString(10)}function _p(){var t=new Date,e=[en(t.getHours()),en(t.getMinutes()),en(t.getSeconds())].join(":");return[t.getDate(),Dp[t.getMonth()],e].join(" ")}function Pa(){console.log("%s - %s",_p(),Xr.apply(null,arguments))}function sn(t,e){if(!e||!ce(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function Na(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Fp,Hr,Qt,Dp,Mp,Fa=Ee(()=>{"use strict";s();u();Aa();ba();Fp=/%[sdj%]/g;Hr={};U.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};U.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};Dp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Mp={inherits:Xt,_extend:sn,log:Pa,isBuffer:Ia,isPrimitive:Ra,isFunction:Qe,isError:Xe,isDate:Jr,isObject:ce,isRegExp:Je,isUndefined:M,isSymbol:Ta,isString:er,isNumber:on,isNullOrUndefined:Ea,isNull:Ze,isBoolean:Qr,isArray:nn,inspect:U,deprecate:tn,format:Xr,debuglog:Sa}});var Oa=h((yg,Zr)=>{"use strict";s();u();var pe=(Fa(),Kn(Ca));if(pe&&pe.default){Zr.exports=pe.default;for(let t in pe)Zr.exports[t]=pe[t]}else pe&&(Zr.exports=pe)});var La=h((mg,qa)=>{"use strict";s();u();qa.exports=Oa().inspect});var or=h((wg,es)=>{"use strict";s();u();var gn=typeof Map=="function"&&Map.prototype,un=Object.getOwnPropertyDescriptor&&gn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,rt=gn&&un&&typeof un.get=="function"?un.get:null,$a=gn&&Map.prototype.forEach,vn=typeof Set=="function"&&Set.prototype,ln=Object.getOwnPropertyDescriptor&&vn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,tt=vn&&ln&&typeof ln.get=="function"?ln.get:null,ka=vn&&Set.prototype.forEach,Up=typeof WeakMap=="function"&&WeakMap.prototype,tr=Up?WeakMap.prototype.has:null,Gp=typeof WeakSet=="function"&&WeakSet.prototype,nr=Gp?WeakSet.prototype.has:null,Wp=typeof WeakRef=="function"&&WeakRef.prototype,Ba=Wp?WeakRef.prototype.deref:null,zp=Boolean.prototype.valueOf,Vp=Object.prototype.toString,Yp=Function.prototype.toString,jp=String.prototype.match,wn=String.prototype.slice,re=String.prototype.replace,Hp=String.prototype.toUpperCase,Da=String.prototype.toLowerCase,ja=RegExp.prototype.test,_a=Array.prototype.concat,G=Array.prototype.join,Kp=Array.prototype.slice,Ma=Math.floor,fn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,cn=Object.getOwnPropertySymbols,yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ke=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ir=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ke||!0)?Symbol.toStringTag:null,Ha=Object.prototype.propertyIsEnumerable,Ua=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Ga(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ja.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Ma(-t):Ma(t);if(n!==t){var i=String(n),o=wn.call(e,i.length+1);return re.call(i,r,"$&_")+"."+re.call(re.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return re.call(e,r,"$&_")}var hn=La(),Wa=hn.custom,za=Xa(Wa)?Wa:null,Ka={__proto__:null,double:'"',single:"'"},Jp={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};es.exports=function t(e,r,n,i){var o=r||{};if(H(o,"quoteStyle")&&!H(Ka,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=H(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=o.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Za(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var p=String(e);return c?Ga(e,p):p}if(typeof e=="bigint"){var d=String(e)+"n";return c?Ga(e,d):d}var v=typeof o.depth=="undefined"?5:o.depth;if(typeof n=="undefined"&&(n=0),n>=v&&v>0&&typeof e=="object")return dn(e)?"[Array]":"[Object]";var m=df(o,n);if(typeof i=="undefined")i=[];else if(Qa(i,e)>=0)return"[Circular]";function w(Se,Sr,Pu){if(Sr&&(i=Kp.call(i),i.push(Sr)),Pu){var Gn={depth:o.depth};return H(o,"quoteStyle")&&(Gn.quoteStyle=o.quoteStyle),t(Se,Gn,n+1,i)}return t(Se,o,n+1,i)}if(typeof e=="function"&&!Va(e)){var A=af(e),T=et(e,w);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(T.length>0?" { "+G.call(T,", ")+" }":"")}if(Xa(e)){var E=ke?re.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):yn.call(e);return typeof e=="object"&&!ke?rr(E):E}if(ff(e)){for(var F="<"+Da.call(String(e.nodeName)),q=e.attributes||[],W=0;W<q.length;W++)F+=" "+q[W].name+"="+Ja(Xp(q[W].value),"double",o);return F+=">",e.childNodes&&e.childNodes.length&&(F+="..."),F+="</"+Da.call(String(e.nodeName))+">",F}if(dn(e)){if(e.length===0)return"[]";var ne=et(e,w);return m&&!hf(ne)?"["+mn(ne,m)+"]":"[ "+G.call(ne,", ")+" ]"}if(Zp(e)){var Ue=et(e,w);return!("cause"in Error.prototype)&&"cause"in e&&!Ha.call(e,"cause")?"{ ["+String(e)+"] "+G.call(_a.call("[cause]: "+w(e.cause),Ue),", ")+" }":Ue.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+G.call(Ue,", ")+" }"}if(typeof e=="object"&&a){if(za&&typeof e[za]=="function"&&hn)return hn(e,{depth:v-n});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(sf(e)){var br=[];return $a&&$a.call(e,function(Se,Sr){br.push(w(Sr,e,!0)+" => "+w(Se,e))}),Ya("Map",rt.call(e),br,m)}if(cf(e)){var _n=[];return ka&&ka.call(e,function(Se){_n.push(w(Se,e))}),Ya("Set",tt.call(e),_n,m)}if(uf(e))return pn("WeakMap");if(pf(e))return pn("WeakSet");if(lf(e))return pn("WeakRef");if(rf(e))return rr(w(Number(e)));if(nf(e))return rr(w(fn.call(e)));if(tf(e))return rr(zp.call(e));if(ef(e))return rr(w(String(e)));if(typeof window!="undefined"&&e===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&e===globalThis||typeof globalThis!="undefined"&&e===globalThis)return"{ [object globalThis] }";if(!Qp(e)&&!Va(e)){var At=et(e,w),Mn=Ua?Ua(e)===Object.prototype:e instanceof Object||e.constructor===Object,bt=e instanceof Object?"":"null prototype",Un=!Mn&&ir&&Object(e)===e&&ir in e?wn.call(te(e),8,-1):bt?"Object":"",Iu=Mn||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",St=Iu+(Un||bt?"["+G.call(_a.call([],Un||[],bt||[]),": ")+"] ":"");return At.length===0?St+"{}":m?St+"{"+mn(At,m)+"}":St+"{ "+G.call(At,", ")+" }"}return String(e)};function Ja(t,e,r){var n=r.quoteStyle||e,i=Ka[n];return i+t+i}function Xp(t){return re.call(String(t),/"/g,""")}function fe(t){return!ir||!(typeof t=="object"&&(ir in t||typeof t[ir]!="undefined"))}function dn(t){return te(t)==="[object Array]"&&fe(t)}function Qp(t){return te(t)==="[object Date]"&&fe(t)}function Va(t){return te(t)==="[object RegExp]"&&fe(t)}function Zp(t){return te(t)==="[object Error]"&&fe(t)}function ef(t){return te(t)==="[object String]"&&fe(t)}function rf(t){return te(t)==="[object Number]"&&fe(t)}function tf(t){return te(t)==="[object Boolean]"&&fe(t)}function Xa(t){if(ke)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!yn)return!1;try{return yn.call(t),!0}catch(e){}return!1}function nf(t){if(!t||typeof t!="object"||!fn)return!1;try{return fn.call(t),!0}catch(e){}return!1}var of=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return of.call(t,e)}function te(t){return Vp.call(t)}function af(t){if(t.name)return t.name;var e=jp.call(Yp.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Qa(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function sf(t){if(!rt||!t||typeof t!="object")return!1;try{rt.call(t);try{tt.call(t)}catch(e){return!0}return t instanceof Map}catch(e){}return!1}function uf(t){if(!tr||!t||typeof t!="object")return!1;try{tr.call(t,tr);try{nr.call(t,nr)}catch(e){return!0}return t instanceof WeakMap}catch(e){}return!1}function lf(t){if(!Ba||!t||typeof t!="object")return!1;try{return Ba.call(t),!0}catch(e){}return!1}function cf(t){if(!tt||!t||typeof t!="object")return!1;try{tt.call(t);try{rt.call(t)}catch(e){return!0}return t instanceof Set}catch(e){}return!1}function pf(t){if(!nr||!t||typeof t!="object")return!1;try{nr.call(t,nr);try{tr.call(t,tr)}catch(e){return!0}return t instanceof WeakSet}catch(e){}return!1}function ff(t){return!t||typeof t!="object"?!1:typeof HTMLElement!="undefined"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Za(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Za(wn.call(t,0,e.maxStringLength),e)+n}var i=Jp[e.quoteStyle||"single"];i.lastIndex=0;var o=re.call(re.call(t,i,"\\$1"),/[\x00-\x1f]/g,yf);return Ja(o,"single",e)}function yf(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Hp.call(e.toString(16))}function rr(t){return"Object("+t+")"}function pn(t){return t+" { ? }"}function Ya(t,e,r,n){var i=n?mn(r,n):G.call(r,", ");return t+" ("+e+") {"+i+"}"}function hf(t){for(var e=0;e<t.length;e++)if(Qa(t[e],`
|
|
11
|
-
`)>=0)return!1;return!0}function df(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=G.call(Array(t.indent+1)," ");else return null;return{base:r,prev:G.call(Array(e+1),r)}}function mn(t,e){if(t.length===0)return"";var r=`
|
|
12
|
-
`+e.prev+e.base;return r+G.call(t,","+r)+`
|
|
13
|
-
`+e.prev}function et(t,e){var r=dn(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=H(t,i)?e(t[i],t):""}var o=typeof cn=="function"?cn(t):[],a;if(ke){a={};for(var c=0;c<o.length;c++)a["$"+o[c]]=o[c]}for(var p in t)H(t,p)&&(r&&String(Number(p))===p&&p<t.length||ke&&a["$"+p]instanceof Symbol||(ja.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if(typeof cn=="function")for(var d=0;d<o.length;d++)Ha.call(t,o[d])&&n.push("["+e(o[d])+"]: "+e(t[o[d]],t));return n}});var nt=h((bg,rs)=>{"use strict";s();u();rs.exports=function(e){return typeof e=="string"||typeof e=="symbol"}});var ns=h((Tg,ts)=>{"use strict";s();u();var mf=N(),gf=or(),vf=nt();ts.exports=function(e,r){if(!vf(r))throw new mf("Assertion failed: P is not a Property Key, got "+gf(r));return e[r]}});var ss=h((Pg,as)=>{"use strict";s();u();var os=Function.prototype.toString,Be=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,An,it;if(typeof Be=="function"&&typeof Object.defineProperty=="function")try{An=Object.defineProperty({},"length",{get:function(){throw it}}),it={},Be(function(){throw 42},null,An)}catch(t){t!==it&&(Be=null)}else Be=null;var wf=/^\s*class\b/,bn=function(e){try{var r=os.call(e);return wf.test(r)}catch(n){return!1}},xn=function(e){try{return bn(e)?!1:(os.call(e),!0)}catch(r){return!1}},ot=Object.prototype.toString,xf="[object Object]",Af="[object Function]",bf="[object GeneratorFunction]",Sf="[object HTMLAllCollection]",Ef="[object HTML document.all class]",Tf="[object HTMLCollection]",Rf=typeof Symbol=="function"&&!!Symbol.toStringTag,If=!(0 in[,]),Sn=function(){return!1};typeof document=="object"&&(is=document.all,ot.call(is)===ot.call(document.all)&&(Sn=function(e){if((If||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var r=ot.call(e);return(r===Sf||r===Ef||r===Tf||r===xf)&&e("")==null}catch(n){}return!1}));var is;as.exports=Be?function(e){if(Sn(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Be(e,null,An)}catch(r){if(r!==it)return!1}return!bn(e)&&xn(e)}:function(e){if(Sn(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(Rf)return xn(e);if(bn(e))return!1;var r=ot.call(e);return r!==Af&&r!==bf&&!/^\[object HTML/.test(r)?!1:xn(e)}});var En=h((Fg,us)=>{"use strict";s();u();us.exports=ss()});var fs=h((Lg,ps)=>{"use strict";s();u();var ls=N(),Pf=ns(),Nf=En(),Cf=nt(),cs=or();ps.exports=function(e,r){if(!Cf(r))throw new ls("Assertion failed: P is not a Property Key");var n=Pf(e,r);if(n!=null){if(!Nf(n))throw new ls(cs(r)+" is not a function: "+cs(n));return n}}});var hs=h((Bg,ys)=>{"use strict";s();u();var Ff=Or();ys.exports=function(e){return(typeof e=="number"||typeof e=="bigint")&&!Ff(e)&&e!==1/0&&e!==-1/0}});var at=h((Mg,ds)=>{"use strict";s();u();var Of=qt(),qf=Lt(),Lf=Or(),$f=hs();ds.exports=function(e){if(typeof e!="number"||Lf(e)||!$f(e))return!1;var r=Of(e);return qf(r)===r}});var Tn=h((Wg,ms)=>{"use strict";s();u();ms.exports=function(e){return!!e&&(typeof e=="function"||typeof e=="object")}});var vs=h((Yg,gs)=>{"use strict";s();u();var kf=kt();gs.exports=function(){return kf()&&!!Symbol.toStringTag}});var Nn=h((Kg,Ss)=>{"use strict";s();u();var ws=_(),Bf=vs()(),Df=Gt(),_f=Ie(),Pn;Bf?(xs=ws("RegExp.prototype.exec"),Rn={},st=function(){throw Rn},In={toString:st,valueOf:st},typeof Symbol.toPrimitive=="symbol"&&(In[Symbol.toPrimitive]=st),Pn=function(e){if(!e||typeof e!="object")return!1;var r=_f(e,"lastIndex"),n=r&&Df(r,"value");if(!n)return!1;try{xs(e,In)}catch(i){return i===Rn}}):(As=ws("Object.prototype.toString"),bs="[object RegExp]",Pn=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:As(e)===bs});var xs,Rn,st,In,As,bs;Ss.exports=Pn});var Cn=h((Qg,Es)=>{"use strict";s();u();var Mf=_(),Uf=Nn(),Gf=Mf("RegExp.prototype.exec"),Wf=N();Es.exports=function(e){if(!Uf(e))throw new Wf("`regex` must be a RegExp");return function(n){return Gf(e,n)!==null}}});var Is=h((rv,Rs)=>{"use strict";s();u();var Ts=N(),zf=or(),Vf=nt(),Yf=Tn();Rs.exports=function(e,r){if(!Yf(e))throw new Ts("Assertion failed: Type(O) is not Object");if(!Vf(r))throw new Ts("Assertion failed: P is not a Property Key, got "+zf(r));return e[r]}});var Ns=h((iv,Ps)=>{"use strict";s();u();Ps.exports=$t()});var On=h((sv,Cs)=>{"use strict";s();u();var jf=_(),Fn=N(),Hf=at(),Kf=jf("String.prototype.slice");Cs.exports=function(e,r,n){if(typeof e!="string")throw new Fn("Assertion failed: `string` must be a String");if(typeof r!="string")throw new Fn("Assertion failed: `searchValue` must be a String");if(!Hf(n)||n<0)throw new Fn("Assertion failed: `fromIndex` must be a non-negative integer");var i=e.length;if(r===""&&n<=i)return n;for(var o=r.length,a=n;a<=i-o;a+=1){var c=Kf(e,a,a+o);if(c===r)return a}return-1}});var ut=h((cv,Fs)=>{"use strict";s();u();var Jf=N();Fs.exports=function(e){if(e==null)throw new Jf(arguments.length>0&&arguments[1]||"Cannot call method on "+e);return e}});var lt=h((yv,Os)=>{"use strict";s();u();var Xf=Y(),Qf=Xf("%String%"),Zf=N();Os.exports=function(e){if(typeof e=="symbol")throw new Zf("Cannot convert a Symbol value to a string");return Qf(e)}});var qn=h((mv,$s)=>{"use strict";s();u();var ey=ut(),ry=lt(),ty=_(),qs=ty("String.prototype.replace"),Ls=/^\s$/.test("\u180E"),ny=Ls?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,iy=Ls?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;$s.exports=function(){var e=ry(ey(this));return qs(qs(e,ny,""),iy,"")}});var Ln=h((wv,Bs)=>{"use strict";s();u();var oy=qn(),ks="\u200B",De="\u180E";Bs.exports=function(){return String.prototype.trim&&ks.trim()===ks&&De.trim()===De&&("_"+De).trim()==="_"+De&&(De+"_").trim()===De+"_"?String.prototype.trim:oy}});var Ms=h((bv,_s)=>{"use strict";s();u();var ay=Ur()(),Ds=Mr(),sy=Ln();_s.exports=function(){var e=sy();return String.prototype.trim!==e&&(ay?Ds(String.prototype,"trim",e,!0):Ds(String.prototype,"trim",e)),e}});var zs=h((Tv,Ws)=>{"use strict";s();u();var uy=Wr(),ly=Yr(),cy=ut(),py=qn(),Us=Ln(),fy=Ms(),yy=uy(Us()),Gs=function(e){return cy(e),yy(e)};ly(Gs,{getPolyfill:Us,implementation:py,shim:fy});Ws.exports=Gs});var Ks=h((Pv,Hs)=>{"use strict";s();u();var js=Y(),hy=js("%RegExp%"),dy=N(),Vs=js("%parseInt%"),my=_(),ct=Cn(),Ys=my("String.prototype.slice"),gy=ct(/^0b[01]+$/i),vy=ct(/^0o[0-7]+$/i),wy=ct(/^[-+]0x[0-9a-f]+$/i),xy=["\x85","\u200B","\uFFFE"].join(""),Ay=new hy("["+xy+"]","g"),by=ct(Ay),Sy=zs();Hs.exports=function t(e){if(typeof e!="string")throw new dy("Assertion failed: `argument` is not a String");if(gy(e))return+Vs(Ys(e,2),2);if(vy(e))return+Vs(Ys(e,2),8);if(by(e)||wy(e))return NaN;var r=Sy(e);return r!==e?t(r):+e}});var Qs=h((Fv,Xs)=>{"use strict";s();u();var Ey=N(),Js=at(),Ty=_(),Ry=Ty("String.prototype.slice");Xs.exports=function(e,r,n){if(typeof e!="string"||!Js(r)||arguments.length>2&&!Js(n))throw new Ey("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return Ry(e,r,arguments.length>2?n:e.length)}});var eu=h((Lv,Zs)=>{"use strict";s();u();Zs.exports=function(e,r){for(var n=0;n<e.length;n+=1)if(!r(e[n],n,e))return!1;return!0}});var tu=h((Bv,ru)=>{"use strict";s();u();var Iy=_()("String.prototype.slice");ru.exports=function(e,r){return e===r?!0:e.length>r.length?!1:Iy(r,0,e.length)===e}});var iu=h((Mv,nu)=>{"use strict";s();u();nu.exports=function(e){return typeof e=="string"||typeof e=="undefined"}});var lu=h((Wv,uu)=>{"use strict";s();u();var K=N(),$n=or(),Py=at(),ou=Tn(),su=Cn(),Ny=Is(),Cy=Kt(),Fy=Ns(),Oy=On(),au=Ks(),J=Qs(),qy=lt(),Ly=eu(),ar=tu(),$y=iu(),ky=su(/^\$[0-9]/),By=su(/^\$[0-9][0-9]/);uu.exports=function(e,r,n,i,o,a){if(typeof e!="string")throw new K("Assertion failed: `matched` must be a String");if(typeof r!="string")throw new K("Assertion failed: `str` must be a String");if(!Py(n)||n<0)throw new K("Assertion failed: `position` must be a nonnegative integer, got "+$n(n));if(!Cy(i)||!Ly(i,$y))throw new K("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+$n(i));if(typeof o!="undefined"&&!ou(o))throw new K("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof a!="string")throw new K("Assertion failed: `replacementTemplate` must be a String");var c=r.length;if(n>c)throw new K("Assertion failed: position > stringLength, got "+$n(n));for(var p=a,d="";p!=="";){var v,m,w;if(ar("$$",p))v="$$",m="$";else if(ar("$`",p))v="$`",m=J(r,0,n);else if(ar("$&",p))v="$&",m=e;else if(ar("$'",p)){v="$'";var A=e.length,T=n+A;m=J(r,Fy(T,c))}else if(ky(p)){var E=By(p)?2:1,F=J(p,1,1+E),q=au(F);if(q<0||q>99)throw new K("Assertion failed: `index` must be >= 0 and <= 99");var W=i.length;q>W&&E===2&&(E=1,F=J(F,0,1),q=au(F)),v=J(p,0,1+E),1<=q&&q<=W?(w=i[q-1],typeof w=="undefined"?m="":m=w):m=v}else if(ar("$<",p)){var ne=Oy(p,">",0);if(!(ne>-1)||typeof o=="undefined")v="$<",m=v;else{v=J(p,0,ne+1);var Ue=J(p,2,ne);if(!ou(o))throw new K("Assertion failed: Type(namedCaptures) is not Object");w=Ny(o,Ue),typeof w=="undefined"?m="":m=qy(w)}}else v=J(p,0,1),m=v;var br=v.length;p=J(p,br),d+=m}return d}});var yu=h((Yv,fu)=>{"use strict";s();u();var cu=Y(),pu=Wr(),Dy=pu(cu("String.prototype.indexOf"));fu.exports=function(e,r){var n=cu(e,!!r);return typeof n=="function"&&Dy(e,".prototype.")>-1?pu(n):n}});var Bn=h((Kv,gu)=>{"use strict";s();u();var hu=da(),_y=fs(),My=lu(),Uy=En(),Gy=ut(),pt=lt(),du=On(),Wy=Y(),ft=yu(),zy=Bt()(),Vy=Nn(),Yy=Wy("%Math.max%"),mu=N(),jy=ft("Array.prototype.push"),kn=ft("String.prototype.slice"),Hy=ft("String.prototype.indexOf"),Ky=ft("String.prototype.replace");gu.exports=function(e,r){var n=Gy(this),i=Vy(e);if(i&&Hy(kn(e,e.source.length+2),"g")===-1)throw new mu("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(zy&&Symbol.replace){if(e!=null){var o=_y(e,Symbol.replace);if(typeof o!="undefined")return hu(o,e,[n,r])}}else if(i)return Ky(n,e,r);var a=pt(n),c=pt(e),p=Uy(r);p||(r=pt(r));for(var d=c.length,v=Yy(1,d),m=[],w=du(a,c,0);w!==-1;)jy(m,w),w=du(a,c,w+v);for(var A=0,T="",E=0;E<m.length;E+=1){var F;if(p)F=pt(hu(r,void 0,[c,m[E],a]));else{if(typeof r!="string")throw new mu("Assertion failed: `replaceValue` should be a string at this point");var q=[];F=My(c,a,m[E],q,void 0,r)}var W=kn(a,A,m[E]);T+=W+F,A=m[E]+d}return A<a.length&&(T+=kn(a,A)),T}});var Dn=h((Qv,vu)=>{"use strict";s();u();var Jy=Bn();vu.exports=function(){return String.prototype.replaceAll||Jy}});var xu=h((r0,wu)=>{"use strict";s();u();var Xy=Yr(),Qy=Dn();wu.exports=function(){var e=Qy();return Xy(String.prototype,{replaceAll:e},{replaceAll:function(){return String.prototype.replaceAll!==e}}),e}});var Eu=h((i0,Su)=>{"use strict";s();u();var Zy=Wr(),eh=Yr(),Au=Bn(),rh=Dn(),th=xu(),bu=Zy(Au);eh(bu,{getPolyfill:rh,implementation:Au,shim:th});Su.exports=bu});var mh={};Rt(mh,{DynamicSnippetsGenerator:()=>xt});module.exports=Kn(mh);s();u();var _b=$u(Eu(),1);s();u();s();u();s();u();function R(t){throw new Error("Unexpected value: "+JSON.stringify(t))}s();u();function sr(t){return Object.keys(t)}s();u();s();u();var ye=class{};s();u();s();u();var $=class extends ye{constructor(r){super();y(this,"value");this.value=r}write(r){typeof this.value=="string"?r.write(this.value):typeof this.value=="function"?this.value(r):this.value.write(r)}};var nh=4,ur=class{constructor(){y(this,"buffer","");y(this,"indentLevel",0);y(this,"hasWrittenAnything",!1);y(this,"lastCharacterIsSemicolon",!1);y(this,"lastCharacterIsNewline",!1)}write(e){let r=e.length>0&&e.endsWith(`
|
|
14
|
-
`),n=r?e.substring(0,e.length-1):e,i=this.getIndentString(),o=n.replaceAll(`
|
|
1
|
+
"use strict";var Ae=Object.defineProperty,dr=Object.defineProperties,mr=Object.getOwnPropertyDescriptor,hr=Object.getOwnPropertyDescriptors,yr=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols;var qe=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable;var Ye=(n,t,e)=>t in n?Ae(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,nt=(n,t)=>{for(var e in t||(t={}))qe.call(t,e)&&Ye(n,e,t[e]);if(Te)for(var e of Te(t))rt.call(t,e)&&Ye(n,e,t[e]);return n},it=(n,t)=>dr(n,hr(t));var ot=n=>typeof n=="symbol"?n:n+"",at=(n,t)=>{var e={};for(var r in n)qe.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&Te)for(var r of Te(n))t.indexOf(r)<0&&rt.call(n,r)&&(e[r]=n[r]);return e};var Ge=(n,t)=>()=>(n&&(t=n(n=0)),t);var st=(n,t)=>{for(var e in t)Ae(n,e,{get:t[e],enumerable:!0})},xr=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yr(t))!qe.call(n,i)&&i!==e&&Ae(n,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return n};var gr=n=>xr(Ae({},"__esModule",{value:!0}),n);var l=(n,t,e)=>Ye(n,typeof t!="symbol"?t+"":t,e);function ut(){throw new Error("setTimeout has not been defined")}function lt(){throw new Error("clearTimeout has not been defined")}function pt(n){if(Y===setTimeout)return setTimeout(n,0);if((Y===ut||!Y)&&setTimeout)return Y=setTimeout,setTimeout(n,0);try{return Y(n,0)}catch(t){try{return Y.call(null,n,0)}catch(e){return Y.call(this,n,0)}}}function wr(n){if(q===clearTimeout)return clearTimeout(n);if((q===lt||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(n);try{return q(n)}catch(t){try{return q.call(null,n)}catch(e){return q.call(this,n)}}}function vr(){!ne||!G||(ne=!1,G.length?F=G.concat(F):Ee=-1,F.length&&ct())}function ct(){if(!ne){var n=pt(vr);ne=!0;for(var t=F.length;t;){for(G=F,F=[];++Ee<t;)G&&G[Ee].run();Ee=-1,t=F.length}G=null,ne=!1,wr(n)}}function br(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];F.push(new dt(n,t)),F.length===1&&!ne&&pt(ct)}function dt(n,t){this.fun=n,this.array=t}function z(){}function _r(n){throw new Error("process.binding is not supported")}function $r(){return"/"}function Or(n){throw new Error("process.chdir is not supported")}function Wr(){return 0}function jr(n){var t=Vr.call(re)*.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 qr(){var n=new Date,t=n-Yr;return t/1e3}var Y,q,F,ne,G,Ee,Tr,Ar,Er,Rr,Sr,kr,Ir,Nr,Cr,Lr,Pr,Br,Fr,Mr,Dr,Ur,re,Vr,Yr,d,ft,f=Ge(()=>{"use strict";Y=ut,q=lt;typeof globalThis.setTimeout=="function"&&(Y=setTimeout);typeof globalThis.clearTimeout=="function"&&(q=clearTimeout);F=[],ne=!1,Ee=-1;dt.prototype.run=function(){this.fun.apply(null,this.array)};Tr="browser",Ar="browser",Er=!0,Rr={},Sr=[],kr="",Ir={},Nr={},Cr={};Lr=z,Pr=z,Br=z,Fr=z,Mr=z,Dr=z,Ur=z;re=globalThis.performance||{},Vr=re.now||re.mozNow||re.msNow||re.oNow||re.webkitNow||function(){return new Date().getTime()};Yr=new Date;d={nextTick:br,title:Tr,browser:Er,env:Rr,argv:Sr,version:kr,versions:Ir,on:Lr,addListener:Pr,once:Br,off:Fr,removeListener:Mr,removeAllListeners:Dr,emit:Ur,binding:_r,cwd:$r,chdir:Or,umask:Wr,hrtime:jr,platform:Ar,release:Nr,config:Cr,uptime:qr},ft={};Object.keys(ft).forEach(n=>{let t=n.split("."),e=d;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=ft[n]:e=e[i]||(e[i]={})}})});function xt(){Ke=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)C[t]=n[t],S[n.charCodeAt(t)]=t;S[45]=62,S[95]=63}function zr(n){Ke||xt();var t,e,r,i,o,a,p=n.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[p-2]==="="?2:n[p-1]==="="?1:0,a=new Gr(p*3/4-o),r=o>0?p-4:p;var c=0;for(t=0,e=0;t<r;t+=4,e+=3)i=S[n.charCodeAt(t)]<<18|S[n.charCodeAt(t+1)]<<12|S[n.charCodeAt(t+2)]<<6|S[n.charCodeAt(t+3)],a[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=i&255;return o===2?(i=S[n.charCodeAt(t)]<<2|S[n.charCodeAt(t+1)]>>4,a[c++]=i&255):o===1&&(i=S[n.charCodeAt(t)]<<10|S[n.charCodeAt(t+1)]<<4|S[n.charCodeAt(t+2)]>>2,a[c++]=i>>8&255,a[c++]=i&255),a}function Kr(n){return C[n>>18&63]+C[n>>12&63]+C[n>>6&63]+C[n&63]}function Hr(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(Kr(r));return i.join("")}function mt(n){Ke||xt();for(var t,e=n.length,r=e%3,i="",o=[],a=16383,p=0,c=e-r;p<c;p+=a)o.push(Hr(n,p,p+a>c?c:p+a));return r===1?(t=n[e-1],i+=C[t>>2],i+=C[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=C[t>>10],i+=C[t>>4&63],i+=C[t<<2&63],i+="="),o.push(i),o.join("")}function Re(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function M(n,t){if(Re()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return He(this,n)}return gt(this,n,t,e)}function gt(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?Zr(n,t,e,r):typeof t=="string"?Xr(n,t,e):Qr(n,t)}function wt(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 Jr(n,t,e,r){return wt(t),t<=0?M(n,t):e!==void 0?typeof r=="string"?M(n,t).fill(e,r):M(n,t).fill(e):M(n,t)}function He(n,t){if(wt(t),n=M(n,t<0?0:Je(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function Xr(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=vt(t,e)|0;n=M(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function ze(n,t){var e=t.length<0?0:Je(t.length)|0;n=M(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function Zr(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=ze(n,t),n}function Qr(n,t){if(L(t)){var e=Je(t.length)|0;return n=M(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"||wn(t.length)?M(n,0):ze(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return ze(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Je(n){if(n>=Re())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Re().toString(16)+" bytes");return n|0}function L(n){return!!(n!=null&&n._isBuffer)}function vt(n,t){if(L(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 Se(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return kt(n).length;default:if(r)return Se(n).length;t=(""+t).toLowerCase(),r=!0}}function en(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 pn(this,t,e);case"utf8":case"utf-8":return At(this,t,e);case"ascii":return un(this,t,e);case"latin1":case"binary":return ln(this,t,e);case"base64":return sn(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cn(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function K(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function bt(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),L(t))return t.length===0?-1:ht(n,t,e,r,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):ht(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function ht(n,t,e,r,i){var o=1,a=n.length,p=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;o=2,a/=2,p/=2,e/=2}function c(T,B){return o===1?T[B]:T.readUInt16BE(B*o)}var h;if(i){var x=-1;for(h=e;h<a;h++)if(c(n,h)===c(t,x===-1?0:h-x)){if(x===-1&&(x=h),h-x+1===p)return x*o}else x!==-1&&(h-=h-x),x=-1}else for(e+p>a&&(e=a-p),h=e;h>=0;h--){for(var y=!0,v=0;v<p;v++)if(c(n,h+v)!==c(t,v)){y=!1;break}if(y)return h}return-1}function tn(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var p=parseInt(t.substr(a*2,2),16);if(isNaN(p))return a;n[e+a]=p}return a}function rn(n,t,e,r){return Ne(Se(t,n.length-e),n,e,r)}function Tt(n,t,e,r){return Ne(xn(t),n,e,r)}function nn(n,t,e,r){return Tt(n,t,e,r)}function on(n,t,e,r){return Ne(kt(t),n,e,r)}function an(n,t,e,r){return Ne(gn(t,n.length-e),n,e,r)}function sn(n,t,e){return t===0&&e===n.length?mt(n):mt(n.slice(t,e))}function At(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],a=null,p=o>239?4:o>223?3:o>191?2:1;if(i+p<=e){var c,h,x,y;switch(p){case 1:o<128&&(a=o);break;case 2:c=n[i+1],(c&192)===128&&(y=(o&31)<<6|c&63,y>127&&(a=y));break;case 3:c=n[i+1],h=n[i+2],(c&192)===128&&(h&192)===128&&(y=(o&15)<<12|(c&63)<<6|h&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:c=n[i+1],h=n[i+2],x=n[i+3],(c&192)===128&&(h&192)===128&&(x&192)===128&&(y=(o&15)<<18|(c&63)<<12|(h&63)<<6|x&63,y>65535&&y<1114112&&(a=y))}}a===null?(a=65533,p=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=p}return fn(r)}function fn(n){var t=n.length;if(t<=yt)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=yt));return e}function un(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 ln(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 pn(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+=yn(n[o]);return i}function cn(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}function A(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 R(n,t,e,r,i,o){if(!L(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 ke(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 Ie(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 Et(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 Rt(n,t,e,r,i){return i||Et(n,t,e,4,34028234663852886e22,-34028234663852886e22),Nt(n,t,e,r,23,4),e+4}function St(n,t,e,r,i){return i||Et(n,t,e,8,17976931348623157e292,-17976931348623157e292),Nt(n,t,e,r,52,8),e+8}function mn(n){if(n=hn(n).replace(dn,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function hn(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function yn(n){return n<16?"0"+n.toString(16):n.toString(16)}function Se(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],a=0;a<r;++a){if(e=n.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function xn(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function gn(n,t){for(var e,r,i,o=[],a=0;a<n.length&&!((t-=2)<0);++a)e=n.charCodeAt(a),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function kt(n){return zr(mn(n))}function Ne(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 wn(n){return n!==n}function vn(n){return n!=null&&(!!n._isBuffer||It(n)||bn(n))}function It(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function bn(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&It(n.slice(0,0))}function Ce(n,t,e,r,i){var o,a,p=i*8-r-1,c=(1<<p)-1,h=c>>1,x=-7,y=e?i-1:0,v=e?-1:1,T=n[t+y];for(y+=v,o=T&(1<<-x)-1,T>>=-x,x+=p;x>0;o=o*256+n[t+y],y+=v,x-=8);for(a=o&(1<<-x)-1,o>>=-x,x+=r;x>0;a=a*256+n[t+y],y+=v,x-=8);if(o===0)o=1-h;else{if(o===c)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-h}return(T?-1:1)*a*Math.pow(2,o-r)}function Nt(n,t,e,r,i,o){var a,p,c,h=o*8-i-1,x=(1<<h)-1,y=x>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=r?0:o-1,B=r?1:-1,be=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(p=isNaN(t)?1:0,a=x):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+y>=1?t+=v/c:t+=v*Math.pow(2,1-y),t*c>=2&&(a++,c/=2),a+y>=x?(p=0,a=x):a+y>=1?(p=(t*c-1)*Math.pow(2,i),a=a+y):(p=t*Math.pow(2,y-1)*Math.pow(2,i),a=0));i>=8;n[e+T]=p&255,T+=B,p/=256,i-=8);for(a=a<<i|p,h+=i;h>0;n[e+T]=a&255,T+=B,a/=256,h-=8);n[e+T-B]|=be*128}var C,S,Gr,Ke,yt,dn,Ct=Ge(()=>{"use strict";f();u();C=[],S=[],Gr=typeof Uint8Array!="undefined"?Uint8Array:Array,Ke=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return gt(null,n,t,e)};s.kMaxLength=Re();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return Jr(null,n,t,e)};s.allocUnsafe=function(n){return He(null,n)};s.allocUnsafeSlow=function(n){return He(null,n)};s.isBuffer=vn;s.compare=function(t,e){if(!L(t)||!L(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,a=Math.min(r,i);o<a;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?1:0};s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!L(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};s.byteLength=vt;s.prototype._isBuffer=!0;s.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)K(this,e,e+1);return this};s.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)K(this,e,e+3),K(this,e+1,e+2);return this};s.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)K(this,e,e+7),K(this,e+1,e+6),K(this,e+2,e+5),K(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?At(this,0,t):en.apply(this,arguments)};s.prototype.equals=function(t){if(!L(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,i,o){if(!L(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=r)return 0;if(i>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,p=r-e,c=Math.min(a,p),h=this.slice(i,o),x=t.slice(e,r),y=0;y<c;++y)if(h[y]!==x[y]){a=h[y],p=x[y];break}return a<p?-1:p<a?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return bt(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return bt(this,t,e,r,!1)};s.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return tn(this,t,e,r);case"utf8":case"utf-8":return rn(this,t,e,r);case"ascii":return Tt(this,t,e,r);case"latin1":case"binary":return nn(this,t,e,r);case"base64":return on(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return an(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};yt=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=s.prototype;else{var o=e-t;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};s.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||A(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return i};s.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||A(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};s.prototype.readUInt8=function(t,e){return e||A(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||A(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||A(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};s.prototype.readUInt32BE=function(t,e){return e||A(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||A(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||A(t,e,this.length);for(var i=e,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(t,e){return e||A(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||A(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||A(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.prototype.readInt32LE=function(t,e){return e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};s.prototype.readInt32BE=function(t,e){return e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};s.prototype.readFloatLE=function(t,e){return e||A(t,4,this.length),Ce(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||A(t,4,this.length),Ce(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||A(t,8,this.length),Ce(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||A(t,8,this.length),Ce(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;R(this,t,e,r,o,0)}var a=1,p=0;for(this[e]=t&255;++p<r&&(a*=256);)this[e+p]=t/a&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;R(this,t,e,r,o,0)}var a=r-1,p=1;for(this[e+a]=t&255;--a>=0&&(p*=256);)this[e+a]=t/p&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ke(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ke(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):Ie(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Ie(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var a=0,p=1,c=0;for(this[e]=t&255;++a<r&&(p*=256);)t<0&&c===0&&this[e+a-1]!==0&&(c=1),this[e+a]=(t/p>>0)-c&255;return e+r};s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var a=r-1,p=1,c=0;for(this[e+a]=t&255;--a>=0&&(p*=256);)t<0&&c===0&&this[e+a+1]!==0&&(c=1),this[e+a]=(t/p>>0)-c&255;return e+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ke(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ke(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Ie(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Ie(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return Rt(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return Rt(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return St(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return St(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var o=i-r,a;if(this===t&&r<e&&e<i)for(a=o-1;a>=0;--a)t[a+e]=this[a+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};s.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var a;if(typeof t=="number")for(a=e;a<r;++a)this[a]=t;else{var p=L(t)?t:Se(new s(t,i).toString()),c=p.length;for(a=0;a<r-e;++a)this[a+e]=p[a%c]}return this};dn=/[^+\/0-9A-Za-z-_]/g});var u=Ge(()=>{"use strict";Ct()});var _i={};st(_i,{DynamicSnippetsGenerator:()=>je});module.exports=gr(_i);f();u();f();u();f();u();f();u();function b(n){throw new Error("Unexpected value: "+JSON.stringify(n))}f();u();f();u();f();u();f();u();f();u();f();u();var Tn=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Lt=Tn;var An=typeof self=="object"&&self&&self.Object===Object&&self,En=Lt||An||Function("return this")(),Pt=En;var Rn=Pt.Symbol,D=Rn;f();u();var Bt=Object.prototype,Sn=Bt.hasOwnProperty,kn=Bt.toString,oe=D?D.toStringTag:void 0;function In(n){var t=Sn.call(n,oe),e=n[oe];try{n[oe]=void 0;var r=!0}catch(o){}var i=kn.call(n);return r&&(t?n[oe]=e:delete n[oe]),i}var Ft=In;f();u();var Nn=Object.prototype,Cn=Nn.toString;function Ln(n){return Cn.call(n)}var Mt=Ln;var Pn="[object Null]",Bn="[object Undefined]",Dt=D?D.toStringTag:void 0;function Fn(n){return n==null?n===void 0?Bn:Pn:Dt&&Dt in Object(n)?Ft(n):Mt(n)}var Ut=Fn;f();u();function Mn(n){return n!=null&&typeof n=="object"}var _t=Mn;var Dn="[object Symbol]";function Un(n){return typeof n=="symbol"||_t(n)&&Ut(n)==Dn}var $t=Un;f();u();f();u();function _n(n,t){for(var e=-1,r=n==null?0:n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}var Ot=_n;f();u();var $n=Array.isArray,Wt=$n;var On=1/0,Vt=D?D.prototype:void 0,jt=Vt?Vt.toString:void 0;function Yt(n){if(typeof n=="string")return n;if(Wt(n))return Ot(n,Yt)+"";if($t(n))return jt?jt.call(n):"";var t=n+"";return t=="0"&&1/n==-On?"-0":t}var qt=Yt;f();u();function Wn(n){return n==null?"":qt(n)}var Gt=Wn;f();u();f();u();f();u();f();u();function Vn(n,t,e){var r=-1,i=n.length;t<0&&(t=-t>i?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=n[r+t];return o}var zt=Vn;function jn(n,t,e){var r=n.length;return e=e===void 0?r:e,!t&&e>=r?n:zt(n,t,e)}var Kt=jn;f();u();var Yn="\\ud800-\\udfff",qn="\\u0300-\\u036f",Gn="\\ufe20-\\ufe2f",zn="\\u20d0-\\u20ff",Kn=qn+Gn+zn,Hn="\\ufe0e\\ufe0f",Jn="\\u200d",Xn=RegExp("["+Jn+Yn+Kn+Hn+"]");function Zn(n){return Xn.test(n)}var Le=Zn;f();u();f();u();function Qn(n){return n.split("")}var Ht=Qn;f();u();var Jt="\\ud800-\\udfff",ei="\\u0300-\\u036f",ti="\\ufe20-\\ufe2f",ri="\\u20d0-\\u20ff",ni=ei+ti+ri,ii="\\ufe0e\\ufe0f",oi="["+Jt+"]",Xe="["+ni+"]",Ze="\\ud83c[\\udffb-\\udfff]",ai="(?:"+Xe+"|"+Ze+")",Xt="[^"+Jt+"]",Zt="(?:\\ud83c[\\udde6-\\uddff]){2}",Qt="[\\ud800-\\udbff][\\udc00-\\udfff]",si="\\u200d",er=ai+"?",tr="["+ii+"]?",fi="(?:"+si+"(?:"+[Xt,Zt,Qt].join("|")+")"+tr+er+")*",ui=tr+er+fi,li="(?:"+[Xt+Xe+"?",Xe,Zt,Qt,oi].join("|")+")",pi=RegExp(Ze+"(?="+Ze+")|"+li+ui,"g");function ci(n){return n.match(pi)||[]}var rr=ci;function di(n){return Le(n)?rr(n):Ht(n)}var nr=di;function mi(n){return function(t){t=Gt(t);var e=Le(t)?nr(t):void 0,r=e?e[0]:t.charAt(0),i=e?Kt(e,1).join(""):t.slice(1);return r[n]()+i}}var ir=mi;var hi=ir("toUpperCase"),Qe=hi;f();u();function ae(n){return Object.keys(n)}f();u();f();u();f();u();var or,ar,se=(ar=(or=d.env.FERN_STACK_TRACK)==null?void 0:or.toLowerCase())!=null?ar:"",P=se!==""&&se!=="0"&&se!=="false",et=["single","multiline","box"].includes(se)?se:"single";P&&(Error.stackTraceLimit=50);var yi=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),xi=new Set(["stacktrace"]);function Be({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:o=!0,filterJs:a=!0,formatFilename:p=c=>c}={}){var h;if(!P)return[];r=[...r,...yi],e=[...e,...xi],i=[...i,"runInteractiveTask"];let c=!1;return((h=new Error().stack)!=null?h:"").split(`
|
|
2
|
+
`).map(x=>{let y=x.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(y&&y.length===5){let[,v,T,B,be]=y;if(!v||!T||!B||!be)return;if(c||i.some(cr=>v==null?void 0:v.includes(cr))){c=!0;return}switch(v){case"Object.<anonymous>":v="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":v=`${v.substring(v.indexOf(".")+1)}()=> { ... }`;break}return{fn:v,path:p(T),position:`${B}:${be}`}}}).filter(x=>{var y,v;return x&&!r.some(T=>x.fn.includes(T))&&!(o&&((y=x.path)!=null&&y.startsWith("node:")))&&!(a&&((v=x.path)!=null&&v.endsWith(".js")))&&!e.some(T=>x.path.includes(T))}).slice(t,t+n)}var Pe=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:r=[],filterFunctions:i=[],stopOn:o=[],filterNode:a=!0,filterJs:p=!0,multiline:c=!1,formatFilename:h=x=>x}={}){l(this,"maxFrames");l(this,"skip");l(this,"filterPaths");l(this,"filterFunctions");l(this,"stopOn");l(this,"filterNode");l(this,"filterJs");l(this,"multiline");l(this,"formatFilename");l(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=r,this.filterFunctions=i,this.stopOn=o,this.filterNode=a,this.filterJs=p,this.multiline=c,this.formatFilename=h}tag(t){let e=this.tracking.get(t)||new Set;Be({maxFrames:this.maxFrames,skip:this.skip,filterPaths:this.filterPaths,filterFunctions:this.filterFunctions,stopOn:this.stopOn,filterNode:this.filterNode,filterJs:this.filterJs,formatFilename:this.formatFilename}).forEach(r=>e.add(r)),this.tracking.set(t,e)}trace(t){if(!P)return"";let e=this.tracking.get(t);return e?[...e].map(r=>`${this.multiline?`
|
|
3
|
+
`:""}${r.fn} - ${r.path}:${r.position}`).join(""):""}frames(t){let e=this.tracking.get(t);return e?[...e]:[]}free(t){this.tracking.delete(t)}clear(){this.tracking=new WeakMap}},U;function sr({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:o=!0,filterJs:a=!0,multiline:p=!1,formatFilename:c=h=>h}={}){P&&(U!=null||(U=new Pe({maxFrames:n,skip:t,filterPaths:e,filterFunctions:r,stopOn:i,filterNode:o,filterJs:a,multiline:p,formatFilename:c})))}function fr(n){U==null||U.tag(n)}function tt(n){var t;return(t=U==null?void 0:U.frames(n))!=null?t:[]}var H=class{constructor(){fr(this)}};f();u();var Fe=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},fe=class extends Fe{async format(t){return t}formatSync(t){return t}};f();u();f();u();f();u();var I=class extends H{constructor(e){super();l(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var gi=4;sr({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var ue=class{constructor(){l(this,"lineBuffer",[]);l(this,"indentLevel",0);l(this,"hasWrittenAnything",!1);l(this,"lastCharacterIsSemicolon",!1);l(this,"lastCharacterIsNewline",!1);l(this,"nodeStackFrames",[])}get buffer(){return P&&this.nodeStackFrames.length>0&&this.writeInternal(`
|
|
4
|
+
`),this.lineBuffer.join(`
|
|
5
|
+
`)+(this.lastCharacterIsNewline?`
|
|
6
|
+
`:"")}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let r=e.length>0&&e.endsWith(`
|
|
7
|
+
`),i=r?e.substring(0,e.length-1):e,o=this.getIndentString(),a=i.replaceAll(`
|
|
15
8
|
`,`
|
|
16
|
-
${
|
|
17
|
-
`),this.writeInternal(
|
|
9
|
+
${o}`);this.isAtStartOfLine()&&(a=o+a),r&&(a+=`
|
|
10
|
+
`),this.writeInternal(a)}else this.writeNode(e)}writeStatement(...t){this.write(...t),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){P&&this.nodeStackFrames.push(...tt(t)),t.write(this),P&&et!=="single"&&this.writeInternal(`
|
|
11
|
+
`)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){this.writeNode(t),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new I(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new I(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new I(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new I(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new I(t).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(t=!0){this.dedent(),this.writeNewLineIfLastLineNot(),t?this.writeLine("}"):this.write("}")}writeLine(...t){this.write(...t.length===0?[""]:t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
18
12
|
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
19
|
-
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:
|
|
20
|
-
`),this.lastCharacterIsSemicolon=e.endsWith(";")),this.buffer+=e}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*nh)}};s();u();var yt=class{formatMultiple(e){return Promise.all(e.map(r=>this.format(r)))}formatMultipleSync(e){return e.map(r=>this.formatSync(r))}},lr=class extends yt{async format(e){return e}formatSync(e){return e}};s();u();s();u();s();u();var cr=class{constructor(){y(this,"reporter");y(this,"snippet");y(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){this.shouldUpdate({snippet:r,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:r}){var n,i;return this.reporter==null||this.reporter.size()>0&&r.size()===0?!0:e.length>((i=(n=this.snippet)==null?void 0:n.length)!=null?i:0)}};var pr=class{constructor(e){y(this,"context");this.context=e}async generate(e,r={}){let n=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let i=new cr;for(let o of n){let a=this.context.clone(),c=this.createSnippetGenerator(a);try{let p=await c.generateSnippet({endpoint:o,request:e,options:r});if(a.errors.empty())return{snippet:p,errors:void 0};i.update({context:a,snippet:p})}catch(p){i.err==null&&(i.err=p)}}return i.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e,r={}){let n=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let i=new cr;for(let o of n){let a=this.context.clone(),c=this.createSnippetGenerator(a);try{let p=c.generateSnippetSync({endpoint:o,request:e,options:r});if(a.errors.empty())return{snippet:p,errors:void 0};i.update({context:a,snippet:p})}catch(p){i.err==null&&(i.err=p)}}return i.getResponseOrThrow({endpoint:e.endpoint})}};s();u();s();u();s();u();var fr=class{constructor(){y(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let n=e.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};s();u();var S={Critical:"CRITICAL",Warning:"WARNING"},yr=class t{constructor(){y(this,"errors");y(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(Vn(zn({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new t;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let n of e){if(typeof n=="string"){r.push(n);continue}r[r.length-1]+=`[${n.index}]`}return r}};var hr=class{constructor({ir:e,config:r,options:n={}}){y(this,"config");y(this,"options");y(this,"errors");y(this,"_ir");y(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.options=n,this.errors=new yr,this.httpEndpointReferenceParser=new fr}associateQueryParametersByWireValue({parameters:e,values:r}){let n=[];for(let[i,o]of Object.entries(r)){this.errors.scope(i);try{let a=e.find(p=>p.name.wireValue===i);if(a==null)throw this.newParameterNotRecognizedError(i);let c=this.isListTypeReference(a.typeReference)&&!Array.isArray(o)?[o]:o;n.push({name:a.name,typeReference:a.typeReference,value:c})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:n}){let i=[];for(let[o,a]of Object.entries(r)){this.errors.scope(o);try{let c=e.find(p=>p.name.wireValue===o);if(c==null){if(n)continue;this.errors.add({severity:S.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:c.name,typeReference:c.typeReference,value:a})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:e,record:r}){let n=r[e.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:S.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:e,record:r}){let n=r[e.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:S.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let i=[];for(let o of n){if(typeof o!="string"){this.errors.add({severity:S.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:S.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:S.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let n=this.getRecord(r);if(n==null)return;let i=e.discriminant.wireValue,o=n[i];if(o==null){this.errors.add({severity:S.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:S.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let a=e.types[o];if(a==null){this.errors.add({severity:S.Critical,message:`No type found for discriminant value "${o}"`});return}let d=n,{[i]:c}=d,p=jn(d,[Yn(i)]);return{singleDiscriminatedUnionType:a,discriminantValue:a.discriminantValue,value:p}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocationOrThrow(e){let r=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:e})&&r.push(n);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:n}){var i;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:n}):!((i=e.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var n,i;return r&&((i=(n=e.metadata)==null?void 0:n.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:R(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let n=r.environments.find(i=>i.id===e);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=r.environments.find(i=>i.id===e);return n==null?void 0:n.name}default:R(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:S.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:S.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=r.environments[0];if(n==null)return this.errors.add({severity:S.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(sr(n.urls));for(let o of sr(e))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:S.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${sr(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:S.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:S.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:S.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:R(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:R(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:R(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};s();u();s();u();var g={};Rt(g,{AstNode:()=>b,ClassInstantiation:()=>me,ClassReference:()=>ge,CodeBlock:()=>ve,KeywordArgument:()=>we,Method:()=>xe,MethodInvocation:()=>Ae,Parameter:()=>C,TypeLiteral:()=>xr,TypeParameter:()=>be,classReference:()=>ph,class_:()=>ah,codeblock:()=>ih,comment:()=>lh,instantiateClass:()=>fh,invokeMethod:()=>hh,keywordArgument:()=>yh,method:()=>uh,module:()=>sh,parameters:()=>oh,positionalArgument:()=>dh,typeParameter:()=>ch});s();u();s();u();s();u();s();u();s();u();s();u();s();u();var ht=class extends ur{constructor({customConfig:r,formatter:n}){super();y(this,"customConfig");y(this,"formatter");y(this,"requires",new Set);this.customConfig=r,this.formatter=n!=null?n:new lr}addRequire(r){this.requires.add(r)}};var _e=class extends ht{constructor({customConfig:e,formatter:r}){super({customConfig:e,formatter:r})}async toStringAsync(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.format(e)}catch(r){throw new Error(`Failed to format Ruby file: ${r}
|
|
21
|
-
${e}`)}return e}toString(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(e)}catch(r){throw new Error(`Failed to format Ruby file: ${r}
|
|
22
|
-
${
|
|
13
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:r}){if(t.length>0){let i=t[0];i!=null&&r(i);for(let o=1;o<t.length;o++){this.write(e);let a=t[o];a!=null&&r(a)}}}toString(){return this.buffer}writeInternal(t){if(t.length===0)return;let e=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
14
|
+
`),this.lastCharacterIsSemicolon=t.endsWith(";");let r=t.split(`
|
|
15
|
+
`),i=P&&!this.shouldSkipTracking(r)&&this.lastCharacterIsNewline;e&&(this.lastLine=`${this.lastLine}${r.shift()||""}`),this.lastCharacterIsNewline&&r.pop(),this.lineBuffer.push(...r),i&&this.appendTrackingComment()}set lastLine(t){this.lineBuffer.length>0?this.lineBuffer[this.lineBuffer.length-1]=t:this.lineBuffer.push(t)}get lastLine(){return this.lineBuffer[this.lineBuffer.length-1]||""}shouldSkipTracking(t){return!1}formatStack(t,e=""){return t.map(r=>`${e?`(${e}) `:""} ${r.fn} - ${r.path} : ${r.position}`)}filterStack(t){return t.filter(e=>!e.fn.startsWith(`${this.constructor.name}.`))}appendTrackingComment(){let t=[...this.formatStack(this.filterStack(Be({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,et){case"single":return this.singleLineTrackingComment(t);case"multiline":return this.multiLineTrackingComment(t);case"box":return this.boxTrackingComment(t)}}singleLineTrackingComment(t){this.lastLine=`${this.lastLine} // ${t.join(" ")}`}multiLineTrackingComment(t){this.lineBuffer.push(...t.map(e=>` // ${e}`))}boxTrackingComment(t){this.lineBuffer.push("/*",...t.map(e=>` ${e}`),"*/")}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return gi}};f();u();f();u();f();u();var le=class{constructor(){l(this,"reporter");l(this,"snippet");l(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:t,snippet:e}){this.shouldUpdate({snippet:e,reporter:t.errors})&&(this.reporter=t.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:t}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${t.method} ${t.path}"`)}shouldUpdate({snippet:t,reporter:e}){var r,i;return this.reporter==null||this.reporter.size()>0&&e.size()===0?!0:t.length>((i=(r=this.snippet)==null?void 0:r.length)!=null?i:0)}};var pe=class{constructor(t){l(this,"context");this.context=t}async generate(t,e={}){let r=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new le;for(let o of r){let a=this.context.clone(),p=this.createSnippetGenerator(a);try{let c=await p.generateSnippet({endpoint:o,request:t,options:e});if(a.errors.empty())return{snippet:c,errors:void 0};i.update({context:a,snippet:c})}catch(c){i.err==null&&(i.err=c)}}return i.getResponseOrThrow({endpoint:t.endpoint})}generateSync(t,e={}){let r=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new le;for(let o of r){let a=this.context.clone(),p=this.createSnippetGenerator(a);try{let c=p.generateSnippetSync({endpoint:o,request:t,options:e});if(a.errors.empty())return{snippet:c,errors:void 0};i.update({context:a,snippet:c})}catch(c){i.err==null&&(i.err=c)}}return i.getResponseOrThrow({endpoint:t.endpoint})}};f();u();f();u();f();u();var ce=class{constructor(){l(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let r=t.match(this.REFERENCE_REGEX);if(!(r==null||r[1]==null||r[2]==null))return{method:r[1],path:r[2]}}};f();u();var w={Critical:"CRITICAL",Warning:"WARNING"},de=class n{constructor(){l(this,"errors");l(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(it(nt({},t),{path:[...this.path]}))}scope(t){this.path.push(t)}unscope(){this.path.pop()}getBySeverity(t){return this.errors.filter(e=>e.severity===t)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let t=new n;return t.errors=[...this.errors],t.path=[...this.path],t}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(t=>({severity:t.severity,path:t.path!=null?this.pathToStringArray(t.path):void 0,message:t.message}))}pathToStringArray(t){let e=[];for(let r of t){if(typeof r=="string"){e.push(r);continue}e[e.length-1]+=`[${r.index}]`}return e}};var me=class{constructor({ir:t,config:e,options:r={}}){l(this,"config");l(this,"options");l(this,"errors");l(this,"_ir");l(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=r,this.errors=new de,this.httpEndpointReferenceParser=new ce}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let a=t.find(c=>c.name.wireValue===i);if(a==null)throw this.newParameterNotRecognizedError(i);let p=this.isListTypeReference(a.typeReference)&&!Array.isArray(o)?[o]:o;r.push({name:a.name,typeReference:a.typeReference,value:p})}finally{this.errors.unscope()}}return r}associateByWireValueOrDefault({parameters:t,values:e}){let r=[];for(let i of t){this.errors.scope(i.name.wireValue);try{let o=e[i.name.wireValue];if(o==null)if(i.typeReference.type==="primitive"&&i.typeReference.value==="STRING")o=`<${i.name.wireValue}>`;else{this.errors.add({severity:w.Critical,message:this.newParameterNotRecognizedError(i.name.wireValue).message});continue}r.push({name:i.name,typeReference:i.typeReference,value:o})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){let i=[];for(let[o,a]of Object.entries(e)){this.errors.scope(o);try{let p=t.find(c=>c.name.wireValue===o);if(p==null){if(r)continue;this.errors.add({severity:w.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:p.name,typeReference:p.typeReference,value:a})}finally{this.errors.unscope()}}return i}getExampleObjectProperties({parameters:t,snippetObject:e}){let r=typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{},i=[];for(let o of t){let a=r[o.name.wireValue];a==null?o.typeReference.type==="nullable"&&i.push({name:o.name,typeReference:o.typeReference,value:null}):i.push({name:o.name,typeReference:o.typeReference,value:a})}return i}getSingleFileValue({property:t,record:e}){let r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:w.Critical,message:`Expected file value to be a string, got ${typeof r}`});return}return r}}getFileArrayValues({property:t,record:e}){let r=e[t.wireValue];if(r==null)return;if(!Array.isArray(r)){this.errors.add({severity:w.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let i=[];for(let o of r){if(typeof o!="string"){this.errors.add({severity:w.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:w.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(t)?"array":typeof t}`});return}return t==null?{}:t}resolveNamedType({typeId:t}){let e=this._ir.types[t];if(e==null){this.errors.add({severity:w.Critical,message:`Type identified by "${t}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e}){let r=this.getRecord(e);if(r==null)return;let i=t.discriminant.wireValue,o=r[i];if(o==null){this.errors.add({severity:w.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:w.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let a=t.types[o];if(a==null){this.errors.add({severity:w.Critical,message:`No type found for discriminant value "${o}"`});return}let h=r,{[i]:p}=h,c=at(h,[ot(i)]);return{singleDiscriminatedUnionType:a,discriminantValue:a.discriminantValue,value:c}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocation(t){let e=[];for(let r of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t})&&e.push(r);return e}resolveEndpointLocationOrThrow(t){let e=this.resolveEndpointLocation(t);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`);return e}needsRequestParameter({request:t,inlinePathParameters:e,inlineFileProperties:r}){var i;return this.includePathParametersInWrappedRequest({request:t,inlinePathParameters:e})||t.queryParameters!=null&&t.queryParameters.length>0||t.headers!=null&&t.headers.length>0?!0:t.body!=null?this.includeRequestBodyInWrappedRequest({body:t.body,inlineFileProperties:r}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,i;return e&&((i=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:b(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}default:b(e)}}isSingleEnvironmentID(t){return typeof t=="string"}isMultiEnvironmentValues(t){return typeof t=="object"}validateMultiEnvironmentUrlValues(t){if(this._ir.environments==null)return this.errors.add({severity:w.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":return this.errors.add({severity:w.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let r=e.environments[0];if(r==null)return this.errors.add({severity:w.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(ae(r.urls));for(let o of ae(t))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:w.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${ae(r.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:w.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:w.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:w.Critical,message:this.newTypeMismatchError({expected:"string",value:t}).message});return}return t}isOptional(t){switch(t.type){case"nullable":return this.isOptional(t.value);case"optional":return!0;case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}isNullable(t){switch(t.type){case"nullable":return!0;case"optional":return this.isNullable(t.value);case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}newAuthMismatchError({auth:t,values:e}){return new Error(`Expected auth type ${t.type}, got ${e.type}`)}newParameterNotRecognizedError(t){return new Error(`"${t}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:t,value:e}){return new Error(`Expected ${t}, got ${typeof e}`)}includeRequestBodyInWrappedRequest({body:t,inlineFileProperties:e}){switch(t.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e});default:b(t)}}includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e}){return this.fileUploadHasBodyProperties({fileUpload:t})||e&&this.fileUploadHasFileProperties({fileUpload:t})}fileUploadHasBodyProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:b(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:b(e)}})}isListTypeReference(t){return t.type==="optional"?this.isListTypeReference(t.value):t.type==="list"||t.type==="set"}parsedEndpointMatches({endpoint:t,parsedEndpoint:e}){return t.location.method===e.method&&t.location.path===e.path}};f();u();f();u();f();u();f();u();var wi=2,k=class extends ue{constructor({customConfig:e,formatter:r}){super();l(this,"customConfig");l(this,"formatter");l(this,"requires",new Set);this.customConfig=e,this.formatter=r!=null?r:new fe}addRequire(e){this.requires.add(e)}getTabSize(){return wi}};var ie=class extends k{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 Ruby file: ${e}
|
|
16
|
+
${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 Ruby file: ${e}
|
|
17
|
+
${t}`)}return t}getContent(){let t=this.stringifyRequires();return t.length>0?`${t}
|
|
23
18
|
|
|
24
|
-
${this.buffer}`:this.buffer}stringifyRequires(){return Array.from(this.requires).map(
|
|
25
|
-
`)}};var
|
|
26
|
-
`).forEach(n=>{r.writeLine(`# ${n}`)})}};s();u();var he=class t extends b{constructor({name:r,namespace:n,typeParameters:i,docstring:o,statements:a}){super();y(this,"name");y(this,"namespace");y(this,"typeParameters");y(this,"docstring");y(this,"statements");this.name=r,this.namespace=n!=null?n:new Set,this.typeParameters=i!=null?i:[],this.docstring=o,this.statements=a!=null?a:[],this.populateChildNamespaces()}write(r){this.docstring&&new k({docs:this.docstring}).write(r),r.write(`module ${this.name}`),this.statements.length?(r.newLine(),r.indent(),this.statements.forEach((n,i)=>{n.write(r),i<this.statements.length-1&&r.newLine()}),r.dedent(),r.write("end")):r.write("; end"),r.newLine()}writeTypeDefinition(r){r.write(`module ${this.name}`),this.typeParameters.length&&(r.write("["),r.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:n=>n.writeTypeDefinition(r)}),r.write("]")),r.newLine(),this.statements.length&&(r.indent(),this.statements.forEach(n=>{n.writeTypeDefinition(r),r.newLine()}),r.dedent()),r.write("end")}populateChildNamespaces(){this.statements.filter(r=>r instanceof t||r instanceof de).forEach(r=>{r.namespace=new Set([...this.namespace,this]),r.populateChildNamespaces()})}get fullyQualifiedNamespace(){return[...this.namespace,this].map(r=>r.name).join("::")}};var de=class extends he{constructor({name:r,superclass:n,typeParameters:i,docstring:o,statements:a}){super({name:r,docstring:o,typeParameters:i});y(this,"superclass");y(this,"statements");this.superclass=n,this.statements=a!=null?a:[]}write(r){this.docstring&&new k({docs:this.docstring}).write(r),r.write(`class ${this.name}`),this.superclass&&r.write(` < ${this.superclass.name}`),this.statements.length?(r.newLine(),r.indent(),this.statements.forEach((n,i)=>{n.write(r),i<this.statements.length-1&&r.newLine()}),r.dedent(),r.write("end")):r.write("; end"),r.newLine()}writeTypeDefinition(r){r.write(`class ${this.name}`),this.typeParameters.length&&(r.write("["),r.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:n=>n.writeTypeDefinition(r)}),r.write("]")),this.superclass&&r.write(` < ${this.superclass.name}`),r.newLine(),this.statements.length&&(r.indent(),this.statements.forEach(n=>{n.writeTypeDefinition(r),r.newLine()}),r.dedent()),r.write("end")}};s();u();var me=class extends b{constructor({classReference:r,arguments_:n}){super();y(this,"classReference");y(this,"arguments_");this.classReference=r,this.arguments_=n}write(r){r.writeNode(this.classReference),r.write("."),r.write("new"),r.write("("),this.arguments_.length>1?(r.indent(),r.newLine(),this.arguments_.forEach((n,i)=>{i>0&&(r.write(","),r.newLine()),n.write(r)}),r.newLine(),r.dedent()):this.arguments_.forEach((n,i)=>{i>0&&r.write(", "),n.write(r)}),r.write(")")}};s();u();var ge=class extends b{constructor({name:r,modules:n,fullyQualified:i}){super();y(this,"name");y(this,"modules");y(this,"fullyQualified");this.name=r,this.modules=n!=null?n:[],this.fullyQualified=i!=null?i:!1}write(r){if(this.fullyQualified||this.modules.length>0){let n=[...this.modules,this.name].join("::");r.write(n);return}r.write(this.name)}};s();u();var ve=class extends b{constructor(r){super();y(this,"arg");this.arg=r}write(r){return new $(this.arg).write(r)}};s();u();var we=class extends b{constructor({name:r,value:n}){super();y(this,"name");y(this,"value");this.name=r,this.value=n}write(r){r.write(`${this.name}: `),this.value.write(r)}};s();u();s();u();s();u();var Me=class t extends b{constructor(r){super();y(this,"internalType");this.internalType=r}write(r){}writeTypeDefinition(r){if(this.internalType)switch(this.internalType.type){case"self":r.write("self");break;case"class":r.write("class");break;case"instance":r.write("instance");break;case"boolean":r.write("bool");break;case"nil":r.write("nil");break;case"top":r.write("top");break;case"bot":r.write("bot");break;case"void":r.write("void");break;case"boolish":r.write("boolish");break;case"string":r.write("String");break;case"integer":r.write("Integer");break;case"union":r.delimit({nodes:this.internalType.elems,delimiter:" | ",writeFunction:n=>n.writeTypeDefinition(r)});break;case"intersection":r.delimit({nodes:this.internalType.elems,delimiter:" & ",writeFunction:n=>n.writeTypeDefinition(r)});break;case"array":r.write("Array["),this.internalType.elem.writeTypeDefinition(r),r.write("]");break;case"hash":r.write("Hash["),this.internalType.keyType.writeTypeDefinition(r),r.write(", "),this.internalType.valueType.writeTypeDefinition(r),r.write("]");break;case"object":r.write(this.internalType.klass);break;case"singleton":r.write("singleton("),r.write(this.internalType.klass),r.write(")");break;case"tuple":r.write("["),r.delimit({nodes:this.internalType.elems,delimiter:", ",writeFunction:n=>n.write(r)}),r.write("]");break;case"generic":r.write(`${this.internalType.baseKlass}[`),r.delimit({nodes:this.internalType.parameters,delimiter:", ",writeFunction:n=>n.writeTypeDefinition(r)}),r.write("]");break;default:R(this.internalType)}else r.write("untyped")}static untyped(){return new this(void 0)}static self(){return new this({type:"self"})}static class_(){return new this({type:"class"})}static instance(){return new this({type:"instance"})}static boolean(){return new this({type:"boolean"})}static nil(){return new this({type:"nil"})}static top(){return new this({type:"top"})}static bot(){return new this({type:"bot"})}static void(){return new this({type:"void"})}static boolish(){return new this({type:"boolish"})}static string(){return new this({type:"string"})}static integer(){return new this({type:"integer"})}static union(r){return new this({type:"union",elems:r})}static intersection(r){return new this({type:"intersection",elems:r})}static array(r){return new this({type:"array",elem:r})}static hash(r,n){return new this({type:"hash",keyType:r,valueType:n})}static object(r){return new this({type:"object",klass:r})}static singleton(r){return new this({type:"singleton",klass:r})}static tuple(r){return new this({type:"tuple",elems:r})}static generic(r,n){return new this({type:"generic",baseKlass:r,parameters:n})}static nilable(r){return t.union([r,t.nil()])}nilable(){return t.nilable(this)}};var C=class extends b{constructor({name:r,type:n,optional:i}){super();y(this,"name");y(this,"type");y(this,"optional");this.name=r,this.type=n!=null?n:Me.untyped(),this.optional=i!=null?i:!1}};var dr=class extends C{constructor({name:r,type:n,initializer:i,optional:o}){super({name:r,type:n,optional:o});y(this,"initializer");this.initializer=i}write(r){r.write(`${this.name}:`),this.initializer&&r.write(` ${this.initializer.write(r)}`)}writeTypeDefinition(r){this.optional&&r.write("?"),r.write(`${this.name}: `),this.type.writeTypeDefinition(r)}};s();u();var mr=class extends C{constructor(){super(...arguments);y(this,"initializer")}write(r){r.write(`**${this.name}`)}writeTypeDefinition(r){r.write("**"),this.type.writeTypeDefinition(r)}};s();u();var dt={Instance:"instance",Class_:"class"},Tu={Public:"public",Private:"private",Protected:"protected"},xe=class extends b{constructor({name:r,docstring:n,kind:i,visibility:o,parameters:a,returnType:c}){var p,d;super();y(this,"name");y(this,"docstring");y(this,"kind");y(this,"positionalParameters");y(this,"keywordParameters");y(this,"positionalSplatParameter");y(this,"keywordSplatParameter");y(this,"yieldParameter");y(this,"visibility");y(this,"statements",[]);y(this,"returnType");this.name=r,this.docstring=n,this.kind=i!=null?i:dt.Instance,this.visibility=o!=null?o:Tu.Public,this.positionalParameters=(p=a==null?void 0:a.positional)!=null?p:[],this.keywordParameters=(d=a==null?void 0:a.keyword)!=null?d:[],this.positionalSplatParameter=a==null?void 0:a.positionalSplat,this.keywordSplatParameter=a==null?void 0:a.keywordSplat,this.yieldParameter=a==null?void 0:a.yield,this.returnType=c!=null?c:Me.untyped()}write(r){switch(this.docstring&&new k({docs:this.docstring}).write(r),this.visibility!==Tu.Public&&(r.write(this.visibility),this.kind===dt.Class_&&r.write("_class_method"),r.write(" ")),this.kind){case dt.Instance:r.write(`def ${this.name}`);break;case dt.Class_:r.write(`def self.${this.name}`);break}this.parameters.length&&(r.write("("),r.delimit({nodes:this.parameters,delimiter:", ",writeFunction:n=>n.write(r)}),r.write(")")),this.statements.length?(r.newLine(),r.indent(),this.statements.forEach((n,i)=>{n.write(r),i<this.statements.length-1&&r.newLine()}),r.dedent(),r.write("end")):r.write("; end"),r.newLine()}writeTypeDefinition(r){r.write(`def ${this.name}: (`),this.parameters.forEach((n,i)=>{n.writeTypeDefinition(r),i<this.parameters.length-1&&r.write(", ")}),r.write(") -> "),this.returnType.writeTypeDefinition(r)}get parameters(){return[...this.positionalParameters,...this.keywordParameters,this.positionalSplatParameter,this.keywordSplatParameter,this.yieldParameter].flatMap(r=>r!==void 0?r:[])}};s();u();var Ae=class extends b{constructor({on:r,method:n,arguments_:i}){super();y(this,"on");y(this,"method");y(this,"arguments_");this.on=r,this.method=n,this.arguments_=i}write(r){this.on.write(r),r.write("."),r.write(this.method),r.write("("),this.arguments_.length>1?(r.indent(),r.newLine(),this.arguments_.forEach((n,i)=>{i>0&&(r.write(","),r.newLine()),n.write(r)}),r.newLine(),r.dedent()):this.arguments_.forEach((n,i)=>{i>0&&r.write(", "),n.write(r)}),r.write(")")}};s();u();var gr=class extends b{constructor({value:r}){super();y(this,"value");this.value=r}write(r){this.value.write(r)}};s();u();var vr=class extends C{constructor({name:r,type:n,optional:i,initializer:o}){super({name:r,type:n,optional:i});y(this,"initializer");this.initializer=o}write(r){r.write(this.name),this.initializer&&r.write(` = ${this.initializer.write(r)}`)}writeTypeDefinition(r){this.optional&&r.write("?"),this.type.writeTypeDefinition(r)}};s();u();var wr=class extends C{write(e){e.write(`*${this.name}`)}writeTypeDefinition(e){e.write("*"),this.type.writeTypeDefinition(e)}};s();u();var xr=class t extends b{constructor(r){super();y(this,"internalType");this.internalType=r}static string(r){return new this({type:"str",value:r})}static integer(r){return new this({type:"int",value:r})}static float(r){return new this({type:"float",value:r})}static boolean(r){return new this({type:"bool",value:r})}static hash(r){return new this({type:"hash",entries:r})}static set(r){return new this({type:"set",values:r})}static list(r){return new this({type:"list",values:r})}static nop(){return new this({type:"nop"})}static nil(){return new this({type:"nil"})}static isNop(r){return r instanceof t&&r.internalType.type==="nop"}static isNil(r){return r instanceof t&&r.internalType.type==="nil"}write(r){switch(this.internalType.type){case"str":{this.internalType.value.includes("'")?r.write(`"${this.internalType.value.replaceAll('"','\\"')}"`):r.write(`'${this.internalType.value}'`);break}case"int":{r.write(this.internalType.value.toString());break}case"float":{r.write(this.internalType.value.toString());break}case"bool":{r.write(this.internalType.value?"true":"false");break}case"hash":{let n=this.internalType.entries.filter(i=>!t.isNop(i.key)&&!t.isNop(i.value));if(n.length===0){r.write("{}");break}r.write(`{
|
|
27
|
-
`),
|
|
28
|
-
}`);break}case"set":{let n=this.internalType.values.filter(i=>!t.isNop(i));if(n.length===0){r.write("Set.new([])");break}r.write("Set.new(["),n.forEach((i,o)=>{o>0&&r.write(", "),i.write(r)}),r.write("])");break}case"list":{let n=this.internalType.values.filter(i=>!t.isNop(i));if(n.length===0){r.write("[]");break}r.write("["),n.forEach((i,o)=>{o>0&&r.write(", "),i.write(r)}),r.write("]");break}case"nop":break;case"nil":r.write("nil");break;default:R(this.internalType)}}};s();u();var mt;(function(t){t[t.Invariant=0]="Invariant",t.Covariant="out",t.Contravariant="in"})(mt||(mt={}));var be=class extends b{constructor({name:r,unchecked:n,bound:i,variance:o,defaultType:a}){super();y(this,"name");y(this,"unchecked");y(this,"bound");y(this,"variance");y(this,"defaultType");this.name=r,this.unchecked=n!=null?n:!1,this.bound=i,this.variance=o!=null?o:mt.Invariant,this.defaultType=a}write(r){}writeTypeDefinition(r){this.unchecked&&r.write("unchecked "),this.variance!=mt.Invariant&&r.write(`${this.variance} `),r.write(this.name),this.bound&&(r.write(" < "),this.bound.writeTypeDefinition(r)),this.defaultType&&(r.write(" = "),this.defaultType.writeTypeDefinition(r))}};s();u();var Ar=class extends C{constructor(){super(...arguments);y(this,"initializer")}write(r){r.write(`&${this.name}`)}};function ih(t){return new ve(t)}var oh={positional(t){return new vr(t)},keyword(t){return new dr(t)},positionalSplat(t){return new wr(t)},keywordSplat(t){return new mr(t)},yield(t){return new Ar(t)}};function ah(t){return new de(t)}function sh(t){return new he(t)}function uh(t){return new xe(t)}function lh(t){return new k(t)}function ch(t){return new be(t)}function ph(t){return new ge(t)}function fh(t){return new me(t)}function yh(t){return new we(t)}function hh(t){return new Ae(t)}function dh(t){return new gr(t)}var Ru="client",gt=class{constructor({context:e,formatter:r}){y(this,"context");y(this,"formatter");this.context=e,this.formatter=r}async generateSnippet({endpoint:e,request:r}){var i;return await this.buildCodeBlock({endpoint:e,snippet:r}).toStringAsync({customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}generateSnippetSync({endpoint:e,request:r}){var i;return this.buildCodeBlock({endpoint:e,snippet:r}).toString({customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}buildCodeBlock({endpoint:e,snippet:r}){return g.codeblock(n=>{n.writeNodeStatement(this.constructClient({endpoint:e,snippet:r})),n.newLine(),n.writeNodeStatement(this.callMethod({endpoint:e,snippet:r}))})}constructClient({endpoint:e,snippet:r}){return g.codeblock(n=>{n.addRequire(this.context.getRootModuleName());let i=this.context.getRootClientClassReference(),o=this.getRootClientBuilderArgs({endpoint:e,snippet:r});n.write(`${Ru} = `),n.writeNode(g.instantiateClass({classReference:i,arguments_:o}))})}getRootClientBaseUrlArg({baseUrl:e,environment:r}){if(e!=null&&r!=null)return this.context.errors.add({severity:"CRITICAL",message:"Cannot specify both baseUrl and environment options"}),[];if(e!=null)return[g.keywordArgument({name:"base_url",value:g.TypeLiteral.string(e)})];if(r!=null){if(this.context.isSingleEnvironmentID(r)){let n=this.context.getEnvironmentTypeReferenceFromID(r);return n==null?(this.context.errors.add({severity:"CRITICAL",message:`Environment ID ${r} not found`}),[]):[g.keywordArgument({name:"environment",value:n})]}if(this.context.isMultiEnvironmentValues(r))return this.context.errors.add({severity:"CRITICAL",message:"Multi-environment values are not supported in Ruby snippets yet"}),[]}return[]}getRootClientAuthArgs({auth:e,values:r}){switch(e.type){case"basic":return r.type!=="basic"?(this.context.errors.add({severity:"CRITICAL",message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getRootClientBasicAuthArgs({auth:e,values:r});case"bearer":return r.type!=="bearer"?(this.context.errors.add({severity:"CRITICAL",message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getRootClientBearerAuthArgs({auth:e,values:r});case"header":return r.type!=="header"?(this.context.errors.add({severity:"CRITICAL",message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getRootClientHeaderAuthArgs({auth:e,values:r});case"oauth":return r.type!=="oauth"?(this.context.errors.add({severity:"CRITICAL",message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getRootClientOAuthArgs({auth:e,values:r});default:return[]}}getRootClientBasicAuthArgs({auth:e,values:r}){return[g.keywordArgument({name:e.username.snakeCase.safeName,value:g.TypeLiteral.string(r.username)}),g.keywordArgument({name:e.password.snakeCase.safeName,value:g.TypeLiteral.string(r.password)})]}getRootClientBearerAuthArgs({auth:e,values:r}){return[g.keywordArgument({name:e.token.snakeCase.safeName,value:g.TypeLiteral.string(r.token)})]}getRootClientHeaderAuthArgs({auth:e,values:r}){return[g.keywordArgument({name:e.header.name.name.snakeCase.safeName,value:g.TypeLiteral.string(r.value)})]}getRootClientOAuthArgs({auth:e,values:r}){return[g.keywordArgument({name:e.clientId.snakeCase.safeName,value:g.TypeLiteral.string(r.clientId)}),g.keywordArgument({name:e.clientSecret.snakeCase.safeName,value:g.TypeLiteral.string(r.clientSecret)})]}getRootClientHeaderArgs({headers:e,values:r}){let n=[];for(let i of e){let o=r[i.name.name.originalName];o!=null&&typeof o=="string"&&n.push(g.keywordArgument({name:i.name.name.snakeCase.safeName,value:g.TypeLiteral.string(o)}))}return n}getRootClientBuilderArgs({endpoint:e,snippet:r}){let n=[];e.auth!=null&&(r.auth!=null?n.push(...this.getRootClientAuthArgs({auth:e.auth,values:r.auth})):this.context.errors.add({severity:"WARNING",message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let i=this.getRootClientBaseUrlArg({baseUrl:r.baseURL,environment:r.environment});return i.length>0&&n.push(...i),this.context.errors.scope("Headers"),this.context.ir.headers!=null&&r.headers!=null&&n.push(...this.getRootClientHeaderArgs({headers:this.context.ir.headers,values:r.headers})),this.context.errors.unscope(),n}callMethod({endpoint:e,snippet:r}){return g.invokeMethod({on:g.codeblock(Ru),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:r})})}getMethodArgs({endpoint:e,snippet:r}){switch(e.request.type){case"inlined":return[this.getMethodArgsForInlinedRequest({request:e.request,snippet:r})];case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:r});default:R(e.request)}}getMethodArgsForInlinedRequest({request:e,snippet:r}){let n=[];if(n.push(...this.getNamedParameterArgs({kind:"PathParameters",namedParameters:e.pathParameters,values:r.pathParameters})),n.push(...this.getNamedParameterArgs({kind:"QueryParameters",namedParameters:e.queryParameters,values:r.queryParameters})),n.push(...this.getNamedParameterArgs({kind:"Headers",namedParameters:e.headers,values:r.headers})),e.body!=null)switch(e.body.type){case"properties":n.push(...this.getMethodArgsForPropertiesRequest({request:e.body,snippet:r}));break;case"referenced":case"fileUpload":break;default:R(e.body)}return g.TypeLiteral.hash(n.map(i=>({key:g.TypeLiteral.string(i.name),value:i.value})))}getNamedParameterArgs({kind:e,namedParameters:r,values:n}){let i=[];if(this.context.errors.scope(e),r!=null){let o=this.context.associateByWireValue({parameters:r,values:n!=null?n:{},ignoreMissingParameters:!0});for(let a of o)i.push(g.keywordArgument({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)}))}return this.context.errors.unscope(),i}getMethodArgsForPropertiesRequest({request:e,snippet:r}){var o;let n=[],i=this.context.associateByWireValue({parameters:e.value,values:(o=this.context.getRecord(r.requestBody))!=null?o:{}});for(let a of i)n.push(g.keywordArgument({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)}));return n}getMethodArgsForBodyRequest({request:e,snippet:r}){if(e.body==null)return[];switch(e.body.type){case"bytes":return this.context.errors.add({severity:"CRITICAL",message:"Multi-environment values are not supported in Ruby snippets yet"}),[];case"typeReference":return[g.positionalArgument({value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.body.value,value:this.context.getRecord(r.requestBody)})})];default:R(e.body)}}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(r=>`${this.context.getMethodName(r)}`).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}};s();u();s();u();var vt=class{constructor({context:e}){y(this,"context");this.context=e}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?g.TypeLiteral.nil():(this.context.errors.add({severity:S.Critical,message:"Expected non-null value, but got null"}),g.TypeLiteral.nop());if(e.value===void 0)return g.TypeLiteral.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return this.convertLiteral({literalType:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let r=this.context.resolveNamedType({typeId:e.typeReference.value});return r==null?g.TypeLiteral.nop():this.convertNamed({named:r,value:e.value,as:e.as})}case"optional":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"nullable":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value});case"unknown":return g.TypeLiteral.nop();default:R(e.typeReference)}}convertLiteral({literalType:e,value:r}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:r});return n==null?g.TypeLiteral.nop():g.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:r});return n==null?g.TypeLiteral.nop():g.TypeLiteral.string(n)}default:R(e)}}convertList({list:e,value:r}){return Array.isArray(r)?g.TypeLiteral.list(r.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:e,value:n})}finally{this.context.errors.unscope()}})):(this.context.errors.add({severity:S.Critical,message:`Expected array but got: ${typeof r}`}),g.TypeLiteral.nop())}convertSet({set:e,value:r}){return Array.isArray(r)?g.TypeLiteral.set(r.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:e,value:n})}finally{this.context.errors.unscope()}})):(this.context.errors.add({severity:S.Critical,message:`Expected array but got: ${typeof r}`}),g.TypeLiteral.nop())}convertMap({map:e,value:r}){return typeof r!="object"||r==null?(this.context.errors.add({severity:S.Critical,message:`Expected object but got: ${r==null?"null":typeof r}`}),g.TypeLiteral.nop()):g.TypeLiteral.hash(Object.entries(r).map(([n,i])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:e.key,value:n,as:"key"}),value:this.convert({typeReference:e.value,value:i})}}finally{this.context.errors.unscope()}}))}convertNamed({named:e,value:r,as:n}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:r,as:n});case"discriminatedUnion":return g.TypeLiteral.nop();case"object":return this.convertObject({object:e,value:r});case"enum":return g.TypeLiteral.nop();case"undiscriminatedUnion":return g.TypeLiteral.nop();default:R(e)}}convertPrimitive({primitive:e,value:r,as:n}){switch(e){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:r,as:n});return i==null?g.TypeLiteral.nop():g.TypeLiteral.integer(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:r});return i==null?g.TypeLiteral.nop():g.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:r,as:n});return i==null?g.TypeLiteral.nop():g.TypeLiteral.boolean(i)}case"BASE_64":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:r});return i==null?g.TypeLiteral.nop():g.TypeLiteral.string(i)}case"UUID":{let i=this.context.getValueAsString({value:r});return i==null?g.TypeLiteral.nop():g.TypeLiteral.string(i)}case"DATE":{let i=this.context.getValueAsString({value:r});return i==null?g.TypeLiteral.nop():g.TypeLiteral.string(i)}case"DATE_TIME":{let i=this.context.getValueAsString({value:r});return i==null?g.TypeLiteral.nop():g.TypeLiteral.string(i)}default:R(e)}}convertObject({object:e,value:r}){return typeof r!="object"||r==null?(this.context.errors.add({severity:S.Critical,message:`Expected object but got: ${r==null?"null":typeof r}`}),g.TypeLiteral.nop()):g.TypeLiteral.hash(Object.entries(r).map(([n,i])=>{var p;this.context.errors.scope(n);let o=e.properties.find(d=>d.name.wireValue===n),a=(p=o==null?void 0:o.typeReference)!=null?p:{type:"unknown"},c={key:g.TypeLiteral.string(n),value:this.convert({typeReference:a,value:i})};return this.context.errors.unscope(),c}))}getValueAsNumber({value:e,as:r}){let n=r==="key"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:e,as:r}){let n=r==="key"?typeof e=="string"?e==="true":!!e:e;return this.context.getValueAsBoolean({value:n})}};var wt=class t extends hr{constructor({ir:r,config:n}){super({ir:r,config:n});y(this,"ir");y(this,"customConfig");y(this,"dynamicTypeLiteralMapper");this.ir=r,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new vt({context:this})}clone(){return new t({ir:this.ir,config:this.config})}getRootClientClassReference(){return g.classReference({name:this.getRootClientClassName(),modules:[this.getRootModuleName()]})}getRootClientClassName(){return"Client"}getRootModuleName(){var r,n;return(n=(r=this.customConfig)==null?void 0:r.clientModuleName)!=null?n:this.config.organization}isSingleEnvironmentID(r){return typeof r=="string"}isMultiEnvironmentValues(r){return typeof r=="object"}getEnvironmentTypeReferenceFromID(r){let n=this.resolveEnvironmentName(r);if(n!=null)return g.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference()),i.write("::"),i.write(this.getEnumName(n))})}getEnvironmentClassReference(){return g.classReference({name:"Environment",modules:[this.getRootModuleName()]})}getEnumName(r){return this.getName(r.screamingSnakeCase.safeName)}getMethodName(r){return this.getName(r.snakeCase.safeName)}getPropertyName(r){return this.getName(r.camelCase.safeName)}getName(r){return r}};var xt=class extends pr{constructor({ir:r,config:n,formatter:i}){super(new wt({ir:r,config:n}));y(this,"formatter");this.formatter=i}async generate(r){return super.generate(r)}generateSync(r){return super.generateSync(r)}createSnippetGenerator(r){return new gt({context:r,formatter:this.formatter})}};0&&(module.exports={DynamicSnippetsGenerator});
|
|
19
|
+
${this.buffer}`:this.buffer}stringifyRequires(){return Array.from(this.requires).map(t=>`require "${t}"`).join(`
|
|
20
|
+
`)}};var m={};st(m,{AstNode:()=>g,ClassInstantiation:()=>J,ClassReference:()=>_,Class_:()=>j,CodeBlock:()=>X,KeywordArgument:()=>Z,KeywordParameter:()=>Q,Method:()=>W,MethodInvocation:()=>ee,MethodKind:()=>O,Module_:()=>V,Parameter:()=>E,Type:()=>$,TypeLiteral:()=>we,TypeParameter:()=>te,Writer:()=>k,begin:()=>Mi,classReference:()=>Ni,class_:()=>Ei,codeblock:()=>$e,comment:()=>ki,falseValue:()=>bi,ifElse:()=>Fi,instantiateClass:()=>Ci,invokeMethod:()=>Pi,keywordArgument:()=>Li,method:()=>Si,module:()=>Ri,nilValue:()=>Ti,parameters:()=>Ai,positionalArgument:()=>Bi,raise:()=>Di,trueValue:()=>vi,typeParameter:()=>Ii,wrapInModules:()=>Ui});f();u();f();u();f();u();f();u();f();u();var g=class extends H{async toStringAsync({customConfig:t,formatter:e}={}){let r=new ie({customConfig:t!=null?t:{},formatter:e});return this.write(r),r.toStringAsync()}toString({customConfig:t,formatter:e}={}){let r=new ie({customConfig:t!=null?t:{},formatter:e});return this.write(r),r.toString()}typeDefinitionToString({customConfig:t,formatter:e}={}){let r=new ie({customConfig:t!=null?t:{},formatter:e});return this.writeTypeDefinition(r),r.toString()}writeTypeDefinition(t){}};var N=class extends g{constructor({docs:e}){super();l(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
21
|
+
`).forEach(r=>{e.writeLine(`# ${r}`)})}};f();u();f();u();f();u();var _=class extends g{constructor({name:e,modules:r,fullyQualified:i}){super();l(this,"name");l(this,"modules");l(this,"fullyQualified");this.name=e,this.modules=r!=null?r:[],this.fullyQualified=i!=null?i:!1}write(e){if(this.fullyQualified||this.modules.length>0){let r=[...this.modules,this.name].join("::");e.write(r);return}e.write(this.name)}};var $=class n extends g{constructor(e){super();l(this,"internalType");this.internalType=e}write(e){var r,i,o;if(this.internalType)switch((r=this.internalType)==null?void 0:r.type){case"integer":e.write("Integer");return;case"string":e.write("String");return;case"class":e.writeNode(this.internalType.reference);return;case"instance":break;case"boolean":e.write("Internal::Types::Boolean");return;case"nil":break;case"top":break;case"bot":break;case"void":break;case"boolish":break;case"union":if(this.internalType.elems.length===2&&((o=(i=this.internalType.elems[1])==null?void 0:i.internalType)==null?void 0:o.type)==="nil"){let a=this.internalType.elems[0];a!=null&&a.write(e)}break;case"intersection":break;case"array":e.write("Internal::Types::Array["),this.internalType.elem.write(e),e.write("]");return;case"hash":e.write("Internal::Types::Hash["),this.internalType.keyType.write(e),e.write(", "),this.internalType.valueType.write(e),e.write("]");return;case"object":e.write("Object");break;case"singleton":break;case"generic":break;case"self":break;case"tuple":break;default:b(this.internalType)}}writeTypeDefinition(e){if(this.internalType)switch(this.internalType.type){case"self":e.write("self");break;case"class":e.write(this.internalType.reference.toString(e));break;case"instance":e.write("instance");break;case"boolean":e.write("bool");break;case"nil":e.write("nil");break;case"top":e.write("top");break;case"bot":e.write("bot");break;case"void":e.write("void");break;case"boolish":e.write("boolish");break;case"string":e.write("String");break;case"integer":e.write("Integer");break;case"union":e.delimit({nodes:this.internalType.elems,delimiter:" | ",writeFunction:r=>r.writeTypeDefinition(e)});break;case"intersection":e.delimit({nodes:this.internalType.elems,delimiter:" & ",writeFunction:r=>r.writeTypeDefinition(e)});break;case"array":e.write("Array["),this.internalType.elem.writeTypeDefinition(e),e.write("]");break;case"hash":e.write("Hash["),this.internalType.keyType.writeTypeDefinition(e),e.write(", "),this.internalType.valueType.writeTypeDefinition(e),e.write("]");break;case"object":e.write(this.internalType.klass);break;case"singleton":e.write("singleton("),e.write(this.internalType.klass),e.write(")");break;case"tuple":e.write("["),e.delimit({nodes:this.internalType.elems,delimiter:", ",writeFunction:r=>r.write(e)}),e.write("]");break;case"generic":e.write(`${this.internalType.baseKlass}[`),e.delimit({nodes:this.internalType.parameters,delimiter:", ",writeFunction:r=>r.writeTypeDefinition(e)}),e.write("]");break;default:b(this.internalType)}else e.write("untyped")}static untyped(){return new this(void 0)}static self(){return new this({type:"self"})}static class_(e){return new this({type:"class",reference:new _({name:e.name,modules:e.modules,fullyQualified:!0})})}static instance(){return new this({type:"instance"})}static boolean(){return new this({type:"boolean"})}static nil(){return new this({type:"nil"})}static top(){return new this({type:"top"})}static bot(){return new this({type:"bot"})}static void(){return new this({type:"void"})}static boolish(){return new this({type:"boolish"})}static string(){return new this({type:"string"})}static integer(){return new this({type:"integer"})}static union(e){return new this({type:"union",elems:e})}static intersection(e){return new this({type:"intersection",elems:e})}static array(e){return new this({type:"array",elem:e})}static hash(e,r){return new this({type:"hash",keyType:e,valueType:r})}static object(e){return new this({type:"object",klass:e})}static singleton(e){return new this({type:"singleton",klass:e})}static tuple(e){return new this({type:"tuple",elems:e})}static generic(e,r){return new this({type:"generic",baseKlass:e,parameters:r})}static nilable(e){return n.union([e,n.nil()])}nilable(){return n.nilable(this)}};var O={Instance:"instance",Class_:"class"},ur={Public:"public",Private:"private",Protected:"protected"},W=class extends g{constructor({name:e,docstring:r,kind:i,visibility:o,parameters:a,returnType:p,statements:c,splatOptionDocs:h}){var x,y;super();l(this,"name");l(this,"docstring");l(this,"kind");l(this,"positionalParameters");l(this,"keywordParameters");l(this,"positionalSplatParameter");l(this,"keywordSplatParameter");l(this,"yieldParameter");l(this,"visibility");l(this,"statements");l(this,"returnType");l(this,"splatOptionDocs");this.name=e,this.docstring=r,this.kind=i!=null?i:O.Instance,this.visibility=o!=null?o:ur.Public,this.positionalParameters=(x=a==null?void 0:a.positional)!=null?x:[],this.keywordParameters=(y=a==null?void 0:a.keyword)!=null?y:[],this.positionalSplatParameter=a==null?void 0:a.positionalSplat,this.keywordSplatParameter=a==null?void 0:a.keywordSplat,this.yieldParameter=a==null?void 0:a.yield,this.returnType=p!=null?p:$.untyped(),this.statements=c!=null?c:[],this.splatOptionDocs=h!=null?h:[]}addStatement(e){this.statements.push(e)}write(e){this.docstring&&new N({docs:this.docstring}).write(e);let r=this.positionalParameters.length>0||this.keywordParameters.length>0||this.keywordSplatParameter!=null;this.docstring&&r&&e.writeLine("#");for(let i of this.positionalParameters){e.write(`# @option ${i.name} [`);let o=new k({customConfig:e.customConfig});i.type.writeTypeDefinition(o),e.write(this.normalizeForYard(o.toString())),e.write("]"),e.newLine()}for(let i of this.keywordParameters){e.write(`# @param ${i.name} [`);let o=new k({customConfig:e.customConfig});i.type.writeTypeDefinition(o),e.write(this.normalizeForYard(o.toString())),e.write("]"),i.docs&&e.write(` ${i.docs}`),e.newLine()}if(this.keywordSplatParameter!=null){e.write(`# @param ${this.keywordSplatParameter.name} [`);let i=new k({customConfig:e.customConfig});this.keywordSplatParameter.type.writeTypeDefinition(i),e.write(this.normalizeForYard(i.toString())),e.write("]"),this.keywordSplatParameter.docs&&e.write(` ${this.keywordSplatParameter.docs}`),e.newLine()}for(let i of this.splatOptionDocs)e.writeLine(`# ${i}`);if(this.returnType!=null){(r||this.docstring)&&e.writeLine("#"),e.write("# @return [");let i=new k({customConfig:e.customConfig});this.returnType.writeTypeDefinition(i),e.write(this.normalizeForYard(i.toString())),e.write("]"),e.newLine()}switch(this.visibility!==ur.Public&&(e.write(this.visibility),this.kind===O.Class_&&e.write("_class_method"),e.write(" ")),this.kind){case O.Instance:e.write(`def ${this.name}`);break;case O.Class_:e.write(`def self.${this.name}`);break}this.parameters.length&&(e.write("("),e.delimit({nodes:this.parameters,delimiter:", ",writeFunction:i=>i.write(e)}),e.write(")")),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((i,o)=>{i.write(e),o<this.statements.length-1&&e.newLine()}),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`def ${this.name}: (`),this.parameters.forEach((r,i)=>{r.writeTypeDefinition(e),i<this.parameters.length-1&&e.write(", ")}),e.write(") -> "),this.returnType.writeTypeDefinition(e)}normalizeForYard(e){let r=e.replace(/\s*\|\s*/g,", ");return r=r.replace(/\bbool\b/g,"Boolean"),r=r.replace(/(^|,\s*)nil(?:,\s*nil)+(?=,|\]|$)/g,"$1nil"),r=r.replace(/Hash\[untyped,\s*untyped\]/g,"Hash"),r}get parameters(){return[...this.positionalParameters,...this.keywordParameters,this.positionalSplatParameter,this.keywordSplatParameter,this.yieldParameter].flatMap(e=>e!==void 0?e:[])}};f();u();var V=class n extends g{constructor({name:e,namespace:r,typeParameters:i,docstring:o,statements:a}){super();l(this,"name");l(this,"namespace");l(this,"typeParameters");l(this,"docstring");l(this,"statements");this.name=e,this.namespace=r!=null?r:new Set,this.typeParameters=i!=null?i:[],this.docstring=o,this.statements=a!=null?a:[],this.populateChildNamespaces()}addStatement(e){this.statements.push(e)}write(e){this.docstring&&new N({docs:this.docstring}).write(e),e.write(`module ${this.name}`),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((r,i)=>{r.write(e),i<this.statements.length-1&&e.newLine()}),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`module ${this.name}`),this.typeParameters.length&&(e.write("["),e.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:r=>r.writeTypeDefinition(e)}),e.write("]")),e.newLine(),this.statements.length&&(e.indent(),this.statements.forEach(r=>{r.writeTypeDefinition(e),e.newLine()}),e.dedent()),e.write("end")}populateChildNamespaces(){this.statements.filter(e=>e instanceof n||e instanceof j).forEach(e=>{e.namespace=new Set([...this.namespace,this]),e.populateChildNamespaces()})}get fullyQualifiedNamespace(){return[...this.namespace,this].map(e=>e.name).join("::")}};var j=class extends V{constructor({name:e,superclass:r,typeParameters:i,docstring:o,statements:a}){super({name:e,docstring:o,typeParameters:i});l(this,"superclass");l(this,"statements");l(this,"methods",[]);this.superclass=r,this.statements=a!=null?a:[]}addStatement(e){this.statements.push(e)}addStatements(e){this.statements.push(...e)}addInstanceMethod(e,r,i){let o=new W({name:e,kind:O.Instance,returnType:r,statements:i});this.addMethod(o)}addMethod(e){this.methods.push(e)}addMethods(e){e.forEach(r=>this.addMethod(r))}write(e){if(this.docstring&&new N({docs:this.docstring}).write(e),e.write(`class ${this.name}`),this.superclass&&(e.write(" < "),this.superclass.write(e)),!this.hasBody()){e.writeLine("; end");return}this.statements.length&&(e.newLine(),e.indent(),this.statements.forEach((r,i)=>{r.write(e),e.newLine()}),e.dedent()),this.methods.length&&(e.newLine(),e.indent(),this.methods.forEach(r=>{r.write(e)}),e.dedent()),e.writeLine("end")}hasBody(){return this.statements.length>0||this.methods.length>0}writeTypeDefinition(e){e.write(`class ${this.name}`),this.typeParameters.length&&(e.write("["),e.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:r=>r.writeTypeDefinition(e)}),e.write("]")),this.superclass&&(e.write(" < "),this.superclass.write(e)),e.newLine(),this.statements.length&&(e.indent(),this.statements.forEach(r=>{r.writeTypeDefinition(e),e.newLine()}),e.dedent()),e.write("end")}};f();u();var J=class extends g{constructor({classReference:e,arguments_:r}){super();l(this,"classReference");l(this,"arguments_");this.classReference=e,this.arguments_=r}write(e){e.writeNode(this.classReference),e.write("."),e.write("new"),e.write("("),this.arguments_.length>1?(e.indent(),e.newLine(),this.arguments_.forEach((r,i)=>{i>0&&(e.write(","),e.newLine()),r.write(e)}),e.newLine(),e.dedent()):this.arguments_.forEach((r,i)=>{i>0&&e.write(", "),r.write(e)}),e.write(")")}};f();u();var X=class extends g{constructor(e){super();l(this,"arg");this.arg=e}write(e){return new I(this.arg).write(e)}};f();u();var Z=class extends g{constructor({name:e,value:r}){super();l(this,"name");l(this,"value");this.name=e,this.value=r}write(e){e.write(`${this.name}: `),this.value.write(e)}};f();u();f();u();var E=class extends g{constructor({name:e,type:r,optional:i,docs:o}){super();l(this,"name");l(this,"type");l(this,"optional");l(this,"docs");this.name=e,this.type=r!=null?r:$.untyped(),this.optional=i!=null?i:!1,this.docs=o}};var Q=class extends E{constructor({name:e,type:r,initializer:i,optional:o}){super({name:e,type:r,optional:o});l(this,"initializer");this.initializer=i}write(e){e.write(`${this.name}:`),this.initializer&&(e.write(" "),e.writeNode(this.initializer))}writeTypeDefinition(e){this.optional&&e.write("?"),e.write(`${this.name}: `),this.type.writeTypeDefinition(e)}};f();u();var he=class extends E{constructor(){super(...arguments);l(this,"initializer")}write(e){e.write(`**${this.name}`)}writeTypeDefinition(e){e.write("**"),this.type.writeTypeDefinition(e)}};f();u();var ee=class extends g{constructor({on:e,method:r,arguments_:i,keywordArguments:o,block:a}){super();l(this,"on");l(this,"method");l(this,"arguments_");l(this,"keywordArguments");l(this,"block");this.on=e,this.method=r,this.arguments_=i,this.keywordArguments=o,this.block=a}write(e){this.on.write(e),e.write("."),e.write(this.method),e.write("(");let r=[];for(let i of this.arguments_)r.push({kind:"positional",node:i});for(let i of this.keywordArguments||[])r.push({kind:"keyword",arg:i});if(r.length>1?(e.indent(),e.newLine(),r.forEach((i,o)=>{o>0&&(e.write(","),e.newLine()),lr(e,i)}),e.newLine(),e.dedent()):r.forEach((i,o)=>{o>0&&e.write(", "),lr(e,i)}),e.write(")"),this.block){let[i,o]=this.block;e.write(" do"),i.length>0&&(e.write(" |"),i.forEach((a,p)=>{p>0&&e.write(", "),e.write(a)}),e.write("|")),e.newLine(),e.indent();for(let a of o)a.write(e),e.writeNewLineIfLastLineNot();e.dedent(),e.write("end")}}};function lr(n,t){switch(t.kind){case"positional":t.node.write(n);break;case"keyword":t.arg.write(n);break;default:b(t)}}f();u();var ye=class extends g{constructor({value:e}){super();l(this,"value");this.value=e}write(e){this.value.write(e)}};f();u();var xe=class extends E{constructor({name:e,type:r,optional:i,initializer:o}){super({name:e,type:r,optional:i});l(this,"initializer");this.initializer=o}write(e){e.write(this.name),this.initializer&&e.write(` = ${this.initializer.write(e)}`)}writeTypeDefinition(e){this.optional&&e.write("?"),this.type.writeTypeDefinition(e)}};f();u();var ge=class extends E{write(t){t.write(`*${this.name}`)}writeTypeDefinition(t){t.write("*"),this.type.writeTypeDefinition(t)}};f();u();var we=class n extends g{constructor(e){super();l(this,"internalType");this.internalType=e}static string(e){return new this({type:"str",value:e})}static integer(e){return new this({type:"int",value:e})}static float(e){return new this({type:"float",value:e})}static boolean(e){return new this({type:"bool",value:e})}static hash(e){return new this({type:"hash",entries:e})}static set(e){return new this({type:"set",values:e})}static list(e){return new this({type:"list",values:e})}static nop(){return new this({type:"nop"})}static nil(){return new this({type:"nil"})}static isNop(e){return e instanceof n&&e.internalType.type==="nop"}static isNil(e){return e instanceof n&&e.internalType.type==="nil"}write(e){switch(this.internalType.type){case"str":{this.internalType.value.includes("'")||this.internalType.value.includes("#")?e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`):e.write(`'${this.internalType.value}'`);break}case"int":{e.write(this.internalType.value.toString());break}case"float":{e.write(this.internalType.value.toString());break}case"bool":{e.write(this.internalType.value?"true":"false");break}case"hash":{let r=this.internalType.entries.filter(i=>!n.isNop(i.key)&&!n.isNop(i.value));if(r.length===0){e.write("{}");break}e.write(`{
|
|
22
|
+
`),r.forEach((i,o)=>{o>0&&e.writeLine(","),e.indent();let a=!1;if(i.key instanceof n&&i.key.internalType.type==="str"){let p=i.key.internalType.value;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(p)&&(e.write(`${p}:`),a=!0)}a||(i.key.write(e),e.write(":")),e.write(" "),i.value.write(e),e.dedent()}),e.write(`
|
|
23
|
+
}`);break}case"set":{let r=this.internalType.values.filter(i=>!n.isNop(i));if(r.length===0){e.write("Set.new([])");break}e.write("Set.new(["),r.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write("])");break}case"list":{let r=this.internalType.values.filter(i=>!n.isNop(i));if(r.length===0){e.write("[]");break}e.write("["),r.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write("]");break}case"nop":break;case"nil":e.write("nil");break;default:b(this.internalType)}}};f();u();var Me;(function(n){n[n.Invariant=0]="Invariant",n.Covariant="out",n.Contravariant="in"})(Me||(Me={}));var te=class extends g{constructor({name:e,unchecked:r,bound:i,variance:o,defaultType:a}){super();l(this,"name");l(this,"unchecked");l(this,"bound");l(this,"variance");l(this,"defaultType");this.name=e,this.unchecked=r!=null?r:!1,this.bound=i,this.variance=o!=null?o:Me.Invariant,this.defaultType=a}write(e){}writeTypeDefinition(e){this.unchecked&&e.write("unchecked "),this.variance!=Me.Invariant&&e.write(`${this.variance} `),e.write(this.name),this.bound&&(e.write(" < "),this.bound.writeTypeDefinition(e)),this.defaultType&&(e.write(" = "),this.defaultType.writeTypeDefinition(e))}};f();u();var ve=class extends E{constructor(){super(...arguments);l(this,"initializer")}write(e){e.write(`&${this.name}`)}};f();u();var De=class extends g{constructor({body:e,rescues:r}){super();l(this,"body");l(this,"rescues");this.body=e,this.rescues=r}write(e){e.write("begin"),e.writeLine(),this.body&&(e.indent(),this.body.write(e),e.writeNewLineIfLastLineNot(),e.dedent());for(let{errorClass:r,errorVariable:i,body:o}of this.rescues)e.write("rescue"),r&&(e.write(" "),r.write(e)),i&&(e.write(" => "),e.write(i)),e.writeLine(),o&&(e.indent(),o.write(e),e.writeNewLineIfLastLineNot(),e.dedent());e.write("end")}};f();u();var Ue=class extends g{constructor({if:e,elseIf:r,elseBody:i}){super();l(this,"ifBranch");l(this,"elseIfs");l(this,"elseBody");this.ifBranch=e,this.elseIfs=r!=null?r:[],this.elseBody=i?Array.isArray(i)?i:[i]:void 0}write(e){e.write("if "),this.ifBranch.condition.write(e),e.writeLine(),e.indent();for(let r of this.ifBranch.thenBody)r.write(e),e.writeNewLineIfLastLineNot();e.dedent();for(let r of this.elseIfs){e.write("elsif "),r.condition.write(e),e.writeLine(),e.indent();for(let i of r.thenBody)i.write(e),e.writeNewLineIfLastLineNot();e.dedent()}if(this.elseBody&&this.elseBody.length>0){e.writeLine("else"),e.indent();for(let r of this.elseBody)r.write(e),e.writeNewLineIfLastLineNot();e.dedent()}e.write("end"),e.writeNewLineIfLastLineNot()}};f();u();var _e=class extends g{constructor({errorClass:e,message:r}){super();l(this,"errorClass");l(this,"message");this.errorClass=e,this.message=r}write(e){e.write("raise"),this.errorClass&&(e.write(" "),this.errorClass.write(e)),this.message&&(this.errorClass&&e.write(", "),this.message.write(e))}};function $e(n){return new X(n)}function vi(){return $e("true")}function bi(){return $e("false")}function Ti(){return $e("nil")}var Ai={positional(n){return new xe(n)},keyword(n){return new Q(n)},positionalSplat(n){return new ge(n)},keywordSplat(n){return new he(n)},yield(n){return new ve(n)}};function Ei(n){return new j(n)}function Ri(n){return new V(n)}function Si(n){return new W(n)}function ki(n){return new N(n)}function Ii(n){return new te(n)}function Ni(n){return new _(n)}function Ci(n){return new J(n)}function Li(n){return new Z(n)}function Pi(n){return new ee(n)}function Bi(n){return new ye(n)}function Fi(n){return new Ue(n)}function Mi(n){return new De(n)}function Di(n){return new _e(n)}function Ui(n,t){let e=n;for(let r of t.toReversed())r.addStatement(e),e=r;return e}f();u();var Oe=class{constructor({context:t}){l(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?m.TypeLiteral.nil():(this.context.errors.add({severity:w.Critical,message:"Expected non-null value, but got null"}),m.TypeLiteral.nop());if(t.value===void 0)return m.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?m.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 m.TypeLiteral.nop();default:b(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?m.TypeLiteral.nop():m.TypeLiteral.string(r)}default:b(t)}}convertList({list:t,value:e}){return Array.isArray(e)?m.TypeLiteral.list(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:w.Critical,message:`Expected array but got: ${typeof e}`}),m.TypeLiteral.nop())}convertSet({set:t,value:e}){return Array.isArray(e)?m.TypeLiteral.set(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:w.Critical,message:`Expected array but got: ${typeof e}`}),m.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:w.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),m.TypeLiteral.nop()):m.TypeLiteral.hash(Object.entries(e).map(([r,i])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}}))}convertNamed({named:t,value:e,as:r}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r});case"discriminatedUnion":return m.TypeLiteral.nop();case"object":return this.convertObject({object:t,value:e});case"enum":return m.TypeLiteral.nop();case"undiscriminatedUnion":return m.TypeLiteral.nop();default:b(t)}}convertPrimitive({primitive:t,value:e,as:r}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:r});return i==null?m.TypeLiteral.nop():m.TypeLiteral.integer(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?m.TypeLiteral.nop():m.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:r});return i==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(i)}case"BASE_64":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeLiteral.nop():m.TypeLiteral.string(i)}case"UUID":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeLiteral.nop():m.TypeLiteral.string(i)}case"DATE":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeLiteral.nop():m.TypeLiteral.string(i)}case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeLiteral.nop():m.TypeLiteral.string(i)}default:b(t)}}convertObject({object:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:w.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),m.TypeLiteral.nop()):m.TypeLiteral.hash(Object.entries(e).map(([r,i])=>{var c;this.context.errors.scope(r);let o=t.properties.find(h=>h.name.wireValue===r),a=(c=o==null?void 0:o.typeReference)!=null?c:{type:"unknown"},p={key:m.TypeLiteral.string(r),value:this.convert({typeReference:a,value:i})};return this.context.errors.unscope(),p}))}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:t;return this.context.getValueAsBoolean({value:r})}};var We=class n extends me{constructor({ir:e,config:r}){super({ir:e,config:r});l(this,"ir");l(this,"customConfig");l(this,"dynamicTypeLiteralMapper");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeLiteralMapper=new Oe({context:this})}clone(){return new n({ir:this.ir,config:this.config})}getRootClientClassReference(){return m.classReference({name:this.getRootClientClassName(),modules:[this.getRootModuleName()]})}getRootClientClassName(){return"Client"}getRootModuleName(){var e,r;return Qe((r=(e=this.customConfig)==null?void 0:e.clientModuleName)!=null?r:this.config.organization)}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}getEnvironmentTypeReferenceFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return m.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference()),i.write("::"),i.write(this.getEnumName(r))})}getEnvironmentClassReference(){return m.classReference({name:"Environment",modules:[this.getRootModuleName()]})}getEnumName(e){return this.getName(e.screamingSnakeCase.safeName)}getMethodName(e){return this.getName(e.snakeCase.safeName)}getPropertyName(e){return this.getName(e.camelCase.safeName)}getName(e){return e}};f();u();var pr="client",Ve=class{constructor({context:t,formatter:e}){l(this,"context");l(this,"formatter");this.context=t,this.formatter=e}async generateSnippet({endpoint:t,request:e}){var i;return await this.buildCodeBlock({endpoint:t,snippet:e}).toStringAsync({customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}generateSnippetSync({endpoint:t,request:e}){var i;return this.buildCodeBlock({endpoint:t,snippet:e}).toString({customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}buildCodeBlock({endpoint:t,snippet:e}){return m.codeblock(r=>{r.writeNodeStatement(this.constructClient({endpoint:t,snippet:e})),r.newLine(),r.writeNodeStatement(this.callMethod({endpoint:t,snippet:e}))})}constructClient({endpoint:t,snippet:e}){return m.codeblock(r=>{r.addRequire(this.context.getRootModuleName().toLowerCase());let i=this.context.getRootClientClassReference(),o=this.getRootClientBuilderArgs({endpoint:t,snippet:e});r.write(`${pr} = `),r.writeNode(m.instantiateClass({classReference:i,arguments_:o}))})}getRootClientBaseUrlArg({baseUrl:t,environment:e}){if(t!=null&&e!=null)return this.context.errors.add({severity:"CRITICAL",message:"Cannot specify both baseUrl and environment options"}),[];if(t!=null)return[m.keywordArgument({name:"base_url",value:m.TypeLiteral.string(t)})];if(e!=null){if(this.context.isSingleEnvironmentID(e)){let r=this.context.getEnvironmentTypeReferenceFromID(e);return r==null?(this.context.errors.add({severity:"CRITICAL",message:`Environment ID ${e} not found`}),[]):[m.keywordArgument({name:"environment",value:r})]}if(this.context.isMultiEnvironmentValues(e))return this.context.errors.add({severity:"CRITICAL",message:"Multi-environment values are not supported in Ruby snippets yet"}),[]}return[]}getRootClientAuthArgs({auth:t,values:e}){if(e.type!==t.type)return this.addError(this.context.newAuthMismatchError({auth:t,values:e}).message),[];switch(t.type){case"basic":return e.type==="basic"?this.getRootClientBasicAuthArgs({auth:t,values:e}):[];case"bearer":return e.type==="bearer"?this.getRootClientBearerAuthArgs({auth:t,values:e}):[];case"header":return e.type==="header"?this.getRootClientHeaderAuthArgs({auth:t,values:e}):[];case"oauth":return e.type==="oauth"?this.getRootClientOAuthArgs({auth:t,values:e}):[];case"inferred":return this.addWarning("Ruby SDK does not support inferred auth yet"),[];default:b(t)}}addError(t){this.context.errors.add({severity:w.Critical,message:t})}addWarning(t){this.context.errors.add({severity:w.Warning,message:t})}getRootClientBasicAuthArgs({auth:t,values:e}){return[m.keywordArgument({name:t.username.snakeCase.safeName,value:m.TypeLiteral.string(e.username)}),m.keywordArgument({name:t.password.snakeCase.safeName,value:m.TypeLiteral.string(e.password)})]}getRootClientBearerAuthArgs({auth:t,values:e}){return[m.keywordArgument({name:t.token.snakeCase.safeName,value:m.TypeLiteral.string(e.token)})]}getRootClientHeaderAuthArgs({auth:t,values:e}){return[m.keywordArgument({name:t.header.name.name.snakeCase.safeName,value:m.TypeLiteral.string(e.value)})]}getRootClientOAuthArgs({auth:t,values:e}){return[m.keywordArgument({name:t.clientId.snakeCase.safeName,value:m.TypeLiteral.string(e.clientId)}),m.keywordArgument({name:t.clientSecret.snakeCase.safeName,value:m.TypeLiteral.string(e.clientSecret)})]}getRootClientHeaderArgs({headers:t,values:e}){let r=[];for(let i of t){let o=e[i.name.name.originalName];o!=null&&typeof o=="string"&&r.push(m.keywordArgument({name:i.name.name.snakeCase.safeName,value:m.TypeLiteral.string(o)}))}return r}getRootClientBuilderArgs({endpoint:t,snippet:e}){let r=[];t.auth!=null&&(e.auth!=null?r.push(...this.getRootClientAuthArgs({auth:t.auth,values:e.auth})):this.context.errors.add({severity:"WARNING",message:`Auth with ${t.auth.type} configuration is required for this endpoint`}));let i=this.getRootClientBaseUrlArg({baseUrl:e.baseURL,environment:e.environment});return i.length>0&&r.push(...i),this.context.errors.scope("Headers"),this.context.ir.headers!=null&&e.headers!=null&&r.push(...this.getRootClientHeaderArgs({headers:this.context.ir.headers,values:e.headers})),this.context.errors.unscope(),r}callMethod({endpoint:t,snippet:e}){let r={on:m.codeblock(pr),method:this.getMethod({endpoint:t}),arguments_:[]};switch(t.request.type){case"inlined":r.keywordArguments=this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});break;case"body":r.arguments_=this.getMethodArgsForBodyRequest({request:t.request,snippet:e});break;default:b(t.request)}return m.invokeMethod(r)}getMethodArgsForInlinedRequest({request:t,snippet:e}){let r=[];if(r.push(...this.getNamedParameterArgs({kind:"PathParameters",namedParameters:t.pathParameters,values:e.pathParameters})),r.push(...this.getNamedParameterArgs({kind:"QueryParameters",namedParameters:t.queryParameters,values:e.queryParameters})),r.push(...this.getNamedParameterArgs({kind:"Headers",namedParameters:t.headers,values:e.headers})),t.body!=null)switch(t.body.type){case"properties":r.push(...this.getMethodArgsForPropertiesRequest({request:t.body,snippet:e}));break;case"referenced":case"fileUpload":break;default:b(t.body)}return r}getNamedParameterArgs({kind:t,namedParameters:e,values:r}){let i=[];if(this.context.errors.scope(t),e!=null){let o=this.context.associateByWireValue({parameters:e,values:r!=null?r:{},ignoreMissingParameters:!0});for(let a of o)i.push(m.keywordArgument({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)}))}return this.context.errors.unscope(),i}getMethodArgsForPropertiesRequest({request:t,snippet:e}){var o;let r=[],i=this.context.associateByWireValue({parameters:t.value,values:(o=this.context.getRecord(e.requestBody))!=null?o:{}});for(let a of i)r.push(m.keywordArgument({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)}));return r}getMethodArgsForBodyRequest({request:t,snippet:e}){var i;let r=[];if(this.context.errors.scope("PathParameters"),t.pathParameters!=null){let o=this.context.associateByWireValue({parameters:t.pathParameters,values:(i=e.pathParameters)!=null?i:{},ignoreMissingParameters:!0});for(let a of o)r.push(m.positionalArgument({value:this.context.dynamicTypeLiteralMapper.convert(a)}))}if(this.context.errors.unscope(),t.body!=null)switch(t.body.type){case"bytes":this.context.errors.add({severity:"CRITICAL",message:"Bytes request body is not supported in Ruby snippets yet"});break;case"typeReference":r.push(m.positionalArgument({value:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.body.value,value:this.context.getRecord(e.requestBody)})}));break;default:b(t.body)}return r}getMethod({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${t.declaration.fernFilepath.allParts.map(e=>`${this.context.getMethodName(e)}`).join(".")}.${this.context.getMethodName(t.declaration.name)}`:this.context.getMethodName(t.declaration.name)}};var je=class extends pe{constructor({ir:e,config:r,formatter:i}){super(new We({ir:e,config:r}));l(this,"formatter");this.formatter=i}async generate(e){return super.generate(e)}generateSync(e){return super.generateSync(e)}createSnippetGenerator(e){return new Ve({context:e,formatter:this.formatter})}};0&&(module.exports={DynamicSnippetsGenerator});
|
|
29
24
|
/*! Bundled license information:
|
|
30
25
|
|
|
31
26
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -35,4 +30,16 @@ ${this.buffer}`:this.buffer}stringifyRequires(){return Array.from(this.requires)
|
|
|
35
30
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
36
31
|
* @license MIT
|
|
37
32
|
*)
|
|
33
|
+
|
|
34
|
+
lodash-es/lodash.js:
|
|
35
|
+
(**
|
|
36
|
+
* @license
|
|
37
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
38
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
39
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
40
|
+
* Released under MIT license <https://lodash.com/license>
|
|
41
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
42
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
43
|
+
*)
|
|
38
44
|
*/
|
|
45
|
+
//# sourceMappingURL=index.cjs.map
|