@fern-api/java-dynamic-snippets 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +6 -6
  2. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
  3. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  4. package/cjs/{DynamicSnippetsGeneratorContext-CqPRgNNz.d.cts → DynamicSnippetsGeneratorContext-BhCKaadj.d.cts} +16 -1
  5. package/cjs/EndpointSnippetGenerator.cjs +2 -2
  6. package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
  7. package/cjs/EndpointSnippetGenerator.d.cts +1 -1
  8. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +6 -6
  9. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
  10. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  11. package/cjs/context/DynamicTypeLiteralMapper.cjs +6 -6
  12. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -1
  13. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  14. package/cjs/context/DynamicTypeMapper.cjs +5 -5
  15. package/cjs/context/DynamicTypeMapper.cjs.map +1 -1
  16. package/cjs/context/DynamicTypeMapper.d.cts +1 -1
  17. package/cjs/context/FilePropertyMapper.cjs +5 -5
  18. package/cjs/context/FilePropertyMapper.cjs.map +1 -1
  19. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  20. package/cjs/index.cjs +6 -6
  21. package/cjs/index.cjs.map +1 -1
  22. package/cjs/index.d.cts +1 -1
  23. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  24. package/esm/DynamicSnippetsGenerator.js +1 -1
  25. package/esm/{DynamicSnippetsGeneratorContext-CqPRgNNz.d.ts → DynamicSnippetsGeneratorContext-BhCKaadj.d.ts} +16 -1
  26. package/esm/EndpointSnippetGenerator.d.ts +1 -1
  27. package/esm/EndpointSnippetGenerator.js +1 -1
  28. package/esm/{chunk-2KH7MFRW.js → chunk-4CABHDQV.js} +2 -2
  29. package/esm/{chunk-SNGFCNTO.js → chunk-ATHAOWL4.js} +2 -2
  30. package/esm/{chunk-GESEOQT7.js → chunk-DD37GKIE.js} +2 -2
  31. package/esm/{chunk-6CITGEM3.js → chunk-JWUP3MFF.js} +3 -3
  32. package/esm/chunk-JWUP3MFF.js.map +1 -0
  33. package/esm/{chunk-G35HVZPV.js → chunk-PSRNJYSA.js} +2 -2
  34. package/esm/{chunk-L6HHZWHP.js → chunk-RVPVA4ZP.js} +2 -2
  35. package/esm/chunk-V3XTHNV6.js +8 -0
  36. package/esm/chunk-V3XTHNV6.js.map +1 -0
  37. package/esm/chunk-Z267S5KO.js +15 -0
  38. package/esm/chunk-Z267S5KO.js.map +1 -0
  39. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  40. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
  41. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  42. package/esm/context/DynamicTypeLiteralMapper.js +1 -1
  43. package/esm/context/DynamicTypeMapper.d.ts +1 -1
  44. package/esm/context/DynamicTypeMapper.js +1 -1
  45. package/esm/context/FilePropertyMapper.d.ts +1 -1
  46. package/esm/context/FilePropertyMapper.js +1 -1
  47. package/esm/index.d.ts +1 -1
  48. package/esm/index.js +1 -1
  49. package/package.json +1 -1
  50. package/esm/chunk-6CITGEM3.js.map +0 -1
  51. package/esm/chunk-GTD7VYDZ.js +0 -8
  52. package/esm/chunk-GTD7VYDZ.js.map +0 -1
  53. package/esm/chunk-OMKG67AN.js +0 -15
  54. package/esm/chunk-OMKG67AN.js.map +0 -1
  55. /package/esm/{chunk-2KH7MFRW.js.map → chunk-4CABHDQV.js.map} +0 -0
  56. /package/esm/{chunk-SNGFCNTO.js.map → chunk-ATHAOWL4.js.map} +0 -0
  57. /package/esm/{chunk-GESEOQT7.js.map → chunk-DD37GKIE.js.map} +0 -0
  58. /package/esm/{chunk-G35HVZPV.js.map → chunk-PSRNJYSA.js.map} +0 -0
  59. /package/esm/{chunk-L6HHZWHP.js.map → chunk-RVPVA4ZP.js.map} +0 -0
@@ -1,4 +1,4 @@
1
1
  import '@fern-api/browser-compatible-base-generator';
2
2
  import '@fern-api/dynamic-ir-sdk';
3
3
  import '@fern-api/java-ast';
