@fern-api/python-dynamic-snippets 4.43.0 → 4.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +37 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +166 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/package.json +9 -10
- package/cjs/DynamicSnippetsGenerator.cjs +0 -42
- package/cjs/DynamicSnippetsGenerator.cjs.map +0 -1
- package/cjs/DynamicSnippetsGenerator.d.cts +0 -25
- package/cjs/DynamicSnippetsGeneratorContext-4_I0JAlU.d.cts +0 -87
- package/cjs/EndpointSnippetGenerator.cjs +0 -31
- package/cjs/EndpointSnippetGenerator.cjs.map +0 -1
- package/cjs/EndpointSnippetGenerator.d.cts +0 -68
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +0 -42
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +0 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +0 -5
- package/cjs/context/DynamicTypeLiteralMapper.cjs +0 -31
- package/cjs/context/DynamicTypeLiteralMapper.cjs.map +0 -1
- package/cjs/context/DynamicTypeLiteralMapper.d.cts +0 -5
- package/cjs/context/FilePropertyMapper.cjs +0 -31
- package/cjs/context/FilePropertyMapper.cjs.map +0 -1
- package/cjs/context/FilePropertyMapper.d.cts +0 -5
- package/cjs/index.cjs +0 -42
- package/cjs/index.cjs.map +0 -1
- package/cjs/index.d.cts +0 -7
- package/esm/DynamicSnippetsGenerator.d.ts +0 -25
- package/esm/DynamicSnippetsGenerator.js +0 -2
- package/esm/DynamicSnippetsGenerator.js.map +0 -1
- package/esm/DynamicSnippetsGeneratorContext-4_I0JAlU.d.ts +0 -87
- package/esm/EndpointSnippetGenerator.d.ts +0 -68
- package/esm/EndpointSnippetGenerator.js +0 -2
- package/esm/EndpointSnippetGenerator.js.map +0 -1
- package/esm/chunk-2KHLQG2A.js +0 -2
- package/esm/chunk-2KHLQG2A.js.map +0 -1
- package/esm/chunk-2SPAKVUZ.js +0 -2
- package/esm/chunk-2SPAKVUZ.js.map +0 -1
- package/esm/chunk-3XEFLXHY.js +0 -2
- package/esm/chunk-3XEFLXHY.js.map +0 -1
- package/esm/chunk-DP6NTUTQ.js +0 -2
- package/esm/chunk-DP6NTUTQ.js.map +0 -1
- package/esm/chunk-HGKGDQ5J.js +0 -15
- package/esm/chunk-HGKGDQ5J.js.map +0 -1
- package/esm/chunk-NHAFJ5OA.js +0 -31
- package/esm/chunk-NHAFJ5OA.js.map +0 -1
- package/esm/chunk-ULECZXWB.js +0 -2
- package/esm/chunk-ULECZXWB.js.map +0 -1
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +0 -5
- package/esm/context/DynamicSnippetsGeneratorContext.js +0 -2
- package/esm/context/DynamicSnippetsGeneratorContext.js.map +0 -1
- package/esm/context/DynamicTypeLiteralMapper.d.ts +0 -5
- package/esm/context/DynamicTypeLiteralMapper.js +0 -2
- package/esm/context/DynamicTypeLiteralMapper.js.map +0 -1
- package/esm/context/FilePropertyMapper.d.ts +0 -5
- package/esm/context/FilePropertyMapper.js +0 -2
- package/esm/context/FilePropertyMapper.js.map +0 -1
- package/esm/index.d.ts +0 -7
- package/esm/index.js +0 -2
- package/esm/index.js.map +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import '@fern-api/browser-compatible-base-generator';
|
|
2
|
-
import '@fern-api/dynamic-ir-sdk';
|
|
3
|
-
import '@fern-api/python-ast';
|
|
4
|
-
import '@fern-api/python-browser-compatible-base';
|
|
5
|
-
export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-4_I0JAlU.cjs';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";var xe=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols;var Ue=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var be=(r,t,e)=>t in r?xe(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ce=(r,t)=>{for(var e in t||(t={}))Ue.call(t,e)&&be(r,e,t[e]);if(we)for(var e of we(t))We.call(t,e)&&be(r,e,t[e]);return r};var Ve=(r,t)=>{var e={};for(var n in r)Ue.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&we)for(var n of we(r))t.indexOf(n)<0&&We.call(r,n)&&(e[n]=r[n]);return e};var Pe=(r,t)=>()=>(r&&(t=r(r=0)),t);var je=(r,t)=>{for(var e in t)xe(r,e,{get:t[e],enumerable:!0})},vt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tt(t))!Ue.call(r,i)&&i!==e&&xe(r,i,{get:()=>t[i],enumerable:!(n=gt(t,i))||n.enumerable});return r};var It=r=>vt(xe({},"__esModule",{value:!0}),r);var c=(r,t,e)=>be(r,typeof t!="symbol"?t+"":t,e);function Qe(){throw new Error("setTimeout has not been defined")}function Ge(){throw new Error("clearTimeout has not been defined")}function Je(r){if(W===setTimeout)return setTimeout(r,0);if((W===Qe||!W)&&setTimeout)return W=setTimeout,setTimeout(r,0);try{return W(r,0)}catch(t){try{return W.call(null,r,0)}catch(e){return W.call(this,r,0)}}}function Et(r){if(V===clearTimeout)return clearTimeout(r);if((V===Ge||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(r);try{return V(r)}catch(t){try{return V.call(null,r)}catch(e){return V.call(this,r)}}}function At(){!te||!K||(te=!1,K.length?M=K.concat(M):ge=-1,M.length&&Ze())}function Ze(){if(!te){var r=Je(At);te=!0;for(var t=M.length;t;){for(K=M,M=[];++ge<t;)K&&K[ge].run();ge=-1,t=M.length}K=null,te=!1,Et(r)}}function Rt(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];M.push(new Ke(r,t)),M.length===1&&!te&&Je(Ze)}function Ke(r,t){this.fun=r,this.array=t}function H(){}function Wt(r){throw new Error("process.binding is not supported")}function Vt(){return"/"}function jt(r){throw new Error("process.chdir is not supported")}function zt(){return 0}function Gt(r){var t=Qt.call(ee)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function Zt(){var r=new Date,t=r-Jt;return t/1e3}var W,V,M,te,K,ge,Nt,kt,St,Lt,bt,Ut,Ct,Pt,Bt,Ft,_t,Dt,Mt,Ot,$t,Yt,ee,Qt,Jt,x,ze,u=Pe(()=>{"use strict";W=Qe,V=Ge;typeof globalThis.setTimeout=="function"&&(W=setTimeout);typeof globalThis.clearTimeout=="function"&&(V=clearTimeout);M=[],te=!1,ge=-1;Ke.prototype.run=function(){this.fun.apply(null,this.array)};Nt="browser",kt="browser",St=!0,Lt={},bt=[],Ut="",Ct={},Pt={},Bt={};Ft=H,_t=H,Dt=H,Mt=H,Ot=H,$t=H,Yt=H;ee=globalThis.performance||{},Qt=ee.now||ee.mozNow||ee.msNow||ee.oNow||ee.webkitNow||function(){return new Date().getTime()};Jt=new Date;x={nextTick:Rt,title:Nt,browser:St,env:Lt,argv:bt,version:Ut,versions:Ct,on:Ft,addListener:_t,once:Dt,off:Mt,removeListener:Ot,removeAllListeners:$t,emit:Yt,binding:Wt,cwd:Vt,chdir:jt,umask:zt,hrtime:Gt,platform:kt,release:Pt,config:Bt,uptime:Zt},ze={};Object.keys(ze).forEach(r=>{let t=r.split("."),e=x;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=ze[r]:e=e[i]||(e[i]={})}})});function et(){Fe=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)P[t]=r[t],L[r.charCodeAt(t)]=t;L[45]=62,L[95]=63}function Ht(r){Fe||et();var t,e,n,i,s,o,f=r.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=r[f-2]==="="?2:r[f-1]==="="?1:0,o=new Kt(f*3/4-s),n=s>0?f-4:f;var l=0;for(t=0,e=0;t<n;t+=4,e+=3)i=L[r.charCodeAt(t)]<<18|L[r.charCodeAt(t+1)]<<12|L[r.charCodeAt(t+2)]<<6|L[r.charCodeAt(t+3)],o[l++]=i>>16&255,o[l++]=i>>8&255,o[l++]=i&255;return s===2?(i=L[r.charCodeAt(t)]<<2|L[r.charCodeAt(t+1)]>>4,o[l++]=i&255):s===1&&(i=L[r.charCodeAt(t)]<<10|L[r.charCodeAt(t+1)]<<4|L[r.charCodeAt(t+2)]>>2,o[l++]=i>>8&255,o[l++]=i&255),o}function Xt(r){return P[r>>18&63]+P[r>>12&63]+P[r>>6&63]+P[r&63]}function qt(r,t,e){for(var n,i=[],s=t;s<e;s+=3)n=(r[s]<<16)+(r[s+1]<<8)+r[s+2],i.push(Xt(n));return i.join("")}function He(r){Fe||et();for(var t,e=r.length,n=e%3,i="",s=[],o=16383,f=0,l=e-n;f<l;f+=o)s.push(qt(r,f,f+o>l?l:f+o));return n===1?(t=r[e-1],i+=P[t>>2],i+=P[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=P[t>>10],i+=P[t>>4&63],i+=P[t<<2&63],i+="="),s.push(i),s.join("")}function Te(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function O(r,t){if(Te()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=a.prototype):(r===null&&(r=new a(t)),r.length=t),r}function a(r,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return _e(this,r)}return tt(this,r,t,e)}function tt(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?nn(r,t,e,n):typeof t=="string"?tn(r,t,e):rn(r,t)}function nt(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function en(r,t,e,n){return nt(t),t<=0?O(r,t):e!==void 0?typeof n=="string"?O(r,t).fill(e,n):O(r,t).fill(e):O(r,t)}function _e(r,t){if(nt(t),r=O(r,t<0?0:De(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function tn(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=rt(t,e)|0;r=O(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function Be(r,t){var e=t.length<0?0:De(t.length)|0;r=O(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function nn(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=Be(r,t),r}function rn(r,t){if(B(t)){var e=De(t.length)|0;return r=O(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||En(t.length)?O(r,0):Be(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Be(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function De(r){if(r>=Te())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Te().toString(16)+" bytes");return r|0}function B(r){return!!(r!=null&&r._isBuffer)}function rt(r,t){if(B(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return ve(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ut(r).length;default:if(n)return ve(r).length;t=(""+t).toLowerCase(),n=!0}}function sn(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return dn(this,t,e);case"utf8":case"utf-8":return ot(this,t,e);case"ascii":return pn(this,t,e);case"latin1":case"binary":return mn(this,t,e);case"base64":return hn(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yn(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function X(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function it(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,n)),B(t))return t.length===0?-1:Xe(r,t,e,n,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Xe(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Xe(r,t,e,n,i){var s=1,o=r.length,f=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;s=2,o/=2,f/=2,e/=2}function l(T,w){return s===1?T[w]:T.readUInt16BE(w*s)}var d;if(i){var p=-1;for(d=e;d<o;d++)if(l(r,d)===l(t,p===-1?0:d-p)){if(p===-1&&(p=d),d-p+1===f)return p*s}else p!==-1&&(d-=d-p),p=-1}else for(e+f>o&&(e=o-f),d=e;d>=0;d--){for(var y=!0,v=0;v<f;v++)if(l(r,d+v)!==l(t,v)){y=!1;break}if(y)return d}return-1}function on(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o<n;++o){var f=parseInt(t.substr(o*2,2),16);if(isNaN(f))return o;r[e+o]=f}return o}function an(r,t,e,n){return Ae(ve(t,r.length-e),r,e,n)}function st(r,t,e,n){return Ae(vn(t),r,e,n)}function cn(r,t,e,n){return st(r,t,e,n)}function fn(r,t,e,n){return Ae(ut(t),r,e,n)}function un(r,t,e,n){return Ae(In(t,r.length-e),r,e,n)}function hn(r,t,e){return t===0&&e===r.length?He(r):He(r.slice(t,e))}function ot(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var s=r[i],o=null,f=s>239?4:s>223?3:s>191?2:1;if(i+f<=e){var l,d,p,y;switch(f){case 1:s<128&&(o=s);break;case 2:l=r[i+1],(l&192)===128&&(y=(s&31)<<6|l&63,y>127&&(o=y));break;case 3:l=r[i+1],d=r[i+2],(l&192)===128&&(d&192)===128&&(y=(s&15)<<12|(l&63)<<6|d&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:l=r[i+1],d=r[i+2],p=r[i+3],(l&192)===128&&(d&192)===128&&(p&192)===128&&(y=(s&15)<<18|(l&63)<<12|(d&63)<<6|p&63,y>65535&&y<1114112&&(o=y))}}o===null?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=f}return ln(n)}function ln(r){var t=r.length;if(t<=qe)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=qe));return e}function pn(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function mn(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function dn(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",s=t;s<e;++s)i+=Tn(r[s]);return i}function yn(r,t,e){for(var n=r.slice(t,e),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}function E(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function k(r,t,e,n,i,s){if(!B(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function Ie(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(r.length-e,2);i<s;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function Ee(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(r.length-e,4);i<s;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function at(r,t,e,n,i,s){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ct(r,t,e,n,i){return i||at(r,t,e,4,34028234663852886e22,-34028234663852886e22),lt(r,t,e,n,23,4),e+4}function ft(r,t,e,n,i){return i||at(r,t,e,8,17976931348623157e292,-17976931348623157e292),lt(r,t,e,n,52,8),e+8}function xn(r){if(r=gn(r).replace(wn,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function gn(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Tn(r){return r<16?"0"+r.toString(16):r.toString(16)}function ve(r,t){t=t||1/0;for(var e,n=r.length,i=null,s=[],o=0;o<n;++o){if(e=r.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&s.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;s.push(e)}else if(e<2048){if((t-=2)<0)break;s.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;s.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;s.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return s}function vn(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function In(r,t){for(var e,n,i,s=[],o=0;o<r.length&&!((t-=2)<0);++o)e=r.charCodeAt(o),n=e>>8,i=e%256,s.push(i),s.push(n);return s}function ut(r){return Ht(xn(r))}function Ae(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function En(r){return r!==r}function An(r){return r!=null&&(!!r._isBuffer||ht(r)||Rn(r))}function ht(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Rn(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&ht(r.slice(0,0))}function Re(r,t,e,n,i){var s,o,f=i*8-n-1,l=(1<<f)-1,d=l>>1,p=-7,y=e?i-1:0,v=e?-1:1,T=r[t+y];for(y+=v,s=T&(1<<-p)-1,T>>=-p,p+=f;p>0;s=s*256+r[t+y],y+=v,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+r[t+y],y+=v,p-=8);if(s===0)s=1-d;else{if(s===l)return o?NaN:(T?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-d}return(T?-1:1)*o*Math.pow(2,s-n)}function lt(r,t,e,n,i,s){var o,f,l,d=s*8-i-1,p=(1<<d)-1,y=p>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=n?0:s-1,w=n?1:-1,I=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+y>=1?t+=v/l:t+=v*Math.pow(2,1-y),t*l>=2&&(o++,l/=2),o+y>=p?(f=0,o=p):o+y>=1?(f=(t*l-1)*Math.pow(2,i),o=o+y):(f=t*Math.pow(2,y-1)*Math.pow(2,i),o=0));i>=8;r[e+T]=f&255,T+=w,f/=256,i-=8);for(o=o<<i|f,d+=i;d>0;r[e+T]=o&255,T+=w,o/=256,d-=8);r[e+T-w]|=I*128}var P,L,Kt,Fe,qe,wn,pt=Pe(()=>{"use strict";u();h();P=[],L=[],Kt=typeof Uint8Array!="undefined"?Uint8Array:Array,Fe=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return tt(null,r,t,e)};a.kMaxLength=Te();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(r,t,e){return en(null,r,t,e)};a.allocUnsafe=function(r){return _e(null,r)};a.allocUnsafeSlow=function(r){return _e(null,r)};a.isBuffer=An;a.compare=function(t,e){if(!B(t)||!B(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,s=0,o=Math.min(n,i);s<o;++s)if(t[s]!==e[s]){n=t[s],i=e[s];break}return n<i?-1:i<n?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 n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=a.allocUnsafe(e),s=0;for(n=0;n<t.length;++n){var o=t[n];if(!B(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,s),s+=o.length}return i};a.byteLength=rt;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)X(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)X(this,e,e+3),X(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)X(this,e,e+7),X(this,e+1,e+6),X(this,e+2,e+5),X(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?ot(this,0,t):sn.apply(this,arguments)};a.prototype.equals=function(t){if(!B(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,n,i,s){if(!B(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var o=s-i,f=n-e,l=Math.min(o,f),d=this.slice(i,s),p=t.slice(e,n),y=0;y<l;++y)if(d[y]!==p[y]){o=d[y],f=p[y];break}return o<f?-1:f<o?1:0};a.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};a.prototype.indexOf=function(t,e,n){return it(this,t,e,n,!0)};a.prototype.lastIndexOf=function(t,e,n){return it(this,t,e,n,!1)};a.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-e;if((n===void 0||n>s)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return on(this,t,e,n);case"utf8":case"utf-8":return an(this,t,e,n);case"ascii":return st(this,t,e,n);case"latin1":case"binary":return cn(this,t,e,n);case"base64":return fn(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return un(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};qe=4096;a.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var s=e-t;i=new a(s,void 0);for(var o=0;o<s;++o)i[o]=this[o+t]}return i};a.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=this[t],s=1,o=0;++o<e&&(s*=256);)i+=this[t+o]*s;return i};a.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=this[t+--e],s=1;e>0&&(s*=256);)i+=this[t+--e]*s;return i};a.prototype.readUInt8=function(t,e){return e||E(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||E(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||E(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||E(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||E(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=this[t],s=1,o=0;++o<e&&(s*=256);)i+=this[t+o]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=e,s=1,o=this[t+--i];i>0&&(s*=256);)o+=this[t+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*e)),o};a.prototype.readInt8=function(t,e){return e||E(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||E(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(t,e){e||E(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(t,e){return e||E(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||E(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||E(t,4,this.length),Re(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||E(t,4,this.length),Re(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||E(t,8,this.length),Re(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||E(t,8,this.length),Re(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var s=Math.pow(2,8*n)-1;k(this,t,e,n,s,0)}var o=1,f=0;for(this[e]=t&255;++f<n&&(o*=256);)this[e+f]=t/o&255;return e+n};a.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var s=Math.pow(2,8*n)-1;k(this,t,e,n,s,0)}var o=n-1,f=1;for(this[e+o]=t&255;--o>=0&&(f*=256);)this[e+o]=t/f&255;return e+n};a.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||k(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,n){return t=+t,e=e|0,n||k(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Ie(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||k(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Ie(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||k(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):Ee(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||k(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):Ee(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var s=Math.pow(2,8*n-1);k(this,t,e,n,s-1,-s)}var o=0,f=1,l=0;for(this[e]=t&255;++o<n&&(f*=256);)t<0&&l===0&&this[e+o-1]!==0&&(l=1),this[e+o]=(t/f>>0)-l&255;return e+n};a.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var s=Math.pow(2,8*n-1);k(this,t,e,n,s-1,-s)}var o=n-1,f=1,l=0;for(this[e+o]=t&255;--o>=0&&(f*=256);)t<0&&l===0&&this[e+o+1]!==0&&(l=1),this[e+o]=(t/f>>0)-l&255;return e+n};a.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||k(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,n){return t=+t,e=e|0,n||k(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Ie(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||k(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Ie(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||k(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):Ee(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||k(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):Ee(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,n){return ct(this,t,e,!0,n)};a.prototype.writeFloatBE=function(t,e,n){return ct(this,t,e,!1,n)};a.prototype.writeDoubleLE=function(t,e,n){return ft(this,t,e,!0,n)};a.prototype.writeDoubleBE=function(t,e,n){return ft(this,t,e,!1,n)};a.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var s=i-n,o;if(this===t&&n<e&&e<i)for(o=s-1;o>=0;--o)t[o+e]=this[o+n];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s};a.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var s=t.charCodeAt(0);s<256&&(t=s)}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<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{var f=B(t)?t:ve(new a(t,i).toString()),l=f.length;for(o=0;o<n-e;++o)this[o+e]=f[o%l]}return this};wn=/[^+\/0-9A-Za-z-_]/g});var h=Pe(()=>{"use strict";pt()});var Hn={};je(Hn,{DynamicTypeLiteralMapper:()=>Ye});module.exports=It(Hn);u();h();u();h();u();h();function S(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();h();u();h();u();h();var mt,dt,me=(dt=(mt=x.env.FERN_STACK_TRACK)==null?void 0:mt.toLowerCase())!=null?dt:"",F=me!==""&&me!=="0"&&me!=="false",Me=["single","multiline","box"].includes(me)?me:"single";F&&(Error.stackTraceLimit=50);var Nn=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),kn=new Set(["stacktrace"]);function ke({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:s=!0,filterJs:o=!0,formatFilename:f=l=>l}={}){var d;if(!F)return[];n=[...n,...Nn],e=[...e,...kn],i=[...i,"runInteractiveTask"];let l=!1;return((d=new Error().stack)!=null?d:"").split(`
|
|
2
|
-
`).map(p=>{let y=p.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(y&&y.length===5){let[,v,T,w,I]=y;if(!v||!T||!w||!I)return;if(l||i.some(A=>v==null?void 0:v.includes(A))){l=!0;return}switch(v){case"Object.<anonymous>":v="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":v=`${v.substring(v.indexOf(".")+1)}()=> { ... }`;break}return{fn:v,path:f(T),position:`${w}:${I}`}}}).filter(p=>{var y,v;return p&&!n.some(T=>p.fn.includes(T))&&!(s&&((y=p.path)!=null&&y.startsWith("node:")))&&!(o&&((v=p.path)!=null&&v.endsWith(".js")))&&!e.some(T=>p.path.includes(T))}).slice(t,t+r)}var Ne=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:n=[],filterFunctions:i=[],stopOn:s=[],filterNode:o=!0,filterJs:f=!0,multiline:l=!1,formatFilename:d=p=>p}={}){c(this,"maxFrames");c(this,"skip");c(this,"filterPaths");c(this,"filterFunctions");c(this,"stopOn");c(this,"filterNode");c(this,"filterJs");c(this,"multiline");c(this,"formatFilename");c(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=n,this.filterFunctions=i,this.stopOn=s,this.filterNode=o,this.filterJs=f,this.multiline=l,this.formatFilename=d}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(n=>e.add(n)),this.tracking.set(t,e)}trace(t){if(!F)return"";let e=this.tracking.get(t);return e?[...e].map(n=>`${this.multiline?`
|
|
3
|
-
`:""}${n.fn} - ${n.path}:${n.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 yt({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:s=!0,filterJs:o=!0,multiline:f=!1,formatFilename:l=d=>d}={}){F&&($!=null||($=new Ne({maxFrames:r,skip:t,filterPaths:e,filterFunctions:n,stopOn:i,filterNode:s,filterJs:o,multiline:f,formatFilename:l})))}function wt(r){$==null||$.tag(r)}function Oe(r){var t;return(t=$==null?void 0:$.frames(r))!=null?t:[]}var q=class{constructor(){wt(this)}};u();h();u();h();u();h();var C=class extends q{constructor(e){super();c(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 Sn=4;yt({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var de=class{constructor(){c(this,"lineBuffer",[]);c(this,"indentLevel",0);c(this,"hasWrittenAnything",!1);c(this,"lastCharacterIsSemicolon",!1);c(this,"lastCharacterIsNewline",!1);c(this,"nodeStackFrames",[])}get buffer(){return F&&this.nodeStackFrames.length>0&&this.writeInternal(`
|
|
4
|
-
`),this.lineBuffer.join(`
|
|
5
|
-
`)+(this.lastCharacterIsNewline?`
|
|
6
|
-
`:"")}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let n=e.length>0&&e.endsWith(`
|
|
7
|
-
`),i=n?e.substring(0,e.length-1):e,s=this.getIndentString(),o=i.replaceAll(`
|
|
8
|
-
`,`
|
|
9
|
-
${s}`);this.isAtStartOfLine()&&(o=s+o),n&&(o+=`
|
|
10
|
-
`),this.writeInternal(o)}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){F&&this.nodeStackFrames.push(...Oe(t)),t.write(this),F&&Me!=="single"&&this.writeInternal(`
|
|
11
|
-
`)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){this.writeNode(t),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new C(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new C(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new C(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new C(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new C(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
|
-
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
13
|
-
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let s=1;s<t.length;s++){this.write(e);let o=t[s];o!=null&&n(o)}}}toString(){return this.buffer}writeInternal(t){if(t.length===0)return;let e=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
14
|
-
`),this.lastCharacterIsSemicolon=t.endsWith(";");let n=t.split(`
|
|
15
|
-
`),i=F&&!this.shouldSkipTracking(n)&&this.lastCharacterIsNewline;e&&(this.lastLine=`${this.lastLine}${n.shift()||""}`),this.lastCharacterIsNewline&&n.pop(),this.lineBuffer.push(...n),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(n=>`${e?`(${e}) `:""} ${n.fn} - ${n.path} : ${n.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,Me){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 Sn}};u();h();u();h();var _={Critical:"CRITICAL",Warning:"WARNING"};u();h();var m={};je(m,{AccessAttribute:()=>ne,AstNode:()=>g,Class:()=>j,ClassInstantiation:()=>ie,CodeBlock:()=>Y,Comment:()=>se,Decorator:()=>oe,Field:()=>z,Lambda:()=>ae,LambdaParameter:()=>ce,Method:()=>G,MethodArgument:()=>ue,MethodInvocation:()=>he,Operator:()=>le,Parameter:()=>Q,PythonFile:()=>pe,Reference:()=>b,StarImport:()=>J,Type:()=>Le,TypeInstantiation:()=>Z,accessAttribute:()=>Un,assign:()=>Cn,class_:()=>Bn,codeBlock:()=>$n,comment:()=>Yn,decorator:()=>_n,field:()=>On,file:()=>Pn,instantiateClass:()=>Fn,invokeFunction:()=>zn,invokeMethod:()=>Qn,lambda:()=>Wn,lambdaParameter:()=>Vn,method:()=>jn,methodArgument:()=>Jn,operator:()=>Zn,parameter:()=>Gn,reference:()=>Dn,starImport:()=>Mn});u();h();u();h();u();h();u();h();var ye=class extends de{constructor(){super(...arguments);c(this,"fullyQualifiedModulePathsToImportedNames",{})}setRefNameOverrides(e){this.fullyQualifiedModulePathsToImportedNames=e}unsetRefNameOverrides(){this.fullyQualifiedModulePathsToImportedNames={}}getRefNameOverride(e){var i;let n=this.fullyQualifiedModulePathsToImportedNames[e.getFullyQualifiedModulePath()];return n||{name:(i=e.alias)!=null?i:e.name,isAlias:!!e.alias}}toString(){return this.buffer}async toStringFormatted(e){return e.format(this.buffer)}};var g=class extends q{constructor(){super(...arguments);c(this,"references",[])}addReference(e){this.references.push(e)}inheritReferences(e){e!==void 0&&e.references.forEach(n=>{this.references.includes(n)||this.addReference(n)})}getReferences(){return this.references}toString(){let e=new ye;return this.write(e),e.toString()}async toStringFormatted(e){let n=new ye;return this.write(n),n.toStringFormatted(e)}};var ne=class extends g{constructor({lhs:e,rhs:n}){super();c(this,"lhs");c(this,"rhs");this.lhs=e,this.inheritReferences(e),this.rhs=n,this.inheritReferences(n)}write(e){this.lhs.write(e),e.write("."),this.rhs.write(e)}};u();h();var Se=class extends g{constructor({lhs:e,rhs:n}){super();c(this,"lhs");c(this,"rhs");this.lhs=e,this.inheritReferences(e),this.rhs=n,this.inheritReferences(n)}write(e){this.lhs.write(e),e.write(" = "),this.rhs.write(e)}};u();h();var re=class extends g{constructor({reference:e,arguments_:n,multiline:i}){super();c(this,"reference");c(this,"arguments");c(this,"multiline");this.reference=e,this.arguments=n,this.multiline=i!=null?i:!1,this.inheritReferences(e),this.arguments.forEach(s=>{this.inheritReferences(s)})}write(e){if(this.reference.write(e),this.arguments.length===0){e.write("()");return}e.write("("),this.multiline&&(e.newLine(),e.indent()),this.arguments.forEach((n,i)=>{n.write(e),i<this.arguments.length-1&&(e.write(","),this.multiline?e.newLine():e.write(" "))}),this.multiline&&(e.newLine(),e.dedent()),e.write(")")}};u();h();var j=class extends g{constructor({docs:e,name:n,extends_:i,decorators:s}){super();c(this,"name");c(this,"extends_");c(this,"decorators");c(this,"fields",[]);c(this,"docs");c(this,"statements",[]);this.name=n,this.extends_=i!=null?i:[],this.decorators=s!=null?s:[],this.docs=e,this.extends_.forEach(o=>{this.inheritReferences(o)}),this.decorators.forEach(o=>{this.inheritReferences(o)})}write(e){this.decorators.forEach(n=>{n.write(e)}),e.write(`class ${this.name}`),this.extends_.length>0&&(e.write("("),this.extends_.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write(")")),e.write(":"),e.newLine(),e.indent(),this.docs!=null&&(e.write('"""'),e.write(this.docs),e.write('"""')),e.writeNewLineIfLastLineNot(),this.fields.forEach(n=>{n.write(e),e.writeNewLineIfLastLineNot()}),e.dedent(),e.indent(),this.statements.length?this.writeStatements({writer:e}):e.write("pass"),e.dedent()}add(e){this.statements.push(e),this.inheritReferences(e)}writeStatements({writer:e}){this.statements.forEach((n,i)=>{n.write(e),e.writeNewLineIfLastLineNot()})}addField(e){this.add(e)}};u();h();var ie=class extends re{constructor(n){var i=n,{classReference:t}=i,e=Ve(i,["classReference"]);super(Ce({reference:t},e))}};u();h();var Y=class extends g{constructor(e){super();c(this,"arg");this.arg=e}write(e){return new C(this.arg).write(e)}};u();h();var se=class extends g{constructor({docs:e}){super();c(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
16
|
-
`).forEach(n=>{e.writeLine(`# ${n}`)})}};u();h();var oe=class extends g{constructor({callable:e}){super();c(this,"callable");this.callable=e,this.inheritReferences(e)}write(e){e.write("@"),this.callable.write(e),e.newLine()}};u();h();var z=class extends g{constructor({name:e,type:n,initializer:i,docs:s}){super();c(this,"name");c(this,"type");c(this,"initializer");c(this,"docs");this.name=e,this.type=n,this.initializer=i,this.docs=s,this.inheritReferences(this.type),this.inheritReferences(this.initializer)}write(e){e.write(this.name),this.type!==void 0&&(e.write(": "),this.type.write(e)),this.initializer!==void 0&&(e.write(" = "),this.initializer.write(e)),this.docs!=null&&(e.newLine(),e.write('"""'),e.newLine(),e.write(this.docs),e.newLine(),e.write('"""'))}};u();h();var ae=class extends g{constructor({parameters:e,body:n}){super();c(this,"parameters");c(this,"body");this.parameters=e!=null?e:[],this.body=n,this.inheritReferences(n)}write(e){e.write("lambda"),this.parameters&&this.parameters.length&&(e.write(" "),this.parameters.forEach((n,i)=>{n.write(e),i<this.parameters.length-1&&e.write(", ")})),e.write(": "),this.body.write(e)}};u();h();u();h();var Q=class extends g{constructor({name:e,type:n,initializer:i}){super();c(this,"name");c(this,"initializer");c(this,"type");this.name=e,this.type=n,this.initializer=i}write(e){e.write(this.name),this.type&&(e.write(": "),this.type.write(e)),this.initializer!==void 0&&(e.write(" = "),this.initializer.write(e))}};var ce=class extends Q{constructor({name:t,initializer:e}){super({name:t,initializer:e,type:void 0})}};u();h();var fe;(function(r){r[r.STATIC=0]="STATIC",r[r.INSTANCE=1]="INSTANCE",r[r.CLASS=2]="CLASS"})(fe||(fe={}));var G=class extends g{constructor({static_:e,name:n,parameters:i,return_:s,docstring:o,type:f,decorators:l}){super();c(this,"name");c(this,"return");c(this,"docstring");c(this,"type");c(this,"parameters");c(this,"decorators");c(this,"statements",[]);c(this,"static_");this.name=n,this.parameters=i!=null?i:[],this.return=s,this.docstring=o,this.type=f,this.decorators=l!=null?l:[],this.static_=e!=null?e:!1,this.parameters.forEach(d=>{this.inheritReferences(d)}),this.inheritReferences(this.return),this.decorators.forEach(d=>{this.inheritReferences(d)}),this.statements.forEach(d=>{this.inheritReferences(d)})}addStatement(e){this.statements.push(e),this.inheritReferences(e)}write(e){this.static_&&this.decorators.push(m.decorator({callable:m.codeBlock("staticmethod")})),this.decorators.forEach(s=>{s.write(e)}),this.type===fe.CLASS?m.decorator({callable:new Y("classmethod")}).write(e):this.type===fe.STATIC&&m.decorator({callable:new Y("staticmethod")}).write(e),e.write(`def ${this.name}(`);let i=this.parameters.length>3;i&&(e.newLine(),e.indent()),this.type===fe.INSTANCE?(e.write("self"),this.parameters.length>0&&(e.write(i?",":", "),i&&e.newLine())):this.type===fe.CLASS&&(e.write("cls"),this.parameters.length>0&&(e.write(i?",":", "),i&&e.newLine())),this.parameters.forEach((s,o)=>{s.write(e),o<this.parameters.length-1&&(e.write(i?",":", "),i&&e.newLine())}),i&&(e.write(","),e.dedent(),e.newLine()),e.write(")"),this.return&&(e.write(" -> "),this.return.write(e)),e.write(":"),e.newLine(),this.docstring&&(e.indent(),e.write('"""'),e.write(this.docstring),e.write('"""'),e.newLine(),e.dedent()),this.statements.length?(e.indent(),this.statements.forEach((s,o)=>{s.write(e),o<this.statements.length-1&&e.newLine()}),e.dedent()):(e.indent(),e.write("pass"),e.dedent()),e.newLine()}};u();h();var ue=class extends g{constructor({name:e,value:n}){super();c(this,"name");c(this,"value");this.name=e,this.value=n,this.inheritReferences(this.value)}write(e){this.name!==void 0&&(e.write(this.name),e.write("=")),this.value.write(e)}};u();h();var he=class extends g{constructor({on:e,method:n,arguments_:i,multiline:s}){super();c(this,"on");c(this,"method");c(this,"arguments");c(this,"multiline");this.on=e,this.method=n,this.arguments=i,this.multiline=s!=null?s:!1,this.inheritReferences(e),this.arguments.forEach(o=>{this.inheritReferences(o)})}write(e){if(this.on.write(e),e.write("."),e.write(this.method),this.arguments.length===0){e.write("()");return}e.write("("),this.multiline&&(e.newLine(),e.indent()),this.arguments.forEach((n,i)=>{n.write(e),i<this.arguments.length-1&&(e.write(","),this.multiline?e.newLine():e.write(" "))}),this.multiline&&(e.newLine(),e.dedent()),e.write(")")}};u();h();u();h();var D={Or:"or",And:"and",Add:"add",Subtract:"subtract",Multiply:"multiple",Divide:"divide",Modulo:"modulo",LeftShift:"leftShift",RightShift:"rightShift"};var le=class extends g{constructor({operator:e,lhs:n,rhs:i}){super();c(this,"operator");c(this,"lhs");c(this,"rhs");this.operator=e,this.lhs=n,this.inheritReferences(n),this.rhs=i,this.inheritReferences(i)}getOperatorString(){switch(this.operator){case D.Or:return"or";case D.And:return"and";case D.Add:return"+";case D.Subtract:return"-";case D.Multiply:return"*";case D.Divide:return"/";case D.Modulo:return"%";case D.LeftShift:return"<<";case D.RightShift:return">>";default:S(this.operator)}}write(e){this.lhs.write(e),e.write(" "),e.write(this.getOperatorString()),e.write(" "),this.rhs.write(e)}};u();h();u();h();function xt(r){if(!r)return"Class";let t=r.replace(/[^a-zA-Z0-9\s_-]/g," ").replace(/[-_\s]+/g," ").trim();return!t||/^\d+$/.test(t)?"Class"+(t||""):(/^\d/.test(t)&&(t="Class"+t),t.split(/(?=[A-Z])|[-_\s]+/).filter(n=>n.length>0).map(n=>n.split(new RegExp("(?<=\\d)(?=[a-zA-Z])|(?<=[a-zA-Z])(?=\\d)")).filter(i=>i.length>0)).flat().map((n,i)=>i===0&&/^\d/.test(n)?"Class"+n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.length>1&&n===n.toUpperCase()&&!/^\d+$/.test(n)?n:n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join(""))}u();h();u();h();var b=class extends g{constructor({name:e,modulePath:n,genericTypes:i,alias:s,attribute:o}){super();c(this,"name");c(this,"modulePath");c(this,"genericTypes");c(this,"alias");c(this,"attribute");this.name=e,this.modulePath=n!=null?n:[],this.genericTypes=i!=null?i:[],this.alias=s,this.attribute=o!=null?o:[],this.references.push(this),this.genericTypes.forEach(f=>{this.inheritReferences(f)})}write(e){let n=e.getRefNameOverride(this);e.write(n.name),this.genericTypes.length>0&&(e.write("["),this.genericTypes.forEach((i,s)=>{s>0&&e.write(", "),i.write(e)}),e.write("]")),this.attribute.length>0&&(e.write("."),this.attribute.forEach((i,s)=>{s>0&&e.write("."),e.write(i)}))}getFullyQualifiedPath(){return this.modulePath.join(".")}getFullyQualifiedModulePath(){return`${this.getFullyQualifiedPath()}.${this.name}`}};var J=class extends b{constructor({modulePath:e}){super({name:"*",modulePath:e});c(this,"docs")}write(e){throw new Error("Not intended to be written outside the context of a PythonFile.")}};var pe=class extends g{constructor({path:e,statements:n,isInitFile:i=!1,comments:s,imports:o}){super();c(this,"path");c(this,"isInitFile");c(this,"statements",[]);c(this,"comments");this.path=e,this.isInitFile=i,n==null||n.forEach(f=>this.addStatement(f)),this.comments=s!=null?s:[],o==null||o.forEach(f=>this.addReference(f))}addStatement(e){this.statements.push(e),this.inheritReferences(e)}write(e){let n=this.deduplicateReferences();this.updateWriterRefNameOverrides({writer:e,uniqueReferences:n}),this.writeComments(e),this.writeImports({writer:e,uniqueReferences:n}),this.statements.forEach((i,s)=>{i.write(e),e.newLine(),s<this.statements.length-1&&e.newLine()}),e.unsetRefNameOverrides()}updateWriterRefNameOverrides({writer:e,uniqueReferences:n}){let i=new Map(n),s={},o=this.getInitialUsedNames(),f=this.path.join("."),l=n.get(f);if(l){let{references:p}=l;p.forEach(y=>{let v=y.getFullyQualifiedModulePath(),T=y.name;s[v]={name:T,isAlias:!1},o.add(y.name)}),i.delete(f)}Array.from(i.values()).flatMap(({references:p})=>p).forEach(p=>{var A;if(p instanceof J)return;let y=(A=p.alias)!=null?A:p.name,v=p.getFullyQualifiedModulePath(),T=y,w=p.modulePath.length-1,I=!!p.alias;for(;o.has(T);){I=!0;let R=p.modulePath[w];w<0||!R?T=`_${T}`:T=`${xt(R)}${T}`,w--}o.add(T),s[v]={name:T,isAlias:I}}),e.setRefNameOverrides(s)}getInitialUsedNames(){let e=new Set;return this.statements.forEach(n=>{(n instanceof j||n instanceof G||n instanceof z)&&e.add(n.name)}),e}deduplicateReferences(){let e=new Map;for(let n of this.references){let i=n.name,s=n.getFullyQualifiedPath();if(s==="")continue;let o=e.get(s);o?o.referenceNames.has(i)||(o.references.push(n),o.referenceNames.add(i)):e.set(s,{modulePath:n.modulePath,references:[n],referenceNames:new Set([i])})}return e}writeComments(e){this.comments.forEach(n=>{n.write(e)}),this.comments.length>0&&e.newLine()}getImportName({writer:e,reference:n}){let i=e.getRefNameOverride(n),s=n.name,o=i.isAlias?i.name:void 0;return`${s}${o?` as ${o}`:""}`}writeImports({writer:e,uniqueReferences:n}){if(n.size!==0){for(let[i,{modulePath:s,references:o}]of n){let f=s;if(!this.isDefinedInFile(f)){if(f[0]===this.path[0]){let l=0;for(;l<this.path.length&&l<f.length&&this.path[l]===f[l];)l++;let d=this.path.length-l;this.isInitFile&&d++;let p=d>0?".".repeat(d):".";p+=f.slice(l).join("."),e.write(`from ${p} import ${o.map(y=>this.getImportName({writer:e,reference:y})).join(", ")}`)}else e.write(`from ${i} import ${o.map(l=>this.getImportName({writer:e,reference:l})).join(", ")}`);e.newLine()}}e.newLine()}}isDefinedInFile(e){return e.length===this.path.length&&e.every((n,i)=>n===this.path[i])}};u();h();var Le=class extends g{constructor(e){super();c(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"int":e.write("int");break;case"float":e.write("float");break;case"bool":e.write("bool");break;case"str":e.write("str");break;case"bytes":e.write("bytes");break;case"list":e.write("List["),this.internalType.value.write(e),e.write("]");break;case"set":e.write("Set["),this.internalType.value.write(e),e.write("]");break;case"tuple":e.write("Tuple["),this.internalType.values.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write("]");break;case"dict":e.write("Dict["),this.internalType.keyType.write(e),e.write(", "),this.internalType.valueType.write(e),e.write("]");break;case"none":e.write("None");break;case"uuid":e.write("UUID");break;case"optional":e.write("Optional["),this.internalType.value.write(e),e.write("]");break;case"union":e.write("Union["),this.internalType.values.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write("]");break;case"any":e.write("Any");break;case"reference":this.internalType.value.write(e);break;case"datetime":e.write("datetime");break;case"literal":typeof this.internalType.value=="string"?e.write(`Literal["${this.internalType.value}"]`):e.write(`Literal[${this.internalType.value}]`);break;default:S(this.internalType)}}static int(){return new this({type:"int"})}static float(){return new this({type:"float"})}static bool(){return new this({type:"bool"})}static str(){return new this({type:"str"})}static bytes(){return new this({type:"bytes"})}static list(e){let n=new this({type:"list",value:e});return n.addReference(m.reference({name:"List",modulePath:["typing"]})),n.inheritReferences(e),n}static set(e){let n=new this({type:"set",value:e});return n.addReference(m.reference({name:"Set",modulePath:["typing"]})),n.inheritReferences(e),n}static tuple(e){let n=new this({type:"tuple",values:e});return n.addReference(m.reference({name:"Tuple",modulePath:["typing"]})),e.forEach(i=>n.inheritReferences(i)),n}static dict(e,n){let i=new this({type:"dict",keyType:e,valueType:n});return i.addReference(m.reference({name:"Dict",modulePath:["typing"]})),i.inheritReferences(e),i.inheritReferences(n),i}static none(){return new this({type:"none"})}static uuid(){let e=new this({type:"uuid"});return e.addReference(m.reference({name:"UUID",modulePath:["uuid"]})),e}static optional(e){if(this.isAlreadyOptional(e))return e;let n=new this({type:"optional",value:e});return n.addReference(m.reference({name:"Optional",modulePath:["typing"]})),n.inheritReferences(e),n}static union(e){let n=new this({type:"union",values:e});return n.addReference(m.reference({name:"Union",modulePath:["typing"]})),e.forEach(i=>n.inheritReferences(i)),n}static any(){let e=new this({type:"any"});return e.addReference(m.reference({name:"Any",modulePath:["typing"]})),e}static datetime(){let e=new this({type:"datetime"});return e.addReference(m.reference({name:"datetime",modulePath:["datetime"]})),e}static reference(e){let n=new this({type:"reference",value:e});return n.addReference(e),n}static literal(e){let n=new this({type:"literal",value:e});return n.addReference(m.reference({name:"Literal",modulePath:["typing"]})),n}static isAlreadyOptional(e){return e.internalType.type==="optional"}};u();h();var Z=class r extends g{constructor(e){super();c(this,"internalType");this.internalType=e}static int(e){return new this({type:"int",value:e})}static float(e){return new this({type:"float",value:e})}static bool(e){return new this({type:"bool",value:e})}static str(e,n={multiline:!1,startOnNewLine:!1,endWithNewLine:!1}){return new this({type:"str",value:e,config:n})}static bytes(e){return new this({type:"bytes",value:e})}static list(e,n={endWithComma:!1}){let i=new this({type:"list",values:e,config:n});return e.forEach(s=>i.inheritReferences(s)),i}static set(e,n={endWithComma:!1}){let i=new this({type:"set",values:e,config:n});return e.forEach(s=>i.inheritReferences(s)),i}static tuple(e,n={endWithComma:!1}){let i=new this({type:"tuple",values:e,config:n});return e.forEach(s=>i.inheritReferences(s)),i}static typedDict(e,n={endWithComma:!1}){let i=new this({type:"typedDict",entries:e,config:n});return e.forEach(s=>i.inheritReferences(s.value)),i}static date(e){let n=new this({type:"date",value:e});return n.addReference(new b({name:"date",modulePath:["datetime"]})),n}static datetime(e){let n=new this({type:"datetime",value:e});return n.addReference(new b({name:"datetime",modulePath:["datetime"]})),n}static dict(e,n={endWithComma:!1}){let i=new this({type:"dict",entries:e,config:n});return e.forEach(s=>{i.inheritReferences(s.key),i.inheritReferences(s.value)}),i}static reference(e){let n=new this({type:"reference",value:e});return n.inheritReferences(e),n}static none(){return new this({type:"none"})}static unknown(e){return new this({type:"unknown",value:e})}static uuid(e){let n=new this({type:"uuid",value:e});return n.addReference(new b({name:"UUID",modulePath:["uuid"]})),n}static nop(){return new this({type:"nop"})}static isNop(e){return e instanceof r&&e.internalType.type==="nop"}isTypedDict(){return this.internalType.type==="typedDict"}asTypedDictOrThrow(){if(this.isTypedDict())return this.internalType;throw new Error("Internal error; python.TypeInstantiation is not a TypedDict")}write(e){var n,i,s,o,f,l,d,p,y,v,T;switch(this.internalType.type){case"int":e.write(this.internalType.value.toString());break;case"float":e.write(this.internalType.value.toString());break;case"bool":this.internalType.value?e.write("True"):e.write("False");break;case"str":if((n=this.internalType.config)!=null&&n.multiline){let{startOnNewLine:w,endWithNewLine:I}=this.internalType.config;this.writeStringWithTripleQuotes({writer:e,value:this.internalType.value,startOnNewLine:w,endWithNewLine:I})}else e.write(`"${this.escapeString(this.internalType.value)}"`);break;case"date":e.write(`date.fromisoformat("${this.internalType.value}")`);break;case"datetime":e.write(`datetime.fromisoformat("${this.internalType.value}")`);break;case"bytes":e.write(`b"${this.internalType.value}"`);break;case"list":{let w=this.internalType,I=$e({values:w.values});if(I.length===0){e.write("[]");break}e.write("["),(i=w.config)!=null&&i.multiline&&(e.newLine(),e.indent()),I.forEach((A,R)=>{var N,U;R>0&&(e.write(","),(N=w.config)!=null&&N.multiline?e.newLine():e.write(" ")),A.write(e),R===I.length-1&&((U=w.config)!=null&&U.endWithComma)&&e.write(",")}),(s=w.config)!=null&&s.multiline&&(e.newLine(),e.dedent()),e.write("]");break}case"set":{let w=this.internalType,I=$e({values:w.values});if(I.length===0){e.write("{}");break}e.write("{"),(o=w.config)!=null&&o.multiline&&(e.newLine(),e.indent()),I.forEach((A,R)=>{var N,U;R>0&&(e.write(","),(N=w.config)!=null&&N.multiline?e.newLine():e.write(" ")),A.write(e),R===I.length-1&&((U=w.config)!=null&&U.endWithComma)&&e.write(",")}),(f=w.config)!=null&&f.multiline&&(e.newLine(),e.dedent()),e.write("}");break}case"tuple":{let w=this.internalType,I=$e({values:w.values});if(I.length===0){e.write("()");break}e.write("("),(l=w.config)!=null&&l.multiline&&(e.newLine(),e.indent()),I.forEach((A,R)=>{var N,U;R>0&&(e.write(","),(N=w.config)!=null&&N.multiline?e.newLine():e.write(" ")),A.write(e),(I.length===1||R===I.length-1&&((U=w.config)!=null&&U.endWithComma))&&e.write(",")}),(d=w.config)!=null&&d.multiline&&(e.newLine(),e.dedent()),e.write(")");break}case"dict":{let w=this.internalType,I=Ln({entries:w.entries});if(I.length===0){e.write("{}");break}e.write("{"),(p=w.config)!=null&&p.multiline&&(e.newLine(),e.indent()),I.forEach((A,R)=>{var N,U;R>0&&(e.write(","),(N=w.config)!=null&&N.multiline?e.newLine():e.write(" ")),A.key.write(e),e.write(": "),A.value.write(e),R===I.length-1&&((U=w.config)!=null&&U.endWithComma)&&e.write(",")}),(y=w.config)!=null&&y.multiline&&(e.newLine(),e.dedent()),e.write("}");break}case"typedDict":{let w=this.internalType,I=bn({entries:w.entries});if(I.length===0){e.write("{}");break}e.write("{"),(v=w.config)!=null&&v.multiline&&(e.writeLine(),e.indent()),I.forEach((A,R)=>{var N;R>0&&(e.write(","),(N=w.config)!=null&&N.multiline?e.newLine():e.write(" ")),e.write(`"${A.name}": `),A.value.write(e)}),(T=w.config)!=null&&T.multiline&&(e.newLine(),e.dedent()),e.write("}");break}case"reference":{this.internalType.value.write(e);break}case"none":e.write("None");break;case"unknown":this.writeUnknown({writer:e,value:this.internalType.value});break;case"uuid":e.write(`UUID("${this.internalType.value}")`);break;case"nop":break;default:S(this.internalType)}}writeStringWithTripleQuotes({writer:e,value:n,startOnNewLine:i,endWithNewLine:s}){var f;e.write('"""');let o=n.split(`
|
|
17
|
-
`);if(o.length<=1){e.write(this.escapeString((f=o[0])!=null?f:"")),e.write('"""');return}i&&e.writeNoIndent(`\\
|
|
18
|
-
`),o.forEach((l,d)=>{e.writeNoIndent(this.escapeString(l)),d===o.length-1?s&&e.writeNoIndent(`\\
|
|
19
|
-
`):e.writeNoIndent(`
|
|
20
|
-
`)}),e.writeNoIndent('"""')}escapeString(e){let n=new RegExp(`(?<!\\\\)(["'\\\\\\t\\n\\r])`,"g"),i={'"':'\\"',"'":"\\'","\\":"\\\\"," ":"\\t","\n":"\\n","\r":"\\r"};return e.replace(n,s=>{var o;return(o=i[s])!=null?o:s})}writeUnknown({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n?"True":"False");return;case"string":e.write(`"${this.escapeString(n)}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("None");return}if(Array.isArray(n)){this.writeUnknownArray({writer:e,value:n});return}this.writeUnknownObject({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:e,value:n}){if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of n)e.writeNode(r.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownObject({writer:e,value:n}){let i=Object.entries(n);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[s,o]of i)e.write(`"${s}": `),e.writeNode(r.unknown(o)),e.writeLine(",");e.dedent(),e.write("}")}};function Ln({entries:r}){return r.filter(t=>!Z.isNop(t.key)&&!Z.isNop(t.value))}function bn({entries:r}){return r.filter(t=>!Z.isNop(t.value))}function $e({values:r}){return r.filter(t=>!Z.isNop(t))}function Un(r){return new ne(r)}function Cn(r){return new Se(r)}function Pn(r){return new pe(r)}function Bn(r){return new j(r)}function Fn(r){return new ie(r)}function _n(r){return new oe(r)}function Dn(r){return new b(r)}function Mn(r){return new J(r)}function On(r){return new z(r)}function $n(r){return new Y(r)}function Yn(r){return new se(r)}function Wn(r){return new ae(r)}function Vn(r){return new ce(r)}function jn(r){return new G(r)}function zn(r){return new re(r)}function Qn(r){return new he(r)}function Gn(r){return new Q(r)}function Jn(r){return new ue(r)}function Zn(r){return new le(r)}var Kn="value",Ye=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?m.TypeInstantiation.none():(this.context.errors.add({severity:_.Critical,message:"Expected non-null value, but got null"}),m.TypeInstantiation.nop());if(t.value===void 0)return m.TypeInstantiation.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literalType:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?m.TypeInstantiation.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"nullable":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return m.TypeInstantiation.unknown(t.value);default:S(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let n=this.context.getValueAsBoolean({value:e});return n==null?m.TypeInstantiation.nop():m.TypeInstantiation.bool(n)}case"string":{let n=this.context.getValueAsString({value:e});return n==null?m.TypeInstantiation.nop():m.TypeInstantiation.str(n)}default:S(t)}}convertList({list:t,value:e}){return Array.isArray(e)?m.TypeInstantiation.list(e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}}),{multiline:!0}):(this.context.errors.add({severity:_.Critical,message:`Expected array but got: ${typeof e}`}),m.TypeInstantiation.nop())}convertSet({set:t,value:e}){return Array.isArray(e)?m.TypeInstantiation.list(e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}}),{multiline:!0}):(this.context.errors.add({severity:_.Critical,message:`Expected array but got: ${typeof e}`}),m.TypeInstantiation.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:_.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),m.TypeInstantiation.nop()):m.TypeInstantiation.dict(Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:t.key,value:n,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}}),{multiline:!0})}convertNamed({named:t,value:e,as:n}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:t,value:e});case"enum":return this.convertEnum({enum_:t,value:e});case"object":return this.convertObject({object_:t,value:e});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:S(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(n==null)return m.TypeInstantiation.nop();let i=n.singleDiscriminatedUnionType,s=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});if(s==null)return m.TypeInstantiation.nop();let o={name:this.context.getPropertyName(t.discriminant.name),value:m.TypeInstantiation.str(i.discriminantValue.wireValue)};return m.TypeInstantiation.typedDict([o,...s],{multiline:!0})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){let n=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});switch(e.type){case"samePropertiesAsObject":{let i=this.context.resolveNamedType({typeId:e.typeId});if(i==null)return;let s=this.convertNamed({named:i,value:t.value});if(!s.isTypedDict()){this.context.errors.add({severity:_.Critical,message:"Internal error; expected union value to be an object"});return}let o=s.asTypedDictOrThrow();return[...n,...o.entries]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let i=this.context.getRecord(t.value);return i==null?[...n,{name:Kn,value:this.convert({typeReference:e.typeReference,value:t.value})}]:[...n,{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:i[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return n;default:S(e)}}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i,s;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(s=this.context.getRecord(t.value))!=null?s:{},ignoreMissingParameters:!0}).map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getPropertyName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})}convertObject({object_:t,value:e}){var i;let n=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return m.TypeInstantiation.typedDict(n.map(s=>{this.context.errors.scope(s.name.wireValue);try{return{name:this.context.getPropertyName(s.name.name),value:this.convert(s)}}finally{this.context.errors.unscope()}}),{multiline:!0})}convertEnum({enum_:t,value:e}){let n=this.getEnumValue({enum_:t,value:e});return n==null?m.TypeInstantiation.nop():m.TypeInstantiation.str(n)}getEnumValue({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:_.Critical,message:`Expected enum value string, got: ${typeof e}`});return}if(t.values.find(i=>i.wireValue===e)==null){this.context.errors.add({severity:_.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return e}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return n==null?m.TypeInstantiation.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{return this.convert({typeReference:n,value:e})}catch(i){continue}this.context.errors.add({severity:_.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertPrimitive({primitive:t,value:e,as:n}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:n});return i==null?m.TypeInstantiation.nop():m.TypeInstantiation.int(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?m.TypeInstantiation.nop():m.TypeInstantiation.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:n});return i==null?m.TypeInstantiation.nop():m.TypeInstantiation.bool(i)}case"BASE_64":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeInstantiation.nop():m.TypeInstantiation.str(i)}case"UUID":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeInstantiation.nop():m.TypeInstantiation.uuid(i)}case"DATE":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeInstantiation.nop():m.TypeInstantiation.date(i)}case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?m.TypeInstantiation.nop():m.TypeInstantiation.datetime(i)}default:S(t)}}getValueAsNumber({value:t,as:e}){let n=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:t,as:e}){let n=e==="key"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:n})}};0&&(module.exports={DynamicTypeLiteralMapper});
|
|
21
|
-
/*! Bundled license information:
|
|
22
|
-
|
|
23
|
-
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
24
|
-
(*!
|
|
25
|
-
* The buffer module from node.js, for the browser.
|
|
26
|
-
*
|
|
27
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
28
|
-
* @license MIT
|
|
29
|
-
*)
|
|
30
|
-
*/
|
|
31
|
-
//# sourceMappingURL=DynamicTypeLiteralMapper.cjs.map
|