@fern-api/ruby-dynamic-snippets 0.0.6 → 1.0.0-rc60
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 +8 -8
- package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
- package/cjs/EndpointSnippetGenerator.cjs +9 -9
- package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
- package/cjs/EndpointSnippetGenerator.d.cts +8 -0
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +8 -8
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
- package/cjs/context/DynamicToLiteralMapper.cjs +8 -8
- package/cjs/context/DynamicToLiteralMapper.cjs.map +1 -1
- package/cjs/index.cjs +8 -8
- package/cjs/index.cjs.map +1 -1
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/EndpointSnippetGenerator.d.ts +8 -0
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/{chunk-KACH37MO.js → chunk-E7XDZIKI.js} +2 -2
- package/esm/{chunk-24Z62MLO.js → chunk-FWYXQB4R.js} +2 -2
- package/esm/chunk-NB75HQID.js +2 -0
- package/esm/chunk-NB75HQID.js.map +1 -0
- package/esm/{chunk-CWYMFRFT.js → chunk-SWWYKNFW.js} +2 -2
- package/esm/chunk-TGWLAKQC.js +34 -0
- package/esm/chunk-TGWLAKQC.js.map +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicToLiteralMapper.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +1 -1
- package/esm/chunk-43L44TD5.js +0 -2
- package/esm/chunk-43L44TD5.js.map +0 -1
- package/esm/chunk-SFFHNMMU.js +0 -34
- package/esm/chunk-SFFHNMMU.js.map +0 -1
- /package/esm/{chunk-KACH37MO.js.map → chunk-E7XDZIKI.js.map} +0 -0
- /package/esm/{chunk-24Z62MLO.js.map → chunk-FWYXQB4R.js.map} +0 -0
- /package/esm/{chunk-CWYMFRFT.js.map → chunk-SWWYKNFW.js.map} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";var pe=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var gt=Object.prototype.hasOwnProperty;var xt=(n,t,e)=>t in n?pe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Ce=(n,t)=>()=>(n&&(t=n(n=0)),t);var Ue=(n,t)=>{for(var e in t)pe(n,e,{get:t[e],enumerable:!0})},At=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wt(t))!gt.call(n,i)&&i!==e&&pe(n,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return n};var Tt=n=>At(pe({},"__esModule",{value:!0}),n);var u=(n,t,e)=>xt(n,typeof t!="symbol"?t+"":t,e);function Ye(){throw new Error("setTimeout has not been defined")}function We(){throw new Error("clearTimeout has not been defined")}function qe(n){if(q===setTimeout)return setTimeout(n,0);if((q===Ye||!q)&&setTimeout)return q=setTimeout,setTimeout(n,0);try{return q(n,0)}catch(t){try{return q.call(null,n,0)}catch(e){return q.call(this,n,0)}}}function kt(n){if(O===clearTimeout)return clearTimeout(n);if((O===We||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(n);try{return O(n)}catch(t){try{return O.call(null,n)}catch(e){return O.call(this,n)}}}function vt(){!te||!K||(te=!1,K.length?B=K.concat(B):me=-1,B.length&&Oe())}function Oe(){if(!te){var n=qe(vt);te=!0;for(var t=B.length;t;){for(K=B,B=[];++me<t;)K&&K[me].run();me=-1,t=B.length}K=null,te=!1,kt(n)}}function bt(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];B.push(new Ke(n,t)),B.length===1&&!te&&qe(Oe)}function Ke(n,t){this.fun=n,this.array=t}function z(){}function Wt(n){throw new Error("process.binding is not supported")}function qt(){return"/"}function Ot(n){throw new Error("process.chdir is not supported")}function Kt(){return 0}function Vt(n){var t=zt.call(ee)*.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 Gt(){var n=new Date,t=n-Ht;return t/1e3}var q,O,B,te,K,me,Et,It,St,Nt,Rt,Ct,Lt,Pt,Bt,Ft,Mt,_t,Dt,Ut,$t,Yt,ee,zt,Ht,y,$e,h=Ce(()=>{"use strict";q=Ye,O=We;typeof globalThis.setTimeout=="function"&&(q=setTimeout);typeof globalThis.clearTimeout=="function"&&(O=clearTimeout);B=[],te=!1,me=-1;Ke.prototype.run=function(){this.fun.apply(null,this.array)};Et="browser",It="browser",St=!0,Nt={},Rt=[],Ct="",Lt={},Pt={},Bt={};Ft=z,Mt=z,_t=z,Dt=z,Ut=z,$t=z,Yt=z;ee=globalThis.performance||{},zt=ee.now||ee.mozNow||ee.msNow||ee.oNow||ee.webkitNow||function(){return new Date().getTime()};Ht=new Date;y={nextTick:bt,title:Et,browser:St,env:Nt,argv:Rt,version:Ct,versions:Lt,on:Ft,addListener:Mt,once:_t,off:Dt,removeListener:Ut,removeAllListeners:$t,emit:Yt,binding:Wt,cwd:qt,chdir:Ot,umask:Kt,hrtime:Vt,platform:It,release:Pt,config:Bt,uptime:Gt},$e={};Object.keys($e).forEach(n=>{let t=n.split("."),e=y;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=$e[n]:e=e[i]||(e[i]={})}})});function Ge(){Pe=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)R[t]=n[t],E[n.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Jt(n){Pe||Ge();var t,e,r,i,o,s,f=n.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[f-2]==="="?2:n[f-1]==="="?1:0,s=new jt(f*3/4-o),r=o>0?f-4:f;var l=0;for(t=0,e=0;t<r;t+=4,e+=3)i=E[n.charCodeAt(t)]<<18|E[n.charCodeAt(t+1)]<<12|E[n.charCodeAt(t+2)]<<6|E[n.charCodeAt(t+3)],s[l++]=i>>16&255,s[l++]=i>>8&255,s[l++]=i&255;return o===2?(i=E[n.charCodeAt(t)]<<2|E[n.charCodeAt(t+1)]>>4,s[l++]=i&255):o===1&&(i=E[n.charCodeAt(t)]<<10|E[n.charCodeAt(t+1)]<<4|E[n.charCodeAt(t+2)]>>2,s[l++]=i>>8&255,s[l++]=i&255),s}function Qt(n){return R[n>>18&63]+R[n>>12&63]+R[n>>6&63]+R[n&63]}function Zt(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(Qt(r));return i.join("")}function ze(n){Pe||Ge();for(var t,e=n.length,r=e%3,i="",o=[],s=16383,f=0,l=e-r;f<l;f+=s)o.push(Zt(n,f,f+s>l?l:f+s));return r===1?(t=n[e-1],i+=R[t>>2],i+=R[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=R[t>>10],i+=R[t>>4&63],i+=R[t<<2&63],i+="="),o.push(i),o.join("")}function de(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function F(n,t){if(de()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=a.prototype):(n===null&&(n=new a(t)),n.length=t),n}function a(n,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Be(this,n)}return je(this,n,t,e)}function je(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?tr(n,t,e,r):typeof t=="string"?er(n,t,e):rr(n,t)}function Je(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 Xt(n,t,e,r){return Je(t),t<=0?F(n,t):e!==void 0?typeof r=="string"?F(n,t).fill(e,r):F(n,t).fill(e):F(n,t)}function Be(n,t){if(Je(t),n=F(n,t<0?0:Fe(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function er(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=Qe(t,e)|0;n=F(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function Le(n,t){var e=t.length<0?0:Fe(t.length)|0;n=F(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function tr(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),a.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=a.prototype):n=Le(n,t),n}function rr(n,t){if(C(t)){var e=Fe(t.length)|0;return n=F(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"||Tr(t.length)?F(n,0):Le(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Le(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Fe(n){if(n>=de())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+de().toString(16)+" bytes");return n|0}function C(n){return!!(n!=null&&n._isBuffer)}function Qe(n,t){if(C(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 ye(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return it(n).length;default:if(r)return ye(n).length;t=(""+t).toLowerCase(),r=!0}}function nr(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 pr(this,t,e);case"utf8":case"utf-8":return et(this,t,e);case"ascii":return fr(this,t,e);case"latin1":case"binary":return lr(this,t,e);case"base64":return hr(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mr(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function V(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function Ze(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,r)),C(t))return t.length===0?-1:Ve(n,t,e,r,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):Ve(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function Ve(n,t,e,r,i){var o=1,s=n.length,f=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;o=2,s/=2,f/=2,e/=2}function l(A,P){return o===1?A[P]:A.readUInt16BE(P*o)}var d;if(i){var m=-1;for(d=e;d<s;d++)if(l(n,d)===l(t,m===-1?0:d-m)){if(m===-1&&(m=d),d-m+1===f)return m*o}else m!==-1&&(d-=d-m),m=-1}else for(e+f>s&&(e=s-f),d=e;d>=0;d--){for(var p=!0,x=0;x<f;x++)if(l(n,d+x)!==l(t,x)){p=!1;break}if(p)return d}return-1}function ir(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var f=parseInt(t.substr(s*2,2),16);if(isNaN(f))return s;n[e+s]=f}return s}function or(n,t,e,r){return xe(ye(t,n.length-e),n,e,r)}function Xe(n,t,e,r){return xe(xr(t),n,e,r)}function sr(n,t,e,r){return Xe(n,t,e,r)}function ar(n,t,e,r){return xe(it(t),n,e,r)}function ur(n,t,e,r){return xe(Ar(t,n.length-e),n,e,r)}function hr(n,t,e){return t===0&&e===n.length?ze(n):ze(n.slice(t,e))}function et(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],s=null,f=o>239?4:o>223?3:o>191?2:1;if(i+f<=e){var l,d,m,p;switch(f){case 1:o<128&&(s=o);break;case 2:l=n[i+1],(l&192)===128&&(p=(o&31)<<6|l&63,p>127&&(s=p));break;case 3:l=n[i+1],d=n[i+2],(l&192)===128&&(d&192)===128&&(p=(o&15)<<12|(l&63)<<6|d&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:l=n[i+1],d=n[i+2],m=n[i+3],(l&192)===128&&(d&192)===128&&(m&192)===128&&(p=(o&15)<<18|(l&63)<<12|(d&63)<<6|m&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=f}return cr(r)}function cr(n){var t=n.length;if(t<=He)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=He));return e}function fr(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 lr(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 pr(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+=gr(n[o]);return i}function mr(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}function T(n,t,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function v(n,t,e,r,i,o){if(!C(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 we(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 ge(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 tt(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||tt(n,t,e,4,34028234663852886e22,-34028234663852886e22),st(n,t,e,r,23,4),e+4}function nt(n,t,e,r,i){return i||tt(n,t,e,8,17976931348623157e292,-17976931348623157e292),st(n,t,e,r,52,8),e+8}function yr(n){if(n=wr(n).replace(dr,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function wr(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function gr(n){return n<16?"0"+n.toString(16):n.toString(16)}function ye(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],s=0;s<r;++s){if(e=n.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function xr(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Ar(n,t){for(var e,r,i,o=[],s=0;s<n.length&&!((t-=2)<0);++s)e=n.charCodeAt(s),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function it(n){return Jt(yr(n))}function xe(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 Tr(n){return n!==n}function kr(n){return n!=null&&(!!n._isBuffer||ot(n)||vr(n))}function ot(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function vr(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&ot(n.slice(0,0))}function Ae(n,t,e,r,i){var o,s,f=i*8-r-1,l=(1<<f)-1,d=l>>1,m=-7,p=e?i-1:0,x=e?-1:1,A=n[t+p];for(p+=x,o=A&(1<<-m)-1,A>>=-m,m+=f;m>0;o=o*256+n[t+p],p+=x,m-=8);for(s=o&(1<<-m)-1,o>>=-m,m+=r;m>0;s=s*256+n[t+p],p+=x,m-=8);if(o===0)o=1-d;else{if(o===l)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-d}return(A?-1:1)*s*Math.pow(2,o-r)}function st(n,t,e,r,i,o){var s,f,l,d=o*8-i-1,m=(1<<d)-1,p=m>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:o-1,P=r?1:-1,le=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,s=m):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+p>=1?t+=x/l:t+=x*Math.pow(2,1-p),t*l>=2&&(s++,l/=2),s+p>=m?(f=0,s=m):s+p>=1?(f=(t*l-1)*Math.pow(2,i),s=s+p):(f=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;n[e+A]=f&255,A+=P,f/=256,i-=8);for(s=s<<i|f,d+=i;d>0;n[e+A]=s&255,A+=P,s/=256,d-=8);n[e+A-P]|=le*128}var R,E,jt,Pe,He,dr,at=Ce(()=>{"use strict";h();c();R=[],E=[],jt=typeof Uint8Array!="undefined"?Uint8Array:Array,Pe=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(n){return n.__proto__=a.prototype,n};a.from=function(n,t,e){return je(null,n,t,e)};a.kMaxLength=de();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(n,t,e){return Xt(null,n,t,e)};a.allocUnsafe=function(n){return Be(null,n)};a.allocUnsafeSlow=function(n){return Be(null,n)};a.isBuffer=kr;a.compare=function(t,e){if(!C(t)||!C(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,s=Math.min(r,i);o<s;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!C(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Qe;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)V(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)V(this,e,e+3),V(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)V(this,e,e+7),V(this,e+1,e+6),V(this,e+2,e+5),V(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?et(this,0,t):nr.apply(this,arguments)};a.prototype.equals=function(t){if(!C(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,r,i,o){if(!C(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=r)return 0;if(i>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var s=o-i,f=r-e,l=Math.min(s,f),d=this.slice(i,o),m=t.slice(e,r),p=0;p<l;++p)if(d[p]!==m[p]){s=d[p],f=m[p];break}return s<f?-1:f<s?1:0};a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};a.prototype.indexOf=function(t,e,r){return Ze(this,t,e,r,!0)};a.prototype.lastIndexOf=function(t,e,r){return Ze(this,t,e,r,!1)};a.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return ir(this,t,e,r);case"utf8":case"utf-8":return or(this,t,e,r);case"ascii":return Xe(this,t,e,r);case"latin1":case"binary":return sr(this,t,e,r);case"base64":return ar(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ur(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};He=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var o=e-t;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+t]}return i};a.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return i};a.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=e,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),Ae(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),Ae(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),Ae(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),Ae(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;v(this,t,e,r,o,0)}var s=1,f=0;for(this[e]=t&255;++f<r&&(s*=256);)this[e+f]=t/s&255;return e+r};a.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;v(this,t,e,r,o,0)}var s=r-1,f=1;for(this[e+s]=t&255;--s>=0&&(f*=256);)this[e+s]=t/f&255;return e+r};a.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):we(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):we(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):ge(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ge(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);v(this,t,e,r,o-1,-o)}var s=0,f=1,l=0;for(this[e]=t&255;++s<r&&(f*=256);)t<0&&l===0&&this[e+s-1]!==0&&(l=1),this[e+s]=(t/f>>0)-l&255;return e+r};a.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);v(this,t,e,r,o-1,-o)}var s=r-1,f=1,l=0;for(this[e+s]=t&255;--s>=0&&(f*=256);)t<0&&l===0&&this[e+s+1]!==0&&(l=1),this[e+s]=(t/f>>0)-l&255;return e+r};a.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):we(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):we(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):ge(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ge(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,r){return rt(this,t,e,!0,r)};a.prototype.writeFloatBE=function(t,e,r){return rt(this,t,e,!1,r)};a.prototype.writeDoubleLE=function(t,e,r){return nt(this,t,e,!0,r)};a.prototype.writeDoubleBE=function(t,e,r){return nt(this,t,e,!1,r)};a.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var o=i-r,s;if(this===t&&r<e&&e<i)for(s=o-1;s>=0;--s)t[s+e]=this[s+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};a.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<r;++s)this[s]=t;else{var f=C(t)?t:ye(new a(t,i).toString()),l=f.length;for(s=0;s<r-e;++s)this[s+e]=f[s%l]}return this};dr=/[^+\/0-9A-Za-z-_]/g});var c=Ce(()=>{"use strict";at()});var Vr={};Ue(Vr,{EndpointSnippetGenerator:()=>De});module.exports=Tt(Vr);h();c();h();c();h();c();function b(n){throw new Error("Unexpected value: "+JSON.stringify(n))}h();c();h();c();h();c();var ut,ht,ne=(ht=(ut=y.env.FERN_STACK_TRACK)==null?void 0:ut.toLowerCase())!=null?ht:"",L=ne!==""&&ne!=="0"&&ne!=="false",Me=["single","multiline","box"].includes(ne)?ne:"single";L&&(Error.stackTraceLimit=50);var br=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),Er=new Set(["stacktrace"]);function ke({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,formatFilename:f=l=>l}={}){var d;if(!L)return[];r=[...r,...br],e=[...e,...Er],i=[...i,"runInteractiveTask"];let l=!1;return((d=new Error().stack)!=null?d:"").split(`
|
|
2
|
-
`).map(
|
|
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}},
|
|
1
|
+
"use strict";var pe=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var gt=Object.prototype.hasOwnProperty;var xt=(n,t,e)=>t in n?pe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Le=(n,t)=>()=>(n&&(t=n(n=0)),t);var De=(n,t)=>{for(var e in t)pe(n,e,{get:t[e],enumerable:!0})},At=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wt(t))!gt.call(n,i)&&i!==e&&pe(n,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return n};var Tt=n=>At(pe({},"__esModule",{value:!0}),n);var u=(n,t,e)=>xt(n,typeof t!="symbol"?t+"":t,e);function Ye(){throw new Error("setTimeout has not been defined")}function qe(){throw new Error("clearTimeout has not been defined")}function We(n){if(W===setTimeout)return setTimeout(n,0);if((W===Ye||!W)&&setTimeout)return W=setTimeout,setTimeout(n,0);try{return W(n,0)}catch(t){try{return W.call(null,n,0)}catch(e){return W.call(this,n,0)}}}function kt(n){if(K===clearTimeout)return clearTimeout(n);if((K===qe||!K)&&clearTimeout)return K=clearTimeout,clearTimeout(n);try{return K(n)}catch(t){try{return K.call(null,n)}catch(e){return K.call(this,n)}}}function vt(){!te||!O||(te=!1,O.length?B=O.concat(B):de=-1,B.length&&Ke())}function Ke(){if(!te){var n=We(vt);te=!0;for(var t=B.length;t;){for(O=B,B=[];++de<t;)O&&O[de].run();de=-1,t=B.length}O=null,te=!1,kt(n)}}function bt(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];B.push(new Oe(n,t)),B.length===1&&!te&&We(Ke)}function Oe(n,t){this.fun=n,this.array=t}function V(){}function qt(n){throw new Error("process.binding is not supported")}function Wt(){return"/"}function Kt(n){throw new Error("process.chdir is not supported")}function Ot(){return 0}function zt(n){var t=Vt.call(ee)*.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 Gt(){var n=new Date,t=n-Ht;return t/1e3}var W,K,B,te,O,de,Et,It,St,Nt,Rt,Lt,Ct,Pt,Bt,Ft,_t,Mt,Ut,Dt,$t,Yt,ee,Vt,Ht,y,$e,c=Le(()=>{"use strict";W=Ye,K=qe;typeof globalThis.setTimeout=="function"&&(W=setTimeout);typeof globalThis.clearTimeout=="function"&&(K=clearTimeout);B=[],te=!1,de=-1;Oe.prototype.run=function(){this.fun.apply(null,this.array)};Et="browser",It="browser",St=!0,Nt={},Rt=[],Lt="",Ct={},Pt={},Bt={};Ft=V,_t=V,Mt=V,Ut=V,Dt=V,$t=V,Yt=V;ee=globalThis.performance||{},Vt=ee.now||ee.mozNow||ee.msNow||ee.oNow||ee.webkitNow||function(){return new Date().getTime()};Ht=new Date;y={nextTick:bt,title:Et,browser:St,env:Nt,argv:Rt,version:Lt,versions:Ct,on:Ft,addListener:_t,once:Mt,off:Ut,removeListener:Dt,removeAllListeners:$t,emit:Yt,binding:qt,cwd:Wt,chdir:Kt,umask:Ot,hrtime:zt,platform:It,release:Pt,config:Bt,uptime:Gt},$e={};Object.keys($e).forEach(n=>{let t=n.split("."),e=y;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=$e[n]:e=e[i]||(e[i]={})}})});function Ge(){Pe=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)R[t]=n[t],E[n.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Jt(n){Pe||Ge();var t,e,r,i,o,s,h=n.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[h-2]==="="?2:n[h-1]==="="?1:0,s=new jt(h*3/4-o),r=o>0?h-4:h;var f=0;for(t=0,e=0;t<r;t+=4,e+=3)i=E[n.charCodeAt(t)]<<18|E[n.charCodeAt(t+1)]<<12|E[n.charCodeAt(t+2)]<<6|E[n.charCodeAt(t+3)],s[f++]=i>>16&255,s[f++]=i>>8&255,s[f++]=i&255;return o===2?(i=E[n.charCodeAt(t)]<<2|E[n.charCodeAt(t+1)]>>4,s[f++]=i&255):o===1&&(i=E[n.charCodeAt(t)]<<10|E[n.charCodeAt(t+1)]<<4|E[n.charCodeAt(t+2)]>>2,s[f++]=i>>8&255,s[f++]=i&255),s}function Qt(n){return R[n>>18&63]+R[n>>12&63]+R[n>>6&63]+R[n&63]}function Zt(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(Qt(r));return i.join("")}function Ve(n){Pe||Ge();for(var t,e=n.length,r=e%3,i="",o=[],s=16383,h=0,f=e-r;h<f;h+=s)o.push(Zt(n,h,h+s>f?f:h+s));return r===1?(t=n[e-1],i+=R[t>>2],i+=R[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=R[t>>10],i+=R[t>>4&63],i+=R[t<<2&63],i+="="),o.push(i),o.join("")}function me(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function F(n,t){if(me()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=a.prototype):(n===null&&(n=new a(t)),n.length=t),n}function a(n,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Be(this,n)}return je(this,n,t,e)}function je(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?tr(n,t,e,r):typeof t=="string"?er(n,t,e):rr(n,t)}function Je(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 Xt(n,t,e,r){return Je(t),t<=0?F(n,t):e!==void 0?typeof r=="string"?F(n,t).fill(e,r):F(n,t).fill(e):F(n,t)}function Be(n,t){if(Je(t),n=F(n,t<0?0:Fe(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function er(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=Qe(t,e)|0;n=F(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function Ce(n,t){var e=t.length<0?0:Fe(t.length)|0;n=F(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function tr(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),a.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=a.prototype):n=Ce(n,t),n}function rr(n,t){if(L(t)){var e=Fe(t.length)|0;return n=F(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"||Tr(t.length)?F(n,0):Ce(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ce(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Fe(n){if(n>=me())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+me().toString(16)+" bytes");return n|0}function L(n){return!!(n!=null&&n._isBuffer)}function Qe(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 ye(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return it(n).length;default:if(r)return ye(n).length;t=(""+t).toLowerCase(),r=!0}}function nr(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 pr(this,t,e);case"utf8":case"utf-8":return et(this,t,e);case"ascii":return lr(this,t,e);case"latin1":case"binary":return fr(this,t,e);case"base64":return hr(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dr(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function z(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function Ze(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,r)),L(t))return t.length===0?-1:ze(n,t,e,r,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):ze(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function ze(n,t,e,r,i){var o=1,s=n.length,h=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;o=2,s/=2,h/=2,e/=2}function f(A,P){return o===1?A[P]:A.readUInt16BE(P*o)}var p;if(i){var d=-1;for(p=e;p<s;p++)if(f(n,p)===f(t,d===-1?0:p-d)){if(d===-1&&(d=p),p-d+1===h)return d*o}else d!==-1&&(p-=p-d),d=-1}else for(e+h>s&&(e=s-h),p=e;p>=0;p--){for(var m=!0,x=0;x<h;x++)if(f(n,p+x)!==f(t,x)){m=!1;break}if(m)return p}return-1}function ir(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var h=parseInt(t.substr(s*2,2),16);if(isNaN(h))return s;n[e+s]=h}return s}function or(n,t,e,r){return xe(ye(t,n.length-e),n,e,r)}function Xe(n,t,e,r){return xe(xr(t),n,e,r)}function sr(n,t,e,r){return Xe(n,t,e,r)}function ar(n,t,e,r){return xe(it(t),n,e,r)}function ur(n,t,e,r){return xe(Ar(t,n.length-e),n,e,r)}function hr(n,t,e){return t===0&&e===n.length?Ve(n):Ve(n.slice(t,e))}function et(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],s=null,h=o>239?4:o>223?3:o>191?2:1;if(i+h<=e){var f,p,d,m;switch(h){case 1:o<128&&(s=o);break;case 2:f=n[i+1],(f&192)===128&&(m=(o&31)<<6|f&63,m>127&&(s=m));break;case 3:f=n[i+1],p=n[i+2],(f&192)===128&&(p&192)===128&&(m=(o&15)<<12|(f&63)<<6|p&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:f=n[i+1],p=n[i+2],d=n[i+3],(f&192)===128&&(p&192)===128&&(d&192)===128&&(m=(o&15)<<18|(f&63)<<12|(p&63)<<6|d&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,h=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=h}return cr(r)}function cr(n){var t=n.length;if(t<=He)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=He));return e}function lr(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 fr(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 pr(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+=gr(n[o]);return i}function dr(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}function T(n,t,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function v(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 we(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 ge(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 tt(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||tt(n,t,e,4,34028234663852886e22,-34028234663852886e22),st(n,t,e,r,23,4),e+4}function nt(n,t,e,r,i){return i||tt(n,t,e,8,17976931348623157e292,-17976931348623157e292),st(n,t,e,r,52,8),e+8}function yr(n){if(n=wr(n).replace(mr,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function wr(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function gr(n){return n<16?"0"+n.toString(16):n.toString(16)}function ye(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],s=0;s<r;++s){if(e=n.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function xr(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Ar(n,t){for(var e,r,i,o=[],s=0;s<n.length&&!((t-=2)<0);++s)e=n.charCodeAt(s),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function it(n){return Jt(yr(n))}function xe(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 Tr(n){return n!==n}function kr(n){return n!=null&&(!!n._isBuffer||ot(n)||vr(n))}function ot(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function vr(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&ot(n.slice(0,0))}function Ae(n,t,e,r,i){var o,s,h=i*8-r-1,f=(1<<h)-1,p=f>>1,d=-7,m=e?i-1:0,x=e?-1:1,A=n[t+m];for(m+=x,o=A&(1<<-d)-1,A>>=-d,d+=h;d>0;o=o*256+n[t+m],m+=x,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=r;d>0;s=s*256+n[t+m],m+=x,d-=8);if(o===0)o=1-p;else{if(o===f)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-p}return(A?-1:1)*s*Math.pow(2,o-r)}function st(n,t,e,r,i,o){var s,h,f,p=o*8-i-1,d=(1<<p)-1,m=d>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:o-1,P=r?1:-1,fe=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(h=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+m>=1?t+=x/f:t+=x*Math.pow(2,1-m),t*f>=2&&(s++,f/=2),s+m>=d?(h=0,s=d):s+m>=1?(h=(t*f-1)*Math.pow(2,i),s=s+m):(h=t*Math.pow(2,m-1)*Math.pow(2,i),s=0));i>=8;n[e+A]=h&255,A+=P,h/=256,i-=8);for(s=s<<i|h,p+=i;p>0;n[e+A]=s&255,A+=P,s/=256,p-=8);n[e+A-P]|=fe*128}var R,E,jt,Pe,He,mr,at=Le(()=>{"use strict";c();l();R=[],E=[],jt=typeof Uint8Array!="undefined"?Uint8Array:Array,Pe=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(n){return n.__proto__=a.prototype,n};a.from=function(n,t,e){return je(null,n,t,e)};a.kMaxLength=me();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(n,t,e){return Xt(null,n,t,e)};a.allocUnsafe=function(n){return Be(null,n)};a.allocUnsafeSlow=function(n){return Be(null,n)};a.isBuffer=kr;a.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,s=Math.min(r,i);o<s;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!L(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Qe;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)z(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)z(this,e,e+3),z(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)z(this,e,e+7),z(this,e+1,e+6),z(this,e+2,e+5),z(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?et(this,0,t):nr.apply(this,arguments)};a.prototype.equals=function(t){if(!L(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,r,i,o){if(!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 s=o-i,h=r-e,f=Math.min(s,h),p=this.slice(i,o),d=t.slice(e,r),m=0;m<f;++m)if(p[m]!==d[m]){s=p[m],h=d[m];break}return s<h?-1:h<s?1:0};a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};a.prototype.indexOf=function(t,e,r){return Ze(this,t,e,r,!0)};a.prototype.lastIndexOf=function(t,e,r){return Ze(this,t,e,r,!1)};a.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return ir(this,t,e,r);case"utf8":case"utf-8":return or(this,t,e,r);case"ascii":return Xe(this,t,e,r);case"latin1":case"binary":return sr(this,t,e,r);case"base64":return ar(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ur(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};He=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var o=e-t;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+t]}return i};a.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return i};a.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=e,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),Ae(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),Ae(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),Ae(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),Ae(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;v(this,t,e,r,o,0)}var s=1,h=0;for(this[e]=t&255;++h<r&&(s*=256);)this[e+h]=t/s&255;return e+r};a.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;v(this,t,e,r,o,0)}var s=r-1,h=1;for(this[e+s]=t&255;--s>=0&&(h*=256);)this[e+s]=t/h&255;return e+r};a.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):we(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):we(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):ge(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ge(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);v(this,t,e,r,o-1,-o)}var s=0,h=1,f=0;for(this[e]=t&255;++s<r&&(h*=256);)t<0&&f===0&&this[e+s-1]!==0&&(f=1),this[e+s]=(t/h>>0)-f&255;return e+r};a.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);v(this,t,e,r,o-1,-o)}var s=r-1,h=1,f=0;for(this[e+s]=t&255;--s>=0&&(h*=256);)t<0&&f===0&&this[e+s+1]!==0&&(f=1),this[e+s]=(t/h>>0)-f&255;return e+r};a.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):we(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):we(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):ge(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||v(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ge(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,r){return rt(this,t,e,!0,r)};a.prototype.writeFloatBE=function(t,e,r){return rt(this,t,e,!1,r)};a.prototype.writeDoubleLE=function(t,e,r){return nt(this,t,e,!0,r)};a.prototype.writeDoubleBE=function(t,e,r){return nt(this,t,e,!1,r)};a.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var o=i-r,s;if(this===t&&r<e&&e<i)for(s=o-1;s>=0;--s)t[s+e]=this[s+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};a.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<r;++s)this[s]=t;else{var h=L(t)?t:ye(new a(t,i).toString()),f=h.length;for(s=0;s<r-e;++s)this[s+e]=h[s%f]}return this};mr=/[^+\/0-9A-Za-z-_]/g});var l=Le(()=>{"use strict";at()});var Gr={};De(Gr,{EndpointSnippetGenerator:()=>Ue});module.exports=Tt(Gr);c();l();c();l();c();l();function b(n){throw new Error("Unexpected value: "+JSON.stringify(n))}c();l();c();l();c();l();var ut,ht,ne=(ht=(ut=y.env.FERN_STACK_TRACK)==null?void 0:ut.toLowerCase())!=null?ht:"",C=ne!==""&&ne!=="0"&&ne!=="false",_e=["single","multiline","box"].includes(ne)?ne:"single";C&&(Error.stackTraceLimit=50);var br=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),Er=new Set(["stacktrace"]);function ke({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,formatFilename:h=f=>f}={}){var p;if(!C)return[];r=[...r,...br],e=[...e,...Er],i=[...i,"runInteractiveTask"];let f=!1;return((p=new Error().stack)!=null?p:"").split(`
|
|
2
|
+
`).map(d=>{let m=d.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(m&&m.length===5){let[,x,A,P,fe]=m;if(!x||!A||!P||!fe)return;if(f||i.some(mt=>x==null?void 0:x.includes(mt))){f=!0;return}switch(x){case"Object.<anonymous>":x="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":x=`${x.substring(x.indexOf(".")+1)}()=> { ... }`;break}return{fn:x,path:h(A),position:`${P}:${fe}`}}}).filter(d=>{var m,x;return d&&!r.some(A=>d.fn.includes(A))&&!(o&&((m=d.path)!=null&&m.startsWith("node:")))&&!(s&&((x=d.path)!=null&&x.endsWith(".js")))&&!e.some(A=>d.path.includes(A))}).slice(t,t+n)}var Te=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:r=[],filterFunctions:i=[],stopOn:o=[],filterNode:s=!0,filterJs:h=!0,multiline:f=!1,formatFilename:p=d=>d}={}){u(this,"maxFrames");u(this,"skip");u(this,"filterPaths");u(this,"filterFunctions");u(this,"stopOn");u(this,"filterNode");u(this,"filterJs");u(this,"multiline");u(this,"formatFilename");u(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=r,this.filterFunctions=i,this.stopOn=o,this.filterNode=s,this.filterJs=h,this.multiline=f,this.formatFilename=p}tag(t){let e=this.tracking.get(t)||new Set;ke({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(!C)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}},_;function ct({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,multiline:h=!1,formatFilename:f=p=>p}={}){C&&(_!=null||(_=new Te({maxFrames:n,skip:t,filterPaths:e,filterFunctions:r,stopOn:i,filterNode:o,filterJs:s,multiline:h,formatFilename:f})))}function lt(n){_==null||_.tag(n)}function Me(n){var t;return(t=_==null?void 0:_.frames(n))!=null?t:[]}var H=class{constructor(){lt(this)}};c();l();var ve=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},ie=class extends ve{async format(t){return t}formatSync(t){return t}};c();l();c();l();c();l();var S=class extends H{constructor(e){super();u(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 Ir=4;ct({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var oe=class{constructor(){u(this,"lineBuffer",[]);u(this,"indentLevel",0);u(this,"hasWrittenAnything",!1);u(this,"lastCharacterIsSemicolon",!1);u(this,"lastCharacterIsNewline",!1);u(this,"nodeStackFrames",[])}get buffer(){return C&&this.nodeStackFrames.length>0&&this.writeInternal(`
|
|
4
4
|
`),this.lineBuffer.join(`
|
|
5
5
|
`)+(this.lastCharacterIsNewline?`
|
|
6
6
|
`:"")}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let r=e.length>0&&e.endsWith(`
|
|
7
7
|
`),i=r?e.substring(0,e.length-1):e,o=this.getIndentString(),s=i.replaceAll(`
|
|
8
8
|
`,`
|
|
9
9
|
${o}`);this.isAtStartOfLine()&&(s=o+s),r&&(s+=`
|
|
10
|
-
`),this.writeInternal(s)}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){
|
|
10
|
+
`),this.writeInternal(s)}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){C&&this.nodeStackFrames.push(...Me(t)),t.write(this),C&&_e!=="single"&&this.writeInternal(`
|
|
11
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 S(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new S(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new S(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new S(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new S(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(`
|
|
12
12
|
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
13
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 s=t[o];s!=null&&r(s)}}}toString(){return this.buffer}writeInternal(t){if(t.length===0)return;let e=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
14
14
|
`),this.lastCharacterIsSemicolon=t.endsWith(";");let r=t.split(`
|
|
15
|
-
`),i=
|
|
15
|
+
`),i=C&&!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(ke({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,_e){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 Ir}};c();l();c();l();var be={Critical:"CRITICAL",Warning:"WARNING"};c();l();c();l();c();l();var Sr=2,I=class extends oe{constructor({customConfig:e,formatter:r}){super();u(this,"customConfig");u(this,"formatter");u(this,"requires",new Set);u(this,"_indentLevel",0);this.customConfig=e,this.formatter=r!=null?r:new ie}addRequire(e){this.requires.add(e)}get currentIndentLevel(){return this._indentLevel}indent(){this._indentLevel++,super.indent()}dedent(){this._indentLevel--,super.dedent()}getTabSize(){return Sr}};var re=class extends I{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
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
17
|
${t}`)}return t}getContent(){let t=this.stringifyRequires();return t.length>0?`${t}
|
|
18
18
|
|
|
19
19
|
${this.buffer}`:this.buffer}stringifyRequires(){return Array.from(this.requires).map(t=>`require "${t}"`).join(`
|
|
20
|
-
`)}};var
|
|
21
|
-
`).forEach(r=>{e.writeLine(`# ${r}`)})}};h();c();h();c();h();c();var _=class extends w{constructor({name:e,modules:r,fullyQualified:i}){super();u(this,"name");u(this,"modules");u(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 D=class n extends w{constructor(e){super();u(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 s=this.internalType.elems[0];s!=null&&s.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 U={Instance:"instance",Class_:"class"},lt={Public:"public",Private:"private",Protected:"protected"},$=class extends w{constructor({name:e,docstring:r,kind:i,visibility:o,parameters:s,returnType:f,statements:l,splatOptionDocs:d}){var m,p;super();u(this,"name");u(this,"docstring");u(this,"kind");u(this,"positionalParameters");u(this,"keywordParameters");u(this,"positionalSplatParameter");u(this,"keywordSplatParameter");u(this,"yieldParameter");u(this,"visibility");u(this,"statements");u(this,"returnType");u(this,"splatOptionDocs");this.name=e,this.docstring=r,this.kind=i!=null?i:U.Instance,this.visibility=o!=null?o:lt.Public,this.positionalParameters=(m=s==null?void 0:s.positional)!=null?m:[],this.keywordParameters=(p=s==null?void 0:s.keyword)!=null?p:[],this.positionalSplatParameter=s==null?void 0:s.positionalSplat,this.keywordSplatParameter=s==null?void 0:s.keywordSplat,this.yieldParameter=s==null?void 0:s.yield,this.returnType=f!=null?f:D.untyped(),this.statements=l!=null?l:[],this.splatOptionDocs=d!=null?d:[]}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 I({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 I({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 I({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 I({customConfig:e.customConfig});this.returnType.writeTypeDefinition(i),e.write(this.normalizeForYard(i.toString())),e.write("]"),e.newLine()}switch(this.visibility!==lt.Public&&(e.write(this.visibility),this.kind===U.Class_&&e.write("_class_method"),e.write(" ")),this.kind){case U.Instance:e.write(`def ${this.name}`);break;case U.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:[])}};h();c();var Y=class n extends w{constructor({name:e,namespace:r,typeParameters:i,docstring:o,statements:s}){super();u(this,"name");u(this,"namespace");u(this,"typeParameters");u(this,"docstring");u(this,"statements");this.name=e,this.namespace=r!=null?r:new Set,this.typeParameters=i!=null?i:[],this.docstring=o,this.statements=s!=null?s:[],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 W).forEach(e=>{e.namespace=new Set([...this.namespace,this]),e.populateChildNamespaces()})}get fullyQualifiedNamespace(){return[...this.namespace,this].map(e=>e.name).join("::")}};var W=class extends Y{constructor({name:e,superclass:r,typeParameters:i,docstring:o,statements:s}){super({name:e,docstring:o,typeParameters:i});u(this,"superclass");u(this,"statements");u(this,"methods",[]);this.superclass=r,this.statements=s!=null?s:[]}addStatement(e){this.statements.push(e)}addStatements(e){this.statements.push(...e)}addInstanceMethod(e,r,i){let o=new $({name:e,kind:U.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")}};h();c();var G=class extends w{constructor({classReference:e,arguments_:r}){super();u(this,"classReference");u(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(")")}};h();c();var j=class extends w{constructor(e){super();u(this,"arg");this.arg=e}write(e){return new S(this.arg).write(e)}};h();c();var J=class extends w{constructor({name:e,value:r}){super();u(this,"name");u(this,"value");this.name=e,this.value=r}write(e){e.write(`${this.name}: `),this.value.write(e)}};h();c();h();c();var k=class extends w{constructor({name:e,type:r,optional:i,docs:o}){super();u(this,"name");u(this,"type");u(this,"optional");u(this,"docs");this.name=e,this.type=r!=null?r:D.untyped(),this.optional=i!=null?i:!1,this.docs=o}};var Q=class extends k{constructor({name:e,type:r,initializer:i,optional:o}){super({name:e,type:r,optional:o});u(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)}};h();c();var se=class extends k{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`**${this.name}`)}writeTypeDefinition(e){e.write("**"),this.type.writeTypeDefinition(e)}};h();c();var Z=class extends w{constructor({on:e,method:r,arguments_:i,keywordArguments:o,block:s}){super();u(this,"on");u(this,"method");u(this,"arguments_");u(this,"keywordArguments");u(this,"block");this.on=e,this.method=r,this.arguments_=i,this.keywordArguments=o,this.block=s}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()),pt(e,i)}),e.newLine(),e.dedent()):r.forEach((i,o)=>{o>0&&e.write(", "),pt(e,i)}),e.write(")"),this.block){let[i,o]=this.block;e.write(" do"),i.length>0&&(e.write(" |"),i.forEach((s,f)=>{f>0&&e.write(", "),e.write(s)}),e.write("|")),e.newLine(),e.indent();for(let s of o)s.write(e),e.writeNewLineIfLastLineNot();e.dedent(),e.write("end")}}};function pt(n,t){switch(t.kind){case"positional":t.node.write(n);break;case"keyword":t.arg.write(n);break;default:b(t)}}h();c();var ae=class extends w{constructor({value:e}){super();u(this,"value");this.value=e}write(e){this.value.write(e)}};h();c();var ue=class extends k{constructor({name:e,type:r,optional:i,initializer:o}){super({name:e,type:r,optional:i});u(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)}};h();c();var he=class extends k{write(t){t.write(`*${this.name}`)}writeTypeDefinition(t){t.write("*"),this.type.writeTypeDefinition(t)}};h();c();var ce=class n extends w{constructor(e){super();u(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 s=!1;if(i.key instanceof n&&i.key.internalType.type==="str"){let
|
|
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)}}};h();c();var Ee;(function(n){n[n.Invariant=0]="Invariant",n.Covariant="out",n.Contravariant="in"})(Ee||(Ee={}));var X=class extends w{constructor({name:e,unchecked:r,bound:i,variance:o,defaultType:s}){super();u(this,"name");u(this,"unchecked");u(this,"bound");u(this,"variance");u(this,"defaultType");this.name=e,this.unchecked=r!=null?r:!1,this.bound=i,this.variance=o!=null?o:Ee.Invariant,this.defaultType=s}write(e){}writeTypeDefinition(e){this.unchecked&&e.write("unchecked "),this.variance!=Ee.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))}};h();c();var fe=class extends k{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`&${this.name}`)}};h();c();var Ie=class extends w{constructor({body:e,rescues:r}){super();u(this,"body");u(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")}};h();c();var Se=class extends w{constructor({if:e,elseIf:r,elseBody:i}){super();u(this,"ifBranch");u(this,"elseIfs");u(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()}};h();c();var Ne=class extends w{constructor({errorClass:e,message:r}){super();u(this,"errorClass");u(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 Re(n){return new j(n)}function Nr(){return Re("true")}function Rr(){return Re("false")}function Cr(){return Re("nil")}var Lr={positional(n){return new ue(n)},keyword(n){return new Q(n)},positionalSplat(n){return new he(n)},keywordSplat(n){return new se(n)},yield(n){return new fe(n)}};function Pr(n){return new W(n)}function Br(n){return new Y(n)}function Fr(n){return new $(n)}function Mr(n){return new N(n)}function _r(n){return new X(n)}function Dr(n){return new _(n)}function Ur(n){return new G(n)}function $r(n){return new J(n)}function Yr(n){return new Z(n)}function Wr(n){return new ae(n)}function qr(n){return new Se(n)}function Or(n){return new Ie(n)}function Kr(n){return new Ne(n)}function zr(n,t){let e=n;for(let r of t.toReversed())r.addStatement(e),e=r;return e}var mt="client",De=class{constructor({context:t,formatter:e}){u(this,"context");u(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})}async generateSnippetAst({endpoint:t,request:e,options:r}){return this.buildCodeBlock({endpoint:t,snippet:e})}buildCodeBlock({endpoint:t,snippet:e}){return g.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 g.codeblock(r=>{r.addRequire(this.context.getRootModuleName().toLowerCase());let i=this.context.getRootClientClassReference(),o=this.getRootClientBuilderArgs({endpoint:t,snippet:e});r.write(`${mt} = `),r.writeNode(g.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[g.keywordArgument({name:"base_url",value:g.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`}),[]):[g.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[];default:b(t)}}addError(t){this.context.errors.add({severity:be.Critical,message:t})}addWarning(t){this.context.errors.add({severity:be.Warning,message:t})}getRootClientBasicAuthArgs({auth:t,values:e}){return[g.keywordArgument({name:t.username.snakeCase.safeName,value:g.TypeLiteral.string(e.username)}),g.keywordArgument({name:t.password.snakeCase.safeName,value:g.TypeLiteral.string(e.password)})]}getRootClientBearerAuthArgs({auth:t,values:e}){return[g.keywordArgument({name:t.token.snakeCase.safeName,value:g.TypeLiteral.string(e.token)})]}getRootClientHeaderAuthArgs({auth:t,values:e}){return[g.keywordArgument({name:t.header.name.name.snakeCase.safeName,value:g.TypeLiteral.string(e.value)})]}getRootClientOAuthArgs({auth:t,values:e}){return[g.keywordArgument({name:t.clientId.snakeCase.safeName,value:g.TypeLiteral.string(e.clientId)}),g.keywordArgument({name:t.clientSecret.snakeCase.safeName,value:g.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(g.keywordArgument({name:i.name.name.snakeCase.safeName,value:g.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:g.codeblock(mt),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 g.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 s of o){let f=this.context.dynamicTypeLiteralMapper.convert(s);g.TypeLiteral.isNop(f)||i.push(g.keywordArgument({name:this.context.getPropertyName(s.name.name),value:f}))}}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 s of i){let f=this.context.dynamicTypeLiteralMapper.convert(s);g.TypeLiteral.isNop(f)||r.push(g.keywordArgument({name:this.context.getPropertyName(s.name.name),value:f}))}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 s of o)r.push(g.positionalArgument({value:this.context.dynamicTypeLiteralMapper.convert(s)}))}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(g.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)}};0&&(module.exports={EndpointSnippetGenerator});
|
|
20
|
+
`)}};var w={};De(w,{AstNode:()=>g,ClassInstantiation:()=>G,ClassReference:()=>M,Class_:()=>q,CodeBlock:()=>j,KeywordArgument:()=>J,KeywordParameter:()=>Q,Method:()=>$,MethodInvocation:()=>Z,MethodKind:()=>D,Module_:()=>Y,Parameter:()=>k,Type:()=>U,TypeLiteral:()=>ce,TypeParameter:()=>X,Writer:()=>I,begin:()=>Vr,classReference:()=>$r,class_:()=>Fr,codeblock:()=>Re,comment:()=>Ur,falseValue:()=>Cr,ifElse:()=>Or,instantiateClass:()=>Yr,invokeMethod:()=>Wr,keywordArgument:()=>qr,method:()=>Mr,module:()=>_r,nilValue:()=>Pr,parameters:()=>Br,positionalArgument:()=>Kr,raise:()=>zr,trueValue:()=>Lr,typeParameter:()=>Dr,wrapInModules:()=>Hr});c();l();c();l();c();l();c();l();c();l();var g=class extends H{async toStringAsync({customConfig:t,formatter:e}={}){let r=new re({customConfig:t!=null?t:{},formatter:e});return this.write(r),r.toStringAsync()}toString({customConfig:t,formatter:e}={}){let r=new re({customConfig:t!=null?t:{},formatter:e});return this.write(r),r.toString()}typeDefinitionToString({customConfig:t,formatter:e}={}){let r=new re({customConfig:t!=null?t:{},formatter:e});return this.writeTypeDefinition(r),r.toString()}writeTypeDefinition(t){}};var Nr=120,Rr=2,N=class extends g{constructor({docs:e}){super();u(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
21
|
+
`).forEach(r=>{this.wrapLine(r,e).forEach(o=>{e.writeLine(`# ${o}`)})})}wrapLine(e,r){let i=r.currentIndentLevel*2,o=Nr-i-Rr;if(e.length<=o)return[e];if(o<20)return[e];let s=e.split(/(\s+)/),h=[],f="";for(let p of s){if(p===""||f===""&&/^\s+$/.test(p))continue;let d=f+p;d.length<=o?f=d:(f.trim()!==""&&h.push(f.trimEnd()),f=p.trimStart(),f.length>o&&(h.push(f),f=""))}return f.trim()!==""&&h.push(f.trimEnd()),h.length===0?[e]:h}};c();l();c();l();c();l();var M=class extends g{constructor({name:e,modules:r,fullyQualified:i}){super();u(this,"name");u(this,"modules");u(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 U=class n extends g{constructor(e){super();u(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 s=this.internalType.elems[0];s!=null&&s.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 M({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 D={Instance:"instance",Class_:"class"},ft={Public:"public",Private:"private",Protected:"protected"},$=class extends g{constructor({name:e,docstring:r,kind:i,visibility:o,parameters:s,returnType:h,statements:f,splatOptionDocs:p}){var d,m;super();u(this,"name");u(this,"docstring");u(this,"kind");u(this,"positionalParameters");u(this,"keywordParameters");u(this,"positionalSplatParameter");u(this,"keywordSplatParameter");u(this,"yieldParameter");u(this,"visibility");u(this,"statements");u(this,"returnType");u(this,"splatOptionDocs");this.name=e,this.docstring=r,this.kind=i!=null?i:D.Instance,this.visibility=o!=null?o:ft.Public,this.positionalParameters=(d=s==null?void 0:s.positional)!=null?d:[],this.keywordParameters=(m=s==null?void 0:s.keyword)!=null?m:[],this.positionalSplatParameter=s==null?void 0:s.positionalSplat,this.keywordSplatParameter=s==null?void 0:s.keywordSplat,this.yieldParameter=s==null?void 0:s.yield,this.returnType=h!=null?h:U.untyped(),this.statements=f!=null?f:[],this.splatOptionDocs=p!=null?p:[]}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 I({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 I({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 I({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 I({customConfig:e.customConfig});this.returnType.writeTypeDefinition(i),e.write(this.normalizeForYard(i.toString())),e.write("]"),e.newLine()}switch(this.visibility!==ft.Public&&(e.write(this.visibility),this.kind===D.Class_&&e.write("_class_method"),e.write(" ")),this.kind){case D.Instance:e.write(`def ${this.name}`);break;case D.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:[])}};c();l();var Y=class n extends g{constructor({name:e,namespace:r,typeParameters:i,docstring:o,statements:s}){super();u(this,"name");u(this,"namespace");u(this,"typeParameters");u(this,"docstring");u(this,"statements");this.name=e,this.namespace=r!=null?r:new Set,this.typeParameters=i!=null?i:[],this.docstring=o,this.statements=s!=null?s:[],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 q).forEach(e=>{e.namespace=new Set([...this.namespace,this]),e.populateChildNamespaces()})}get fullyQualifiedNamespace(){return[...this.namespace,this].map(e=>e.name).join("::")}};var q=class extends Y{constructor({name:e,superclass:r,typeParameters:i,docstring:o,statements:s}){super({name:e,docstring:o,typeParameters:i});u(this,"superclass");u(this,"statements");u(this,"methods",[]);this.superclass=r,this.statements=s!=null?s:[]}addStatement(e){this.statements.push(e)}addStatements(e){this.statements.push(...e)}addInstanceMethod(e,r,i){let o=new $({name:e,kind:D.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")}};c();l();var G=class extends g{constructor({classReference:e,arguments_:r}){super();u(this,"classReference");u(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(")")}};c();l();var j=class extends g{constructor(e){super();u(this,"arg");this.arg=e}write(e){return new S(this.arg).write(e)}};c();l();var J=class extends g{constructor({name:e,value:r}){super();u(this,"name");u(this,"value");this.name=e,this.value=r}write(e){e.write(`${this.name}: `),this.value.write(e)}};c();l();c();l();var k=class extends g{constructor({name:e,type:r,optional:i,docs:o}){super();u(this,"name");u(this,"type");u(this,"optional");u(this,"docs");this.name=e,this.type=r!=null?r:U.untyped(),this.optional=i!=null?i:!1,this.docs=o}};var Q=class extends k{constructor({name:e,type:r,initializer:i,optional:o}){super({name:e,type:r,optional:o});u(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)}};c();l();var se=class extends k{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`**${this.name}`)}writeTypeDefinition(e){e.write("**"),this.type.writeTypeDefinition(e)}};c();l();var Z=class extends g{constructor({on:e,method:r,arguments_:i,keywordArguments:o,block:s}){super();u(this,"on");u(this,"method");u(this,"arguments_");u(this,"keywordArguments");u(this,"block");this.on=e,this.method=r,this.arguments_=i,this.keywordArguments=o,this.block=s}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()),pt(e,i)}),e.newLine(),e.dedent()):r.forEach((i,o)=>{o>0&&e.write(", "),pt(e,i)}),e.write(")"),this.block){let[i,o]=this.block;e.write(" do"),i.length>0&&(e.write(" |"),i.forEach((s,h)=>{h>0&&e.write(", "),e.write(s)}),e.write("|")),e.newLine(),e.indent();for(let s of o)s.write(e),e.writeNewLineIfLastLineNot();e.dedent(),e.write("end")}}};function pt(n,t){switch(t.kind){case"positional":t.node.write(n);break;case"keyword":t.arg.write(n);break;default:b(t)}}c();l();var ae=class extends g{constructor({value:e}){super();u(this,"value");this.value=e}write(e){this.value.write(e)}};c();l();var ue=class extends k{constructor({name:e,type:r,optional:i,initializer:o}){super({name:e,type:r,optional:i});u(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)}};c();l();var he=class extends k{write(t){t.write(`*${this.name}`)}writeTypeDefinition(t){t.write("*"),this.type.writeTypeDefinition(t)}};c();l();var ce=class n extends g{constructor(e){super();u(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 s=!1;if(i.key instanceof n&&i.key.internalType.type==="str"){let h=i.key.internalType.value;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(h)&&(e.write(`${h}:`),s=!0)}s||(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)}}};c();l();var Ee;(function(n){n[n.Invariant=0]="Invariant",n.Covariant="out",n.Contravariant="in"})(Ee||(Ee={}));var X=class extends g{constructor({name:e,unchecked:r,bound:i,variance:o,defaultType:s}){super();u(this,"name");u(this,"unchecked");u(this,"bound");u(this,"variance");u(this,"defaultType");this.name=e,this.unchecked=r!=null?r:!1,this.bound=i,this.variance=o!=null?o:Ee.Invariant,this.defaultType=s}write(e){}writeTypeDefinition(e){this.unchecked&&e.write("unchecked "),this.variance!=Ee.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))}};c();l();var le=class extends k{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`&${this.name}`)}};c();l();var Ie=class extends g{constructor({body:e,rescues:r}){super();u(this,"body");u(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")}};c();l();var Se=class extends g{constructor({if:e,elseIf:r,elseBody:i}){super();u(this,"ifBranch");u(this,"elseIfs");u(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()}};c();l();var Ne=class extends g{constructor({errorClass:e,message:r}){super();u(this,"errorClass");u(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 Re(n){return new j(n)}function Lr(){return Re("true")}function Cr(){return Re("false")}function Pr(){return Re("nil")}var Br={positional(n){return new ue(n)},keyword(n){return new Q(n)},positionalSplat(n){return new he(n)},keywordSplat(n){return new se(n)},yield(n){return new le(n)}};function Fr(n){return new q(n)}function _r(n){return new Y(n)}function Mr(n){return new $(n)}function Ur(n){return new N(n)}function Dr(n){return new X(n)}function $r(n){return new M(n)}function Yr(n){return new G(n)}function qr(n){return new J(n)}function Wr(n){return new Z(n)}function Kr(n){return new ae(n)}function Or(n){return new Se(n)}function Vr(n){return new Ie(n)}function zr(n){return new Ne(n)}function Hr(n,t){let e=n;for(let r of t.toReversed())r.addStatement(e),e=r;return e}var dt="client",Ue=class{constructor({context:t,formatter:e}){u(this,"context");u(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})}async generateSnippetAst({endpoint:t,request:e,options:r}){return this.buildCodeBlock({endpoint:t,snippet:e})}buildCodeBlock({endpoint:t,snippet:e}){return w.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 w.codeblock(r=>{r.addRequire(this.context.getRootModuleName().toLowerCase());let i=this.context.getRootClientClassReference(),o=this.getRootClientBuilderArgs({endpoint:t,snippet:e});r.write(`${dt} = `),r.writeNode(w.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[w.keywordArgument({name:"base_url",value:w.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`}),[]):[w.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[];default:b(t)}}addError(t){this.context.errors.add({severity:be.Critical,message:t})}addWarning(t){this.context.errors.add({severity:be.Warning,message:t})}getRootClientBasicAuthArgs({auth:t,values:e}){return[w.keywordArgument({name:t.username.snakeCase.safeName,value:w.TypeLiteral.string(e.username)}),w.keywordArgument({name:t.password.snakeCase.safeName,value:w.TypeLiteral.string(e.password)})]}getRootClientBearerAuthArgs({auth:t,values:e}){return[w.keywordArgument({name:t.token.snakeCase.safeName,value:w.TypeLiteral.string(e.token)})]}getRootClientHeaderAuthArgs({auth:t,values:e}){return[w.keywordArgument({name:t.header.name.name.snakeCase.safeName,value:w.TypeLiteral.string(e.value)})]}getRootClientOAuthArgs({auth:t,values:e}){return[w.keywordArgument({name:t.clientId.snakeCase.safeName,value:w.TypeLiteral.string(e.clientId)}),w.keywordArgument({name:t.clientSecret.snakeCase.safeName,value:w.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(w.keywordArgument({name:i.name.name.snakeCase.safeName,value:w.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}){var o;let r={on:w.codeblock(dt),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.keywordArguments=this.getMethodArgsForBodyRequest({request:t.request,snippet:e});break;default:b(t.request)}let i=this.getRequestOptions({endpoint:t,snippet:e});return i!=null&&(r.keywordArguments=(o=r.keywordArguments)!=null?o:[],r.keywordArguments.push(i)),w.invokeMethod(r)}getRequestOptions({endpoint:t,snippet:e}){var f;let r=(f=e.headers)!=null?f:{},i=Object.entries(r);if(i.length===0)return;let o=new Set;if(this.context.ir.headers!=null)for(let p of this.context.ir.headers)o.add(p.name.wireValue.toLowerCase());if(t.request.type==="inlined"&&t.request.headers!=null)for(let p of t.request.headers)o.add(p.name.wireValue.toLowerCase());let s=i.filter(([p])=>!o.has(p.toLowerCase()));if(s.length===0)return;let h=s.map(([p,d])=>({key:w.TypeLiteral.string(p),value:w.TypeLiteral.string(String(d))}));return w.keywordArgument({name:"request_options",value:w.TypeLiteral.hash([{key:w.TypeLiteral.string("additional_headers"),value:w.TypeLiteral.hash(h)}])})}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 s of o){let h=this.context.dynamicTypeLiteralMapper.convert(s);w.TypeLiteral.isNop(h)||i.push(w.keywordArgument({name:this.context.getPropertyName(s.name.name),value:h}))}}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 s of i){let h=this.context.dynamicTypeLiteralMapper.convert(s);w.TypeLiteral.isNop(h)||r.push(w.keywordArgument({name:this.context.getPropertyName(s.name.name),value:h}))}return r}getMethodArgsForBodyRequest({request:t,snippet:e}){let r=[];if(r.push(...this.getNamedParameterArgs({kind:"PathParameters",namedParameters:t.pathParameters,values:e.pathParameters})),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":{let i=this.context.getRecord(e.requestBody);if(i!=null){let o=t.body.value;if(o.type==="named"){let s=this.context.resolveNamedType({typeId:o.value});if(s!=null){let h=this.getBodyFieldsAsKeywordArgs({namedType:s,bodyRecord:i});r.push(...h)}}}break}default:b(t.body)}return r}getBodyFieldsAsKeywordArgs({namedType:t,bodyRecord:e}){let r=[];switch(t.type){case"object":{for(let i of t.properties){let o=i.name.wireValue,s=e[o];if(s!==void 0){this.context.errors.scope(o);let h=this.context.dynamicTypeLiteralMapper.convert({typeReference:i.typeReference,value:s});this.context.errors.unscope(),w.TypeLiteral.isNop(h)||r.push(w.keywordArgument({name:this.context.getPropertyName(i.name.name),value:h}))}}break}case"alias":case"discriminatedUnion":case"undiscriminatedUnion":case"enum":break;default:b(t)}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)}};0&&(module.exports={EndpointSnippetGenerator});
|
|
24
24
|
/*! Bundled license information:
|
|
25
25
|
|
|
26
26
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|