4
- export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-CqPRgNNz.cjs';
4
+ export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-BhCKaadj.cjs';
@@ -1,6 +1,6 @@
1
- "use strict";var ne=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var st=Object.prototype.hasOwnProperty;var lt=(n,t,e)=>t in n?ne(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var xe=(n,t)=>()=>(n&&(t=n(n=0)),t);var Re=(n,t)=>{for(var e in t)ne(n,e,{get:t[e],enumerable:!0})},ut=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ot(t))!st.call(n,i)&&i!==e&&ne(n,i,{get:()=>t[i],enumerable:!(r=at(t,i))||r.enumerable});return n};var ct=n=>ut(ne({},"__esModule",{value:!0}),n);var h=(n,t,e)=>lt(n,typeof t!="symbol"?t+"":t,e);function Se(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}function Fe(n){if(M===setTimeout)return setTimeout(n,0);if((M===Se||!M)&&setTimeout)return M=setTimeout,setTimeout(n,0);try{return M(n,0)}catch(t){try{return M.call(null,n,0)}catch(e){return M.call(this,n,0)}}}function pt(n){if(O===clearTimeout)return clearTimeout(n);if((O===Ce||!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 ft(){!z||!D||(z=!1,D.length?C=D.concat(C):ie=-1,C.length&&Be())}function Be(){if(!z){var n=Fe(ft);z=!0;for(var t=C.length;t;){for(D=C,C=[];++ie<t;)D&&D[ie].run();ie=-1,t=C.length}D=null,z=!1,pt(n)}}function ht(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];C.push(new _e(n,t)),C.length===1&&!z&&Fe(Be)}function _e(n,t){this.fun=n,this.array=t}function $(){}function Ut(n){throw new Error("process.binding is not supported")}function St(){return"/"}function Ct(n){throw new Error("process.chdir is not supported")}function Ft(){return 0}function _t(n){var t=Bt.call(K)*.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 Ot(){var n=new Date,t=n-Mt;return t/1e3}var M,O,C,z,D,ie,mt,dt,yt,wt,xt,gt,vt,Tt,Nt,kt,It,At,Lt,bt,Et,Rt,K,Bt,Mt,w,Ue,p=xe(()=>{"use strict";M=Se,O=Ce;typeof globalThis.setTimeout=="function"&&(M=setTimeout);typeof globalThis.clearTimeout=="function"&&(O=clearTimeout);C=[],z=!1,ie=-1;_e.prototype.run=function(){this.fun.apply(null,this.array)};mt="browser",dt="browser",yt=!0,wt={},xt=[],gt="",vt={},Tt={},Nt={};kt=$,It=$,At=$,Lt=$,bt=$,Et=$,Rt=$;K=globalThis.performance||{},Bt=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};Mt=new Date;w={nextTick:ht,title:mt,browser:yt,env:wt,argv:xt,version:gt,versions:vt,on:kt,addListener:It,once:At,off:Lt,removeListener:bt,removeAllListeners:Et,emit:Rt,binding:Ut,cwd:St,chdir:Ct,umask:Ft,hrtime:_t,platform:dt,release:Tt,config:Nt,uptime:Ot},Ue={};Object.keys(Ue).forEach(n=>{let t=n.split("."),e=w;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=Ue[n]:e=e[i]||(e[i]={})}})});function $e(){ve=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)E[t]=n[t],L[n.charCodeAt(t)]=t;L[45]=62,L[95]=63}function $t(n){ve||$e();var t,e,r,i,a,o,l=n.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=n[l-2]==="="?2:n[l-1]==="="?1:0,o=new Dt(l*3/4-a),r=a>0?l-4:l;var c=0;for(t=0,e=0;t<r;t+=4,e+=3)i=L[n.charCodeAt(t)]<<18|L[n.charCodeAt(t+1)]<<12|L[n.charCodeAt(t+2)]<<6|L[n.charCodeAt(t+3)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=i&255;return a===2?(i=L[n.charCodeAt(t)]<<2|L[n.charCodeAt(t+1)]>>4,o[c++]=i&255):a===1&&(i=L[n.charCodeAt(t)]<<10|L[n.charCodeAt(t+1)]<<4|L[n.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=i&255),o}function Pt(n){return E[n>>18&63]+E[n>>12&63]+E[n>>6&63]+E[n&63]}function jt(n,t,e){for(var r,i=[],a=t;a<e;a+=3)r=(n[a]<<16)+(n[a+1]<<8)+n[a+2],i.push(Pt(r));return i.join("")}function Me(n){ve||$e();for(var t,e=n.length,r=e%3,i="",a=[],o=16383,l=0,c=e-r;l<c;l+=o)a.push(jt(n,l,l+o>c?c:l+o));return r===1?(t=n[e-1],i+=E[t>>2],i+=E[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=E[t>>10],i+=E[t>>4&63],i+=E[t<<2&63],i+="="),a.push(i),a.join("")}function ae(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function F(n,t){if(ae()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Te(this,n)}return Pe(this,n,t,e)}function Pe(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?Wt(n,t,e,r):typeof t=="string"?Yt(n,t,e):Gt(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 Vt(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 Te(n,t){if(je(t),n=F(n,t<0?0:Ne(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function Yt(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=Ve(t,e)|0;n=F(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function ge(n,t){var e=t.length<0?0:Ne(t.length)|0;n=F(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function Wt(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=ge(n,t),n}function Gt(n,t){if(R(t)){var e=Ne(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"||cr(t.length)?F(n,0):ge(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return ge(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ne(n){if(n>=ae())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ae().toString(16)+" bytes");return n|0}function R(n){return!!(n!=null&&n._isBuffer)}function Ve(n,t){if(R(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 oe(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ke(n).length;default:if(r)return oe(n).length;t=(""+t).toLowerCase(),r=!0}}function Jt(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 rr(this,t,e);case"utf8":case"utf-8":return Ge(this,t,e);case"ascii":return er(this,t,e);case"latin1":case"binary":return tr(this,t,e);case"base64":return Zt(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nr(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function P(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function Ye(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),R(t))return t.length===0?-1:Oe(n,t,e,r,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):Oe(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function Oe(n,t,e,r,i){var a=1,o=n.length,l=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;a=2,o/=2,l/=2,e/=2}function c(T,S){return a===1?T[S]:T.readUInt16BE(S*a)}var m;if(i){var y=-1;for(m=e;m<o;m++)if(c(n,m)===c(t,y===-1?0:m-y)){if(y===-1&&(y=m),m-y+1===l)return y*a}else y!==-1&&(m-=m-y),y=-1}else for(e+l>o&&(e=o-l),m=e;m>=0;m--){for(var d=!0,g=0;g<l;g++)if(c(n,m+g)!==c(t,g)){d=!1;break}if(d)return m}return-1}function qt(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var l=parseInt(t.substr(o*2,2),16);if(isNaN(l))return o;n[e+o]=l}return o}function Ht(n,t,e,r){return ue(oe(t,n.length-e),n,e,r)}function We(n,t,e,r){return ue(lr(t),n,e,r)}function Kt(n,t,e,r){return We(n,t,e,r)}function zt(n,t,e,r){return ue(Ke(t),n,e,r)}function Xt(n,t,e,r){return ue(ur(t,n.length-e),n,e,r)}function Zt(n,t,e){return t===0&&e===n.length?Me(n):Me(n.slice(t,e))}function Ge(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var a=n[i],o=null,l=a>239?4:a>223?3:a>191?2:1;if(i+l<=e){var c,m,y,d;switch(l){case 1:a<128&&(o=a);break;case 2:c=n[i+1],(c&192)===128&&(d=(a&31)<<6|c&63,d>127&&(o=d));break;case 3:c=n[i+1],m=n[i+2],(c&192)===128&&(m&192)===128&&(d=(a&15)<<12|(c&63)<<6|m&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=n[i+1],m=n[i+2],y=n[i+3],(c&192)===128&&(m&192)===128&&(y&192)===128&&(d=(a&15)<<18|(c&63)<<12|(m&63)<<6|y&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,l=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=l}return Qt(r)}function Qt(n){var t=n.length;if(t<=De)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=De));return e}function er(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 tr(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 rr(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var i="",a=t;a<e;++a)i+=sr(n[a]);return i}function nr(n,t,e){for(var r=n.slice(t,e),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+r[a+1]*256);return i}function N(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 k(n,t,e,r,i,a){if(!R(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(e+r>n.length)throw new RangeError("Index out of range")}function se(n,t,e,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(n.length-e,2);i<a;++i)n[e+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}function le(n,t,e,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(n.length-e,4);i<a;++i)n[e+i]=t>>>(r?i:3-i)*8&255}function Je(n,t,e,r,i,a){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function qe(n,t,e,r,i){return i||Je(n,t,e,4,34028234663852886e22,-34028234663852886e22),Xe(n,t,e,r,23,4),e+4}function He(n,t,e,r,i){return i||Je(n,t,e,8,17976931348623157e292,-17976931348623157e292),Xe(n,t,e,r,52,8),e+8}function ar(n){if(n=or(n).replace(ir,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function or(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function sr(n){return n<16?"0"+n.toString(16):n.toString(16)}function oe(n,t){t=t||1/0;for(var e,r=n.length,i=null,a=[],o=0;o<r;++o){if(e=n.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;a.push(e)}else if(e<2048){if((t-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function lr(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function ur(n,t){for(var e,r,i,a=[],o=0;o<n.length&&!((t-=2)<0);++o)e=n.charCodeAt(o),r=e>>8,i=e%256,a.push(i),a.push(r);return a}function Ke(n){return $t(ar(n))}function ue(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 cr(n){return n!==n}function pr(n){return n!=null&&(!!n._isBuffer||ze(n)||fr(n))}function ze(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function fr(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&ze(n.slice(0,0))}function ce(n,t,e,r,i){var a,o,l=i*8-r-1,c=(1<<l)-1,m=c>>1,y=-7,d=e?i-1:0,g=e?-1:1,T=n[t+d];for(d+=g,a=T&(1<<-y)-1,T>>=-y,y+=l;y>0;a=a*256+n[t+d],d+=g,y-=8);for(o=a&(1<<-y)-1,a>>=-y,y+=r;y>0;o=o*256+n[t+d],d+=g,y-=8);if(a===0)a=1-m;else{if(a===c)return o?NaN:(T?-1:1)*(1/0);o=o+Math.pow(2,r),a=a-m}return(T?-1:1)*o*Math.pow(2,a-r)}function Xe(n,t,e,r,i,a){var o,l,c,m=a*8-i-1,y=(1<<m)-1,d=y>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=r?0:a-1,S=r?1:-1,re=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,o=y):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?t+=g/c:t+=g*Math.pow(2,1-d),t*c>=2&&(o++,c/=2),o+d>=y?(l=0,o=y):o+d>=1?(l=(t*c-1)*Math.pow(2,i),o=o+d):(l=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;n[e+T]=l&255,T+=S,l/=256,i-=8);for(o=o<<i|l,m+=i;m>0;n[e+T]=o&255,T+=S,o/=256,m-=8);n[e+T-S]|=re*128}var E,L,Dt,ve,De,ir,Ze=xe(()=>{"use strict";p();f();E=[],L=[],Dt=typeof Uint8Array!="undefined"?Uint8Array:Array,ve=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return Pe(null,n,t,e)};s.kMaxLength=ae();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return Vt(null,n,t,e)};s.allocUnsafe=function(n){return Te(null,n)};s.allocUnsafeSlow=function(n){return Te(null,n)};s.isBuffer=pr;s.compare=function(t,e){if(!R(t)||!R(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,a=0,o=Math.min(r,i);a<o;++a)if(t[a]!==e[a]){r=t[a],i=e[a];break}return r<i?-1:i<r?1:0};s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=s.allocUnsafe(e),a=0;for(r=0;r<t.length;++r){var o=t[r];if(!R(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};s.byteLength=Ve;s.prototype._isBuffer=!0;s.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)P(this,e,e+1);return this};s.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)P(this,e,e+3),P(this,e+1,e+2);return this};s.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)P(this,e,e+7),P(this,e+1,e+6),P(this,e+2,e+5),P(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?Ge(this,0,t):Jt.apply(this,arguments)};s.prototype.equals=function(t){if(!R(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,i,a){if(!R(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),a===void 0&&(a=this.length),e<0||r>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=r)return 0;if(i>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var o=a-i,l=r-e,c=Math.min(o,l),m=this.slice(i,a),y=t.slice(e,r),d=0;d<c;++d)if(m[d]!==y[d]){o=m[d],l=y[d];break}return o<l?-1:l<o?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return Ye(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return Ye(this,t,e,r,!1)};s.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((r===void 0||r>a)&&(r=a),t.length>0&&(r<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 qt(this,t,e,r);case"utf8":case"utf-8":return Ht(this,t,e,r);case"ascii":return We(this,t,e,r);case"latin1":case"binary":return Kt(this,t,e,r);case"base64":return zt(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xt(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};De=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=s.prototype;else{var a=e-t;i=new s(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+t]}return i};s.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=this[t],a=1,o=0;++o<e&&(a*=256);)i+=this[t+o]*a;return i};s.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=this[t+--e],a=1;e>0&&(a*=256);)i+=this[t+--e]*a;return i};s.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};s.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=this[t],a=1,o=0;++o<e&&(a*=256);)i+=this[t+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=e,a=1,o=this[t+--i];i>0&&(a*=256);)o+=this[t+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readInt8=function(t,e){return e||N(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};s.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};s.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),ce(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),ce(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),ce(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),ce(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var a=Math.pow(2,8*r)-1;k(this,t,e,r,a,0)}var o=1,l=0;for(this[e]=t&255;++l<r&&(o*=256);)this[e+l]=t/o&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var a=Math.pow(2,8*r)-1;k(this,t,e,r,a,0)}var o=r-1,l=1;for(this[e+o]=t&255;--o>=0&&(l*=256);)this[e+o]=t/l&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):se(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):se(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):le(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):le(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var a=Math.pow(2,8*r-1);k(this,t,e,r,a-1,-a)}var o=0,l=1,c=0;for(this[e]=t&255;++o<r&&(l*=256);)t<0&&c===0&&this[e+o-1]!==0&&(c=1),this[e+o]=(t/l>>0)-c&255;return e+r};s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var a=Math.pow(2,8*r-1);k(this,t,e,r,a-1,-a)}var o=r-1,l=1,c=0;for(this[e+o]=t&255;--o>=0&&(l*=256);)t<0&&c===0&&this[e+o+1]!==0&&(c=1),this[e+o]=(t/l>>0)-c&255;return e+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):se(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):se(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):le(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):le(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return qe(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return qe(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return He(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return He(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var a=i-r,o;if(this===t&&r<e&&e<i)for(o=a-1;o>=0;--o)t[o+e]=this[o+r];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a};s.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var a=t.charCodeAt(0);a<256&&(t=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var o;if(typeof t=="number")for(o=e;o<r;++o)this[o]=t;else{var l=R(t)?t:oe(new s(t,i).toString()),c=l.length;for(o=0;o<r-e;++o)this[o+e]=l[o%c]}return this};ir=/[^+\/0-9A-Za-z-_]/g});var f=xe(()=>{"use strict";Ze()});var Pr={};Re(Pr,{DynamicTypeLiteralMapper:()=>Ee});module.exports=ct(Pr);p();f();p();f();p();f();function I(n){throw new Error("Unexpected value: "+JSON.stringify(n))}p();f();p();f();p();f();var Qe,et,X=(et=(Qe=w.env.FERN_STACK_TRACK)==null?void 0:Qe.toLowerCase())!=null?et:"",U=X!==""&&X!=="0"&&X!=="false",ke=["single","multiline","box"].includes(X)?X:"single";U&&(Error.stackTraceLimit=50);var hr=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),mr=new Set(["stacktrace"]);function fe({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:a=!0,filterJs:o=!0,formatFilename:l=c=>c}={}){var m;if(!U)return[];r=[...r,...hr],e=[...e,...mr],i=[...i,"runInteractiveTask"];let c=!1;return((m=new Error().stack)!=null?m:"").split(`
2
- `).map(y=>{let d=y.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(d&&d.length===5){let[,g,T,S,re]=d;if(!g||!T||!S||!re)return;if(c||i.some(it=>g==null?void 0:g.includes(it))){c=!0;return}switch(g){case"Object.<anonymous>":g="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":g=`${g.substring(g.indexOf(".")+1)}()=> { ... }`;break}return{fn:g,path:l(T),position:`${S}:${re}`}}}).filter(y=>{var d,g;return y&&!r.some(T=>y.fn.includes(T))&&!(a&&((d=y.path)!=null&&d.startsWith("node:")))&&!(o&&((g=y.path)!=null&&g.endsWith(".js")))&&!e.some(T=>y.path.includes(T))}).slice(t,t+n)}var pe=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:r=[],filterFunctions:i=[],stopOn:a=[],filterNode:o=!0,filterJs:l=!0,multiline:c=!1,formatFilename:m=y=>y}={}){h(this,"maxFrames");h(this,"skip");h(this,"filterPaths");h(this,"filterFunctions");h(this,"stopOn");h(this,"filterNode");h(this,"filterJs");h(this,"multiline");h(this,"formatFilename");h(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=r,this.filterFunctions=i,this.stopOn=a,this.filterNode=o,this.filterJs=l,this.multiline=c,this.formatFilename=m}tag(t){let e=this.tracking.get(t)||new Set;fe({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(!U)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}},B;function tt({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:a=!0,filterJs:o=!0,multiline:l=!1,formatFilename:c=m=>m}={}){U&&(B!=null||(B=new pe({maxFrames:n,skip:t,filterPaths:e,filterFunctions:r,stopOn:i,filterNode:a,filterJs:o,multiline:l,formatFilename:c})))}function rt(n){B==null||B.tag(n)}function Ie(n){var t;return(t=B==null?void 0:B.frames(n))!=null?t:[]}var j=class{constructor(){rt(this)}};p();f();var he=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},Z=class extends he{async format(t){return t}formatSync(t){return t}};p();f();p();f();p();f();var b=class extends j{constructor(e){super();h(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 dr=4;tt({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var Q=class{constructor(){h(this,"lineBuffer",[]);h(this,"indentLevel",0);h(this,"hasWrittenAnything",!1);h(this,"lastCharacterIsSemicolon",!1);h(this,"lastCharacterIsNewline",!1);h(this,"nodeStackFrames",[])}get buffer(){return U&&this.nodeStackFrames.length>0&&this.writeInternal(`
1
+ "use strict";var ne=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var st=Object.prototype.hasOwnProperty;var lt=(n,t,e)=>t in n?ne(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var xe=(n,t)=>()=>(n&&(t=n(n=0)),t);var Re=(n,t)=>{for(var e in t)ne(n,e,{get:t[e],enumerable:!0})},ct=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ot(t))!st.call(n,i)&&i!==e&&ne(n,i,{get:()=>t[i],enumerable:!(r=at(t,i))||r.enumerable});return n};var ut=n=>ct(ne({},"__esModule",{value:!0}),n);var h=(n,t,e)=>lt(n,typeof t!="symbol"?t+"":t,e);function Se(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}function Fe(n){if(M===setTimeout)return setTimeout(n,0);if((M===Se||!M)&&setTimeout)return M=setTimeout,setTimeout(n,0);try{return M(n,0)}catch(t){try{return M.call(null,n,0)}catch(e){return M.call(this,n,0)}}}function pt(n){if(O===clearTimeout)return clearTimeout(n);if((O===Ce||!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 ft(){!z||!D||(z=!1,D.length?C=D.concat(C):ie=-1,C.length&&Be())}function Be(){if(!z){var n=Fe(ft);z=!0;for(var t=C.length;t;){for(D=C,C=[];++ie<t;)D&&D[ie].run();ie=-1,t=C.length}D=null,z=!1,pt(n)}}function ht(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];C.push(new _e(n,t)),C.length===1&&!z&&Fe(Be)}function _e(n,t){this.fun=n,this.array=t}function P(){}function Ut(n){throw new Error("process.binding is not supported")}function St(){return"/"}function Ct(n){throw new Error("process.chdir is not supported")}function Ft(){return 0}function _t(n){var t=Bt.call(K)*.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 Ot(){var n=new Date,t=n-Mt;return t/1e3}var M,O,C,z,D,ie,mt,dt,yt,wt,xt,gt,vt,Tt,Nt,kt,It,Lt,At,bt,Et,Rt,K,Bt,Mt,w,Ue,p=xe(()=>{"use strict";M=Se,O=Ce;typeof globalThis.setTimeout=="function"&&(M=setTimeout);typeof globalThis.clearTimeout=="function"&&(O=clearTimeout);C=[],z=!1,ie=-1;_e.prototype.run=function(){this.fun.apply(null,this.array)};mt="browser",dt="browser",yt=!0,wt={},xt=[],gt="",vt={},Tt={},Nt={};kt=P,It=P,Lt=P,At=P,bt=P,Et=P,Rt=P;K=globalThis.performance||{},Bt=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};Mt=new Date;w={nextTick:ht,title:mt,browser:yt,env:wt,argv:xt,version:gt,versions:vt,on:kt,addListener:It,once:Lt,off:At,removeListener:bt,removeAllListeners:Et,emit:Rt,binding:Ut,cwd:St,chdir:Ct,umask:Ft,hrtime:_t,platform:dt,release:Tt,config:Nt,uptime:Ot},Ue={};Object.keys(Ue).forEach(n=>{let t=n.split("."),e=w;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=Ue[n]:e=e[i]||(e[i]={})}})});function Pe(){ve=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)E[t]=n[t],A[n.charCodeAt(t)]=t;A[45]=62,A[95]=63}function Pt(n){ve||Pe();var t,e,r,i,a,o,l=n.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=n[l-2]==="="?2:n[l-1]==="="?1:0,o=new Dt(l*3/4-a),r=a>0?l-4:l;var u=0;for(t=0,e=0;t<r;t+=4,e+=3)i=A[n.charCodeAt(t)]<<18|A[n.charCodeAt(t+1)]<<12|A[n.charCodeAt(t+2)]<<6|A[n.charCodeAt(t+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=i&255;return a===2?(i=A[n.charCodeAt(t)]<<2|A[n.charCodeAt(t+1)]>>4,o[u++]=i&255):a===1&&(i=A[n.charCodeAt(t)]<<10|A[n.charCodeAt(t+1)]<<4|A[n.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=i&255),o}function $t(n){return E[n>>18&63]+E[n>>12&63]+E[n>>6&63]+E[n&63]}function jt(n,t,e){for(var r,i=[],a=t;a<e;a+=3)r=(n[a]<<16)+(n[a+1]<<8)+n[a+2],i.push($t(r));return i.join("")}function Me(n){ve||Pe();for(var t,e=n.length,r=e%3,i="",a=[],o=16383,l=0,u=e-r;l<u;l+=o)a.push(jt(n,l,l+o>u?u:l+o));return r===1?(t=n[e-1],i+=E[t>>2],i+=E[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=E[t>>10],i+=E[t>>4&63],i+=E[t<<2&63],i+="="),a.push(i),a.join("")}function ae(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function F(n,t){if(ae()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Te(this,n)}return $e(this,n,t,e)}function $e(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?Wt(n,t,e,r):typeof t=="string"?Yt(n,t,e):Gt(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 Vt(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 Te(n,t){if(je(t),n=F(n,t<0?0:Ne(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function Yt(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=Ve(t,e)|0;n=F(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function ge(n,t){var e=t.length<0?0:Ne(t.length)|0;n=F(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function Wt(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=ge(n,t),n}function Gt(n,t){if(R(t)){var e=Ne(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"||ur(t.length)?F(n,0):ge(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return ge(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ne(n){if(n>=ae())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ae().toString(16)+" bytes");return n|0}function R(n){return!!(n!=null&&n._isBuffer)}function Ve(n,t){if(R(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 oe(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ke(n).length;default:if(r)return oe(n).length;t=(""+t).toLowerCase(),r=!0}}function Jt(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 rr(this,t,e);case"utf8":case"utf-8":return Ge(this,t,e);case"ascii":return er(this,t,e);case"latin1":case"binary":return tr(this,t,e);case"base64":return Zt(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nr(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function $(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function Ye(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),R(t))return t.length===0?-1:Oe(n,t,e,r,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):Oe(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function Oe(n,t,e,r,i){var a=1,o=n.length,l=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;a=2,o/=2,l/=2,e/=2}function u(T,S){return a===1?T[S]:T.readUInt16BE(S*a)}var m;if(i){var y=-1;for(m=e;m<o;m++)if(u(n,m)===u(t,y===-1?0:m-y)){if(y===-1&&(y=m),m-y+1===l)return y*a}else y!==-1&&(m-=m-y),y=-1}else for(e+l>o&&(e=o-l),m=e;m>=0;m--){for(var d=!0,g=0;g<l;g++)if(u(n,m+g)!==u(t,g)){d=!1;break}if(d)return m}return-1}function qt(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var l=parseInt(t.substr(o*2,2),16);if(isNaN(l))return o;n[e+o]=l}return o}function Ht(n,t,e,r){return ce(oe(t,n.length-e),n,e,r)}function We(n,t,e,r){return ce(lr(t),n,e,r)}function Kt(n,t,e,r){return We(n,t,e,r)}function zt(n,t,e,r){return ce(Ke(t),n,e,r)}function Xt(n,t,e,r){return ce(cr(t,n.length-e),n,e,r)}function Zt(n,t,e){return t===0&&e===n.length?Me(n):Me(n.slice(t,e))}function Ge(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var a=n[i],o=null,l=a>239?4:a>223?3:a>191?2:1;if(i+l<=e){var u,m,y,d;switch(l){case 1:a<128&&(o=a);break;case 2:u=n[i+1],(u&192)===128&&(d=(a&31)<<6|u&63,d>127&&(o=d));break;case 3:u=n[i+1],m=n[i+2],(u&192)===128&&(m&192)===128&&(d=(a&15)<<12|(u&63)<<6|m&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:u=n[i+1],m=n[i+2],y=n[i+3],(u&192)===128&&(m&192)===128&&(y&192)===128&&(d=(a&15)<<18|(u&63)<<12|(m&63)<<6|y&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,l=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=l}return Qt(r)}function Qt(n){var t=n.length;if(t<=De)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=De));return e}function er(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 tr(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 rr(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var i="",a=t;a<e;++a)i+=sr(n[a]);return i}function nr(n,t,e){for(var r=n.slice(t,e),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+r[a+1]*256);return i}function N(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 k(n,t,e,r,i,a){if(!R(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(e+r>n.length)throw new RangeError("Index out of range")}function se(n,t,e,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(n.length-e,2);i<a;++i)n[e+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}function le(n,t,e,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(n.length-e,4);i<a;++i)n[e+i]=t>>>(r?i:3-i)*8&255}function Je(n,t,e,r,i,a){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function qe(n,t,e,r,i){return i||Je(n,t,e,4,34028234663852886e22,-34028234663852886e22),Xe(n,t,e,r,23,4),e+4}function He(n,t,e,r,i){return i||Je(n,t,e,8,17976931348623157e292,-17976931348623157e292),Xe(n,t,e,r,52,8),e+8}function ar(n){if(n=or(n).replace(ir,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function or(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function sr(n){return n<16?"0"+n.toString(16):n.toString(16)}function oe(n,t){t=t||1/0;for(var e,r=n.length,i=null,a=[],o=0;o<r;++o){if(e=n.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;a.push(e)}else if(e<2048){if((t-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function lr(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function cr(n,t){for(var e,r,i,a=[],o=0;o<n.length&&!((t-=2)<0);++o)e=n.charCodeAt(o),r=e>>8,i=e%256,a.push(i),a.push(r);return a}function Ke(n){return Pt(ar(n))}function ce(n,t,e,r){for(var i=0;i<r&&!(i+e>=t.length||i>=n.length);++i)t[i+e]=n[i];return i}function ur(n){return n!==n}function pr(n){return n!=null&&(!!n._isBuffer||ze(n)||fr(n))}function ze(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function fr(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&ze(n.slice(0,0))}function ue(n,t,e,r,i){var a,o,l=i*8-r-1,u=(1<<l)-1,m=u>>1,y=-7,d=e?i-1:0,g=e?-1:1,T=n[t+d];for(d+=g,a=T&(1<<-y)-1,T>>=-y,y+=l;y>0;a=a*256+n[t+d],d+=g,y-=8);for(o=a&(1<<-y)-1,a>>=-y,y+=r;y>0;o=o*256+n[t+d],d+=g,y-=8);if(a===0)a=1-m;else{if(a===u)return o?NaN:(T?-1:1)*(1/0);o=o+Math.pow(2,r),a=a-m}return(T?-1:1)*o*Math.pow(2,a-r)}function Xe(n,t,e,r,i,a){var o,l,u,m=a*8-i-1,y=(1<<m)-1,d=y>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=r?0:a-1,S=r?1:-1,re=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,o=y):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+d>=1?t+=g/u:t+=g*Math.pow(2,1-d),t*u>=2&&(o++,u/=2),o+d>=y?(l=0,o=y):o+d>=1?(l=(t*u-1)*Math.pow(2,i),o=o+d):(l=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;n[e+T]=l&255,T+=S,l/=256,i-=8);for(o=o<<i|l,m+=i;m>0;n[e+T]=o&255,T+=S,o/=256,m-=8);n[e+T-S]|=re*128}var E,A,Dt,ve,De,ir,Ze=xe(()=>{"use strict";p();f();E=[],A=[],Dt=typeof Uint8Array!="undefined"?Uint8Array:Array,ve=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return $e(null,n,t,e)};s.kMaxLength=ae();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return Vt(null,n,t,e)};s.allocUnsafe=function(n){return Te(null,n)};s.allocUnsafeSlow=function(n){return Te(null,n)};s.isBuffer=pr;s.compare=function(t,e){if(!R(t)||!R(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,a=0,o=Math.min(r,i);a<o;++a)if(t[a]!==e[a]){r=t[a],i=e[a];break}return r<i?-1:i<r?1:0};s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=s.allocUnsafe(e),a=0;for(r=0;r<t.length;++r){var o=t[r];if(!R(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};s.byteLength=Ve;s.prototype._isBuffer=!0;s.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)$(this,e,e+1);return this};s.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)$(this,e,e+3),$(this,e+1,e+2);return this};s.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)$(this,e,e+7),$(this,e+1,e+6),$(this,e+2,e+5),$(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?Ge(this,0,t):Jt.apply(this,arguments)};s.prototype.equals=function(t){if(!R(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,i,a){if(!R(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),a===void 0&&(a=this.length),e<0||r>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=r)return 0;if(i>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var o=a-i,l=r-e,u=Math.min(o,l),m=this.slice(i,a),y=t.slice(e,r),d=0;d<u;++d)if(m[d]!==y[d]){o=m[d],l=y[d];break}return o<l?-1:l<o?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return Ye(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return Ye(this,t,e,r,!1)};s.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((r===void 0||r>a)&&(r=a),t.length>0&&(r<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 qt(this,t,e,r);case"utf8":case"utf-8":return Ht(this,t,e,r);case"ascii":return We(this,t,e,r);case"latin1":case"binary":return Kt(this,t,e,r);case"base64":return zt(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xt(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};De=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=s.prototype;else{var a=e-t;i=new s(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+t]}return i};s.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=this[t],a=1,o=0;++o<e&&(a*=256);)i+=this[t+o]*a;return i};s.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=this[t+--e],a=1;e>0&&(a*=256);)i+=this[t+--e]*a;return i};s.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};s.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=this[t],a=1,o=0;++o<e&&(a*=256);)i+=this[t+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var i=e,a=1,o=this[t+--i];i>0&&(a*=256);)o+=this[t+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readInt8=function(t,e){return e||N(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};s.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};s.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),ue(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),ue(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),ue(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),ue(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var a=Math.pow(2,8*r)-1;k(this,t,e,r,a,0)}var o=1,l=0;for(this[e]=t&255;++l<r&&(o*=256);)this[e+l]=t/o&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var a=Math.pow(2,8*r)-1;k(this,t,e,r,a,0)}var o=r-1,l=1;for(this[e+o]=t&255;--o>=0&&(l*=256);)this[e+o]=t/l&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):se(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):se(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):le(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):le(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var a=Math.pow(2,8*r-1);k(this,t,e,r,a-1,-a)}var o=0,l=1,u=0;for(this[e]=t&255;++o<r&&(l*=256);)t<0&&u===0&&this[e+o-1]!==0&&(u=1),this[e+o]=(t/l>>0)-u&255;return e+r};s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var a=Math.pow(2,8*r-1);k(this,t,e,r,a-1,-a)}var o=r-1,l=1,u=0;for(this[e+o]=t&255;--o>=0&&(l*=256);)t<0&&u===0&&this[e+o+1]!==0&&(u=1),this[e+o]=(t/l>>0)-u&255;return e+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):se(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):se(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):le(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):le(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return qe(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return qe(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return He(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return He(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var a=i-r,o;if(this===t&&r<e&&e<i)for(o=a-1;o>=0;--o)t[o+e]=this[o+r];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a};s.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var a=t.charCodeAt(0);a<256&&(t=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var o;if(typeof t=="number")for(o=e;o<r;++o)this[o]=t;else{var l=R(t)?t:oe(new s(t,i).toString()),u=l.length;for(o=0;o<r-e;++o)this[o+e]=l[o%u]}return this};ir=/[^+\/0-9A-Za-z-_]/g});var f=xe(()=>{"use strict";Ze()});var jr={};Re(jr,{DynamicTypeLiteralMapper:()=>Ee});module.exports=ut(jr);p();f();p();f();p();f();function I(n){throw new Error("Unexpected value: "+JSON.stringify(n))}p();f();p();f();p();f();var Qe,et,X=(et=(Qe=w.env.FERN_STACK_TRACK)==null?void 0:Qe.toLowerCase())!=null?et:"",U=X!==""&&X!=="0"&&X!=="false",ke=["single","multiline","box"].includes(X)?X:"single";U&&(Error.stackTraceLimit=50);var hr=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),mr=new Set(["stacktrace"]);function fe({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:a=!0,filterJs:o=!0,formatFilename:l=u=>u}={}){var m;if(!U)return[];r=[...r,...hr],e=[...e,...mr],i=[...i,"runInteractiveTask"];let u=!1;return((m=new Error().stack)!=null?m:"").split(`
2
+ `).map(y=>{let d=y.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(d&&d.length===5){let[,g,T,S,re]=d;if(!g||!T||!S||!re)return;if(u||i.some(it=>g==null?void 0:g.includes(it))){u=!0;return}switch(g){case"Object.<anonymous>":g="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":g=`${g.substring(g.indexOf(".")+1)}()=> { ... }`;break}return{fn:g,path:l(T),position:`${S}:${re}`}}}).filter(y=>{var d,g;return y&&!r.some(T=>y.fn.includes(T))&&!(a&&((d=y.path)!=null&&d.startsWith("node:")))&&!(o&&((g=y.path)!=null&&g.endsWith(".js")))&&!e.some(T=>y.path.includes(T))}).slice(t,t+n)}var pe=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:r=[],filterFunctions:i=[],stopOn:a=[],filterNode:o=!0,filterJs:l=!0,multiline:u=!1,formatFilename:m=y=>y}={}){h(this,"maxFrames");h(this,"skip");h(this,"filterPaths");h(this,"filterFunctions");h(this,"stopOn");h(this,"filterNode");h(this,"filterJs");h(this,"multiline");h(this,"formatFilename");h(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=r,this.filterFunctions=i,this.stopOn=a,this.filterNode=o,this.filterJs=l,this.multiline=u,this.formatFilename=m}tag(t){let e=this.tracking.get(t)||new Set;fe({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(!U)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}},B;function tt({maxFrames:n=50,skip:t=0,filterPaths:e=[],filterFunctions:r=[],stopOn:i=[],filterNode:a=!0,filterJs:o=!0,multiline:l=!1,formatFilename:u=m=>m}={}){U&&(B!=null||(B=new pe({maxFrames:n,skip:t,filterPaths:e,filterFunctions:r,stopOn:i,filterNode:a,filterJs:o,multiline:l,formatFilename:u})))}function rt(n){B==null||B.tag(n)}function Ie(n){var t;return(t=B==null?void 0:B.frames(n))!=null?t:[]}var j=class{constructor(){rt(this)}};p();f();var he=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},Z=class extends he{async format(t){return t}formatSync(t){return t}};p();f();p();f();p();f();var b=class extends j{constructor(e){super();h(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 dr=4;tt({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var Q=class{constructor(){h(this,"lineBuffer",[]);h(this,"indentLevel",0);h(this,"hasWrittenAnything",!1);h(this,"lastCharacterIsSemicolon",!1);h(this,"lastCharacterIsNewline",!1);h(this,"nodeStackFrames",[])}get buffer(){return U&&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(`
@@ -12,20 +12,20 @@ ${a}`);this.isAtStartOfLine()&&(o=a+o),r&&(o+=`
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 a=1;a<t.length;a++){this.write(e);let o=t[a];o!=null&&r(o)}}}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=U&&!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(fe({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,ke){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 dr}};p();f();function Ae(n){return(n==null?void 0:n.name)!=null&&(n==null?void 0:n.assignment)!=null}p();f();p();f();var _={Critical:"CRITICAL",Warning:"WARNING"};p();f();p();f();p();f();var V=class extends Q{constructor({packageName:e,customConfig:r,formatter:i}){super();h(this,"packageName");h(this,"customConfig");h(this,"formatter");h(this,"imports",new Set);this.packageName=e,this.customConfig=r,this.formatter=i!=null?i:new Z}addImport(e){this.imports.add(e)}getImports(){return new Set(this.imports)}};var ee=class extends V{constructor({packageName:t,customConfig:e,formatter:r}){super({packageName:t,customConfig:e,formatter:r})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Java file: ${e}
15
+ `),i=U&&!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(fe({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,ke){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 dr}};p();f();function Le(n){return(n==null?void 0:n.name)!=null&&(n==null?void 0:n.assignment)!=null}p();f();p();f();var _={Critical:"CRITICAL",Warning:"WARNING"};p();f();p();f();p();f();var V=class extends Q{constructor({packageName:e,customConfig:r,formatter:i}){super();h(this,"packageName");h(this,"customConfig");h(this,"formatter");h(this,"imports",new Set);this.packageName=e,this.customConfig=r,this.formatter=i!=null?i:new Z}addImport(e){this.imports.add(e)}getImports(){return new Set(this.imports)}};var ee=class extends V{constructor({packageName:t,customConfig:e,formatter:r}){super({packageName:t,customConfig:e,formatter:r})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Java 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 Java file: ${e}
17
17
  ${t}`)}return t}getContent(){let t=`package ${this.packageName};
18
18
 
19
19
  `,e=this.stringifyImports();return e.length>0?`${t}${e}
20
20
 
21
21
  ${this.buffer}`:t+this.buffer}stringifyImports(){return Array.from(this.imports).filter(t=>t!==this.packageName).map(t=>`import ${t};`).sort().join(`
22
- `)}};var u={};Re(u,{Access:()=>Le,AstNode:()=>v,Class:()=>Y,ClassInstantiation:()=>W,ClassReference:()=>x,CodeBlock:()=>G,Method:()=>J,MethodInvocation:()=>q,Parameter:()=>H,Type:()=>te,TypeLiteral:()=>A,Writer:()=>V,classReference:()=>_r,class_:()=>Br,codeblock:()=>Fr,instantiateClass:()=>Mr,invokeMethod:()=>Or,method:()=>Dr,parameter:()=>$r});p();f();p();f();p();f();var Le={Public:"public",Protected:"protected",Private:"private"};p();f();p();f();var v=class extends j{async toStringAsync({packageName:t,customConfig:e,formatter:r}){let i=new ee({packageName:t,customConfig:e,formatter:r});return this.write(i),i.toStringAsync()}toString({packageName:t,customConfig:e,formatter:r}){let i=new ee({packageName:t,customConfig:e,formatter:r});return this.write(i),i.toString()}};var Y=class extends v{constructor({name:e,access:r}){super();h(this,"name");h(this,"access");h(this,"methods",[]);this.name=e,this.access=r}write(e){if(e.write(`${this.access} class ${this.name}`),this.isEmpty()){e.writeLine(" {}");return}e.writeLine(" {"),e.indent();for(let r of this.methods)e.writeNode(r),e.newLine();e.dedent(),e.write("}")}addMethod(e){this.methods.push(e)}isEmpty(){return this.methods.length===0}};p();f();p();f();p();f();p();f();var x=class extends v{constructor({name:e,packageName:r,fullyQualified:i}){super();h(this,"name");h(this,"packageName");h(this,"fullyQualified");this.name=e,this.packageName=r,this.fullyQualified=i!=null?i:!1}write(e){if(e.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){e.write(`${this.packageName}.${this.name}`);return}e.write(this.name)}};p();f();var te=class extends v{constructor(e){super();h(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"array":e.writeNode(this.internalType.value),e.write("[]");break;case"bigInteger":e.writeNode(yr);break;case"boolean":e.write("Boolean");break;case"bytes":e.write("byte[]");break;case"date":e.write("String");break;case"dateTime":e.writeNode(gr);break;case"double":e.write("Double");break;case"float":e.write("Float");break;case"generic":e.writeNode(this.internalType.value),e.write("<");for(let[r,i]of this.internalType.parameters.entries())e.writeNode(i),r<this.internalType.parameters.length-1&&e.write(", ");e.write(">");break;case"inputStream":e.writeNode(Nr);break;case"integer":e.write("Integer");break;case"iterable":this.writeIterable({writer:e,iterable:this.internalType});break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write("Long");break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"object":{e.write("Object");break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write("String");break;case"uuid":e.writeNode(Tr);break;case"void":e.write("Void");break;default:I(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(e){return new this({type:"array",value:e})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(e){return new this({type:"list",value:e})}static long(){return new this({type:"long"})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static object(){return new this({type:"object"})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static reference(e){return new this({type:"reference",value:e})}static generic(e,r){return new this({type:"generic",value:e,parameters:r})}static set(e){return new this({type:"set",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(e){return new this({type:"iterable",value:e})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:e,list:r}){e.writeNode(wr),e.write("<"),r.value.write(e),e.write(">")}writeMap({writer:e,map:r}){e.writeNode(xr),e.write("<"),r.keyType.write(e),e.write(", "),r.valueType.write(e),e.write(">")}writeOptional({writer:e,optional:r}){e.writeNode(me),e.write("<"),r.value.write(e),e.write(">")}writeIterable({writer:e,iterable:r}){e.writeNode(me),e.write("<"),r.value.write(e),e.write(">")}writeSet({writer:e,set:r}){e.writeNode(vr),e.write("<"),r.value.write(e),e.write(">")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},de=new x({name:"Arrays",packageName:"java.util"}),yr=new x({name:"BigInteger",packageName:"java.math"}),Oi=new x({name:"HashMap",packageName:"java.util"}),wr=new x({name:"List",packageName:"java.util"}),xr=new x({name:"Map",packageName:"java.util"}),gr=new x({name:"OffsetDateTime",packageName:"java.time"}),me=new x({name:"Optional",packageName:"java.util"}),vr=new x({name:"Set",packageName:"java.util"}),Tr=new x({name:"UUID",packageName:"java.util"}),Nr=new x({name:"InputStream",packageName:"java.io"});var A=class n extends v{constructor(e){super();h(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:e,bigInteger:this.internalType});break;case"boolean":e.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:e,builder:this.internalType});break;case"bytes":e.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"date":e.write(`"${this.internalType.value}"`);break;case"dateTime":this.writeDateTime({writer:e,dateTime:this.internalType});break;case"double":{let r=this.internalType.value.toString();!r.includes(".")&&!r.includes("e")&&!r.includes("E")?e.write(`${r}.0`):e.write(r);break}case"enum":this.writeEnum({writer:e,enum_:this.internalType});break;case"float":e.write(`${this.internalType.value}f`);break;case"integer":e.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"raw":{this.internalType.value instanceof v?e.writeNode(this.internalType.value):e.write(this.internalType.value);break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:e,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:e,uuid:this.internalType});break;case"nop":break;default:I(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(e){return new this({type:"bigInteger",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static builder({classReference:e,parameters:r}){return new this({type:"builder",classReference:e,parameters:r})}static bytes(e){return new this({type:"bytes",value:e})}static class_({reference:e,parameters:r}){return new this({type:"class",reference:e,parameters:r})}static date(e){return new this({type:"date",value:e})}static dateTime(e){return new this({type:"dateTime",value:e})}static double(e){return new this({type:"double",value:e})}static enum_({classReference:e,value:r}){return new this({type:"enum",classReference:e,value:r})}static float(e){return new this({type:"float",value:e})}static integer(e){return new this({type:"integer",value:e})}static list({valueType:e,values:r,isParameter:i}){return new this({type:"list",valueType:e,values:r,isParameter:i})}static long(e){return new this({type:"long",value:e})}static map({keyType:e,valueType:r,entries:i}){return new this({type:"map",keyType:e,valueType:r,entries:i})}static optional({value:e,useOf:r}){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e,useOf:r})}static raw(e){return new this({type:"raw",value:e})}static reference(e){return new this({type:"reference",value:e})}static set({valueType:e,values:r}){return new this({type:"set",valueType:e,values:r})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static uuid(e){return new this({type:"uuid",value:e})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:I(this.internalType)}}writeBigInteger({writer:e,bigInteger:r}){e.write("new "),e.writeNode(u.instantiateClass({classReference:kr,arguments_:[n.string(r.value)]}))}writeBuilder({writer:e,builder:r}){e.writeNode(r.classReference),e.writeNewLineIfLastLineNot(),e.indent(),this.writeBuilderParameters({writer:e,parameters:this.orderBuilderParameters(Er({parameters:r.parameters}))}),e.dedent()}writeBuilderParameters({writer:e,parameters:r}){e.writeLine(".builder()");for(let i of r)e.write(`.${i.name}(`),i.value.shouldWriteInLine()||e.newLine(),e.indent(),e.writeNode(i.value),e.dedent(),i.value.shouldWriteInLine()||e.newLine(),e.writeLine(")");e.writeNewLineIfLastLineNot(),e.write(".build()")}orderBuilderParameters(e){return e.some(i=>!i.value.isOptional()&&!this.isCollection(i.value))?e.sort((i,a)=>{let o=this.isNonRequired(i.value),l=this.isNonRequired(a.value);return o&&!l?1:!o&&l?-1:0}):e.sort((i,a)=>{let o=i.value.isOptional(),l=a.value.isOptional();return o&&!l?1:!o&&l?-1:0})}isCollection(e){let r=e.internalType.type;return r==="list"||r==="set"||r==="map"}isNonRequired(e){return e.isOptional()||this.isCollection(e)}writeClass({writer:e,class_:r}){let i=br({parameters:r.parameters});e.writeNode(u.instantiateClass({classReference:r.reference,arguments_:i.map(a=>a.value)}))}writeDateTime({writer:e,dateTime:r}){e.writeNode(u.invokeMethod({on:Ar,method:"parse",arguments_:[n.string(r.value)]}))}writeEnum({writer:e,enum_:r}){e.writeNode(r.classReference),e.write("."+r.value)}writeList({writer:e,list:r}){this.writeIterable({writer:e,iterable:r})}writeMap({writer:e,map:r}){let i=Rr({entries:r.entries});if(i.length===0){e.write("new "),e.writeNode(ye),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(ye),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.writeLine(">() {{"),e.indent();for(let a of i)e.write("put("),e.writeNode(a.key),e.write(", "),e.writeNode(a.value),e.writeLine(");");e.dedent(),e.write("}}")}writeOptional({writer:e,optional:r}){if(!r.useOf){e.writeNode(r.value);return}e.writeNode(u.invokeMethod({on:me,method:"of",arguments_:[r.value]}))}writeSet({writer:e,set:r}){this.writeIterable({writer:e,iterable:r})}writeIterable({writer:e,iterable:r}){let i=r.type==="list"?be:Ir,a=Ur({values:r.values});if(r.type==="list"&&r.isParameter&&a.length>0){e.writeNode(u.invokeMethod({on:de,method:"asList",arguments_:a}));return}if(a.length===0){e.write(`new ${i.name}<`),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(i),e.write("<"),e.writeNode(r.valueType),e.writeLine(">("),e.indent(),e.writeNode(u.invokeMethod({on:de,method:"asList",arguments_:a})),e.writeNewLineIfLastLineNot(),e.dedent(),e.write(")")}writeUnknown({writer:e,value:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(`"${this.escapeString(r)}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownMap({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("new "),e.writeNode(be),e.write("<Object>()");return}e.write("new "),e.writeNode(be),e.write("<Object>("),e.writeNode(u.invokeMethod({on:de,method:"asList",arguments_:r.map(i=>n.unknown(i))})),e.write(")")}writeUnknownMap({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("new "),e.writeNode(ye),e.write("<String, Object>()");return}e.writeLine("new "),e.writeNode(ye),e.write("<String, Object>() {{"),e.indent();for(let[a,o]of i)e.write(`put("${a}", `),e.writeNode(n.unknown(o)),e.writeLine(");");e.dedent(),e.write("}}")}writeUUID({writer:e,uuid:r}){e.writeNode(u.invokeMethod({on:Lr,method:"fromString",arguments_:[n.string(r.value)]}))}escapeString(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},be=new x({name:"ArrayList",packageName:"java.util"}),kr=new x({name:"BigInteger",packageName:"java.math"}),ye=new x({name:"HashMap",packageName:"java.util"}),Ir=new x({name:"HashSet",packageName:"java.util"}),qi=new x({name:"List",packageName:"java.util"}),Hi=new x({name:"Map",packageName:"java.util"}),Ar=new x({name:"OffsetDateTime",packageName:"java.time"}),Ki=new x({name:"Set",packageName:"java.util"}),Lr=new x({name:"UUID",packageName:"java.util"});function br({parameters:n}){return n.filter(t=>!A.isNop(t.value))}function Er({parameters:n}){return n.filter(t=>!A.isNop(t.value))}function Rr({entries:n}){return n.filter(t=>!A.isNop(t.key)&&!A.isNop(t.value))}function Ur({values:n}){return n.filter(t=>!A.isNop(t))}function we({writer:n,arguments_:t}){let e=Cr(t);if(e.length===0){n.write("()");return}if(e.some(i=>i instanceof A&&!i.shouldWriteInLine())){Sr({writer:n,arguments_:e});return}n.write("("),e.forEach((i,a)=>{a>0&&n.write(", "),nt({writer:n,argument:i})}),n.write(")")}function Sr({writer:n,arguments_:t}){n.writeLine("("),n.indent(),t.forEach((e,r)=>{r>0&&n.writeLine(","),nt({writer:n,argument:e})}),n.dedent(),t.length>0&&n.newLine(),n.write(")")}function nt({writer:n,argument:t}){Ae(t)?n.writeNodeOrString(t.assignment):t.write(n)}function Cr(n){return n.filter(t=>!(t instanceof A&&A.isNop(t)))}var W=class extends v{constructor({classReference:e,arguments_:r}){super();h(this,"classReference");h(this,"arguments_");this.classReference=e,this.arguments_=r}write(e){e.writeNode(this.classReference),we({writer:e,arguments_:this.arguments_})}};p();f();var G=class extends v{constructor(e){super();h(this,"arg");this.arg=e}write(e){return new b(this.arg).write(e)}};p();f();var J=class extends v{constructor({name:e,access:r,parameters:i,body:a,static_:o,return_:l}){super();h(this,"name");h(this,"access");h(this,"parameters");h(this,"body");h(this,"return_");h(this,"static_");this.name=e,this.access=r,this.parameters=i,this.body=a,this.return_=l,this.static_=o!=null?o:!1}write(e){if(e.write(`${this.access} `),this.static_&&e.write("static "),this.return_!=null?e.writeNode(this.return_):e.write("void"),e.write(` ${this.name}`),this.parameters.length===0)e.write("()");else if(this.parameters.length===1){if(e.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);e.writeNode(this.parameters[0]),e.write(")")}else e.writeLine("("),e.indent(),this.parameters.forEach((r,i)=>{i>0&&e.writeLine(", "),e.writeNode(r)}),e.dedent(),e.write(")");if(this.body==null){e.write(";");return}e.writeLine(" {"),e.indent(),e.writeNode(this.body),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("}")}};p();f();var q=class extends v{constructor({method:e,arguments_:r,on:i}){super();h(this,"on");h(this,"method");h(this,"arguments_");this.on=i,this.method=e,this.arguments_=r}write(e){this.on.write(e),e.write("."),e.write(this.method),we({writer:e,arguments_:this.arguments_})}};p();f();var H=class extends v{constructor({name:e,type:r}){super();h(this,"name");h(this,"type");this.name=e,this.type=r}write(e){e.writeNode(this.type),e.write(` ${this.name}`)}};function Fr(n){return new G(n)}function Br(n){return new Y(n)}function _r(n){return new x(n)}function Mr(n){return new W(n)}function Or(n){return new q(n)}function Dr(n){return new J(n)}function $r(n){return new H(n)}var Ee=class{constructor({context:t}){h(this,"context");this.context=t}isNopTypeLiteral(t){var r;return((r=t.internalType)==null?void 0:r.type)==="nop"}usesOptionalNullable(){var t;return((t=this.context.customConfig)==null?void 0:t["collapse-optional-nullable"])===!0}wrapInOptionalIfNotNop(t,e=!1){return this.isNopTypeLiteral(t)?t:this.usesOptionalNullable()?this.context.getOptionalNullableOf(t):u.TypeLiteral.optional({value:t,useOf:e})}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:_.Critical,message:"Expected non-null value, but got null"}),u.TypeLiteral.nop());if(t.value===void 0)return u.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value,as:t.as});case"literal":return this.convertLiteral({literal:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value,as:t.as});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?u.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as,inUndiscriminatedUnion:t.inUndiscriminatedUnion})}case"nullable":case"optional":{if(t.value===void 0||typeof t.value=="object"&&t.value!==null&&Object.keys(t.value).length===0&&t.typeReference.value.type==="named")return this.usesOptionalNullable()?this.context.getOptionalNullableAbsent():u.TypeLiteral.reference(u.invokeMethod({on:u.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(t.typeReference.value.type==="list"){let i=this.convertList({list:t.typeReference.value.value,value:t.value});return this.wrapInOptionalIfNotNop(i,!0)}if(this.usesOptionalNullable()&&(t.typeReference.value.type==="optional"||t.typeReference.value.type==="nullable"))return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as,inUndiscriminatedUnion:t.inUndiscriminatedUnion});let e=this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as,inUndiscriminatedUnion:t.inUndiscriminatedUnion}),r=t.as==="mapValue"||t.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(e,r)}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,as:t.as});case"unknown":return this.convertUnknown({value:t.value});default:I(t.typeReference)}}convertList({list:t,value:e,as:r}){if(!Array.isArray(e))return this.context.errors.add({severity:_.Critical,message:`Expected array but got: ${typeof e}`}),u.TypeLiteral.nop();let i=t.type==="optional"||t.type==="nullable";return u.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((a,o)=>{this.context.errors.scope({index:o});try{if(i){let l=this.convert({typeReference:t.value,value:a,as:r});return this.wrapInOptionalIfNotNop(l,!0)}return this.convert({typeReference:t,value:a,as:r})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?u.TypeLiteral.nop():u.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?u.TypeLiteral.nop():u.TypeLiteral.string(r)}default:I(t)}}convertSet({set:t,value:e,as:r}){return Array.isArray(e)?u.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((i,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:t,value:i,as:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:_.Critical,message:`Expected array but got: ${typeof e}`}),u.TypeLiteral.nop())}convertMap({map:t,value:e,as:r}){return typeof e!="object"||e==null?(this.context.errors.add({severity:_.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),u.TypeLiteral.nop()):u.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:t.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:t.value}),entries:Object.entries(e).map(([i,a])=>{this.context.errors.scope(i);try{return{key:this.convert({typeReference:t.key,value:i,as:"mapKey"}),value:this.convert({typeReference:t.value,value:a,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:r,inUndiscriminatedUnion:i}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r,inUndiscriminatedUnion:i});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,as:r});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:I(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let r=this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),i=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(i==null)return u.TypeLiteral.nop();let a=i.singleDiscriminatedUnionType;switch(a.type){case"samePropertiesAsObject":{let o=this.context.resolveNamedType({typeId:a.typeId});return o==null?u.TypeLiteral.nop():u.TypeLiteral.reference(u.invokeMethod({on:r,method:this.context.getPropertyName(a.discriminantValue.name),arguments_:[this.convertNamed({named:o,value:i.value})]}))}case"singleProperty":{let o=this.context.getRecord(i.value);if(o==null)return u.TypeLiteral.nop();try{return this.context.errors.scope(a.discriminantValue.wireValue),u.TypeLiteral.reference(u.invokeMethod({on:r,method:this.context.getPropertyName(a.discriminantValue.name),arguments_:[this.convert({typeReference:a.typeReference,value:o[a.discriminantValue.wireValue]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return u.TypeLiteral.reference(u.invokeMethod({on:r,method:this.context.getPropertyName(a.discriminantValue.name),arguments_:[]}));default:I(a)}}convertObject({object_:t,value:e,as:r}){var o;let i=this.context.associateByWireValue({parameters:t.properties,values:(o=this.context.getRecord(e))!=null?o:{}}),a=r==="request"?i.filter(l=>!this.context.isDirectLiteral(l.typeReference)):i;return u.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),parameters:a.map(l=>{this.context.errors.scope(l.name.wireValue);try{return{name:this.context.getMethodName(l.name.name),value:this.convert({typeReference:l.typeReference,value:l.value,as:r})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let r=this.getEnumValueName({enum_:t,value:e});return r==null?u.TypeLiteral.nop():u.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),value:r})}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:_.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(i=>i.wireValue===e);if(r==null){this.context.errors.add({severity:_.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getEnumName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return r==null?u.TypeLiteral.nop():this.context.isPrimitive(r.valueTypeReference)?u.TypeLiteral.reference(u.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:"of",arguments_:[r.typeInstantiation]})):u.TypeLiteral.reference(u.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:"of",arguments_:[r.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){var l;let r=[],i=[];for(let c of t.types)try{r.push(JSON.stringify(c));let m=this.convert({typeReference:c,value:e,inUndiscriminatedUnion:!0});return{valueTypeReference:c,typeInstantiation:m}}catch(m){i.push(`Type ${JSON.stringify(c)}: ${m instanceof Error?m.message:String(m)}`);continue}this.context.errors.add({severity:_.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value. Tried ${r.length} variants. Errors: ${i.join("; ")}`});let a=(l=t.declaration.name)!=null?l:"UnknownUnion",o=i.map((c,m)=>` ${m+1}. ${c}`).join(`
22
+ `)}};var c={};Re(c,{Access:()=>Ae,AstNode:()=>v,Class:()=>Y,ClassInstantiation:()=>W,ClassReference:()=>x,CodeBlock:()=>G,Method:()=>J,MethodInvocation:()=>q,Parameter:()=>H,Type:()=>te,TypeLiteral:()=>L,Writer:()=>V,classReference:()=>Mr,class_:()=>_r,codeblock:()=>Br,instantiateClass:()=>Or,invokeMethod:()=>Dr,method:()=>Pr,parameter:()=>$r});p();f();p();f();p();f();var Ae={Public:"public",Protected:"protected",Private:"private"};p();f();p();f();var v=class extends j{async toStringAsync({packageName:t,customConfig:e,formatter:r}){let i=new ee({packageName:t,customConfig:e,formatter:r});return this.write(i),i.toStringAsync()}toString({packageName:t,customConfig:e,formatter:r}){let i=new ee({packageName:t,customConfig:e,formatter:r});return this.write(i),i.toString()}};var Y=class extends v{constructor({name:e,access:r}){super();h(this,"name");h(this,"access");h(this,"methods",[]);this.name=e,this.access=r}write(e){if(e.write(`${this.access} class ${this.name}`),this.isEmpty()){e.writeLine(" {}");return}e.writeLine(" {"),e.indent();for(let r of this.methods)e.writeNode(r),e.newLine();e.dedent(),e.write("}")}addMethod(e){this.methods.push(e)}isEmpty(){return this.methods.length===0}};p();f();p();f();p();f();p();f();var x=class extends v{constructor({name:e,packageName:r,fullyQualified:i}){super();h(this,"name");h(this,"packageName");h(this,"fullyQualified");this.name=e,this.packageName=r,this.fullyQualified=i!=null?i:!1}write(e){if(e.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){e.write(`${this.packageName}.${this.name}`);return}e.write(this.name)}};p();f();var te=class extends v{constructor(e){super();h(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"array":e.writeNode(this.internalType.value),e.write("[]");break;case"bigInteger":e.writeNode(yr);break;case"boolean":e.write("Boolean");break;case"bytes":e.write("byte[]");break;case"date":e.write("String");break;case"dateTime":e.writeNode(gr);break;case"double":e.write("Double");break;case"float":e.write("Float");break;case"generic":e.writeNode(this.internalType.value),e.write("<");for(let[r,i]of this.internalType.parameters.entries())e.writeNode(i),r<this.internalType.parameters.length-1&&e.write(", ");e.write(">");break;case"inputStream":e.writeNode(Nr);break;case"integer":e.write("Integer");break;case"iterable":this.writeIterable({writer:e,iterable:this.internalType});break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write("Long");break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"object":{e.write("Object");break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write("String");break;case"uuid":e.writeNode(Tr);break;case"void":e.write("Void");break;default:I(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(e){return new this({type:"array",value:e})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(e){return new this({type:"list",value:e})}static long(){return new this({type:"long"})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static object(){return new this({type:"object"})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static reference(e){return new this({type:"reference",value:e})}static generic(e,r){return new this({type:"generic",value:e,parameters:r})}static set(e){return new this({type:"set",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(e){return new this({type:"iterable",value:e})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:e,list:r}){e.writeNode(wr),e.write("<"),r.value.write(e),e.write(">")}writeMap({writer:e,map:r}){e.writeNode(xr),e.write("<"),r.keyType.write(e),e.write(", "),r.valueType.write(e),e.write(">")}writeOptional({writer:e,optional:r}){e.writeNode(me),e.write("<"),r.value.write(e),e.write(">")}writeIterable({writer:e,iterable:r}){e.writeNode(me),e.write("<"),r.value.write(e),e.write(">")}writeSet({writer:e,set:r}){e.writeNode(vr),e.write("<"),r.value.write(e),e.write(">")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},de=new x({name:"Arrays",packageName:"java.util"}),yr=new x({name:"BigInteger",packageName:"java.math"}),Di=new x({name:"HashMap",packageName:"java.util"}),wr=new x({name:"List",packageName:"java.util"}),xr=new x({name:"Map",packageName:"java.util"}),gr=new x({name:"OffsetDateTime",packageName:"java.time"}),me=new x({name:"Optional",packageName:"java.util"}),vr=new x({name:"Set",packageName:"java.util"}),Tr=new x({name:"UUID",packageName:"java.util"}),Nr=new x({name:"InputStream",packageName:"java.io"});var L=class n extends v{constructor(e){super();h(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:e,bigInteger:this.internalType});break;case"boolean":e.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:e,builder:this.internalType});break;case"bytes":e.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"date":this.writeDate({writer:e,date:this.internalType});break;case"dateTime":this.writeDateTime({writer:e,dateTime:this.internalType});break;case"double":{let r=this.internalType.value.toString();!r.includes(".")&&!r.includes("e")&&!r.includes("E")?e.write(`${r}.0`):e.write(r);break}case"enum":this.writeEnum({writer:e,enum_:this.internalType});break;case"float":e.write(`${this.internalType.value}f`);break;case"integer":e.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"raw":{this.internalType.value instanceof v?e.writeNode(this.internalType.value):e.write(this.internalType.value);break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:e,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:e,uuid:this.internalType});break;case"nop":break;default:I(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(e){return new this({type:"bigInteger",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static builder({classReference:e,parameters:r}){return new this({type:"builder",classReference:e,parameters:r})}static bytes(e){return new this({type:"bytes",value:e})}static class_({reference:e,parameters:r}){return new this({type:"class",reference:e,parameters:r})}static date(e){return new this({type:"date",value:e})}static dateTime(e){return new this({type:"dateTime",value:e})}static double(e){return new this({type:"double",value:e})}static enum_({classReference:e,value:r}){return new this({type:"enum",classReference:e,value:r})}static float(e){return new this({type:"float",value:e})}static integer(e){return new this({type:"integer",value:e})}static list({valueType:e,values:r,isParameter:i}){return new this({type:"list",valueType:e,values:r,isParameter:i})}static long(e){return new this({type:"long",value:e})}static map({keyType:e,valueType:r,entries:i}){return new this({type:"map",keyType:e,valueType:r,entries:i})}static optional({value:e,useOf:r}){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e,useOf:r})}static raw(e){return new this({type:"raw",value:e})}static reference(e){return new this({type:"reference",value:e})}static set({valueType:e,values:r}){return new this({type:"set",valueType:e,values:r})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static uuid(e){return new this({type:"uuid",value:e})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:I(this.internalType)}}writeBigInteger({writer:e,bigInteger:r}){e.write("new "),e.writeNode(c.instantiateClass({classReference:kr,arguments_:[n.string(r.value)]}))}writeBuilder({writer:e,builder:r}){e.writeNode(r.classReference),e.writeNewLineIfLastLineNot(),e.indent(),this.writeBuilderParameters({writer:e,parameters:this.orderBuilderParameters(Rr({parameters:r.parameters}))}),e.dedent()}writeBuilderParameters({writer:e,parameters:r}){e.writeLine(".builder()");for(let i of r)e.write(`.${i.name}(`),i.value.shouldWriteInLine()||e.newLine(),e.indent(),e.writeNode(i.value),e.dedent(),i.value.shouldWriteInLine()||e.newLine(),e.writeLine(")");e.writeNewLineIfLastLineNot(),e.write(".build()")}orderBuilderParameters(e){return e.some(i=>!i.value.isOptional()&&!this.isCollection(i.value))?e.sort((i,a)=>{let o=this.isNonRequired(i.value),l=this.isNonRequired(a.value);return o&&!l?1:!o&&l?-1:0}):e.sort((i,a)=>{let o=i.value.isOptional(),l=a.value.isOptional();return o&&!l?1:!o&&l?-1:0})}isCollection(e){let r=e.internalType.type;return r==="list"||r==="set"||r==="map"}isNonRequired(e){return e.isOptional()||this.isCollection(e)}writeClass({writer:e,class_:r}){let i=Er({parameters:r.parameters});e.writeNode(c.instantiateClass({classReference:r.reference,arguments_:i.map(a=>a.value)}))}writeDate({writer:e,date:r}){e.writeNode(c.invokeMethod({on:Lr,method:"parse",arguments_:[n.string(r.value)]}))}writeDateTime({writer:e,dateTime:r}){e.writeNode(c.invokeMethod({on:Ar,method:"parse",arguments_:[n.string(r.value)]}))}writeEnum({writer:e,enum_:r}){e.writeNode(r.classReference),e.write("."+r.value)}writeList({writer:e,list:r}){this.writeIterable({writer:e,iterable:r})}writeMap({writer:e,map:r}){let i=Ur({entries:r.entries});if(i.length===0){e.write("new "),e.writeNode(ye),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(ye),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.writeLine(">() {{"),e.indent();for(let a of i)e.write("put("),e.writeNode(a.key),e.write(", "),e.writeNode(a.value),e.writeLine(");");e.dedent(),e.write("}}")}writeOptional({writer:e,optional:r}){if(!r.useOf){e.writeNode(r.value);return}e.writeNode(c.invokeMethod({on:me,method:"of",arguments_:[r.value]}))}writeSet({writer:e,set:r}){this.writeIterable({writer:e,iterable:r})}writeIterable({writer:e,iterable:r}){let i=r.type==="list"?be:Ir,a=Sr({values:r.values});if(r.type==="list"&&r.isParameter&&a.length>0){e.writeNode(c.invokeMethod({on:de,method:"asList",arguments_:a}));return}if(a.length===0){e.write(`new ${i.name}<`),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(i),e.write("<"),e.writeNode(r.valueType),e.writeLine(">("),e.indent(),e.writeNode(c.invokeMethod({on:de,method:"asList",arguments_:a})),e.writeNewLineIfLastLineNot(),e.dedent(),e.write(")")}writeUnknown({writer:e,value:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(`"${this.escapeString(r)}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownMap({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("new "),e.writeNode(be),e.write("<Object>()");return}e.write("new "),e.writeNode(be),e.write("<Object>("),e.writeNode(c.invokeMethod({on:de,method:"asList",arguments_:r.map(i=>n.unknown(i))})),e.write(")")}writeUnknownMap({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("new "),e.writeNode(ye),e.write("<String, Object>()");return}e.writeLine("new "),e.writeNode(ye),e.write("<String, Object>() {{"),e.indent();for(let[a,o]of i)e.write(`put("${a}", `),e.writeNode(n.unknown(o)),e.writeLine(");");e.dedent(),e.write("}}")}writeUUID({writer:e,uuid:r}){e.writeNode(c.invokeMethod({on:br,method:"fromString",arguments_:[n.string(r.value)]}))}escapeString(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},be=new x({name:"ArrayList",packageName:"java.util"}),kr=new x({name:"BigInteger",packageName:"java.math"}),ye=new x({name:"HashMap",packageName:"java.util"}),Ir=new x({name:"HashSet",packageName:"java.util"}),Hi=new x({name:"List",packageName:"java.util"}),Lr=new x({name:"LocalDate",packageName:"java.time"}),Ki=new x({name:"Map",packageName:"java.util"}),Ar=new x({name:"OffsetDateTime",packageName:"java.time"}),zi=new x({name:"Set",packageName:"java.util"}),br=new x({name:"UUID",packageName:"java.util"});function Er({parameters:n}){return n.filter(t=>!L.isNop(t.value))}function Rr({parameters:n}){return n.filter(t=>!L.isNop(t.value))}function Ur({entries:n}){return n.filter(t=>!L.isNop(t.key)&&!L.isNop(t.value))}function Sr({values:n}){return n.filter(t=>!L.isNop(t))}function we({writer:n,arguments_:t}){let e=Fr(t);if(e.length===0){n.write("()");return}if(e.some(i=>i instanceof L&&!i.shouldWriteInLine())){Cr({writer:n,arguments_:e});return}n.write("("),e.forEach((i,a)=>{a>0&&n.write(", "),nt({writer:n,argument:i})}),n.write(")")}function Cr({writer:n,arguments_:t}){n.writeLine("("),n.indent(),t.forEach((e,r)=>{r>0&&n.writeLine(","),nt({writer:n,argument:e})}),n.dedent(),t.length>0&&n.newLine(),n.write(")")}function nt({writer:n,argument:t}){Le(t)?n.writeNodeOrString(t.assignment):t.write(n)}function Fr(n){return n.filter(t=>!(t instanceof L&&L.isNop(t)))}var W=class extends v{constructor({classReference:e,arguments_:r}){super();h(this,"classReference");h(this,"arguments_");this.classReference=e,this.arguments_=r}write(e){e.writeNode(this.classReference),we({writer:e,arguments_:this.arguments_})}};p();f();var G=class extends v{constructor(e){super();h(this,"arg");this.arg=e}write(e){return new b(this.arg).write(e)}};p();f();var J=class extends v{constructor({name:e,access:r,parameters:i,body:a,static_:o,return_:l}){super();h(this,"name");h(this,"access");h(this,"parameters");h(this,"body");h(this,"return_");h(this,"static_");this.name=e,this.access=r,this.parameters=i,this.body=a,this.return_=l,this.static_=o!=null?o:!1}write(e){if(e.write(`${this.access} `),this.static_&&e.write("static "),this.return_!=null?e.writeNode(this.return_):e.write("void"),e.write(` ${this.name}`),this.parameters.length===0)e.write("()");else if(this.parameters.length===1){if(e.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);e.writeNode(this.parameters[0]),e.write(")")}else e.writeLine("("),e.indent(),this.parameters.forEach((r,i)=>{i>0&&e.writeLine(", "),e.writeNode(r)}),e.dedent(),e.write(")");if(this.body==null){e.write(";");return}e.writeLine(" {"),e.indent(),e.writeNode(this.body),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("}")}};p();f();var q=class extends v{constructor({method:e,arguments_:r,on:i}){super();h(this,"on");h(this,"method");h(this,"arguments_");this.on=i,this.method=e,this.arguments_=r}write(e){this.on.write(e),e.write("."),e.write(this.method),we({writer:e,arguments_:this.arguments_})}};p();f();var H=class extends v{constructor({name:e,type:r}){super();h(this,"name");h(this,"type");this.name=e,this.type=r}write(e){e.writeNode(this.type),e.write(` ${this.name}`)}};function Br(n){return new G(n)}function _r(n){return new Y(n)}function Mr(n){return new x(n)}function Or(n){return new W(n)}function Dr(n){return new q(n)}function Pr(n){return new J(n)}function $r(n){return new H(n)}var Ee=class{constructor({context:t}){h(this,"context");this.context=t}isNopTypeLiteral(t){var r;return((r=t.internalType)==null?void 0:r.type)==="nop"}usesOptionalNullable(){var t;return((t=this.context.customConfig)==null?void 0:t["collapse-optional-nullable"])===!0}wrapInOptionalIfNotNop(t,e=!1){return this.isNopTypeLiteral(t)?t:this.usesOptionalNullable()?this.context.getOptionalNullableOf(t):c.TypeLiteral.optional({value:t,useOf:e})}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:_.Critical,message:"Expected non-null value, but got null"}),c.TypeLiteral.nop());if(t.value===void 0)return c.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value,as:t.as});case"literal":return this.convertLiteral({literal:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value,as:t.as});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?c.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as,inUndiscriminatedUnion:t.inUndiscriminatedUnion})}case"nullable":case"optional":{if(t.value===void 0||typeof t.value=="object"&&t.value!==null&&Object.keys(t.value).length===0&&t.typeReference.value.type==="named")return this.usesOptionalNullable()?this.context.getOptionalNullableAbsent():c.TypeLiteral.reference(c.invokeMethod({on:c.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(t.typeReference.value.type==="list"){let i=this.convertList({list:t.typeReference.value.value,value:t.value});return this.wrapInOptionalIfNotNop(i,!0)}if(this.usesOptionalNullable()&&(t.typeReference.value.type==="optional"||t.typeReference.value.type==="nullable"))return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as,inUndiscriminatedUnion:t.inUndiscriminatedUnion});let e=this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as,inUndiscriminatedUnion:t.inUndiscriminatedUnion}),r=t.as==="mapValue"||t.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(e,r)}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,as:t.as});case"unknown":return this.convertUnknown({value:t.value});default:I(t.typeReference)}}convertList({list:t,value:e,as:r}){if(!Array.isArray(e))return this.context.errors.add({severity:_.Critical,message:`Expected array but got: ${typeof e}`}),c.TypeLiteral.nop();let i=t.type==="optional"||t.type==="nullable";return c.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((a,o)=>{this.context.errors.scope({index:o});try{if(i){let l=this.convert({typeReference:t.value,value:a,as:r});return this.wrapInOptionalIfNotNop(l,!0)}return this.convert({typeReference:t,value:a,as:r})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?c.TypeLiteral.nop():c.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?c.TypeLiteral.nop():c.TypeLiteral.string(r)}default:I(t)}}convertSet({set:t,value:e,as:r}){return Array.isArray(e)?c.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((i,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:t,value:i,as:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:_.Critical,message:`Expected array but got: ${typeof e}`}),c.TypeLiteral.nop())}convertMap({map:t,value:e,as:r}){return typeof e!="object"||e==null?(this.context.errors.add({severity:_.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),c.TypeLiteral.nop()):c.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:t.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:t.value}),entries:Object.entries(e).map(([i,a])=>{this.context.errors.scope(i);try{return{key:this.convert({typeReference:t.key,value:i,as:"mapKey"}),value:this.convert({typeReference:t.value,value:a,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:r,inUndiscriminatedUnion:i}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r,inUndiscriminatedUnion:i});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,as:r});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:I(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let r=this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),i=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(i==null)return c.TypeLiteral.nop();let a=i.singleDiscriminatedUnionType;switch(a.type){case"samePropertiesAsObject":{let o=this.context.resolveNamedType({typeId:a.typeId});return o==null?c.TypeLiteral.nop():c.TypeLiteral.reference(c.invokeMethod({on:r,method:this.context.getPropertyName(a.discriminantValue.name),arguments_:[this.convertNamed({named:o,value:i.value})]}))}case"singleProperty":{let o=this.context.getRecord(i.value);if(o==null)return c.TypeLiteral.nop();try{return this.context.errors.scope(a.discriminantValue.wireValue),c.TypeLiteral.reference(c.invokeMethod({on:r,method:this.context.getPropertyName(a.discriminantValue.name),arguments_:[this.convert({typeReference:a.typeReference,value:o["value"]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return c.TypeLiteral.reference(c.invokeMethod({on:r,method:this.context.getPropertyName(a.discriminantValue.name),arguments_:[]}));default:I(a)}}convertObject({object_:t,value:e,as:r}){var o;let i=this.context.associateByWireValue({parameters:t.properties,values:(o=this.context.getRecord(e))!=null?o:{}}),a=r==="request"?i.filter(l=>!this.context.isDirectLiteral(l.typeReference)):i;return c.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),parameters:a.map(l=>{this.context.errors.scope(l.name.wireValue);try{return{name:this.context.getMethodName(l.name.name),value:this.convert({typeReference:l.typeReference,value:l.value,as:r})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let r=this.getEnumValueName({enum_:t,value:e});return r==null?c.TypeLiteral.nop():c.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),value:r})}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:_.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(i=>i.wireValue===e);if(r==null){this.context.errors.add({severity:_.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getEnumName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return r==null?c.TypeLiteral.nop():this.context.isPrimitive(r.valueTypeReference)?c.TypeLiteral.reference(c.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:"of",arguments_:[r.typeInstantiation]})):c.TypeLiteral.reference(c.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:"of",arguments_:[r.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){var l;let r=[],i=[];for(let u of t.types)try{r.push(JSON.stringify(u));let m=this.convert({typeReference:u,value:e,inUndiscriminatedUnion:!0});return{valueTypeReference:u,typeInstantiation:m}}catch(m){i.push(`Type ${JSON.stringify(u)}: ${m instanceof Error?m.message:String(m)}`);continue}this.context.errors.add({severity:_.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value. Tried ${r.length} variants. Errors: ${i.join("; ")}`});let a=(l=t.declaration.name)!=null?l:"UnknownUnion",o=i.map((u,m)=>` ${m+1}. ${u}`).join(`
23
23
  `);throw new Error(`Failed to match undiscriminated union "${a}" for ${typeof e} value.
24
24
  Value: ${JSON.stringify(e)}
25
25
  Attempted ${r.length} variants:
26
26
  ${o}
27
27
 
28
- This prevents invalid snippet code generation that would cause formatter errors.`)}getUndiscriminatedUnionFieldName({typeReference:t}){switch(t.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:t});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:t.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:t});case"named":{let e=this.context.resolveNamedType({typeId:t.value});return e==null?void 0:this.context.getClassName(e.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:t});case"nullable":return this.getUndiscriminatedUnionFieldNameForNullable({typeReference:t});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:t.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:t});case"unknown":return"Unknown";default:I(t)}}getUndiscriminatedUnionFieldNameForList({list:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`ListOf${e}`}getUndiscriminatedUnionFieldNameForMap({map:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t.key});if(e==null)return;let r=this.getUndiscriminatedUnionFieldName({typeReference:t.value});if(r!=null)return`MapOf${e}To${r}`}getUndiscriminatedUnionFieldNameForOptional({typeReference:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`Optional${e}`}getUndiscriminatedUnionFieldNameForNullable({typeReference:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`Nullable${e}`}getUndiscriminatedUnionFieldNameForSet({set:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`SetOf${e}`}getUndiscriminatedUnionFieldNameForLiteral({literal:t}){}getUndiscriminatedUnionFieldNameForPrimitive({primitive:t}){switch(t){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":return"Float";case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":return"BigInteger";case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:I(t)}}convertUnknown({value:t}){return u.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){switch(t){case"INTEGER":case"UINT":{let i=this.getValueAsNumber({value:e,as:r});return i==null?u.TypeLiteral.nop():u.TypeLiteral.integer(i)}case"LONG":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:r});return i==null?u.TypeLiteral.nop():u.TypeLiteral.long(i)}case"FLOAT":{let i=this.getValueAsNumber({value:e,as:r});return i==null?u.TypeLiteral.nop():u.TypeLiteral.float(i)}case"DOUBLE":{let i=this.getValueAsNumber({value:e,as:r});return i==null?u.TypeLiteral.nop():u.TypeLiteral.double(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:r});return i==null?u.TypeLiteral.nop():u.TypeLiteral.boolean(i)}case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?u.TypeLiteral.nop():u.TypeLiteral.string(i)}case"DATE":{let i=this.context.getValueAsString({value:e});return i==null?u.TypeLiteral.nop():u.TypeLiteral.string(i)}case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?u.TypeLiteral.nop():u.TypeLiteral.dateTime(i)}case"UUID":{let i=this.context.getValueAsString({value:e});return i==null?u.TypeLiteral.nop():u.TypeLiteral.uuid(i)}case"BASE_64":{let i=this.context.getValueAsString({value:e});return i==null?u.TypeLiteral.nop():u.TypeLiteral.bytes(i)}case"BIG_INTEGER":{let i=this.context.getValueAsString({value:e});return i==null?u.TypeLiteral.nop():u.TypeLiteral.bigInteger(i)}default:I(t)}}getValueAsNumber({value:t,as:e}){let r=e==="mapKey"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:t,as:e}){let r=e==="mapKey"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:r})}};0&&(module.exports={DynamicTypeLiteralMapper});
28
+ This prevents invalid snippet code generation that would cause formatter errors.`)}getUndiscriminatedUnionFieldName({typeReference:t}){switch(t.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:t});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:t.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:t});case"named":{let e=this.context.resolveNamedType({typeId:t.value});return e==null?void 0:this.context.getClassName(e.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:t});case"nullable":return this.getUndiscriminatedUnionFieldNameForNullable({typeReference:t});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:t.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:t});case"unknown":return"Unknown";default:I(t)}}getUndiscriminatedUnionFieldNameForList({list:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`ListOf${e}`}getUndiscriminatedUnionFieldNameForMap({map:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t.key});if(e==null)return;let r=this.getUndiscriminatedUnionFieldName({typeReference:t.value});if(r!=null)return`MapOf${e}To${r}`}getUndiscriminatedUnionFieldNameForOptional({typeReference:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`Optional${e}`}getUndiscriminatedUnionFieldNameForNullable({typeReference:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`Nullable${e}`}getUndiscriminatedUnionFieldNameForSet({set:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`SetOf${e}`}getUndiscriminatedUnionFieldNameForLiteral({literal:t}){}getUndiscriminatedUnionFieldNameForPrimitive({primitive:t}){switch(t){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":return"Float";case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":return"BigInteger";case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:I(t)}}convertUnknown({value:t}){return c.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){var i;switch(t){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:e,as:r});return a==null?c.TypeLiteral.nop():c.TypeLiteral.integer(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:e,as:r});return a==null?c.TypeLiteral.nop():c.TypeLiteral.long(a)}case"FLOAT":{let a=this.getValueAsNumber({value:e,as:r});return a==null?c.TypeLiteral.nop():c.TypeLiteral.float(a)}case"DOUBLE":{let a=this.getValueAsNumber({value:e,as:r});return a==null?c.TypeLiteral.nop():c.TypeLiteral.double(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:e,as:r});return a==null?c.TypeLiteral.nop():c.TypeLiteral.boolean(a)}case"STRING":{let a=this.context.getValueAsString({value:e});return a==null?c.TypeLiteral.nop():c.TypeLiteral.string(a)}case"DATE":{let a=this.context.getValueAsString({value:e});return a==null?c.TypeLiteral.nop():((i=this.context.customConfig)==null?void 0:i["use-local-date-for-dates"])===!0?c.TypeLiteral.date(a):c.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:e});return a==null?c.TypeLiteral.nop():c.TypeLiteral.dateTime(a)}case"UUID":{let a=this.context.getValueAsString({value:e});return a==null?c.TypeLiteral.nop():c.TypeLiteral.uuid(a)}case"BASE_64":{let a=this.context.getValueAsString({value:e});return a==null?c.TypeLiteral.nop():c.TypeLiteral.bytes(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:e});return a==null?c.TypeLiteral.nop():c.TypeLiteral.bigInteger(a)}default:I(t)}}getValueAsNumber({value:t,as:e}){let r=e==="mapKey"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:t,as:e}){let r=e==="mapKey"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:r})}};0&&(module.exports={DynamicTypeLiteralMapper});
29
29
  /*! Bundled license information:
30
30
 
31
31
  @esbuild-plugins/node-globals-polyfill/Buffer.js: