@fern-api/java-dynamic-snippets 0.0.3 → 0.0.5

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 (78) hide show
  1. package/cjs/Config.cjs +1 -0
  2. package/cjs/Config.cjs.map +1 -0
  3. package/cjs/DynamicSnippetsGenerator.cjs +25 -11
  4. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -0
  5. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  6. package/cjs/{DynamicSnippetsGeneratorContext-B2BA5MLv.d.cts → DynamicSnippetsGeneratorContext-DGzYoCz3.d.cts} +19 -6
  7. package/cjs/EndpointSnippetGenerator.cjs +15 -7
  8. package/cjs/EndpointSnippetGenerator.cjs.map +1 -0
  9. package/cjs/EndpointSnippetGenerator.d.cts +4 -1
  10. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +25 -11
  11. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -0
  12. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  13. package/cjs/context/DynamicTypeLiteralMapper.cjs +21 -7
  14. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -0
  15. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  16. package/cjs/context/DynamicTypeMapper.cjs +15 -7
  17. package/cjs/context/DynamicTypeMapper.cjs.map +1 -0
  18. package/cjs/context/DynamicTypeMapper.d.cts +1 -1
  19. package/cjs/context/FilePropertyMapper.cjs +15 -7
  20. package/cjs/context/FilePropertyMapper.cjs.map +1 -0
  21. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  22. package/cjs/index.cjs +23 -21
  23. package/cjs/index.cjs.map +1 -0
  24. package/cjs/index.d.cts +2 -2
  25. package/esm/Config.js +2 -1
  26. package/esm/Config.js.map +1 -0
  27. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  28. package/esm/DynamicSnippetsGenerator.js +2 -1
  29. package/esm/DynamicSnippetsGenerator.js.map +1 -0
  30. package/esm/{DynamicSnippetsGeneratorContext-B2BA5MLv.d.ts → DynamicSnippetsGeneratorContext-DGzYoCz3.d.ts} +19 -6
  31. package/esm/EndpointSnippetGenerator.d.ts +4 -1
  32. package/esm/EndpointSnippetGenerator.js +2 -1
  33. package/esm/EndpointSnippetGenerator.js.map +1 -0
  34. package/esm/chunk-2U3YQWRZ.js +12 -0
  35. package/esm/chunk-2U3YQWRZ.js.map +1 -0
  36. package/esm/chunk-3X524Y2I.js +23 -0
  37. package/esm/chunk-3X524Y2I.js.map +1 -0
  38. package/esm/chunk-5CTXVUPZ.js +8 -0
  39. package/esm/chunk-5CTXVUPZ.js.map +1 -0
  40. package/esm/chunk-EOZMORS3.js +2 -0
  41. package/esm/chunk-EOZMORS3.js.map +1 -0
  42. package/esm/chunk-JFD4YVTW.js +15 -0
  43. package/esm/chunk-JFD4YVTW.js.map +1 -0
  44. package/esm/chunk-KQE3JYZ2.js +2 -0
  45. package/esm/chunk-KQE3JYZ2.js.map +1 -0
  46. package/esm/chunk-N3AIOPEV.js +2 -0
  47. package/esm/chunk-N3AIOPEV.js.map +1 -0
  48. package/esm/chunk-PBNDQMXA.js +2 -0
  49. package/esm/chunk-PBNDQMXA.js.map +1 -0
  50. package/esm/chunk-QH22Z5KY.js +2 -0
  51. package/esm/chunk-QH22Z5KY.js.map +1 -0
  52. package/esm/{chunk-452HWDL4.js → chunk-VYJE6STI.js} +2 -1
  53. package/esm/chunk-VYJE6STI.js.map +1 -0
  54. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  55. package/esm/context/DynamicSnippetsGeneratorContext.js +2 -1
  56. package/esm/context/DynamicSnippetsGeneratorContext.js.map +1 -0
  57. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  58. package/esm/context/DynamicTypeLiteralMapper.js +2 -1
  59. package/esm/context/DynamicTypeLiteralMapper.js.map +1 -0
  60. package/esm/context/DynamicTypeMapper.d.ts +1 -1
  61. package/esm/context/DynamicTypeMapper.js +2 -1
  62. package/esm/context/DynamicTypeMapper.js.map +1 -0
  63. package/esm/context/FilePropertyMapper.d.ts +1 -1
  64. package/esm/context/FilePropertyMapper.js +2 -1
  65. package/esm/context/FilePropertyMapper.js.map +1 -0
  66. package/esm/index.d.ts +2 -2
  67. package/esm/index.js +2 -13
  68. package/esm/index.js.map +1 -0
  69. package/package.json +1 -1
  70. package/esm/chunk-2AZXIWKY.js +0 -11
  71. package/esm/chunk-7CY27UU7.js +0 -1
  72. package/esm/chunk-AASPH6YC.js +0 -15
  73. package/esm/chunk-BKM7JFLZ.js +0 -1
  74. package/esm/chunk-HN67B7VQ.js +0 -1
  75. package/esm/chunk-JSEUWNSK.js +0 -1
  76. package/esm/chunk-N3DIPQCT.js +0 -14
  77. package/esm/chunk-TTNRR5YY.js +0 -1
  78. package/esm/chunk-WFKWXM7L.js +0 -1
@@ -1,18 +1,31 @@
1
- "use strict";var ue=Object.defineProperty,yr=Object.defineProperties,gr=Object.getOwnPropertyDescriptor,wr=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertyNames,se=Object.getOwnPropertySymbols;var Re=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable;var be=(n,t,e)=>t in n?ue(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,je=(n,t)=>{for(var e in t||(t={}))Re.call(t,e)&&be(n,e,t[e]);if(se)for(var e of se(t))De.call(t,e)&&be(n,e,t[e]);return n},Ve=(n,t)=>yr(n,wr(t));var We=n=>typeof n=="symbol"?n:n+"",$e=(n,t)=>{var e={};for(var r in n)Re.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&se)for(var r of se(n))t.indexOf(r)<0&&De.call(n,r)&&(e[r]=n[r]);return e};var Ae=(n,t)=>()=>(n&&(t=n(n=0)),t);var Ye=(n,t)=>{for(var e in t)ue(n,e,{get:t[e],enumerable:!0})},Tr=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of vr(t))!Re.call(n,a)&&a!==e&&ue(n,a,{get:()=>t[a],enumerable:!(r=gr(t,a))||r.enumerable});return n};var Nr=n=>Tr(ue({},"__esModule",{value:!0}),n);var c=(n,t,e)=>be(n,typeof t!="symbol"?t+"":t,e);function ze(){throw new Error("setTimeout has not been defined")}function qe(){throw new Error("clearTimeout has not been defined")}function He(n){if(F===setTimeout)return setTimeout(n,0);if((F===ze||!F)&&setTimeout)return F=setTimeout,setTimeout(n,0);try{return F(n,0)}catch(t){try{return F.call(null,n,0)}catch(e){return F.call(this,n,0)}}}function br(n){if(B===clearTimeout)return clearTimeout(n);if((B===qe||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(n);try{return B(n)}catch(t){try{return B.call(null,n)}catch(e){return B.call(this,n)}}}function Rr(){!Z||!O||(Z=!1,O.length?S=O.concat(S):fe=-1,S.length&&Je())}function Je(){if(!Z){var n=He(Rr);Z=!0;for(var t=S.length;t;){for(O=S,S=[];++fe<t;)O&&O[fe].run();fe=-1,t=S.length}O=null,Z=!1,br(n)}}function Ar(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];S.push(new Ze(n,t)),S.length===1&&!Z&&He(Je)}function Ze(n,t){this.fun=n,this.array=t}function _(){}function Wr(n){throw new Error("process.binding is not supported")}function $r(){return"/"}function Yr(n){throw new Error("process.chdir is not supported")}function Gr(){return 0}function qr(n){var t=zr.call(J)*.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 Jr(){var n=new Date,t=n-Hr;return t/1e3}var F,B,S,Z,O,fe,Er,Ir,kr,Lr,Cr,Sr,Ur,Pr,Fr,Br,Mr,Or,_r,Dr,jr,Vr,J,zr,Hr,p,Ge,u=Ae(()=>{"use strict";F=ze,B=qe;typeof globalThis.setTimeout=="function"&&(F=setTimeout);typeof globalThis.clearTimeout=="function"&&(B=clearTimeout);S=[],Z=!1,fe=-1;Ze.prototype.run=function(){this.fun.apply(null,this.array)};Er="browser",Ir="browser",kr=!0,Lr={},Cr=[],Sr="",Ur={},Pr={},Fr={};Br=_,Mr=_,Or=_,_r=_,Dr=_,jr=_,Vr=_;J=globalThis.performance||{},zr=J.now||J.mozNow||J.msNow||J.oNow||J.webkitNow||function(){return new Date().getTime()};Hr=new Date;p={nextTick:Ar,title:Er,browser:kr,env:Lr,argv:Cr,version:Sr,versions:Ur,on:Br,addListener:Mr,once:Or,off:_r,removeListener:Dr,removeAllListeners:jr,emit:Vr,binding:Wr,cwd:$r,chdir:Yr,umask:Gr,hrtime:qr,platform:Ir,release:Pr,config:Fr,uptime:Jr},Ge={};Object.keys(Ge).forEach(n=>{let t=n.split("."),e=p;for(let r=0;r<t.length;r++){let a=t[r];r===t.length-1?e[a]=Ge[n]:e=e[a]||(e[a]={})}})});function et(){Ie=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)k[t]=n[t],E[n.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Kr(n){Ie||et();var t,e,r,a,i,o,m=n.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=n[m-2]==="="?2:n[m-1]==="="?1:0,o=new Zr(m*3/4-i),r=i>0?m-4:m;var d=0;for(t=0,e=0;t<r;t+=4,e+=3)a=E[n.charCodeAt(t)]<<18|E[n.charCodeAt(t+1)]<<12|E[n.charCodeAt(t+2)]<<6|E[n.charCodeAt(t+3)],o[d++]=a>>16&255,o[d++]=a>>8&255,o[d++]=a&255;return i===2?(a=E[n.charCodeAt(t)]<<2|E[n.charCodeAt(t+1)]>>4,o[d++]=a&255):i===1&&(a=E[n.charCodeAt(t)]<<10|E[n.charCodeAt(t+1)]<<4|E[n.charCodeAt(t+2)]>>2,o[d++]=a>>8&255,o[d++]=a&255),o}function Xr(n){return k[n>>18&63]+k[n>>12&63]+k[n>>6&63]+k[n&63]}function Qr(n,t,e){for(var r,a=[],i=t;i<e;i+=3)r=(n[i]<<16)+(n[i+1]<<8)+n[i+2],a.push(Xr(r));return a.join("")}function Ke(n){Ie||et();for(var t,e=n.length,r=e%3,a="",i=[],o=16383,m=0,d=e-r;m<d;m+=o)i.push(Qr(n,m,m+o>d?d:m+o));return r===1?(t=n[e-1],a+=k[t>>2],a+=k[t<<4&63],a+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],a+=k[t>>10],a+=k[t>>4&63],a+=k[t<<2&63],a+="="),i.push(a),i.join("")}function le(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(n,t){if(le()<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 ke(this,n)}return tt(this,n,t,e)}function tt(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?rn(n,t,e,r):typeof t=="string"?tn(n,t,e):nn(n,t)}function rt(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 en(n,t,e,r){return rt(t),t<=0?U(n,t):e!==void 0?typeof r=="string"?U(n,t).fill(e,r):U(n,t).fill(e):U(n,t)}function ke(n,t){if(rt(t),n=U(n,t<0?0:Le(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function tn(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=nt(t,e)|0;n=U(n,r);var a=n.write(t,e);return a!==r&&(n=n.slice(0,a)),n}function Ee(n,t){var e=t.length<0?0:Le(t.length)|0;n=U(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function rn(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=Ee(n,t),n}function nn(n,t){if(L(t)){var e=Le(t.length)|0;return n=U(n,e),n.length===0||t.copy(n,0,0,e),n}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||bn(t.length)?U(n,0):Ee(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ee(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Le(n){if(n>=le())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+le().toString(16)+" bytes");return n|0}function L(n){return!!(n!=null&&n._isBuffer)}function nt(n,t){if(L(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var e=n.length;if(e===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return pe(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return lt(n).length;default:if(r)return pe(n).length;t=(""+t).toLowerCase(),r=!0}}function an(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 hn(this,t,e);case"utf8":case"utf-8":return ot(this,t,e);case"ascii":return mn(this,t,e);case"latin1":case"binary":return dn(this,t,e);case"base64":return pn(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xn(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function D(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function at(n,t,e,r,a){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=a?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(a)return-1;e=n.length-1}else if(e<0)if(a)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),L(t))return t.length===0?-1:Xe(n,t,e,r,a);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):Xe(n,[t],e,r,a);throw new TypeError("val must be string, number or Buffer")}function Xe(n,t,e,r,a){var i=1,o=n.length,m=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;i=2,o/=2,m/=2,e/=2}function d(A,H){return i===1?A[H]:A.readUInt16BE(H*i)}var x;if(a){var y=-1;for(x=e;x<o;x++)if(d(n,x)===d(t,y===-1?0:x-y)){if(y===-1&&(y=x),x-y+1===m)return y*i}else y!==-1&&(x-=x-y),y=-1}else for(e+m>o&&(e=o-m),x=e;x>=0;x--){for(var h=!0,I=0;I<m;I++)if(d(n,x+I)!==d(t,I)){h=!1;break}if(h)return x}return-1}function on(n,t,e,r){e=Number(e)||0;var a=n.length-e;r?(r=Number(r),r>a&&(r=a)):r=a;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o<r;++o){var m=parseInt(t.substr(o*2,2),16);if(isNaN(m))return o;n[e+o]=m}return o}function sn(n,t,e,r){return de(pe(t,n.length-e),n,e,r)}function it(n,t,e,r){return de(Tn(t),n,e,r)}function un(n,t,e,r){return it(n,t,e,r)}function fn(n,t,e,r){return de(lt(t),n,e,r)}function ln(n,t,e,r){return de(Nn(t,n.length-e),n,e,r)}function pn(n,t,e){return t===0&&e===n.length?Ke(n):Ke(n.slice(t,e))}function ot(n,t,e){e=Math.min(n.length,e);for(var r=[],a=t;a<e;){var i=n[a],o=null,m=i>239?4:i>223?3:i>191?2:1;if(a+m<=e){var d,x,y,h;switch(m){case 1:i<128&&(o=i);break;case 2:d=n[a+1],(d&192)===128&&(h=(i&31)<<6|d&63,h>127&&(o=h));break;case 3:d=n[a+1],x=n[a+2],(d&192)===128&&(x&192)===128&&(h=(i&15)<<12|(d&63)<<6|x&63,h>2047&&(h<55296||h>57343)&&(o=h));break;case 4:d=n[a+1],x=n[a+2],y=n[a+3],(d&192)===128&&(x&192)===128&&(y&192)===128&&(h=(i&15)<<18|(d&63)<<12|(x&63)<<6|y&63,h>65535&&h<1114112&&(o=h))}}o===null?(o=65533,m=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),a+=m}return cn(r)}function cn(n){var t=n.length;if(t<=Qe)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=Qe));return e}function mn(n,t,e){var r="";e=Math.min(n.length,e);for(var a=t;a<e;++a)r+=String.fromCharCode(n[a]&127);return r}function dn(n,t,e){var r="";e=Math.min(n.length,e);for(var a=t;a<e;++a)r+=String.fromCharCode(n[a]);return r}function hn(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var a="",i=t;i<e;++i)a+=vn(n[i]);return a}function xn(n,t,e){for(var r=n.slice(t,e),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+r[i+1]*256);return a}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 b(n,t,e,r,a,i){if(!L(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(e+r>n.length)throw new RangeError("Index out of range")}function ce(n,t,e,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(n.length-e,2);a<i;++a)n[e+a]=(t&255<<8*(r?a:1-a))>>>(r?a:1-a)*8}function me(n,t,e,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(n.length-e,4);a<i;++a)n[e+a]=t>>>(r?a:3-a)*8&255}function st(n,t,e,r,a,i){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ut(n,t,e,r,a){return a||st(n,t,e,4,34028234663852886e22,-34028234663852886e22),ct(n,t,e,r,23,4),e+4}function ft(n,t,e,r,a){return a||st(n,t,e,8,17976931348623157e292,-17976931348623157e292),ct(n,t,e,r,52,8),e+8}function gn(n){if(n=wn(n).replace(yn,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function wn(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function vn(n){return n<16?"0"+n.toString(16):n.toString(16)}function pe(n,t){t=t||1/0;for(var e,r=n.length,a=null,i=[],o=0;o<r;++o){if(e=n.charCodeAt(o),e>55295&&e<57344){if(!a){if(e>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=e;continue}if(e<56320){(t-=3)>-1&&i.push(239,191,189),a=e;continue}e=(a-55296<<10|e-56320)+65536}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,e<128){if((t-=1)<0)break;i.push(e)}else if(e<2048){if((t-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Tn(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Nn(n,t){for(var e,r,a,i=[],o=0;o<n.length&&!((t-=2)<0);++o)e=n.charCodeAt(o),r=e>>8,a=e%256,i.push(a),i.push(r);return i}function lt(n){return Kr(gn(n))}function de(n,t,e,r){for(var a=0;a<r&&!(a+e>=t.length||a>=n.length);++a)t[a+e]=n[a];return a}function bn(n){return n!==n}function Rn(n){return n!=null&&(!!n._isBuffer||pt(n)||An(n))}function pt(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function An(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&pt(n.slice(0,0))}function he(n,t,e,r,a){var i,o,m=a*8-r-1,d=(1<<m)-1,x=d>>1,y=-7,h=e?a-1:0,I=e?-1:1,A=n[t+h];for(h+=I,i=A&(1<<-y)-1,A>>=-y,y+=m;y>0;i=i*256+n[t+h],h+=I,y-=8);for(o=i&(1<<-y)-1,i>>=-y,y+=r;y>0;o=o*256+n[t+h],h+=I,y-=8);if(i===0)i=1-x;else{if(i===d)return o?NaN:(A?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-x}return(A?-1:1)*o*Math.pow(2,i-r)}function ct(n,t,e,r,a,i){var o,m,d,x=i*8-a-1,y=(1<<x)-1,h=y>>1,I=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:i-1,H=r?1:-1,xr=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,o=y):(o=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-o))<1&&(o--,d*=2),o+h>=1?t+=I/d:t+=I*Math.pow(2,1-h),t*d>=2&&(o++,d/=2),o+h>=y?(m=0,o=y):o+h>=1?(m=(t*d-1)*Math.pow(2,a),o=o+h):(m=t*Math.pow(2,h-1)*Math.pow(2,a),o=0));a>=8;n[e+A]=m&255,A+=H,m/=256,a-=8);for(o=o<<a|m,x+=a;x>0;n[e+A]=o&255,A+=H,o/=256,x-=8);n[e+A-H]|=xr*128}var k,E,Zr,Ie,Qe,yn,mt=Ae(()=>{"use strict";u();f();k=[],E=[],Zr=typeof Uint8Array!="undefined"?Uint8Array:Array,Ie=!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 tt(null,n,t,e)};s.kMaxLength=le();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 en(null,n,t,e)};s.allocUnsafe=function(n){return ke(null,n)};s.allocUnsafeSlow=function(n){return ke(null,n)};s.isBuffer=Rn;s.compare=function(t,e){if(!L(t)||!L(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,a=e.length,i=0,o=Math.min(r,a);i<o;++i)if(t[i]!==e[i]){r=t[i],a=e[i];break}return r<a?-1:a<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 a=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!L(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(a,i),i+=o.length}return a};s.byteLength=nt;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)D(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)D(this,e,e+3),D(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)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?ot(this,0,t):an.apply(this,arguments)};s.prototype.equals=function(t){if(!L(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,a,i){if(!L(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),e<0||r>t.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&e>=r)return 0;if(a>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,a>>>=0,i>>>=0,this===t)return 0;for(var o=i-a,m=r-e,d=Math.min(o,m),x=this.slice(a,i),y=t.slice(e,r),h=0;h<d;++h)if(x[h]!==y[h]){o=x[h],m=y[h];break}return o<m?-1:m<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 at(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return at(this,t,e,r,!1)};s.prototype.write=function(t,e,r,a){if(e===void 0)a="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")a=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,a===void 0&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((r===void 0||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var o=!1;;)switch(a){case"hex":return on(this,t,e,r);case"utf8":case"utf-8":return sn(this,t,e,r);case"ascii":return it(this,t,e,r);case"latin1":case"binary":return un(this,t,e,r);case"base64":return fn(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ln(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Qe=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 a;if(s.TYPED_ARRAY_SUPPORT)a=this.subarray(t,e),a.__proto__=s.prototype;else{var i=e-t;a=new s(i,void 0);for(var o=0;o<i;++o)a[o]=this[o+t]}return a};s.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var a=this[t],i=1,o=0;++o<e&&(i*=256);)a+=this[t+o]*i;return a};s.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var a=this[t+--e],i=1;e>0&&(i*=256);)a+=this[t+--e]*i;return a};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 a=this[t],i=1,o=0;++o<e&&(i*=256);)a+=this[t+o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var a=e,i=1,o=this[t+--a];a>0&&(i*=256);)o+=this[t+--a]*i;return i*=128,o>=i&&(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),he(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),he(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),he(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),he(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,a){if(t=+t,e=e|0,r=r|0,!a){var i=Math.pow(2,8*r)-1;b(this,t,e,r,i,0)}var o=1,m=0;for(this[e]=t&255;++m<r&&(o*=256);)this[e+m]=t/o&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,a){if(t=+t,e=e|0,r=r|0,!a){var i=Math.pow(2,8*r)-1;b(this,t,e,r,i,0)}var o=r-1,m=1;for(this[e+o]=t&255;--o>=0&&(m*=256);)this[e+o]=t/m&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||b(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||b(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ce(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||b(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ce(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||b(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):me(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||b(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):me(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,a){if(t=+t,e=e|0,!a){var i=Math.pow(2,8*r-1);b(this,t,e,r,i-1,-i)}var o=0,m=1,d=0;for(this[e]=t&255;++o<r&&(m*=256);)t<0&&d===0&&this[e+o-1]!==0&&(d=1),this[e+o]=(t/m>>0)-d&255;return e+r};s.prototype.writeIntBE=function(t,e,r,a){if(t=+t,e=e|0,!a){var i=Math.pow(2,8*r-1);b(this,t,e,r,i-1,-i)}var o=r-1,m=1,d=0;for(this[e+o]=t&255;--o>=0&&(m*=256);)t<0&&d===0&&this[e+o+1]!==0&&(d=1),this[e+o]=(t/m>>0)-d&255;return e+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||b(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||b(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ce(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||b(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ce(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||b(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):me(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||b(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):me(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return ut(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return ut(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return ft(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return ft(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,a){if(r||(r=0),!a&&a!==0&&(a=this.length),e>=t.length&&(e=t.length),e||(e=0),a>0&&a<r&&(a=r),a===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(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-e<a-r&&(a=t.length-e+r);var i=a-r,o;if(this===t&&r<e&&e<a)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i};s.prototype.fill=function(t,e,r,a){if(typeof t=="string"){if(typeof e=="string"?(a=e,e=0,r=this.length):typeof r=="string"&&(a=r,r=this.length),t.length===1){var i=t.charCodeAt(0);i<256&&(t=i)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!s.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}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 m=L(t)?t:pe(new s(t,a).toString()),d=m.length;for(o=0;o<r-e;++o)this[o+e]=m[o%d]}return this};yn=/[^+\/0-9A-Za-z-_]/g});var f=Ae(()=>{"use strict";mt()});var Mi={};Ye(Mi,{DynamicSnippetsGeneratorContext:()=>_e});module.exports=Nr(Mi);u();f();u();f();u();f();u();f();u();f();u();f();u();f();var En=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,dt=En;var In=typeof self=="object"&&self&&self.Object===Object&&self,kn=dt||In||Function("return this")(),ht=kn;var Ln=ht.Symbol,P=Ln;u();f();var xt=Object.prototype,Cn=xt.hasOwnProperty,Sn=xt.toString,X=P?P.toStringTag:void 0;function Un(n){var t=Cn.call(n,X),e=n[X];try{n[X]=void 0;var r=!0}catch(i){}var a=Sn.call(n);return r&&(t?n[X]=e:delete n[X]),a}var yt=Un;u();f();var Pn=Object.prototype,Fn=Pn.toString;function Bn(n){return Fn.call(n)}var gt=Bn;var Mn="[object Null]",On="[object Undefined]",wt=P?P.toStringTag:void 0;function _n(n){return n==null?n===void 0?On:Mn:wt&&wt in Object(n)?yt(n):gt(n)}var vt=_n;u();f();function Dn(n){return n!=null&&typeof n=="object"}var Tt=Dn;var jn="[object Symbol]";function Vn(n){return typeof n=="symbol"||Tt(n)&&vt(n)==jn}var Nt=Vn;u();f();u();f();function Wn(n,t){for(var e=-1,r=n==null?0:n.length,a=Array(r);++e<r;)a[e]=t(n[e],e,n);return a}var bt=Wn;u();f();var $n=Array.isArray,Rt=$n;var Yn=1/0,At=P?P.prototype:void 0,Et=At?At.toString:void 0;function It(n){if(typeof n=="string")return n;if(Rt(n))return bt(n,It)+"";if(Nt(n))return Et?Et.call(n):"";var t=n+"";return t=="0"&&1/n==-Yn?"-0":t}var kt=It;u();f();function Gn(n){return n==null?"":kt(n)}var M=Gn;u();f();u();f();u();f();u();f();u();f();u();f();function zn(n,t,e){var r=-1,a=n.length;t<0&&(t=-t>a?0:a+t),e=e>a?a:e,e<0&&(e+=a),a=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(a);++r<a;)i[r]=n[r+t];return i}var Lt=zn;function qn(n,t,e){var r=n.length;return e=e===void 0?r:e,!t&&e>=r?n:Lt(n,t,e)}var Ct=qn;u();f();var Hn="\\ud800-\\udfff",Jn="\\u0300-\\u036f",Zn="\\ufe20-\\ufe2f",Kn="\\u20d0-\\u20ff",Xn=Jn+Zn+Kn,Qn="\\ufe0e\\ufe0f",ea="\\u200d",ta=RegExp("["+ea+Hn+Xn+Qn+"]");function ra(n){return ta.test(n)}var xe=ra;u();f();u();f();function na(n){return n.split("")}var St=na;u();f();var Ut="\\ud800-\\udfff",aa="\\u0300-\\u036f",ia="\\ufe20-\\ufe2f",oa="\\u20d0-\\u20ff",sa=aa+ia+oa,ua="\\ufe0e\\ufe0f",fa="["+Ut+"]",Ce="["+sa+"]",Se="\\ud83c[\\udffb-\\udfff]",la="(?:"+Ce+"|"+Se+")",Pt="[^"+Ut+"]",Ft="(?:\\ud83c[\\udde6-\\uddff]){2}",Bt="[\\ud800-\\udbff][\\udc00-\\udfff]",pa="\\u200d",Mt=la+"?",Ot="["+ua+"]?",ca="(?:"+pa+"(?:"+[Pt,Ft,Bt].join("|")+")"+Ot+Mt+")*",ma=Ot+Mt+ca,da="(?:"+[Pt+Ce+"?",Ce,Ft,Bt,fa].join("|")+")",ha=RegExp(Se+"(?="+Se+")|"+da+ma,"g");function xa(n){return n.match(ha)||[]}var _t=xa;function ya(n){return xe(n)?_t(n):St(n)}var Dt=ya;function ga(n){return function(t){t=M(t);var e=xe(t)?Dt(t):void 0,r=e?e[0]:t.charAt(0),a=e?Ct(e,1).join(""):t.slice(1);return r[n]()+a}}var jt=ga;var wa=jt("toUpperCase"),Vt=wa;function va(n){return Vt(M(n).toLowerCase())}var Wt=va;u();f();u();f();function Ta(n,t,e,r){var a=-1,i=n==null?0:n.length;for(r&&i&&(e=n[++a]);++a<i;)e=t(e,n[a],a,n);return e}var $t=Ta;u();f();u();f();u();f();function Na(n){return function(t){return n==null?void 0:n[t]}}var Yt=Na;var ba={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Ra=Yt(ba),Gt=Ra;var Aa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ea="\\u0300-\\u036f",Ia="\\ufe20-\\ufe2f",ka="\\u20d0-\\u20ff",La=Ea+Ia+ka,Ca="["+La+"]",Sa=RegExp(Ca,"g");function Ua(n){return n=M(n),n&&n.replace(Aa,Gt).replace(Sa,"")}var zt=Ua;u();f();u();f();var Pa=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Fa(n){return n.match(Pa)||[]}var qt=Fa;u();f();var Ba=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ma(n){return Ba.test(n)}var Ht=Ma;u();f();var Qt="\\ud800-\\udfff",Oa="\\u0300-\\u036f",_a="\\ufe20-\\ufe2f",Da="\\u20d0-\\u20ff",ja=Oa+_a+Da,er="\\u2700-\\u27bf",tr="a-z\\xdf-\\xf6\\xf8-\\xff",Va="\\xac\\xb1\\xd7\\xf7",Wa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$a="\\u2000-\\u206f",Ya=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rr="A-Z\\xc0-\\xd6\\xd8-\\xde",Ga="\\ufe0e\\ufe0f",nr=Va+Wa+$a+Ya,ar="['\u2019]",Jt="["+nr+"]",za="["+ja+"]",ir="\\d+",qa="["+er+"]",or="["+tr+"]",sr="[^"+Qt+nr+ir+er+tr+rr+"]",Ha="\\ud83c[\\udffb-\\udfff]",Ja="(?:"+za+"|"+Ha+")",Za="[^"+Qt+"]",ur="(?:\\ud83c[\\udde6-\\uddff]){2}",fr="[\\ud800-\\udbff][\\udc00-\\udfff]",K="["+rr+"]",Ka="\\u200d",Zt="(?:"+or+"|"+sr+")",Xa="(?:"+K+"|"+sr+")",Kt="(?:"+ar+"(?:d|ll|m|re|s|t|ve))?",Xt="(?:"+ar+"(?:D|LL|M|RE|S|T|VE))?",lr=Ja+"?",pr="["+Ga+"]?",Qa="(?:"+Ka+"(?:"+[Za,ur,fr].join("|")+")"+pr+lr+")*",ei="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ti="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ri=pr+lr+Qa,ni="(?:"+[qa,ur,fr].join("|")+")"+ri,ai=RegExp([K+"?"+or+"+"+Kt+"(?="+[Jt,K,"$"].join("|")+")",Xa+"+"+Xt+"(?="+[Jt,K+Zt,"$"].join("|")+")",K+"?"+Zt+"+"+Kt,K+"+"+Xt,ti,ei,ir,ni].join("|"),"g");function ii(n){return n.match(ai)||[]}var cr=ii;function oi(n,t,e){return n=M(n),t=e?void 0:t,t===void 0?Ht(n)?cr(n):qt(n):n.match(t)||[]}var mr=oi;var si="['\u2019]",ui=RegExp(si,"g");function fi(n){return function(t){return $t(mr(zt(t).replace(ui,"")),n,"")}}var dr=fi;var li=dr(function(n,t,e){return t=t.toLowerCase(),n+(e?Wt(t):t)}),Ue=li;u();f();u();f();function g(n){throw new Error("Unexpected value: "+JSON.stringify(n))}u();f();function Q(n){return Object.keys(n)}u();f();u();f();var j=class{};u();f();u();f();var C=class extends j{constructor(e){super();c(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var pi=4,ee=class{constructor(){c(this,"buffer","");c(this,"indentLevel",0);c(this,"hasWrittenAnything",!1);c(this,"lastCharacterIsSemicolon",!1);c(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
2
- `),r=e?t.substring(0,t.length-1):t,a=this.getIndentString(),i=r.replaceAll(`
1
+ "use strict";var yt=Object.defineProperty,Qn=Object.defineProperties,ea=Object.getOwnPropertyDescriptor,ta=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertyNames,ht=Object.getOwnPropertySymbols;var $t=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable;var Dt=(r,e,t)=>e in r?yt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,p=(r,e)=>{for(var t in e||(e={}))$t.call(e,t)&&Dt(r,t,e[t]);if(ht)for(var t of ht(e))or.call(e,t)&&Dt(r,t,e[t]);return r},T=(r,e)=>Qn(r,ta(e));var ur=r=>typeof r=="symbol"?r:r+"",lr=(r,e)=>{var t={};for(var n in r)$t.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&ht)for(var n of ht(r))e.indexOf(n)<0&&or.call(r,n)&&(t[n]=r[n]);return t};var Vt=(r,e)=>()=>(r&&(e=r(r=0)),e);var Wt=(r,e)=>{for(var t in e)yt(r,t,{get:e[t],enumerable:!0})},na=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ra(e))!$t.call(r,a)&&a!==t&&yt(r,a,{get:()=>e[a],enumerable:!(n=ea(e,a))||n.enumerable});return r};var aa=r=>na(yt({},"__esModule",{value:!0}),r);var g=(r,e,t)=>Dt(r,typeof e!="symbol"?e+"":e,t);function fr(){throw new Error("setTimeout has not been defined")}function pr(){throw new Error("clearTimeout has not been defined")}function dr(r){if(ce===setTimeout)return setTimeout(r,0);if((ce===fr||!ce)&&setTimeout)return ce=setTimeout,setTimeout(r,0);try{return ce(r,0)}catch(e){try{return ce.call(null,r,0)}catch(t){return ce.call(this,r,0)}}}function ia(r){if(fe===clearTimeout)return clearTimeout(r);if((fe===pr||!fe)&&clearTimeout)return fe=clearTimeout,clearTimeout(r);try{return fe(r)}catch(e){try{return fe.call(null,r)}catch(t){return fe.call(this,r)}}}function sa(){!ze||!xe||(ze=!1,xe.length?re=xe.concat(re):xt=-1,re.length&&mr())}function mr(){if(!ze){var r=dr(sa);ze=!0;for(var e=re.length;e;){for(xe=re,re=[];++xt<e;)xe&&xe[xt].run();xt=-1,e=re.length}xe=null,ze=!1,ia(r)}}function oa(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];re.push(new hr(r,e)),re.length===1&&!ze&&dr(mr)}function hr(r,e){this.fun=r,this.array=e}function ge(){}function ka(r){throw new Error("process.binding is not supported")}function Na(){return"/"}function Ra(r){throw new Error("process.chdir is not supported")}function Aa(){return 0}function Ea(r){var e=Ia.call(Ze)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}function Ca(){var r=new Date,e=r-Sa;return e/1e3}var ce,fe,re,ze,xe,xt,ua,la,ca,fa,pa,da,ma,ha,ya,xa,ga,va,wa,ba,_a,Ta,Ze,Ia,Sa,x,cr,l=Vt(()=>{"use strict";ce=fr,fe=pr;typeof globalThis.setTimeout=="function"&&(ce=setTimeout);typeof globalThis.clearTimeout=="function"&&(fe=clearTimeout);re=[],ze=!1,xt=-1;hr.prototype.run=function(){this.fun.apply(null,this.array)};ua="browser",la="browser",ca=!0,fa={},pa=[],da="",ma={},ha={},ya={};xa=ge,ga=ge,va=ge,wa=ge,ba=ge,_a=ge,Ta=ge;Ze=globalThis.performance||{},Ia=Ze.now||Ze.mozNow||Ze.msNow||Ze.oNow||Ze.webkitNow||function(){return new Date().getTime()};Sa=new Date;x={nextTick:oa,title:ua,browser:ca,env:fa,argv:pa,version:da,versions:ma,on:xa,addListener:ga,once:va,off:wa,removeListener:ba,removeAllListeners:_a,emit:Ta,binding:ka,cwd:Na,chdir:Ra,umask:Aa,hrtime:Ea,platform:la,release:ha,config:ya,uptime:Ca},cr={};Object.keys(cr).forEach(r=>{let e=r.split("."),t=x;for(let n=0;n<e.length;n++){let a=e[n];n===e.length-1?t[a]=cr[r]:t=t[a]||(t[a]={})}})});function vr(){zt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)J[e]=r[e],W[r.charCodeAt(e)]=e;W[45]=62,W[95]=63}function Oa(r){zt||vr();var e,t,n,a,i,s,o=r.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=r[o-2]==="="?2:r[o-1]==="="?1:0,s=new La(o*3/4-i),n=i>0?o-4:o;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)a=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],s[f++]=a>>16&255,s[f++]=a>>8&255,s[f++]=a&255;return i===2?(a=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,s[f++]=a&255):i===1&&(a=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,s[f++]=a>>8&255,s[f++]=a&255),s}function Ua(r){return J[r>>18&63]+J[r>>12&63]+J[r>>6&63]+J[r&63]}function Fa(r,e,t){for(var n,a=[],i=e;i<t;i+=3)n=(r[i]<<16)+(r[i+1]<<8)+r[i+2],a.push(Ua(n));return a.join("")}function yr(r){zt||vr();for(var e,t=r.length,n=t%3,a="",i=[],s=16383,o=0,f=t-n;o<f;o+=s)i.push(Fa(r,o,o+s>f?f:o+s));return n===1?(e=r[t-1],a+=J[e>>2],a+=J[e<<4&63],a+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],a+=J[e>>10],a+=J[e>>4&63],a+=J[e<<2&63],a+="="),i.push(a),i.join("")}function gt(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ne(r,e){if(gt()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=u.prototype):(r===null&&(r=new u(e)),r.length=e),r}function u(r,e,t){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Yt(this,r)}return wr(this,r,e,t)}function wr(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?Ma(r,e,t,n):typeof e=="string"?Pa(r,e,t):Ba(r,e)}function br(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function ja(r,e,t,n){return br(e),e<=0?ne(r,e):t!==void 0?typeof n=="string"?ne(r,e).fill(t,n):ne(r,e).fill(t):ne(r,e)}function Yt(r,e){if(br(e),r=ne(r,e<0?0:qt(e)|0),!u.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}function Pa(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=_r(e,t)|0;r=ne(r,n);var a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function Zt(r,e){var t=e.length<0?0:qt(e.length)|0;r=ne(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Ma(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),u.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=u.prototype):r=Zt(r,e),r}function Ba(r,e){if(H(e)){var t=qt(e.length)|0;return r=ne(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||ai(e.length)?ne(r,0):Zt(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Zt(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function qt(r){if(r>=gt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+gt().toString(16)+" bytes");return r|0}function H(r){return!!(r!=null&&r._isBuffer)}function _r(r,e){if(H(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return vt(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Er(r).length;default:if(n)return vt(r).length;e=(""+e).toLowerCase(),n=!0}}function Da(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ha(this,e,t);case"utf8":case"utf-8":return Nr(this,e,t);case"ascii":return Ga(this,e,t);case"latin1":case"binary":return Ja(this,e,t);case"base64":return Ya(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ka(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function ve(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Tr(r,e,t,n,a){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(a)return-1;t=r.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof e=="string"&&(e=u.from(e,n)),H(e))return e.length===0?-1:xr(r,e,t,n,a);if(typeof e=="number")return e=e&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):xr(r,[e],t,n,a);throw new TypeError("val must be string, number or Buffer")}function xr(r,e,t,n,a){var i=1,s=r.length,o=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;i=2,s/=2,o/=2,t/=2}function f(U,te){return i===1?U[te]:U.readUInt16BE(te*i)}var d;if(a){var y=-1;for(d=t;d<s;d++)if(f(r,d)===f(e,y===-1?0:d-y)){if(y===-1&&(y=d),d-y+1===o)return y*i}else y!==-1&&(d-=d-y),y=-1}else for(t+o>s&&(t=s-o),d=t;d>=0;d--){for(var _=!0,E=0;E<o;E++)if(f(r,d+E)!==f(e,E)){_=!1;break}if(_)return d}return-1}function $a(r,e,t,n){t=Number(t)||0;var a=r.length-t;n?(n=Number(n),n>a&&(n=a)):n=a;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var o=parseInt(e.substr(s*2,2),16);if(isNaN(o))return s;r[t+s]=o}return s}function Va(r,e,t,n){return _t(vt(e,r.length-t),r,t,n)}function kr(r,e,t,n){return _t(ri(e),r,t,n)}function Wa(r,e,t,n){return kr(r,e,t,n)}function Za(r,e,t,n){return _t(Er(e),r,t,n)}function za(r,e,t,n){return _t(ni(e,r.length-t),r,t,n)}function Ya(r,e,t){return e===0&&t===r.length?yr(r):yr(r.slice(e,t))}function Nr(r,e,t){t=Math.min(r.length,t);for(var n=[],a=e;a<t;){var i=r[a],s=null,o=i>239?4:i>223?3:i>191?2:1;if(a+o<=t){var f,d,y,_;switch(o){case 1:i<128&&(s=i);break;case 2:f=r[a+1],(f&192)===128&&(_=(i&31)<<6|f&63,_>127&&(s=_));break;case 3:f=r[a+1],d=r[a+2],(f&192)===128&&(d&192)===128&&(_=(i&15)<<12|(f&63)<<6|d&63,_>2047&&(_<55296||_>57343)&&(s=_));break;case 4:f=r[a+1],d=r[a+2],y=r[a+3],(f&192)===128&&(d&192)===128&&(y&192)===128&&(_=(i&15)<<18|(f&63)<<12|(d&63)<<6|y&63,_>65535&&_<1114112&&(s=_))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),a+=o}return qa(n)}function qa(r){var e=r.length;if(e<=gr)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=gr));return t}function Ga(r,e,t){var n="";t=Math.min(r.length,t);for(var a=e;a<t;++a)n+=String.fromCharCode(r[a]&127);return n}function Ja(r,e,t){var n="";t=Math.min(r.length,t);for(var a=e;a<t;++a)n+=String.fromCharCode(r[a]);return n}function Ha(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var a="",i=e;i<t;++i)a+=ti(r[i]);return a}function Ka(r,e,t){for(var n=r.slice(e,t),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+n[i+1]*256);return a}function j(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}function B(r,e,t,n,a,i){if(!H(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}function wt(r,e,t,n){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(r.length-t,2);a<i;++a)r[t+a]=(e&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}function bt(r,e,t,n){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(r.length-t,4);a<i;++a)r[t+a]=e>>>(n?a:3-a)*8&255}function Rr(r,e,t,n,a,i){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ar(r,e,t,n,a){return a||Rr(r,e,t,4,34028234663852886e22,-34028234663852886e22),Cr(r,e,t,n,23,4),t+4}function Ir(r,e,t,n,a){return a||Rr(r,e,t,8,17976931348623157e292,-17976931348623157e292),Cr(r,e,t,n,52,8),t+8}function Qa(r){if(r=ei(r).replace(Xa,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function ei(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function ti(r){return r<16?"0"+r.toString(16):r.toString(16)}function vt(r,e){e=e||1/0;for(var t,n=r.length,a=null,i=[],s=0;s<n;++s){if(t=r.charCodeAt(s),t>55295&&t<57344){if(!a){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function ri(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function ni(r,e){for(var t,n,a,i=[],s=0;s<r.length&&!((e-=2)<0);++s)t=r.charCodeAt(s),n=t>>8,a=t%256,i.push(a),i.push(n);return i}function Er(r){return Oa(Qa(r))}function _t(r,e,t,n){for(var a=0;a<n&&!(a+t>=e.length||a>=r.length);++a)e[a+t]=r[a];return a}function ai(r){return r!==r}function ii(r){return r!=null&&(!!r._isBuffer||Sr(r)||si(r))}function Sr(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function si(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Sr(r.slice(0,0))}function Tt(r,e,t,n,a){var i,s,o=a*8-n-1,f=(1<<o)-1,d=f>>1,y=-7,_=t?a-1:0,E=t?-1:1,U=r[e+_];for(_+=E,i=U&(1<<-y)-1,U>>=-y,y+=o;y>0;i=i*256+r[e+_],_+=E,y-=8);for(s=i&(1<<-y)-1,i>>=-y,y+=n;y>0;s=s*256+r[e+_],_+=E,y-=8);if(i===0)i=1-d;else{if(i===f)return s?NaN:(U?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-d}return(U?-1:1)*s*Math.pow(2,i-n)}function Cr(r,e,t,n,a,i){var s,o,f,d=i*8-a-1,y=(1<<d)-1,_=y>>1,E=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,U=n?0:i-1,te=n?1:-1,mt=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=y):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+_>=1?e+=E/f:e+=E*Math.pow(2,1-_),e*f>=2&&(s++,f/=2),s+_>=y?(o=0,s=y):s+_>=1?(o=(e*f-1)*Math.pow(2,a),s=s+_):(o=e*Math.pow(2,_-1)*Math.pow(2,a),s=0));a>=8;r[t+U]=o&255,U+=te,o/=256,a-=8);for(s=s<<a|o,d+=a;d>0;r[t+U]=s&255,U+=te,s/=256,d-=8);r[t+U-te]|=mt*128}var J,W,La,zt,gr,Xa,Lr=Vt(()=>{"use strict";l();c();J=[],W=[],La=typeof Uint8Array!="undefined"?Uint8Array:Array,zt=!1;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;u.poolSize=8192;u._augment=function(r){return r.__proto__=u.prototype,r};u.from=function(r,e,t){return wr(null,r,e,t)};u.kMaxLength=gt();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]);u.alloc=function(r,e,t){return ja(null,r,e,t)};u.allocUnsafe=function(r){return Yt(null,r)};u.allocUnsafeSlow=function(r){return Yt(null,r)};u.isBuffer=ii;u.compare=function(e,t){if(!H(e)||!H(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,a=t.length,i=0,s=Math.min(n,a);i<s;++i)if(e[i]!==t[i]){n=e[i],a=t[i];break}return n<a?-1:a<n?1:0};u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return u.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var a=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!H(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(a,i),i+=s.length}return a};u.byteLength=_r;u.prototype._isBuffer=!0;u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)ve(this,t,t+1);return this};u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)ve(this,t,t+3),ve(this,t+1,t+2);return this};u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)ve(this,t,t+7),ve(this,t+1,t+6),ve(this,t+2,t+5),ve(this,t+3,t+4);return this};u.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Nr(this,0,e):Da.apply(this,arguments)};u.prototype.equals=function(e){if(!H(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:u.compare(this,e)===0};u.prototype.compare=function(e,t,n,a,i){if(!H(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),t<0||n>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=n)return 0;if(a>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,a>>>=0,i>>>=0,this===e)return 0;for(var s=i-a,o=n-t,f=Math.min(s,o),d=this.slice(a,i),y=e.slice(t,n),_=0;_<f;++_)if(d[_]!==y[_]){s=d[_],o=y[_];break}return s<o?-1:o<s?1:0};u.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};u.prototype.indexOf=function(e,t,n){return Tr(this,e,t,n,!0)};u.prototype.lastIndexOf=function(e,t,n){return Tr(this,e,t,n,!1)};u.prototype.write=function(e,t,n,a){if(t===void 0)a="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")a=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var s=!1;;)switch(a){case"hex":return $a(this,e,t,n);case"utf8":case"utf-8":return Va(this,e,t,n);case"ascii":return kr(this,e,t,n);case"latin1":case"binary":return Wa(this,e,t,n);case"base64":return Za(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return za(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),s=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};gr=4096;u.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var a;if(u.TYPED_ARRAY_SUPPORT)a=this.subarray(e,t),a.__proto__=u.prototype;else{var i=t-e;a=new u(i,void 0);for(var s=0;s<i;++s)a[s]=this[s+e]}return a};u.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||j(e,t,this.length);for(var a=this[e],i=1,s=0;++s<t&&(i*=256);)a+=this[e+s]*i;return a};u.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||j(e,t,this.length);for(var a=this[e+--t],i=1;t>0&&(i*=256);)a+=this[e+--t]*i;return a};u.prototype.readUInt8=function(e,t){return t||j(e,1,this.length),this[e]};u.prototype.readUInt16LE=function(e,t){return t||j(e,2,this.length),this[e]|this[e+1]<<8};u.prototype.readUInt16BE=function(e,t){return t||j(e,2,this.length),this[e]<<8|this[e+1]};u.prototype.readUInt32LE=function(e,t){return t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};u.prototype.readUInt32BE=function(e,t){return t||j(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};u.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||j(e,t,this.length);for(var a=this[e],i=1,s=0;++s<t&&(i*=256);)a+=this[e+s]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a};u.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||j(e,t,this.length);for(var a=t,i=1,s=this[e+--a];a>0&&(i*=256);)s+=this[e+--a]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s};u.prototype.readInt8=function(e,t){return t||j(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};u.prototype.readInt16LE=function(e,t){t||j(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(e,t){t||j(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(e,t){return t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};u.prototype.readInt32BE=function(e,t){return t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};u.prototype.readFloatLE=function(e,t){return t||j(e,4,this.length),Tt(this,e,!0,23,4)};u.prototype.readFloatBE=function(e,t){return t||j(e,4,this.length),Tt(this,e,!1,23,4)};u.prototype.readDoubleLE=function(e,t){return t||j(e,8,this.length),Tt(this,e,!0,52,8)};u.prototype.readDoubleBE=function(e,t){return t||j(e,8,this.length),Tt(this,e,!1,52,8)};u.prototype.writeUIntLE=function(e,t,n,a){if(e=+e,t=t|0,n=n|0,!a){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var s=1,o=0;for(this[t]=e&255;++o<n&&(s*=256);)this[t+o]=e/s&255;return t+n};u.prototype.writeUIntBE=function(e,t,n,a){if(e=+e,t=t|0,n=n|0,!a){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+n};u.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):wt(this,e,t,!0),t+2};u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):wt(this,e,t,!1),t+2};u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):bt(this,e,t,!0),t+4};u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):bt(this,e,t,!1),t+4};u.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=0,o=1,f=0;for(this[t]=e&255;++s<n&&(o*=256);)e<0&&f===0&&this[t+s-1]!==0&&(f=1),this[t+s]=(e/o>>0)-f&255;return t+n};u.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=n-1,o=1,f=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&f===0&&this[t+s+1]!==0&&(f=1),this[t+s]=(e/o>>0)-f&255;return t+n};u.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1};u.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):wt(this,e,t,!0),t+2};u.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):wt(this,e,t,!1),t+2};u.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):bt(this,e,t,!0),t+4};u.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):bt(this,e,t,!1),t+4};u.prototype.writeFloatLE=function(e,t,n){return Ar(this,e,t,!0,n)};u.prototype.writeFloatBE=function(e,t,n){return Ar(this,e,t,!1,n)};u.prototype.writeDoubleLE=function(e,t,n){return Ir(this,e,t,!0,n)};u.prototype.writeDoubleBE=function(e,t,n){return Ir(this,e,t,!1,n)};u.prototype.copy=function(e,t,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<n&&(a=n),a===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-n&&(a=e.length-t+n);var i=a-n,s;if(this===e&&n<t&&t<a)for(s=i-1;s>=0;--s)e[s+t]=this[s+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<i;++s)e[s+t]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i};u.prototype.fill=function(e,t,n,a){if(typeof e=="string"){if(typeof t=="string"?(a=t,t=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!u.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<n;++s)this[s]=e;else{var o=H(e)?e:vt(new u(e,a).toString()),f=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%f]}return this};Xa=/[^+\/0-9A-Za-z-_]/g});var c=Vt(()=>{"use strict";Lr()});var Cu={};Wt(Cu,{DynamicSnippetsGeneratorContext:()=>sr});module.exports=aa(Cu);l();c();l();c();l();c();function C(r){throw new Error("Unexpected value: "+JSON.stringify(r))}l();c();l();c();l();c();l();c();l();c();l();c();var oi=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Or=oi;var ui=typeof self=="object"&&self&&self.Object===Object&&self,li=Or||ui||Function("return this")(),Ur=li;var ci=Ur.Symbol,ae=ci;l();c();var Fr=Object.prototype,fi=Fr.hasOwnProperty,pi=Fr.toString,tt=ae?ae.toStringTag:void 0;function di(r){var e=fi.call(r,tt),t=r[tt];try{r[tt]=void 0;var n=!0}catch(i){}var a=pi.call(r);return n&&(e?r[tt]=t:delete r[tt]),a}var jr=di;l();c();var mi=Object.prototype,hi=mi.toString;function yi(r){return hi.call(r)}var Pr=yi;var xi="[object Null]",gi="[object Undefined]",Mr=ae?ae.toStringTag:void 0;function vi(r){return r==null?r===void 0?gi:xi:Mr&&Mr in Object(r)?jr(r):Pr(r)}var Br=vi;l();c();function wi(r){return r!=null&&typeof r=="object"}var Dr=wi;var bi="[object Symbol]";function _i(r){return typeof r=="symbol"||Dr(r)&&Br(r)==bi}var $r=_i;l();c();l();c();function Ti(r,e){for(var t=-1,n=r==null?0:r.length,a=Array(n);++t<n;)a[t]=e(r[t],t,r);return a}var Vr=Ti;l();c();var ki=Array.isArray,Wr=ki;var Ni=1/0,Zr=ae?ae.prototype:void 0,zr=Zr?Zr.toString:void 0;function Yr(r){if(typeof r=="string")return r;if(Wr(r))return Vr(r,Yr)+"";if($r(r))return zr?zr.call(r):"";var e=r+"";return e=="0"&&1/r==-Ni?"-0":e}var qr=Yr;l();c();function Ri(r){return r==null?"":qr(r)}var pe=Ri;l();c();l();c();l();c();l();c();l();c();l();c();function Ai(r,e,t){var n=-1,a=r.length;e<0&&(e=-e>a?0:a+e),t=t>a?a:t,t<0&&(t+=a),a=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(a);++n<a;)i[n]=r[n+e];return i}var Gr=Ai;function Ii(r,e,t){var n=r.length;return t=t===void 0?n:t,!e&&t>=n?r:Gr(r,e,t)}var Jr=Ii;l();c();var Ei="\\ud800-\\udfff",Si="\\u0300-\\u036f",Ci="\\ufe20-\\ufe2f",Li="\\u20d0-\\u20ff",Oi=Si+Ci+Li,Ui="\\ufe0e\\ufe0f",Fi="\\u200d",ji=RegExp("["+Fi+Ei+Oi+Ui+"]");function Pi(r){return ji.test(r)}var kt=Pi;l();c();l();c();function Mi(r){return r.split("")}var Hr=Mi;l();c();var Kr="\\ud800-\\udfff",Bi="\\u0300-\\u036f",Di="\\ufe20-\\ufe2f",$i="\\u20d0-\\u20ff",Vi=Bi+Di+$i,Wi="\\ufe0e\\ufe0f",Zi="["+Kr+"]",Gt="["+Vi+"]",Jt="\\ud83c[\\udffb-\\udfff]",zi="(?:"+Gt+"|"+Jt+")",Xr="[^"+Kr+"]",Qr="(?:\\ud83c[\\udde6-\\uddff]){2}",en="[\\ud800-\\udbff][\\udc00-\\udfff]",Yi="\\u200d",tn=zi+"?",rn="["+Wi+"]?",qi="(?:"+Yi+"(?:"+[Xr,Qr,en].join("|")+")"+rn+tn+")*",Gi=rn+tn+qi,Ji="(?:"+[Xr+Gt+"?",Gt,Qr,en,Zi].join("|")+")",Hi=RegExp(Jt+"(?="+Jt+")|"+Ji+Gi,"g");function Ki(r){return r.match(Hi)||[]}var nn=Ki;function Xi(r){return kt(r)?nn(r):Hr(r)}var an=Xi;function Qi(r){return function(e){e=pe(e);var t=kt(e)?an(e):void 0,n=t?t[0]:e.charAt(0),a=t?Jr(t,1).join(""):e.slice(1);return n[r]()+a}}var sn=Qi;var es=sn("toUpperCase"),on=es;function ts(r){return on(pe(r).toLowerCase())}var un=ts;l();c();l();c();function rs(r,e,t,n){var a=-1,i=r==null?0:r.length;for(n&&i&&(t=r[++a]);++a<i;)t=e(t,r[a],a,r);return t}var ln=rs;l();c();l();c();l();c();function ns(r){return function(e){return r==null?void 0:r[e]}}var cn=ns;var as={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},is=cn(as),fn=is;var ss=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,os="\\u0300-\\u036f",us="\\ufe20-\\ufe2f",ls="\\u20d0-\\u20ff",cs=os+us+ls,fs="["+cs+"]",ps=RegExp(fs,"g");function ds(r){return r=pe(r),r&&r.replace(ss,fn).replace(ps,"")}var pn=ds;l();c();l();c();var ms=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function hs(r){return r.match(ms)||[]}var dn=hs;l();c();var ys=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function xs(r){return ys.test(r)}var mn=xs;l();c();var vn="\\ud800-\\udfff",gs="\\u0300-\\u036f",vs="\\ufe20-\\ufe2f",ws="\\u20d0-\\u20ff",bs=gs+vs+ws,wn="\\u2700-\\u27bf",bn="a-z\\xdf-\\xf6\\xf8-\\xff",_s="\\xac\\xb1\\xd7\\xf7",Ts="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ks="\\u2000-\\u206f",Ns=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_n="A-Z\\xc0-\\xd6\\xd8-\\xde",Rs="\\ufe0e\\ufe0f",Tn=_s+Ts+ks+Ns,kn="['\u2019]",hn="["+Tn+"]",As="["+bs+"]",Nn="\\d+",Is="["+wn+"]",Rn="["+bn+"]",An="[^"+vn+Tn+Nn+wn+bn+_n+"]",Es="\\ud83c[\\udffb-\\udfff]",Ss="(?:"+As+"|"+Es+")",Cs="[^"+vn+"]",In="(?:\\ud83c[\\udde6-\\uddff]){2}",En="[\\ud800-\\udbff][\\udc00-\\udfff]",Ye="["+_n+"]",Ls="\\u200d",yn="(?:"+Rn+"|"+An+")",Os="(?:"+Ye+"|"+An+")",xn="(?:"+kn+"(?:d|ll|m|re|s|t|ve))?",gn="(?:"+kn+"(?:D|LL|M|RE|S|T|VE))?",Sn=Ss+"?",Cn="["+Rs+"]?",Us="(?:"+Ls+"(?:"+[Cs,In,En].join("|")+")"+Cn+Sn+")*",Fs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",js="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ps=Cn+Sn+Us,Ms="(?:"+[Is,In,En].join("|")+")"+Ps,Bs=RegExp([Ye+"?"+Rn+"+"+xn+"(?="+[hn,Ye,"$"].join("|")+")",Os+"+"+gn+"(?="+[hn,Ye+yn,"$"].join("|")+")",Ye+"?"+yn+"+"+xn,Ye+"+"+gn,js,Fs,Nn,Ms].join("|"),"g");function Ds(r){return r.match(Bs)||[]}var Ln=Ds;function $s(r,e,t){return r=pe(r),e=t?void 0:e,e===void 0?mn(r)?Ln(r):dn(r):r.match(e)||[]}var On=$s;var Vs="['\u2019]",Ws=RegExp(Vs,"g");function Zs(r){return function(e){return ln(On(pn(e).replace(Ws,"")),r,"")}}var Un=Zs;var zs=Un(function(r,e,t){return e=e.toLowerCase(),r+(t?un(e):e)}),Ht=zs;l();c();function rt(r){return Object.keys(r)}l();c();l();c();l();c();var Fn,jn,nt=(jn=(Fn=x.env.FERN_STACK_TRACK)==null?void 0:Fn.toLowerCase())!=null?jn:"",K=nt!==""&&nt!=="0"&&nt!=="false",Kt=["single","multiline","box"].includes(nt)?nt:"single";K&&(Error.stackTraceLimit=50);var Ys=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),qs=new Set(["stacktrace"]);function Rt({maxFrames:r=50,skip:e=0,filterPaths:t=[],filterFunctions:n=[],stopOn:a=[],filterNode:i=!0,filterJs:s=!0,formatFilename:o=f=>f}={}){var d;if(!K)return[];n=[...n,...Ys],t=[...t,...qs],a=[...a,"runInteractiveTask"];let f=!1;return((d=new Error().stack)!=null?d:"").split(`
2
+ `).map(y=>{let _=y.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(_&&_.length===5){let[,E,U,te,mt]=_;if(!E||!U||!te||!mt)return;if(f||a.some(Xn=>E==null?void 0:E.includes(Xn))){f=!0;return}switch(E){case"Object.<anonymous>":E="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":E=`${E.substring(E.indexOf(".")+1)}()=> { ... }`;break}return{fn:E,path:o(U),position:`${te}:${mt}`}}}).filter(y=>{var _,E;return y&&!n.some(U=>y.fn.includes(U))&&!(i&&((_=y.path)!=null&&_.startsWith("node:")))&&!(s&&((E=y.path)!=null&&E.endsWith(".js")))&&!t.some(U=>y.path.includes(U))}).slice(e,e+r)}var Nt=class{constructor({maxFrames:e=50,skip:t=0,filterPaths:n=[],filterFunctions:a=[],stopOn:i=[],filterNode:s=!0,filterJs:o=!0,multiline:f=!1,formatFilename:d=y=>y}={}){g(this,"maxFrames");g(this,"skip");g(this,"filterPaths");g(this,"filterFunctions");g(this,"stopOn");g(this,"filterNode");g(this,"filterJs");g(this,"multiline");g(this,"formatFilename");g(this,"tracking",new WeakMap);this.maxFrames=e,this.skip=t,this.filterPaths=n,this.filterFunctions=a,this.stopOn=i,this.filterNode=s,this.filterJs=o,this.multiline=f,this.formatFilename=d}tag(e){let t=this.tracking.get(e)||new Set;Rt({maxFrames:this.maxFrames,skip:this.skip,filterPaths:this.filterPaths,filterFunctions:this.filterFunctions,stopOn:this.stopOn,filterNode:this.filterNode,filterJs:this.filterJs,formatFilename:this.formatFilename}).forEach(n=>t.add(n)),this.tracking.set(e,t)}trace(e){if(!K)return"";let t=this.tracking.get(e);return t?[...t].map(n=>`${this.multiline?`
3
+ `:""}${n.fn} - ${n.path}:${n.position}`).join(""):""}frames(e){let t=this.tracking.get(e);return t?[...t]:[]}free(e){this.tracking.delete(e)}clear(){this.tracking=new WeakMap}},ie;function Pn({maxFrames:r=50,skip:e=0,filterPaths:t=[],filterFunctions:n=[],stopOn:a=[],filterNode:i=!0,filterJs:s=!0,multiline:o=!1,formatFilename:f=d=>d}={}){K&&(ie!=null||(ie=new Nt({maxFrames:r,skip:e,filterPaths:t,filterFunctions:n,stopOn:a,filterNode:i,filterJs:s,multiline:o,formatFilename:f})))}function Mn(r){ie==null||ie.tag(r)}function Xt(r){var e;return(e=ie==null?void 0:ie.frames(r))!=null?e:[]}var we=class{constructor(){Mn(this)}};l();c();var At=class{formatMultiple(e){return Promise.all(e.map(t=>this.format(t)))}formatMultipleSync(e){return e.map(t=>this.formatSync(t))}},at=class extends At{async format(e){return e}formatSync(e){return e}};l();c();l();c();l();c();var q=class extends we{constructor(t){super();g(this,"value");this.value=t}write(t){typeof this.value=="string"?t.write(this.value):typeof this.value=="function"?this.value(t):this.value.write(t)}};var Gs=4;Pn({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var it=class{constructor(){g(this,"lineBuffer",[]);g(this,"indentLevel",0);g(this,"hasWrittenAnything",!1);g(this,"lastCharacterIsSemicolon",!1);g(this,"lastCharacterIsNewline",!1);g(this,"nodeStackFrames",[])}get buffer(){return K&&this.nodeStackFrames.length>0&&this.writeInternal(`
4
+ `),this.lineBuffer.join(`
5
+ `)+(this.lastCharacterIsNewline?`
6
+ `:"")}write(...e){for(let t of e)if(t!=null)if(typeof t=="string"){let n=t.length>0&&t.endsWith(`
7
+ `),a=n?t.substring(0,t.length-1):t,i=this.getIndentString(),s=a.replaceAll(`
3
8
  `,`
4
- ${a}`);this.isAtStartOfLine()&&(i=a+i),e&&(i+=`
5
- `),this.writeInternal(i)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new C(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new C(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new C(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new C(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",r,a="}"){let i=t.filter(o=>o!==void 0).join(" ");i?this.write(`${i} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),r(),this.dedent()}finally{this.write(a!=null?a:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
9
+ ${i}`);this.isAtStartOfLine()&&(s=i+s),n&&(s+=`
10
+ `),this.writeInternal(s)}else this.writeNode(t)}writeStatement(...e){this.write(...e),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(e){let t=this.indentLevel;this.indentLevel=0,this.write(e),this.indentLevel=t}writeNode(e){K&&this.nodeStackFrames.push(...Xt(e)),e.write(this),K&&Kt!=="single"&&this.writeInternal(`
11
+ `)}writeNodeOrString(e){if(typeof e=="string"){this.write(e);return}this.writeNode(e)}writeNodeStatement(e){this.writeNode(e),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(e){new q(e).write(this),e.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(e,t){new q(e).write(this),this.write(" (",t,")"),this.pushScope()}controlFlowWithoutStatement(e){new q(e).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(e,t){this.dedent(),this.write("} "),new q(e).write(this),this.write(" (",t,")"),this.pushScope()}alternativeControlFlow(e){this.dedent(),this.write("} "),new q(e).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(e=!0){this.dedent(),this.writeNewLineIfLastLineNot(),e?this.writeLine("}"):this.write("}")}writeLine(...e){this.write(...e.length===0?[""]:e),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
12
  `)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:r}){if(t.length>0){let a=t[0];a!=null&&r(a);for(let i=1;i<t.length;i++){this.write(e);let o=t[i];o!=null&&r(o)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
8
- `),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*pi)}};u();f();var ye=class{},te=class extends ye{async format(t){return t}formatSync(t){return t}};u();f();function Pe(n){return(n==null?void 0:n.name)!=null}u();f();u();f();u();f();u();f();var re=class{constructor(){c(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let r=t.match(this.REFERENCE_REGEX);if(!(r==null||r[1]==null||r[2]==null))return{method:r[1],path:r[2]}}};u();f();var v={Critical:"CRITICAL",Warning:"WARNING"},ne=class n{constructor(){c(this,"errors");c(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(Ve(je({},t),{path:[...this.path]}))}scope(t){this.path.push(t)}unscope(){this.path.pop()}getBySeverity(t){return this.errors.filter(e=>e.severity===t)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let t=new n;return t.errors=[...this.errors],t.path=[...this.path],t}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(t=>({severity:t.severity,path:t.path!=null?this.pathToStringArray(t.path):void 0,message:t.message}))}pathToStringArray(t){let e=[];for(let r of t){if(typeof r=="string"){e.push(r);continue}e[e.length-1]+=`[${r.index}]`}return e}};var ae=class{constructor({ir:t,config:e,options:r={}}){c(this,"config");c(this,"options");c(this,"errors");c(this,"_ir");c(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=r,this.errors=new ne,this.httpEndpointReferenceParser=new re}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];for(let[a,i]of Object.entries(e)){this.errors.scope(a);try{let o=t.find(d=>d.name.wireValue===a);if(o==null)throw this.newParameterNotRecognizedError(a);let m=this.isListTypeReference(o.typeReference)&&!Array.isArray(i)?[i]:i;r.push({name:o.name,typeReference:o.typeReference,value:m})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){let a=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let m=t.find(d=>d.name.wireValue===i);if(m==null){if(r)continue;this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(i).message});continue}a.push({name:m.name,typeReference:m.typeReference,value:o})}finally{this.errors.unscope()}}return a}getSingleFileValue({property:t,record:e}){let r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:v.Critical,message:`Expected file value to be a string, got ${typeof r}`});return}return r}}getFileArrayValues({property:t,record:e}){let r=e[t.wireValue];if(r==null)return;if(!Array.isArray(r)){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let a=[];for(let i of r){if(typeof i!="string"){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}a.push(i)}return a}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:v.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(t)?"array":typeof t}`});return}return t==null?{}:t}resolveNamedType({typeId:t}){let e=this._ir.types[t];if(e==null){this.errors.add({severity:v.Critical,message:`Type identified by "${t}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e}){let r=this.getRecord(e);if(r==null)return;let a=t.discriminant.wireValue,i=r[a];if(i==null){this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(a).message});return}if(typeof i!="string"){this.errors.add({severity:v.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let o=t.types[i];if(o==null){this.errors.add({severity:v.Critical,message:`No type found for discriminant value "${i}"`});return}let x=r,{[a]:m}=x,d=$e(x,[We(a)]);return{singleDiscriminatedUnionType:o,discriminantValue:o.discriminantValue,value:d}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocationOrThrow(t){let e=[];for(let r of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t})&&e.push(r);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`);return e}needsRequestParameter({request:t,inlinePathParameters:e,inlineFileProperties:r}){var a;return this.includePathParametersInWrappedRequest({request:t,inlinePathParameters:e})||t.queryParameters!=null&&t.queryParameters.length>0||t.headers!=null&&t.headers.length>0?!0:t.body!=null?this.includeRequestBodyInWrappedRequest({body:t.body,inlineFileProperties:r}):!((a=t.metadata)!=null&&a.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,a;return e&&((a=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?a:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:g(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let r=e.environments.find(a=>a.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(a=>a.id===t);return r==null?void 0:r.name}default:g(e)}}isSingleEnvironmentID(t){return typeof t=="string"}isMultiEnvironmentValues(t){return typeof t=="object"}validateMultiEnvironmentUrlValues(t){if(this._ir.environments==null)return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let r=e.environments[0];if(r==null)return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let a=new Set(Q(r.urls));for(let i of Q(t))a.has(i)&&a.delete(i);return a.size>0?(this.errors.add({severity:v.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${Q(r.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"string",value:t}).message});return}return t}isOptional(t){switch(t.type){case"nullable":return this.isOptional(t.value);case"optional":return!0;case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}isNullable(t){switch(t.type){case"nullable":return!0;case"optional":return this.isNullable(t.value);case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}newAuthMismatchError({auth:t,values:e}){return new Error(`Expected auth type ${t.type}, got ${e.type}`)}newParameterNotRecognizedError(t){return new Error(`"${t}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:t,value:e}){return new Error(`Expected ${t}, got ${typeof e}`)}includeRequestBodyInWrappedRequest({body:t,inlineFileProperties:e}){switch(t.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e});default:g(t)}}includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e}){return this.fileUploadHasBodyProperties({fileUpload:t})||e&&this.fileUploadHasFileProperties({fileUpload:t})}fileUploadHasBodyProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:g(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:g(e)}})}isListTypeReference(t){return t.type==="optional"?this.isListTypeReference(t.value):t.type==="list"||t.type==="set"}parsedEndpointMatches({endpoint:t,parsedEndpoint:e}){return t.location.method===e.method&&t.location.path===e.path}};u();f();var l={};Ye(l,{Access:()=>Fe,AstNode:()=>T,Class:()=>W,ClassInstantiation:()=>$,ClassReference:()=>w,CodeBlock:()=>Y,Method:()=>G,MethodInvocation:()=>z,Parameter:()=>q,Type:()=>oe,TypeLiteral:()=>R,Writer:()=>V,classReference:()=>Ci,class_:()=>Li,codeblock:()=>ki,instantiateClass:()=>Si,invokeMethod:()=>Ui,method:()=>Pi,parameter:()=>Fi});u();f();u();f();u();f();var Fe={Public:"public",Protected:"protected",Private:"private"};u();f();u();f();u();f();var V=class extends ee{constructor({packageName:e,customConfig:r,formatter:a}){super();c(this,"packageName");c(this,"customConfig");c(this,"formatter");c(this,"imports",new Set);this.packageName=e,this.customConfig=r,this.formatter=a!=null?a:new te}addImport(e){this.imports.add(e)}};var ie=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}
9
- ${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Java file: ${e}
10
- ${t}`)}return t}getContent(){let t=`package ${this.packageName};
13
+ `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:e,delimiter:t,writeFunction:n}){if(e.length>0){let a=e[0];a!=null&&n(a);for(let i=1;i<e.length;i++){this.write(t);let s=e[i];s!=null&&n(s)}}}toString(){return this.buffer}writeInternal(e){if(e.length===0)return;let t=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=e.endsWith(`
14
+ `),this.lastCharacterIsSemicolon=e.endsWith(";");let n=e.split(`
15
+ `),a=K&&!this.shouldSkipTracking(n)&&this.lastCharacterIsNewline;t&&(this.lastLine=`${this.lastLine}${n.shift()||""}`),this.lastCharacterIsNewline&&n.pop(),this.lineBuffer.push(...n),a&&this.appendTrackingComment()}set lastLine(e){this.lineBuffer.length>0?this.lineBuffer[this.lineBuffer.length-1]=e:this.lineBuffer.push(e)}get lastLine(){return this.lineBuffer[this.lineBuffer.length-1]||""}shouldSkipTracking(e){return!1}formatStack(e,t=""){return e.map(n=>`${t?`(${t}) `:""} ${n.fn} - ${n.path} : ${n.position}`)}filterStack(e){return e.filter(t=>!t.fn.startsWith(`${this.constructor.name}.`))}appendTrackingComment(){let e=[...this.formatStack(this.filterStack(Rt({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,Kt){case"single":return this.singleLineTrackingComment(e);case"multiline":return this.multiLineTrackingComment(e);case"box":return this.boxTrackingComment(e)}}singleLineTrackingComment(e){this.lastLine=`${this.lastLine} // ${e.join(" ")}`}multiLineTrackingComment(e){this.lineBuffer.push(...e.map(t=>` // ${t}`))}boxTrackingComment(e){this.lineBuffer.push("/*",...e.map(t=>` ${t}`),"*/")}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return Gs}};l();c();function Qt(r){return(r==null?void 0:r.name)!=null&&(r==null?void 0:r.assignment)!=null}l();c();l();c();l();c();l();c();var st=class{constructor(){g(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let n=e.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};l();c();var O={Critical:"CRITICAL",Warning:"WARNING"},ot=class r{constructor(){g(this,"errors");g(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(T(p({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(t=>t.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new r;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let t=[];for(let n of e){if(typeof n=="string"){t.push(n);continue}t[t.length-1]+=`[${n.index}]`}return t}};var ut=class{constructor({ir:e,config:t,options:n={}}){g(this,"config");g(this,"options");g(this,"errors");g(this,"_ir");g(this,"httpEndpointReferenceParser");this._ir=e,this.config=t,this.options=n,this.errors=new ot,this.httpEndpointReferenceParser=new st}associateQueryParametersByWireValue({parameters:e,values:t}){let n=[];for(let[a,i]of Object.entries(t)){this.errors.scope(a);try{let s=e.find(f=>f.name.wireValue===a);if(s==null)throw this.newParameterNotRecognizedError(a);let o=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;n.push({name:s.name,typeReference:s.typeReference,value:o})}finally{this.errors.unscope()}}return n}associateByWireValueOrDefault({parameters:e,values:t}){let n=[];for(let a of e){this.errors.scope(a.name.wireValue);try{let i=t[a.name.wireValue];if(i==null)if(a.typeReference.type==="primitive"&&a.typeReference.value==="STRING")i=`<${a.name.wireValue}>`;else{this.errors.add({severity:O.Critical,message:this.newParameterNotRecognizedError(a.name.wireValue).message});continue}n.push({name:a.name,typeReference:a.typeReference,value:i})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:e,values:t,ignoreMissingParameters:n}){let a=[];for(let[i,s]of Object.entries(t)){this.errors.scope(i);try{let o=e.find(f=>f.name.wireValue===i);if(o==null){if(n)continue;this.errors.add({severity:O.Critical,message:this.newParameterNotRecognizedError(i).message});continue}a.push({name:o.name,typeReference:o.typeReference,value:s})}finally{this.errors.unscope()}}return a}getExampleObjectProperties({parameters:e,snippetObject:t}){let n=typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{},a=[];for(let i of e){let s=n[i.name.wireValue];s==null?i.typeReference.type==="nullable"&&a.push({name:i.name,typeReference:i.typeReference,value:null}):a.push({name:i.name,typeReference:i.typeReference,value:s})}return a}getSingleFileValue({property:e,record:t}){let n=t[e.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:O.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:e,record:t}){let n=t[e.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:O.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let a=[];for(let i of n){if(typeof i!="string"){this.errors.add({severity:O.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}a.push(i)}return a}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:O.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let t=this._ir.types[e];if(t==null){this.errors.add({severity:O.Critical,message:`Type identified by "${e}" could not be found`});return}return t}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t}){let n=this.getRecord(t);if(n==null)return;let a=e.discriminant.wireValue,i=n[a];if(i==null){this.errors.add({severity:O.Critical,message:this.newParameterNotRecognizedError(a).message});return}if(typeof i!="string"){this.errors.add({severity:O.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:O.Critical,message:`No type found for discriminant value "${i}"`});return}let d=n,{[a]:o}=d,f=lr(d,[ur(a)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:f}}resolveEndpointOrThrow(e){let t=this.httpEndpointReferenceParser.tryParse(e);if(t==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(t)}resolveEndpointLocation(e){let t=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:e})&&t.push(n);return t}resolveEndpointLocationOrThrow(e){let t=this.resolveEndpointLocation(e);if(t.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return t}needsRequestParameter({request:e,inlinePathParameters:t,inlineFileProperties:n}){var a;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:t})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:n}):!((a=e.metadata)!=null&&a.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:t}){var n,a;return t&&((a=(n=e.metadata)==null?void 0:n.includePathParameters)!=null?a:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:C(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":{let n=t.environments.find(a=>a.id===e);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=t.environments.find(a=>a.id===e);return n==null?void 0:n.name}default:C(t)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:O.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":return this.errors.add({severity:O.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=t.environments[0];if(n==null)return this.errors.add({severity:O.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let a=new Set(rt(n.urls));for(let i of rt(e))a.has(i)&&a.delete(i);return a.size>0?(this.errors.add({severity:O.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${rt(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:O.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:O.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:O.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:t}){return new Error(`Expected auth type ${e.type}, got ${t.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:t}){return new Error(`Expected ${e}, got ${typeof t}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:t}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t});default:C(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t}){return this.fileUploadHasBodyProperties({fileUpload:e})||t&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:C(t)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:C(t)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:t}){return e.location.method===t.method&&e.location.path===t.path}};l();c();l();c();l();c();var be=class extends it{constructor({packageName:t,customConfig:n,formatter:a}){super();g(this,"packageName");g(this,"customConfig");g(this,"formatter");g(this,"imports",new Set);this.packageName=t,this.customConfig=n,this.formatter=a!=null?a:new at}addImport(t){this.imports.add(t)}getImports(){return new Set(this.imports)}};var lt=class extends be{constructor({packageName:e,customConfig:t,formatter:n}){super({packageName:e,customConfig:t,formatter:n})}async toStringAsync(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.format(e)}catch(t){throw new Error(`Failed to format Java file: ${t}
16
+ ${e}`)}return e}toString(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(e)}catch(t){throw new Error(`Failed to format Java file: ${t}
17
+ ${e}`)}return e}getContent(){let e=`package ${this.packageName};
11
18
 
12
- `,e=this.stringifyImports();return e.length>0?`${t}${e}
19
+ `,t=this.stringifyImports();return t.length>0?`${e}${t}
13
20
 
14
- ${this.buffer}`:t+this.buffer}stringifyImports(){return Array.from(this.imports).filter(t=>t!==this.packageName).map(t=>`import ${t};`).sort().join(`
15
- `)}};var T=class extends j{async toStringAsync({packageName:t,customConfig:e,formatter:r}){let a=new ie({packageName:t,customConfig:e,formatter:r});return this.write(a),a.toStringAsync()}toString({packageName:t,customConfig:e,formatter:r}){let a=new ie({packageName:t,customConfig:e,formatter:r});return this.write(a),a.toString()}};u();f();var W=class extends T{constructor({name:e,access:r}){super();c(this,"name");c(this,"access");c(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}};u();f();var w=class extends T{constructor({name:e,packageName:r,fullyQualified:a}){super();c(this,"name");c(this,"packageName");c(this,"fullyQualified");this.name=e,this.packageName=r,this.fullyQualified=a!=null?a:!1}write(e){if(e.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){e.write(`${this.packageName}.${this.name}`);return}e.write(this.name)}};u();f();u();f();u();f();u();f();var oe=class extends T{constructor(e){super();c(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"bigInteger":e.writeNode(ci);break;case"boolean":e.write("Boolean");break;case"bytes":e.write("byte[]");break;case"float":e.write("Float");break;case"date":e.write("String");break;case"dateTime":e.writeNode(hi);break;case"double":e.write("Double");break;case"integer":e.write("Integer");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(yi);break;default:g(this.internalType)}}isOptional(){return this.internalType.type==="optional"}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 set(e){return new this({type:"set",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}writeList({writer:e,list:r}){e.writeNode(mi),e.write("<"),r.value.write(e),e.write(">")}writeMap({writer:e,map:r}){e.writeNode(di),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(">")}writeSet({writer:e,set:r}){e.writeNode(xi),e.write("<"),r.value.write(e),e.write(">")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},Be=new w({name:"Arrays",packageName:"java.util"}),ci=new w({name:"BigInteger",packageName:"java.math"}),il=new w({name:"HashMap",packageName:"java.util"}),mi=new w({name:"List",packageName:"java.util"}),di=new w({name:"Map",packageName:"java.util"}),hi=new w({name:"OffsetDateTime",packageName:"java.time"}),Me=new w({name:"Optional",packageName:"java.util"}),xi=new w({name:"Set",packageName:"java.util"}),yi=new w({name:"UUID",packageName:"java.util"});var R=class n extends T{constructor(e){super();c(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":e.write(this.internalType.value.toString());break;case"enum":this.writeEnum({writer:e,enum_:this.internalType});break;case"float":e.write(`${this.internalType.value}f`);break;case"integer":e.write(this.internalType.value.toString());break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write(`${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":{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:g(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}){return new this({type:"list",valueType:e,values:r})}static long(e){return new this({type:"long",value:e})}static map({keyType:e,valueType:r,entries:a}){return new this({type:"map",keyType:e,valueType:r,entries:a})}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:g(this.internalType)}}writeBigInteger({writer:e,bigInteger:r}){e.write("new "),e.writeNode(l.instantiateClass({classReference:gi,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(bi({parameters:r.parameters}))}),e.dedent()}writeBuilderParameters({writer:e,parameters:r}){e.writeLine(".builder()");for(let a of r)e.write(`.${a.name}(`),a.value.shouldWriteInLine()||e.newLine(),e.indent(),e.writeNode(a.value),e.dedent(),a.value.shouldWriteInLine()||e.newLine(),e.writeLine(")");e.writeNewLineIfLastLineNot(),e.write(".build()")}orderBuilderParameters(e){return e.sort((r,a)=>r.value.isOptional()&&!a.value.isOptional()?1:!r.value.isOptional()&&a.value.isOptional()?-1:0)}writeClass({writer:e,class_:r}){let a=Ni({parameters:r.parameters});e.writeNode(l.instantiateClass({classReference:r.reference,arguments_:a.map(i=>i.value)}))}writeDateTime({writer:e,dateTime:r}){e.writeNode(l.invokeMethod({on:vi,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 a=Ri({entries:r.entries});if(a.length===0){e.write("new "),e.writeNode(ge),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(ge),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.writeLine(">() {{"),e.indent();for(let i of a)e.write("put("),e.writeNode(i.key),e.write(", "),e.writeNode(i.value),e.writeLine(");");e.dedent(),e.write("}}")}writeOptional({writer:e,optional:r}){if(!r.useOf){e.writeNode(r.value);return}e.writeNode(l.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 a=r.type==="list"?Oe:wi,i=Ai({values:r.values});if(i.length===0){e.write(`new ${a.name}<`),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(a),e.write("<"),e.writeNode(r.valueType),e.writeLine(">("),e.indent(),e.writeNode(l.invokeMethod({on:Be,method:"asList",arguments_:i})),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(Oe),e.write("<Object>()");return}e.writeLine("new"),e.writeNode(Oe),e.write("<Object>() {"),e.indent(),e.writeNode(l.invokeMethod({on:Be,method:"asList",arguments_:r.map(a=>n.unknown(a))})),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("}")}writeUnknownMap({writer:e,value:r}){let a=Object.entries(r);if(a.length===0){e.write("new "),e.writeNode(ge),e.write("<String, Object>()");return}e.writeLine("new "),e.writeNode(ge),e.write("<String, Object>() {{"),e.indent();for(let[i,o]of a)e.write(`put("${i}", `),e.writeNode(n.unknown(o)),e.writeLine(");");e.dedent(),e.write("}}")}writeUUID({writer:e,uuid:r}){e.writeNode(l.invokeMethod({on:Ti,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"}},Oe=new w({name:"ArrayList",packageName:"java.util"}),gi=new w({name:"BigInteger",packageName:"java.math"}),ge=new w({name:"HashMap",packageName:"java.util"}),wi=new w({name:"HashSet",packageName:"java.util"}),hl=new w({name:"List",packageName:"java.util"}),xl=new w({name:"Map",packageName:"java.util"}),vi=new w({name:"OffsetDateTime",packageName:"java.time"}),yl=new w({name:"Set",packageName:"java.util"}),Ti=new w({name:"UUID",packageName:"java.util"});function Ni({parameters:n}){return n.filter(t=>!R.isNop(t.value))}function bi({parameters:n}){return n.filter(t=>!R.isNop(t.value))}function Ri({entries:n}){return n.filter(t=>!R.isNop(t.key)&&!R.isNop(t.value))}function Ai({values:n}){return n.filter(t=>!R.isNop(t))}function we({writer:n,arguments_:t}){let e=Ii(t);if(e.length===0){n.write("()");return}if(e.some(a=>a instanceof R&&!a.shouldWriteInLine())){Ei({writer:n,arguments_:e});return}n.write("("),e.forEach((a,i)=>{i>0&&n.write(", "),hr({writer:n,argument:a})}),n.write(")")}function Ei({writer:n,arguments_:t}){n.writeLine("("),n.indent(),t.forEach((e,r)=>{r>0&&n.writeLine(","),hr({writer:n,argument:e})}),n.dedent(),t.length>0&&n.newLine(),n.write(")")}function hr({writer:n,argument:t}){Pe(t)?n.writeNodeOrString(t.assignment):t.write(n)}function Ii(n){return n.filter(t=>!(t instanceof R&&R.isNop(t)))}var $=class extends T{constructor({classReference:e,arguments_:r}){super();c(this,"classReference");c(this,"arguments_");this.classReference=e,this.arguments_=r}write(e){e.writeNode(this.classReference),we({writer:e,arguments_:this.arguments_})}};u();f();var Y=class extends T{constructor(e){super();c(this,"arg");this.arg=e}write(e){return new C(this.arg).write(e)}};u();f();var G=class extends T{constructor({name:e,access:r,parameters:a,body:i,static_:o,return_:m}){super();c(this,"name");c(this,"access");c(this,"parameters");c(this,"body");c(this,"return_");c(this,"static_");this.name=e,this.access=r,this.parameters=a,this.body=i,this.return_=m,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("()"):(e.writeLine("("),e.indent(),this.parameters.forEach((r,a)=>{a>0&&e.writeLine(", "),e.writeNode(r)}),e.dedent(),e.write(")")),this.body==null){e.write(";");return}e.writeLine(" {"),e.indent(),e.writeNode(this.body),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("}")}};u();f();var z=class extends T{constructor({method:e,arguments_:r,on:a}){super();c(this,"on");c(this,"method");c(this,"arguments_");this.on=a,this.method=e,this.arguments_=r}write(e){this.on.write(e),e.write("."),e.write(this.method),we({writer:e,arguments_:this.arguments_})}};u();f();var q=class extends T{constructor({name:e,type:r}){super();c(this,"name");c(this,"type");this.name=e,this.type=r}write(e){e.writeNode(this.type),e.write(` ${this.name}`)}};function ki(n){return new Y(n)}function Li(n){return new W(n)}function Ci(n){return new w(n)}function Si(n){return new $(n)}function Ui(n){return new z(n)}function Pi(n){return new G(n)}function Fi(n){return new q(n)}u();f();var ve=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:v.Critical,message:"Expected non-null value, but got null"}),l.TypeLiteral.nop());if(t.value===void 0)return l.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literal:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?l.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"nullable":case"optional":return l.TypeLiteral.optional({value:this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as}),useOf:t.as==="mapValue"});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return this.convertUnknown({value:t.value});default:g(t.typeReference)}}convertList({list:t,value:e}){return Array.isArray(e)?l.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((r,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:v.Critical,message:`Expected array but got: ${typeof e}`}),l.TypeLiteral.nop())}convertLiteral({literal:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?l.TypeLiteral.nop():l.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?l.TypeLiteral.nop():l.TypeLiteral.string(r)}default:g(t)}}convertSet({set:t,value:e}){return Array.isArray(e)?l.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((r,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:v.Critical,message:`Expected array but got: ${typeof e}`}),l.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:v.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),l.TypeLiteral.nop()):l.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:t.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:t.value}),entries:Object.entries(e).map(([r,a])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"mapKey"}),value:this.convert({typeReference:t.value,value:a,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:r}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r});case"discriminatedUnion":return 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:g(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let r=this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(a==null)return l.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let o=this.context.resolveNamedType({typeId:i.typeId});return o==null?l.TypeLiteral.nop():l.TypeLiteral.reference(l.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:o,value:a.value})]}))}case"singleProperty":{let o=this.context.getRecord(a.value);if(o==null)return l.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),l.TypeLiteral.reference(l.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:o[i.discriminantValue.wireValue]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return l.TypeLiteral.reference(l.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:g(i)}}convertObject({object_:t,value:e,as:r}){var i;let a=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return l.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),parameters:a.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getMethodName(o.name.name),value:this.convert({typeReference:o.typeReference,value:o.value,as:r})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let r=this.getEnumValueName({enum_:t,value:e});return r==null?l.TypeLiteral.nop():l.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:v.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(a=>a.wireValue===e);if(r==null){this.context.errors.add({severity:v.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});if(r==null)return l.TypeLiteral.nop();if(this.context.isPrimitive(r.valueTypeReference))return l.TypeLiteral.reference(l.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:"of",arguments_:[r.typeInstantiation]}));let a=this.getUndiscriminatedUnionFieldName({typeReference:r.valueTypeReference});return a==null?l.TypeLiteral.nop():l.TypeLiteral.reference(l.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:`of${a}`,arguments_:[r.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let r of t.types)try{let a=this.convert({typeReference:r,value:e});return{valueTypeReference:r,typeInstantiation:a}}catch(a){continue}this.context.errors.add({severity:v.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}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:g(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:g(t)}}convertUnknown({value:t}){return l.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){switch(t){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.integer(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.long(a)}case"FLOAT":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.float(a)}case"DOUBLE":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.double(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.boolean(a)}case"STRING":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.string(a)}case"DATE":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.dateTime(a)}case"UUID":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.uuid(a)}case"BASE_64":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.bytes(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.bigInteger(a)}default:g(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})}};u();f();var Te=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return l.Type.list(this.convert({typeReference:t.typeReference}));case"literal":return this.convertLiteral({literal:t.typeReference.value});case"map":return l.Type.map(this.convert({typeReference:t.typeReference.key}),this.convert({typeReference:t.typeReference.value}));case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?this.convertUnknown():this.convertNamed({named:e})}case"optional":case"nullable":return l.Type.optional(this.convert({typeReference:t.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:t.typeReference.value});case"set":return l.Type.set(this.convert({typeReference:t.typeReference}));case"unknown":return this.convertUnknown();default:g(t.typeReference)}}convertNamed({named:t}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return l.Type.reference(l.classReference({name:this.context.getClassName(t.declaration.name),packageName:this.context.getTypesPackageName(t.declaration.fernFilepath)}));default:g(t)}}convertLiteral({literal:t}){switch(t.type){case"boolean":return l.Type.boolean();case"string":return l.Type.string()}}convertUnknown(){return l.Type.object()}convertPrimitive({primitive:t}){switch(t){case"INTEGER":return l.Type.integer();case"UINT":return l.Type.integer();case"LONG":return l.Type.long();case"UINT_64":return l.Type.long();case"FLOAT":return l.Type.float();case"DOUBLE":return l.Type.double();case"BOOLEAN":return l.Type.boolean();case"STRING":return l.Type.string();case"DATE":return l.Type.date();case"DATE_TIME":return l.Type.dateTime();case"UUID":return l.Type.uuid();case"BASE_64":return l.Type.bytes();case"BIG_INTEGER":return l.Type.bigInteger();default:g(t)}}};u();f();var Ne=class{constructor({context:t}){c(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var i;let r={fileFields:[],bodyPropertyFields:[]},a=(i=this.context.getRecord(e))!=null?i:{};for(let o of t.properties)switch(o.type){case"file":r.fileFields.push({name:this.context.getMethodName(o.name),value:this.getSingleFileProperty({property:o,record:a})});break;case"fileArray":r.fileFields.push({name:this.context.getMethodName(o.name),value:this.getArrayFileProperty({property:o,record:a})});break;case"bodyProperty":r.bodyPropertyFields.push({name:this.context.getMethodName(o.name.name),value:this.getBodyProperty({property:o,record:a})});break;default:g(o)}return r}getSingleFileProperty({property:t,record:e}){let r=this.context.getSingleFileValue({property:t,record:e});return r==null?l.TypeLiteral.nop():l.TypeLiteral.reference(this.context.getFileStreamFromString(r))}getArrayFileProperty({property:t,record:e}){let r=this.context.getFileArrayValues({property:t,record:e});if(r==null)return l.TypeLiteral.nop();for(let a of r)return l.TypeLiteral.reference(this.context.getFileStreamFromString(a));return l.TypeLiteral.nop()}getBodyProperty({property:t,record:e}){let r=e[t.name.wireValue];return r==null?l.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:r})}};var Bi=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),_e=class n extends ae{constructor({ir:e,config:r,options:a}){super({ir:e,config:r,options:a});c(this,"ir");c(this,"customConfig");c(this,"dynamicTypeMapper");c(this,"dynamicTypeLiteralMapper");c(this,"filePropertyMapper");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeMapper=new Te({context:this}),this.dynamicTypeLiteralMapper=new ve({context:this}),this.filePropertyMapper=new Ne({context:this})}clone(){return new n({ir:this.ir,config:this.config,options:this.options})}getClassName(e){return this.getName(e.pascalCase.safeName)}getEnumName(e){return this.getName(e.screamingSnakeCase.safeName)}getPropertyName(e){return this.getName(e.camelCase.safeName)}getMethodName(e){return this.getName(e.camelCase.safeName)}getRootClientClassReference(){return l.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["client-class-name"])!=null?r:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return l.codeblock(a=>{a.writeNode(this.getEnvironmentClassReference()),a.write("."),a.write(this.getEnumName(r))})}getEnvironmentClassReference(){return l.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:e}){return l.classReference({name:e.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(e.fernFilepath)})}getNullableClassReference(){return l.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return l.TypeLiteral.reference(l.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getFileStreamFromString(e){return l.TypeLiteral.reference(l.codeblock(r=>{r.write("new "),r.writeNode(this.getFileStreamClassReference()),r.write("("),r.writeNode(this.getByteArrayInputStreamClassReference()),r.write("("),r.writeNode(l.TypeLiteral.string(e)),r.write(".getBytes("),r.writeNode(this.getStandardCharsetsClassReference()),r.write(".UTF_8)))")}))}getFileStreamClassReference(){return l.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return l.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return l.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(e){switch(e.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});if(r==null)return!1;switch(r.type){case"alias":return this.isPrimitive(r.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:g(r)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:g(e)}}getRootPackageName(){let e=this.getPackagePrefixTokens();return this.joinPackageTokens(e)}getCorePackageName(){let e=this.getPackagePrefixTokens();return e.push("core"),this.joinPackageTokens(e)}getTypesPackageName(e){return this.getResourcesPackage(e,"types")}getRequestsPackageName(e){return this.getPackageLayout()==="flat"?this.getTypesPackageName(e):this.getResourcesPackage(e,"requests")}getResourcesPackage(e,r){let a=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":e!=null&&a.push(...e.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:e!=null&&e.allParts.length>0&&a.push("resources"),e!=null&&a.push(...e.allParts.map(i=>this.getPackageNameSegment(i)))}return r!=null&&a.push(r),this.joinPackageTokens(a)}getPackageName(e,r){let a=this.getPackageNameSegments(e);return a=r!=null?[...a,r]:a,[...this.getPackagePrefixTokens(),...a].join(".")}getPackageLayout(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["package-layout"])!=null?r:"nested"}shouldInlinePathParameters(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["inline-path-parameters"])!=null?r:!1}shouldInlineFileProperties(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["inline-file-properties"])!=null?r:!1}getPackageNameSegments(e){return e.packagePath.map(r=>this.getPackageNameSegment(r))}getPackageNameSegment(e){return e.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var r;if(((r=this.customConfig)==null?void 0:r["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let e=[];return e.push("com"),e.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),e.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),e}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return Ue(this.config.workspaceName)}startsWithNumber(e){return/^\d/.test(e)}splitOnNonAlphaNumericChar(e){return e.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(e){return e.replace(/-([a-z])/g,(r,a)=>a.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}joinPackageTokens(e){return e.map(a=>this.startsWithNumber(a)?"_"+a:a).join(".")}getName(e){return this.isReservedName(e)?"_"+e:e}isReservedName(e){return Bi.has(e)}};0&&(module.exports={DynamicSnippetsGeneratorContext});
21
+ ${this.buffer}`:e+this.buffer}stringifyImports(){return Array.from(this.imports).filter(e=>e!==this.packageName).map(e=>`import ${e};`).sort().join(`
22
+ `)}};l();c();l();c();var S={};Wt(S,{BRAND:()=>bo,DIRTY:()=>_e,EMPTY_PATH:()=>Xs,INVALID:()=>k,NEVER:()=>iu,OK:()=>M,ParseStatus:()=>P,Schema:()=>A,ZodAny:()=>he,ZodArray:()=>le,ZodBigInt:()=>ke,ZodBoolean:()=>Ne,ZodBranded:()=>ft,ZodCatch:()=>je,ZodDate:()=>Re,ZodDefault:()=>Fe,ZodDiscriminatedUnion:()=>St,ZodEffects:()=>Y,ZodEnum:()=>Oe,ZodError:()=>D,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>Lt,ZodIntersection:()=>Se,ZodIssueCode:()=>h,ZodLazy:()=>Ce,ZodLiteral:()=>Le,ZodMap:()=>Xe,ZodNaN:()=>et,ZodNativeEnum:()=>Ue,ZodNever:()=>G,ZodNull:()=>Ie,ZodNullable:()=>ee,ZodNumber:()=>Te,ZodObject:()=>$,ZodOptional:()=>Z,ZodParsedType:()=>w,ZodPipeline:()=>pt,ZodPromise:()=>ye,ZodReadonly:()=>Pe,ZodRecord:()=>Ct,ZodSchema:()=>A,ZodSet:()=>Qe,ZodString:()=>me,ZodSymbol:()=>He,ZodTransformer:()=>Y,ZodTuple:()=>Q,ZodType:()=>A,ZodUndefined:()=>Ae,ZodUnion:()=>Ee,ZodUnknown:()=>ue,ZodVoid:()=>Ke,addIssueToContext:()=>v,any:()=>So,array:()=>Uo,bigint:()=>No,boolean:()=>Jn,coerce:()=>au,custom:()=>Yn,date:()=>Ro,datetimeRegex:()=>Zn,defaultErrorMap:()=>se,discriminatedUnion:()=>Mo,effect:()=>Ho,enum:()=>qo,function:()=>Zo,getErrorMap:()=>qe,getParsedType:()=>X,instanceof:()=>To,intersection:()=>Bo,isAborted:()=>It,isAsync:()=>Ge,isDirty:()=>Et,isValid:()=>de,late:()=>_o,lazy:()=>zo,literal:()=>Yo,makeIssue:()=>ct,map:()=>Vo,nan:()=>ko,nativeEnum:()=>Go,never:()=>Lo,null:()=>Eo,nullable:()=>Xo,number:()=>Gn,object:()=>Fo,objectUtil:()=>er,oboolean:()=>nu,onumber:()=>ru,optional:()=>Ko,ostring:()=>tu,pipeline:()=>eu,preprocess:()=>Qo,promise:()=>Jo,quotelessJson:()=>Js,record:()=>$o,set:()=>Wo,setErrorMap:()=>Ks,strictObject:()=>jo,string:()=>qn,symbol:()=>Ao,transformer:()=>Ho,tuple:()=>Do,undefined:()=>Io,union:()=>Po,unknown:()=>Co,util:()=>I,void:()=>Oo});l();c();l();c();l();c();l();c();l();c();var I;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{let i={};for(let s of a)i[s]=s;return i},r.getValidEnumValues=a=>{let i=r.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(let o of i)s[o]=a[o];return r.objectValues(s)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},r.find=(a,i)=>{for(let s of a)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(I||(I={}));var er;(function(r){r.mergeShapes=(e,t)=>p(p({},e),t)})(er||(er={}));var w=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),X=r=>{switch(typeof r){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(r)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(r)?w.array:r===null?w.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?w.promise:typeof Map!="undefined"&&r instanceof Map?w.map:typeof Set!="undefined"&&r instanceof Set?w.set:typeof Date!="undefined"&&r instanceof Date?w.date:w.object;default:return w.unknown}};var h=I.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Js=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),D=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let o=n,f=0;for(;f<s.path.length;){let d=s.path[f];f===s.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(s))):o[d]=o[d]||{_errors:[]},o=o[d],f++}}};return a(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let a of this.issues)if(a.path.length>0){let i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};D.create=r=>new D(r);var Hs=(r,e)=>{let t;switch(r.code){case h.invalid_type:r.received===w.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case h.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,I.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:t=`Unrecognized key(s) in object: ${I.joinValues(r.keys,", ")}`;break;case h.invalid_union:t="Invalid input";break;case h.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${I.joinValues(r.options)}`;break;case h.invalid_enum_value:t=`Invalid enum value. Expected ${I.joinValues(r.options)}, received '${r.received}'`;break;case h.invalid_arguments:t="Invalid function arguments";break;case h.invalid_return_type:t="Invalid function return type";break;case h.invalid_date:t="Invalid date";break;case h.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:I.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case h.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case h.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case h.custom:t="Invalid input";break;case h.invalid_intersection_types:t="Intersection results could not be merged";break;case h.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case h.not_finite:t="Number must be finite";break;default:t=e.defaultError,I.assertNever(r)}return{message:t}},se=Hs;var Bn=se;function Ks(r){Bn=r}function qe(){return Bn}l();c();var ct=r=>{let{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],s=T(p({},a),{path:i});if(a.message!==void 0)return T(p({},a),{path:i,message:a.message});let o="",f=n.filter(d=>!!d).slice().reverse();for(let d of f)o=d(s,{data:e,defaultError:o}).message;return T(p({},a),{path:i,message:o})},Xs=[];function v(r,e){let t=qe(),n=ct({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===se?void 0:se].filter(a=>!!a)});r.common.issues.push(n)}var P=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let a of t){if(a.status==="aborted")return k;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let a of t){let i=await a.key,s=await a.value;n.push({key:i,value:s})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let a of t){let{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return k;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||a.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}},k=Object.freeze({status:"aborted"}),_e=r=>({status:"dirty",value:r}),M=r=>({status:"valid",value:r}),It=r=>r.status==="aborted",Et=r=>r.status==="dirty",de=r=>r.status==="valid",Ge=r=>typeof Promise!="undefined"&&r instanceof Promise;l();c();l();c();var b;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));var z=class{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dn=(r,e)=>{if(de(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new D(r.common.issues);return this._error=t,this._error}}};function R(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{var d,y;let{message:f}=r;return s.code==="invalid_enum_value"?{message:f!=null?f:o.defaultError}:typeof o.data=="undefined"?{message:(d=f!=null?f:n)!=null?d:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(y=f!=null?f:t)!=null?y:o.defaultError}},description:a}}var A=class{get description(){return this._def.description}_getType(e){return X(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new P,ctx:{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ge(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var i;let n={common:{issues:[],async:(i=t==null?void 0:t.async)!=null?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Dn(n,a)}"~validate"(e){var n,a;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:t});return de(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>de(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Ge(a)?a:Promise.resolve(a));return Dn(n,i)}refine(e,t){let n=a=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{let s=e(a),o=()=>i.addIssue(p({code:h.custom},n(a)));return typeof Promise!="undefined"&&s instanceof Promise?s.then(f=>f?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new Y({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Z.create(this,this._def)}nullable(){return ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return le.create(this)}promise(){return ye.create(this,this._def)}or(e){return Ee.create([this,e],this._def)}and(e){return Se.create(this,e,this._def)}transform(e){return new Y(T(p({},R(this._def)),{schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new Fe(T(p({},R(this._def)),{innerType:this,defaultValue:t,typeName:N.ZodDefault}))}brand(){return new ft(p({typeName:N.ZodBranded,type:this},R(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new je(T(p({},R(this._def)),{innerType:this,catchValue:t,typeName:N.ZodCatch}))}describe(e){let t=this.constructor;return new t(T(p({},this._def),{description:e}))}pipe(e){return pt.create(this,e)}readonly(){return Pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Qs=/^c[^\s-]{8,}$/i,eo=/^[0-9a-z]+$/,to=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ro=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,no=/^[a-z0-9_-]{21}$/i,ao=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,io=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,so=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tr,uo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,co=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,po=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ho=new RegExp(`^${Vn}$`);function Wn(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function yo(r){return new RegExp(`^${Wn(r)}$`)}function Zn(r){let e=`${Vn}T${Wn(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function xo(r,e){return!!((e==="v4"||!e)&&uo.test(r)||(e==="v6"||!e)&&co.test(r))}function go(r,e){if(!ao.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch(t){return!1}}function vo(r,e){return!!((e==="v4"||!e)&&lo.test(r)||(e==="v6"||!e)&&fo.test(r))}var me=class r extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.string,received:i.parsedType}),k}let n=new P,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?v(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&v(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")so.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"email",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")tr||(tr=new RegExp(oo,"u")),tr.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"emoji",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ro.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"uuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")no.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"nanoid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Qs.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")eo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid2",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")to.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ulid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),v(a,{validation:"url",code:h.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"regex",code:h.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Zn(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ho.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?yo(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?io.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"duration",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?xo(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ip",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?go(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"jwt",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?vo(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cidr",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?po.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?mo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64url",code:h.invalid_string,message:i.message}),n.dirty()):I.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),p({validation:t,code:h.invalid_string},b.errToObj(n)))}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(p({kind:"email"},b.errToObj(e)))}url(e){return this._addCheck(p({kind:"url"},b.errToObj(e)))}emoji(e){return this._addCheck(p({kind:"emoji"},b.errToObj(e)))}uuid(e){return this._addCheck(p({kind:"uuid"},b.errToObj(e)))}nanoid(e){return this._addCheck(p({kind:"nanoid"},b.errToObj(e)))}cuid(e){return this._addCheck(p({kind:"cuid"},b.errToObj(e)))}cuid2(e){return this._addCheck(p({kind:"cuid2"},b.errToObj(e)))}ulid(e){return this._addCheck(p({kind:"ulid"},b.errToObj(e)))}base64(e){return this._addCheck(p({kind:"base64"},b.errToObj(e)))}base64url(e){return this._addCheck(p({kind:"base64url"},b.errToObj(e)))}jwt(e){return this._addCheck(p({kind:"jwt"},b.errToObj(e)))}ip(e){return this._addCheck(p({kind:"ip"},b.errToObj(e)))}cidr(e){return this._addCheck(p({kind:"cidr"},b.errToObj(e)))}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(p({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},b.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(p({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},b.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(p({kind:"duration"},b.errToObj(e)))}regex(e,t){return this._addCheck(p({kind:"regex",regex:e},b.errToObj(t)))}includes(e,t){return this._addCheck(p({kind:"includes",value:e,position:t==null?void 0:t.position},b.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(p({kind:"startsWith",value:e},b.errToObj(t)))}endsWith(e,t){return this._addCheck(p({kind:"endsWith",value:e},b.errToObj(t)))}min(e,t){return this._addCheck(p({kind:"min",value:e},b.errToObj(t)))}max(e,t){return this._addCheck(p({kind:"max",value:e},b.errToObj(t)))}length(e,t){return this._addCheck(p({kind:"length",value:e},b.errToObj(t)))}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};me.create=r=>{var e;return new me(p({checks:[],typeName:N.ZodString,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};function wo(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}var Te=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.number,received:i.parsedType}),k}let n,a=new P;for(let i of this._def.checks)i.kind==="int"?I.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?wo(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_finite,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,a){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(a)}]}))}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&I.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Te.create=r=>new Te(p({checks:[],typeName:N.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var ke=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(i){return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n,a=new P;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:w.bigint,received:t.parsedType}),k}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,a){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(a)}]}))}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};ke.create=r=>{var e;return new ke(p({checks:[],typeName:N.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};var Ne=class extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.boolean,received:n.parsedType}),k}return M(e.data)}};Ne.create=r=>new Ne(p({typeName:N.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var Re=class r extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.date,received:i.parsedType}),k}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_date}),k}let n=new P,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):I.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Re.create=r=>new Re(p({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:N.ZodDate},R(r)));var He=class extends A{_parse(e){if(this._getType(e)!==w.symbol){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.symbol,received:n.parsedType}),k}return M(e.data)}};He.create=r=>new He(p({typeName:N.ZodSymbol},R(r)));var Ae=class extends A{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.undefined,received:n.parsedType}),k}return M(e.data)}};Ae.create=r=>new Ae(p({typeName:N.ZodUndefined},R(r)));var Ie=class extends A{_parse(e){if(this._getType(e)!==w.null){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.null,received:n.parsedType}),k}return M(e.data)}};Ie.create=r=>new Ie(p({typeName:N.ZodNull},R(r)));var he=class extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return M(e.data)}};he.create=r=>new he(p({typeName:N.ZodAny},R(r)));var ue=class extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return M(e.data)}};ue.create=r=>new ue(p({typeName:N.ZodUnknown},R(r)));var G=class extends A{_parse(e){let t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:w.never,received:t.parsedType}),k}};G.create=r=>new G(p({typeName:N.ZodNever},R(r)));var Ke=class extends A{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.void,received:n.parsedType}),k}return M(e.data)}};Ke.create=r=>new Ke(p({typeName:N.ZodVoid},R(r)));var le=class r extends A{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==w.array)return v(t,{code:h.invalid_type,expected:w.array,received:t.parsedType}),k;if(a.exactLength!==null){let s=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(s||o)&&(v(t,{code:s?h.too_big:h.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(v(t,{code:h.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(v(t,{code:h.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>a.type._parseAsync(new z(t,s,t.path,o)))).then(s=>P.mergeArray(n,s));let i=[...t.data].map((s,o)=>a.type._parseSync(new z(t,s,t.path,o)));return P.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new r(T(p({},this._def),{minLength:{value:e,message:b.toString(t)}}))}max(e,t){return new r(T(p({},this._def),{maxLength:{value:e,message:b.toString(t)}}))}length(e,t){return new r(T(p({},this._def),{exactLength:{value:e,message:b.toString(t)}}))}nonempty(e){return this.min(1,e)}};le.create=(r,e)=>new le(p({type:r,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray},R(e)));function Je(r){if(r instanceof $){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Z.create(Je(n))}return new $(T(p({},r._def),{shape:()=>e}))}else return r instanceof le?new le(T(p({},r._def),{type:Je(r.element)})):r instanceof Z?Z.create(Je(r.unwrap())):r instanceof ee?ee.create(Je(r.unwrap())):r instanceof Q?Q.create(r.items.map(e=>Je(e))):r}var $=class r extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=I.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==w.object){let d=this._getOrReturnCtx(e);return v(d,{code:h.invalid_type,expected:w.object,received:d.parsedType}),k}let{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof G&&this._def.unknownKeys==="strip"))for(let d in a.data)s.includes(d)||o.push(d);let f=[];for(let d of s){let y=i[d],_=a.data[d];f.push({key:{status:"valid",value:d},value:y._parse(new z(a,_,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof G){let d=this._def.unknownKeys;if(d==="passthrough")for(let y of o)f.push({key:{status:"valid",value:y},value:{status:"valid",value:a.data[y]}});else if(d==="strict")o.length>0&&(v(a,{code:h.unrecognized_keys,keys:o}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let y of o){let _=a.data[y];f.push({key:{status:"valid",value:y},value:d._parse(new z(a,_,a.path,y)),alwaysSet:y in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let d=[];for(let y of f){let _=await y.key,E=await y.value;d.push({key:_,value:E,alwaysSet:y.alwaysSet})}return d}).then(d=>P.mergeObjectSync(n,d)):P.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new r(p(T(p({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,o,f;let a=(o=(s=(i=this._def).errorMap)==null?void 0:s.call(i,t,n).message)!=null?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=b.errToObj(e).message)!=null?f:a}:{message:a}}}:{}))}strip(){return new r(T(p({},this._def),{unknownKeys:"strip"}))}passthrough(){return new r(T(p({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new r(T(p({},this._def),{shape:()=>p(p({},this._def.shape()),e)}))}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>p(p({},this._def.shape()),e._def.shape()),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r(T(p({},this._def),{catchall:e}))}pick(e){let t={};for(let n of I.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r(T(p({},this._def),{shape:()=>t}))}omit(e){let t={};for(let n of I.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r(T(p({},this._def),{shape:()=>t}))}deepPartial(){return Je(this)}partial(e){let t={};for(let n of I.objectKeys(this.shape)){let a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new r(T(p({},this._def),{shape:()=>t}))}required(e){let t={};for(let n of I.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Z;)i=i._def.innerType;t[n]=i}return new r(T(p({},this._def),{shape:()=>t}))}keyof(){return zn(I.objectKeys(this.shape))}};$.create=(r,e)=>new $(p({shape:()=>r,unknownKeys:"strip",catchall:G.create(),typeName:N.ZodObject},R(e)));$.strictCreate=(r,e)=>new $(p({shape:()=>r,unknownKeys:"strict",catchall:G.create(),typeName:N.ZodObject},R(e)));$.lazycreate=(r,e)=>new $(p({shape:r,unknownKeys:"strip",catchall:G.create(),typeName:N.ZodObject},R(e)));var Ee=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(o=>new D(o.ctx.common.issues));return v(t,{code:h.invalid_union,unionErrors:s}),k}if(t.common.async)return Promise.all(n.map(async i=>{let s=T(p({},t),{common:T(p({},t.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(a);{let i,s=[];for(let f of n){let d=T(p({},t),{common:T(p({},t.common),{issues:[]}),parent:null}),y=f._parseSync({data:t.data,path:t.path,parent:d});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map(f=>new D(f));return v(t,{code:h.invalid_union,unionErrors:o}),k}}get options(){return this._def.options}};Ee.create=(r,e)=>new Ee(p({options:r,typeName:N.ZodUnion},R(e)));var oe=r=>r instanceof Ce?oe(r.schema):r instanceof Y?oe(r.innerType()):r instanceof Le?[r.value]:r instanceof Oe?r.options:r instanceof Ue?I.objectValues(r.enum):r instanceof Fe?oe(r._def.innerType):r instanceof Ae?[void 0]:r instanceof Ie?[null]:r instanceof Z?[void 0,...oe(r.unwrap())]:r instanceof ee?[null,...oe(r.unwrap())]:r instanceof ft||r instanceof Pe?oe(r.unwrap()):r instanceof je?oe(r._def.innerType):[],St=class r extends A{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.object)return v(t,{code:h.invalid_type,expected:w.object,received:t.parsedType}),k;let n=this.discriminator,a=t.data[n],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let a=new Map;for(let i of t){let s=oe(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,i)}}return new r(p({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a},R(n)))}};function rr(r,e){let t=X(r),n=X(e);if(r===e)return{valid:!0,data:r};if(t===w.object&&n===w.object){let a=I.objectKeys(e),i=I.objectKeys(r).filter(o=>a.indexOf(o)!==-1),s=p(p({},r),e);for(let o of i){let f=rr(r[o],e[o]);if(!f.valid)return{valid:!1};s[o]=f.data}return{valid:!0,data:s}}else if(t===w.array&&n===w.array){if(r.length!==e.length)return{valid:!1};let a=[];for(let i=0;i<r.length;i++){let s=r[i],o=e[i],f=rr(s,o);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return t===w.date&&n===w.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var Se=class extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=(i,s)=>{if(It(i)||It(s))return k;let o=rr(i.value,s.value);return o.valid?((Et(i)||Et(s))&&t.dirty(),{status:t.value,value:o.data}):(v(n,{code:h.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Se.create=(r,e,t)=>new Se(p({left:r,right:e,typeName:N.ZodIntersection},R(t)));var Q=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return v(n,{code:h.invalid_type,expected:w.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return v(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...n.data].map((s,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new z(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>P.mergeArray(t,s)):P.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new r(T(p({},this._def),{rest:e}))}};Q.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Q(p({items:r,typeName:N.ZodTuple,rest:null},R(e)))};var Ct=class r extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.object)return v(n,{code:h.invalid_type,expected:w.object,received:n.parsedType}),k;let a=[],i=this._def.keyType,s=this._def.valueType;for(let o in n.data)a.push({key:i._parse(new z(n,o,n.path,o)),value:s._parse(new z(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?P.mergeObjectAsync(t,a):P.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof A?new r(p({keyType:e,valueType:t,typeName:N.ZodRecord},R(n))):new r(p({keyType:me.create(),valueType:e,typeName:N.ZodRecord},R(t)))}},Xe=class extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.map)return v(n,{code:h.invalid_type,expected:w.map,received:n.parsedType}),k;let a=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([o,f],d)=>({key:a._parse(new z(n,o,n.path,[d,"key"])),value:i._parse(new z(n,f,n.path,[d,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of s){let d=await f.key,y=await f.value;if(d.status==="aborted"||y.status==="aborted")return k;(d.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(d.value,y.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let f of s){let d=f.key,y=f.value;if(d.status==="aborted"||y.status==="aborted")return k;(d.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(d.value,y.value)}return{status:t.value,value:o}}}};Xe.create=(r,e,t)=>new Xe(p({valueType:e,keyType:r,typeName:N.ZodMap},R(t)));var Qe=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return v(n,{code:h.invalid_type,expected:w.set,received:n.parsedType}),k;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(v(n,{code:h.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(v(n,{code:h.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let i=this._def.valueType;function s(f){let d=new Set;for(let y of f){if(y.status==="aborted")return k;y.status==="dirty"&&t.dirty(),d.add(y.value)}return{status:t.value,value:d}}let o=[...n.data.values()].map((f,d)=>i._parse(new z(n,f,n.path,d)));return n.common.async?Promise.all(o).then(f=>s(f)):s(o)}min(e,t){return new r(T(p({},this._def),{minSize:{value:e,message:b.toString(t)}}))}max(e,t){return new r(T(p({},this._def),{maxSize:{value:e,message:b.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Qe.create=(r,e)=>new Qe(p({valueType:r,minSize:null,maxSize:null,typeName:N.ZodSet},R(e)));var Lt=class r extends A{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.function)return v(t,{code:h.invalid_type,expected:w.function,received:t.parsedType}),k;function n(o,f){return ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,qe(),se].filter(d=>!!d),issueData:{code:h.invalid_arguments,argumentsError:f}})}function a(o,f){return ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,qe(),se].filter(d=>!!d),issueData:{code:h.invalid_return_type,returnTypeError:f}})}let i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ye){let o=this;return M(async function(...f){let d=new D([]),y=await o._def.args.parseAsync(f,i).catch(U=>{throw d.addIssue(n(f,U)),d}),_=await Reflect.apply(s,this,y);return await o._def.returns._def.type.parseAsync(_,i).catch(U=>{throw d.addIssue(a(_,U)),d})})}else{let o=this;return M(function(...f){let d=o._def.args.safeParse(f,i);if(!d.success)throw new D([n(f,d.error)]);let y=Reflect.apply(s,this,d.data),_=o._def.returns.safeParse(y,i);if(!_.success)throw new D([a(y,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r(T(p({},this._def),{args:Q.create(e).rest(ue.create())}))}returns(e){return new r(T(p({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r(p({args:e||Q.create([]).rest(ue.create()),returns:t||ue.create(),typeName:N.ZodFunction},R(n)))}},Ce=class extends A{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ce.create=(r,e)=>new Ce(p({getter:r,typeName:N.ZodLazy},R(e)));var Le=class extends A{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}};Le.create=(r,e)=>new Le(p({value:r,typeName:N.ZodLiteral},R(e)));function zn(r,e){return new Oe(p({values:r,typeName:N.ZodEnum},R(e)))}var Oe=class r extends A{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{expected:I.joinValues(n),received:t.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{received:t.data,code:h.invalid_enum_value,options:n}),k}return M(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,p(p({},this._def),t))}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),p(p({},this._def),t))}};Oe.create=zn;var Ue=class extends A{_parse(e){let t=I.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){let a=I.objectValues(t);return v(n,{expected:I.joinValues(a),received:n.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(I.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=I.objectValues(t);return v(n,{received:n.data,code:h.invalid_enum_value,options:a}),k}return M(e.data)}get enum(){return this._def.values}};Ue.create=(r,e)=>new Ue(p({values:r,typeName:N.ZodNativeEnum},R(e)));var ye=class extends A{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&t.common.async===!1)return v(t,{code:h.invalid_type,expected:w.promise,received:t.parsedType}),k;let n=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return M(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ye.create=(r,e)=>new ye(p({type:r,typeName:N.ZodPromise},R(e)));var Y=class extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{v(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let s=a.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return k;let f=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return f.status==="aborted"?k:f.status==="dirty"?_e(f.value):t.value==="dirty"?_e(f.value):f});{if(t.value==="aborted")return k;let o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?_e(o.value):t.value==="dirty"?_e(o.value):o}}if(a.type==="refinement"){let s=o=>{let f=a.refinement(o,i);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!de(s))return k;let o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>de(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:t.value,value:o})):k);I.assertNever(a)}};Y.create=(r,e,t)=>new Y(p({schema:r,typeName:N.ZodEffects,effect:e},R(t)));Y.createWithPreprocess=(r,e,t)=>new Y(p({schema:e,effect:{type:"preprocess",transform:r},typeName:N.ZodEffects},R(t)));var Z=class extends A{_parse(e){return this._getType(e)===w.undefined?M(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(r,e)=>new Z(p({innerType:r,typeName:N.ZodOptional},R(e)));var ee=class extends A{_parse(e){return this._getType(e)===w.null?M(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ee.create=(r,e)=>new ee(p({innerType:r,typeName:N.ZodNullable},R(e)));var Fe=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Fe.create=(r,e)=>new Fe(p({innerType:r,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},R(e)));var je=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=T(p({},t),{common:T(p({},t.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:p({},n)});return Ge(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};je.create=(r,e)=>new je(p({innerType:r,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},R(e)));var et=class extends A{_parse(e){if(this._getType(e)!==w.nan){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.nan,received:n.parsedType}),k}return{status:"valid",value:e.data}}};et.create=r=>new et(p({typeName:N.ZodNaN},R(r)));var bo=Symbol("zod_brand"),ft=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},pt=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?k:i.status==="dirty"?(t.dirty(),_e(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:N.ZodPipeline})}},Pe=class extends A{_parse(e){let t=this._def.innerType._parse(e),n=a=>(de(a)&&(a.value=Object.freeze(a.value)),a);return Ge(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}};Pe.create=(r,e)=>new Pe(p({innerType:r,typeName:N.ZodReadonly},R(e)));function $n(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Yn(r,e={},t){return r?he.create().superRefine((n,a)=>{var s,o;let i=r(n);if(i instanceof Promise)return i.then(f=>{var d,y;if(!f){let _=$n(e,n),E=(y=(d=_.fatal)!=null?d:t)!=null?y:!0;a.addIssue(T(p({code:"custom"},_),{fatal:E}))}});if(!i){let f=$n(e,n),d=(o=(s=f.fatal)!=null?s:t)!=null?o:!0;a.addIssue(T(p({code:"custom"},f),{fatal:d}))}}):he.create()}var _o={object:$.lazycreate},N;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(N||(N={}));var To=(r,e={message:`Input not instance of ${r.name}`})=>Yn(t=>t instanceof r,e),qn=me.create,Gn=Te.create,ko=et.create,No=ke.create,Jn=Ne.create,Ro=Re.create,Ao=He.create,Io=Ae.create,Eo=Ie.create,So=he.create,Co=ue.create,Lo=G.create,Oo=Ke.create,Uo=le.create,Fo=$.create,jo=$.strictCreate,Po=Ee.create,Mo=St.create,Bo=Se.create,Do=Q.create,$o=Ct.create,Vo=Xe.create,Wo=Qe.create,Zo=Lt.create,zo=Ce.create,Yo=Le.create,qo=Oe.create,Go=Ue.create,Jo=ye.create,Ho=Y.create,Ko=Z.create,Xo=ee.create,Qo=Y.createWithPreprocess,eu=pt.create,tu=()=>qn().optional(),ru=()=>Gn().optional(),nu=()=>Jn().optional(),au={string:(r=>me.create(T(p({},r),{coerce:!0}))),number:(r=>Te.create(T(p({},r),{coerce:!0}))),boolean:(r=>Ne.create(T(p({},r),{coerce:!0}))),bigint:(r=>ke.create(T(p({},r),{coerce:!0}))),date:(r=>Re.create(T(p({},r),{coerce:!0})))};var iu=k;l();c();var Hn=S.strictObject({title:S.string(),content:S.string()});var nr=S.object({"base-api-exception-class-name":S.string().optional(),"base-exception-class-name":S.string().optional(),"client-class-name":S.string().optional(),"inline-file-properties":S.boolean().optional(),"inline-path-parameters":S.boolean().optional(),"package-layout":S.enum(["flat","nested"]).optional(),"package-prefix":S.string().optional(),"custom-dependencies":S.array(S.string()).optional(),"disable-required-property-builder-checks":S.boolean().optional(),"enable-forward-compatible-enums":S.boolean().optional(),"enable-inline-types":S.boolean().optional(),"enable-public-constructors":S.boolean().optional(),"generate-unknown-as-json-node":S.boolean().optional(),"json-include":S.enum(["non-absent","non-empty"]).optional(),"enable-extensible-builders":S.boolean().optional(),"use-default-request-parameter-values":S.boolean().optional(),"enable-wire-tests":S.boolean().default(!1),"collapse-optional-nullable":S.boolean().optional(),"custom-readme-sections":S.array(Hn).optional(),"custom-pager-name":S.string().optional(),"wrapped-aliases":S.boolean().optional()});var m={};Wt(m,{Access:()=>ar,AstNode:()=>F,Class:()=>Me,ClassInstantiation:()=>Be,ClassReference:()=>L,CodeBlock:()=>De,Method:()=>$e,MethodInvocation:()=>Ve,Parameter:()=>We,Type:()=>dt,TypeLiteral:()=>V,Writer:()=>be,classReference:()=>Nu,class_:()=>ku,codeblock:()=>Tu,instantiateClass:()=>Ru,invokeMethod:()=>Au,method:()=>Iu,parameter:()=>Eu});l();c();l();c();l();c();var ar={Public:"public",Protected:"protected",Private:"private"};l();c();l();c();var F=class extends we{async toStringAsync({packageName:e,customConfig:t,formatter:n}){let a=new lt({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toStringAsync()}toString({packageName:e,customConfig:t,formatter:n}){let a=new lt({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toString()}};var Me=class extends F{constructor({name:t,access:n}){super();g(this,"name");g(this,"access");g(this,"methods",[]);this.name=t,this.access=n}write(t){if(t.write(`${this.access} class ${this.name}`),this.isEmpty()){t.writeLine(" {}");return}t.writeLine(" {"),t.indent();for(let n of this.methods)t.writeNode(n),t.newLine();t.dedent(),t.write("}")}addMethod(t){this.methods.push(t)}isEmpty(){return this.methods.length===0}};l();c();l();c();l();c();l();c();var L=class extends F{constructor({name:t,packageName:n,fullyQualified:a}){super();g(this,"name");g(this,"packageName");g(this,"fullyQualified");this.name=t,this.packageName=n,this.fullyQualified=a!=null?a:!1}write(t){if(t.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){t.write(`${this.packageName}.${this.name}`);return}t.write(this.name)}};l();c();var dt=class extends F{constructor(t){super();g(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"array":t.writeNode(this.internalType.value),t.write("[]");break;case"bigInteger":t.writeNode(su);break;case"boolean":t.write("Boolean");break;case"bytes":t.write("byte[]");break;case"date":t.write("String");break;case"dateTime":t.writeNode(lu);break;case"double":t.write("Double");break;case"float":t.write("Float");break;case"generic":t.writeNode(this.internalType.value),t.write("<");for(let[n,a]of this.internalType.parameters.entries())t.writeNode(a),n<this.internalType.parameters.length-1&&t.write(", ");t.write(">");break;case"inputStream":t.writeNode(pu);break;case"integer":t.write("Integer");break;case"iterable":this.writeIterable({writer:t,iterable:this.internalType});break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write("Long");break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"object":{t.write("Object");break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write("String");break;case"uuid":t.writeNode(fu);break;case"void":t.write("Void");break;default:C(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(t){return new this({type:"array",value:t})}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(t){return new this({type:"list",value:t})}static long(){return new this({type:"long"})}static map(t,n){return new this({type:"map",keyType:t,valueType:n})}static object(){return new this({type:"object"})}static optional(t){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t})}static reference(t){return new this({type:"reference",value:t})}static generic(t,n){return new this({type:"generic",value:t,parameters:n})}static set(t){return new this({type:"set",value:t})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(t){return new this({type:"iterable",value:t})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:t,list:n}){t.writeNode(ou),t.write("<"),n.value.write(t),t.write(">")}writeMap({writer:t,map:n}){t.writeNode(uu),t.write("<"),n.keyType.write(t),t.write(", "),n.valueType.write(t),t.write(">")}writeOptional({writer:t,optional:n}){t.writeNode(Ot),t.write("<"),n.value.write(t),t.write(">")}writeIterable({writer:t,iterable:n}){t.writeNode(Ot),t.write("<"),n.value.write(t),t.write(">")}writeSet({writer:t,set:n}){t.writeNode(cu),t.write("<"),n.value.write(t),t.write(">")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},Ut=new L({name:"Arrays",packageName:"java.util"}),su=new L({name:"BigInteger",packageName:"java.math"}),vm=new L({name:"HashMap",packageName:"java.util"}),ou=new L({name:"List",packageName:"java.util"}),uu=new L({name:"Map",packageName:"java.util"}),lu=new L({name:"OffsetDateTime",packageName:"java.time"}),Ot=new L({name:"Optional",packageName:"java.util"}),cu=new L({name:"Set",packageName:"java.util"}),fu=new L({name:"UUID",packageName:"java.util"}),pu=new L({name:"InputStream",packageName:"java.io"});var V=class r extends F{constructor(t){super();g(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:t,bigInteger:this.internalType});break;case"boolean":t.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:t,builder:this.internalType});break;case"bytes":t.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:t,class_:this.internalType});break}case"date":t.write(`"${this.internalType.value}"`);break;case"dateTime":this.writeDateTime({writer:t,dateTime:this.internalType});break;case"double":{let n=this.internalType.value.toString();!n.includes(".")&&!n.includes("e")&&!n.includes("E")?t.write(`${n}.0`):t.write(n);break}case"enum":this.writeEnum({writer:t,enum_:this.internalType});break;case"float":t.write(`${this.internalType.value}f`);break;case"integer":t.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"raw":{this.internalType.value instanceof F?t.writeNode(this.internalType.value):t.write(this.internalType.value);break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:t,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:t,uuid:this.internalType});break;case"nop":break;default:C(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(t){return new this({type:"bigInteger",value:t})}static boolean(t){return new this({type:"boolean",value:t})}static builder({classReference:t,parameters:n}){return new this({type:"builder",classReference:t,parameters:n})}static bytes(t){return new this({type:"bytes",value:t})}static class_({reference:t,parameters:n}){return new this({type:"class",reference:t,parameters:n})}static date(t){return new this({type:"date",value:t})}static dateTime(t){return new this({type:"dateTime",value:t})}static double(t){return new this({type:"double",value:t})}static enum_({classReference:t,value:n}){return new this({type:"enum",classReference:t,value:n})}static float(t){return new this({type:"float",value:t})}static integer(t){return new this({type:"integer",value:t})}static list({valueType:t,values:n,isParameter:a}){return new this({type:"list",valueType:t,values:n,isParameter:a})}static long(t){return new this({type:"long",value:t})}static map({keyType:t,valueType:n,entries:a}){return new this({type:"map",keyType:t,valueType:n,entries:a})}static optional({value:t,useOf:n}){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t,useOf:n})}static raw(t){return new this({type:"raw",value:t})}static reference(t){return new this({type:"reference",value:t})}static set({valueType:t,values:n}){return new this({type:"set",valueType:t,values:n})}static string(t){return new this({type:"string",value:t})}static unknown(t){return new this({type:"unknown",value:t})}static uuid(t){return new this({type:"uuid",value:t})}static nop(){return new this({type:"nop"})}static isNop(t){return t.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:C(this.internalType)}}writeBigInteger({writer:t,bigInteger:n}){t.write("new "),t.writeNode(m.instantiateClass({classReference:du,arguments_:[r.string(n.value)]}))}writeBuilder({writer:t,builder:n}){t.writeNode(n.classReference),t.writeNewLineIfLastLineNot(),t.indent(),this.writeBuilderParameters({writer:t,parameters:this.orderBuilderParameters(gu({parameters:n.parameters}))}),t.dedent()}writeBuilderParameters({writer:t,parameters:n}){t.writeLine(".builder()");for(let a of n)t.write(`.${a.name}(`),a.value.shouldWriteInLine()||t.newLine(),t.indent(),t.writeNode(a.value),t.dedent(),a.value.shouldWriteInLine()||t.newLine(),t.writeLine(")");t.writeNewLineIfLastLineNot(),t.write(".build()")}orderBuilderParameters(t){return t.some(a=>!a.value.isOptional()&&!this.isCollection(a.value))?t.sort((a,i)=>{let s=this.isNonRequired(a.value),o=this.isNonRequired(i.value);return s&&!o?1:!s&&o?-1:0}):t.sort((a,i)=>{let s=a.value.isOptional(),o=i.value.isOptional();return s&&!o?1:!s&&o?-1:0})}isCollection(t){let n=t.internalType.type;return n==="list"||n==="set"||n==="map"}isNonRequired(t){return t.isOptional()||this.isCollection(t)}writeClass({writer:t,class_:n}){let a=xu({parameters:n.parameters});t.writeNode(m.instantiateClass({classReference:n.reference,arguments_:a.map(i=>i.value)}))}writeDateTime({writer:t,dateTime:n}){t.writeNode(m.invokeMethod({on:hu,method:"parse",arguments_:[r.string(n.value)]}))}writeEnum({writer:t,enum_:n}){t.writeNode(n.classReference),t.write("."+n.value)}writeList({writer:t,list:n}){this.writeIterable({writer:t,iterable:n})}writeMap({writer:t,map:n}){let a=vu({entries:n.entries});if(a.length===0){t.write("new "),t.writeNode(Ft),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(Ft),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.writeLine(">() {{"),t.indent();for(let i of a)t.write("put("),t.writeNode(i.key),t.write(", "),t.writeNode(i.value),t.writeLine(");");t.dedent(),t.write("}}")}writeOptional({writer:t,optional:n}){if(!n.useOf){t.writeNode(n.value);return}t.writeNode(m.invokeMethod({on:Ot,method:"of",arguments_:[n.value]}))}writeSet({writer:t,set:n}){this.writeIterable({writer:t,iterable:n})}writeIterable({writer:t,iterable:n}){let a=n.type==="list"?ir:mu,i=wu({values:n.values});if(n.type==="list"&&n.isParameter&&i.length>0){t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:i}));return}if(i.length===0){t.write(`new ${a.name}<`),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(a),t.write("<"),t.writeNode(n.valueType),t.writeLine(">("),t.indent(),t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:i})),t.writeNewLineIfLastLineNot(),t.dedent(),t.write(")")}writeUnknown({writer:t,value:n}){switch(typeof n){case"boolean":t.write(n.toString());return;case"string":t.write(`"${this.escapeString(n)}"`);return;case"number":t.write(n.toString());return;case"object":if(n==null){t.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:t,value:n});return}this.writeUnknownMap({writer:t,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:t,value:n}){if(n.length===0){t.write("new "),t.writeNode(ir),t.write("<Object>()");return}t.write("new "),t.writeNode(ir),t.write("<Object>("),t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:n.map(a=>r.unknown(a))})),t.write(")")}writeUnknownMap({writer:t,value:n}){let a=Object.entries(n);if(a.length===0){t.write("new "),t.writeNode(Ft),t.write("<String, Object>()");return}t.writeLine("new "),t.writeNode(Ft),t.write("<String, Object>() {{"),t.indent();for(let[i,s]of a)t.write(`put("${i}", `),t.writeNode(r.unknown(s)),t.writeLine(");");t.dedent(),t.write("}}")}writeUUID({writer:t,uuid:n}){t.writeNode(m.invokeMethod({on:yu,method:"fromString",arguments_:[r.string(n.value)]}))}escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},ir=new L({name:"ArrayList",packageName:"java.util"}),du=new L({name:"BigInteger",packageName:"java.math"}),Ft=new L({name:"HashMap",packageName:"java.util"}),mu=new L({name:"HashSet",packageName:"java.util"}),Em=new L({name:"List",packageName:"java.util"}),Sm=new L({name:"Map",packageName:"java.util"}),hu=new L({name:"OffsetDateTime",packageName:"java.time"}),Cm=new L({name:"Set",packageName:"java.util"}),yu=new L({name:"UUID",packageName:"java.util"});function xu({parameters:r}){return r.filter(e=>!V.isNop(e.value))}function gu({parameters:r}){return r.filter(e=>!V.isNop(e.value))}function vu({entries:r}){return r.filter(e=>!V.isNop(e.key)&&!V.isNop(e.value))}function wu({values:r}){return r.filter(e=>!V.isNop(e))}function jt({writer:r,arguments_:e}){let t=_u(e);if(t.length===0){r.write("()");return}if(t.some(a=>a instanceof V&&!a.shouldWriteInLine())){bu({writer:r,arguments_:t});return}r.write("("),t.forEach((a,i)=>{i>0&&r.write(", "),Kn({writer:r,argument:a})}),r.write(")")}function bu({writer:r,arguments_:e}){r.writeLine("("),r.indent(),e.forEach((t,n)=>{n>0&&r.writeLine(","),Kn({writer:r,argument:t})}),r.dedent(),e.length>0&&r.newLine(),r.write(")")}function Kn({writer:r,argument:e}){Qt(e)?r.writeNodeOrString(e.assignment):e.write(r)}function _u(r){return r.filter(e=>!(e instanceof V&&V.isNop(e)))}var Be=class extends F{constructor({classReference:t,arguments_:n}){super();g(this,"classReference");g(this,"arguments_");this.classReference=t,this.arguments_=n}write(t){t.writeNode(this.classReference),jt({writer:t,arguments_:this.arguments_})}};l();c();var De=class extends F{constructor(t){super();g(this,"arg");this.arg=t}write(t){return new q(this.arg).write(t)}};l();c();var $e=class extends F{constructor({name:t,access:n,parameters:a,body:i,static_:s,return_:o}){super();g(this,"name");g(this,"access");g(this,"parameters");g(this,"body");g(this,"return_");g(this,"static_");this.name=t,this.access=n,this.parameters=a,this.body=i,this.return_=o,this.static_=s!=null?s:!1}write(t){if(t.write(`${this.access} `),this.static_&&t.write("static "),this.return_!=null?t.writeNode(this.return_):t.write("void"),t.write(` ${this.name}`),this.parameters.length===0)t.write("()");else if(this.parameters.length===1){if(t.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);t.writeNode(this.parameters[0]),t.write(")")}else t.writeLine("("),t.indent(),this.parameters.forEach((n,a)=>{a>0&&t.writeLine(", "),t.writeNode(n)}),t.dedent(),t.write(")");if(this.body==null){t.write(";");return}t.writeLine(" {"),t.indent(),t.writeNode(this.body),t.writeNewLineIfLastLineNot(),t.dedent(),t.write("}")}};l();c();var Ve=class extends F{constructor({method:t,arguments_:n,on:a}){super();g(this,"on");g(this,"method");g(this,"arguments_");this.on=a,this.method=t,this.arguments_=n}write(t){this.on.write(t),t.write("."),t.write(this.method),jt({writer:t,arguments_:this.arguments_})}};l();c();var We=class extends F{constructor({name:t,type:n}){super();g(this,"name");g(this,"type");this.name=t,this.type=n}write(t){t.writeNode(this.type),t.write(` ${this.name}`)}};function Tu(r){return new De(r)}function ku(r){return new Me(r)}function Nu(r){return new L(r)}function Ru(r){return new Be(r)}function Au(r){return new Ve(r)}function Iu(r){return new $e(r)}function Eu(r){return new We(r)}l();c();var Pt=class{constructor({context:e}){g(this,"context");this.context=e}isNopTypeLiteral(e){var n;return((n=e.internalType)==null?void 0:n.type)==="nop"}wrapInOptionalIfNotNop(e,t=!1){return this.isNopTypeLiteral(e)?e:m.TypeLiteral.optional({value:e,useOf:t})}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:O.Critical,message:"Expected non-null value, but got null"}),m.TypeLiteral.nop());if(e.value===void 0)return m.TypeLiteral.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value,as:e.as});case"literal":return this.convertLiteral({literal:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value,as:e.as});case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?m.TypeLiteral.nop():this.convertNamed({named:t,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion})}case"nullable":case"optional":{if(e.value===void 0||typeof e.value=="object"&&e.value!==null&&Object.keys(e.value).length===0&&e.typeReference.value.type==="named")return m.TypeLiteral.reference(m.invokeMethod({on:m.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(e.typeReference.value.type==="list"){let a=this.convertList({list:e.typeReference.value.value,value:e.value});return this.wrapInOptionalIfNotNop(a,!0)}let t=this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion}),n=e.as==="mapValue"||e.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(t,n)}case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value,as:e.as});case"unknown":return this.convertUnknown({value:e.value});default:C(e.typeReference)}}convertList({list:e,value:t,as:n}){if(!Array.isArray(t))return this.context.errors.add({severity:O.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop();let a=e.type==="optional"||e.type==="nullable";return m.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((i,s)=>{this.context.errors.scope({index:s});try{if(a){let o=this.convert({typeReference:e.value,value:i,as:n});return this.wrapInOptionalIfNotNop(o,!0)}return this.convert({typeReference:e,value:i,as:n})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:e,value:t}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.string(n)}default:C(e)}}convertSet({set:e,value:t,as:n}){return Array.isArray(t)?m.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((a,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:e,value:a,as:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:O.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop())}convertMap({map:e,value:t,as:n}){return typeof t!="object"||t==null?(this.context.errors.add({severity:O.Critical,message:`Expected object but got: ${t==null?"null":typeof t}`}),m.TypeLiteral.nop()):m.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(t).map(([a,i])=>{this.context.errors.scope(a);try{return{key:this.convert({typeReference:e.key,value:a,as:"mapKey"}),value:this.convert({typeReference:e.value,value:i,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:t,as:n,inUndiscriminatedUnion:a}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:t,as:n,inUndiscriminatedUnion:a});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:t});case"enum":return this.convertEnum({enum_:e,value:t});case"object":return this.convertObject({object_:e,value:t,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t});default:C(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:t}){let n=this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t});if(a==null)return m.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let s=this.context.resolveNamedType({typeId:i.typeId});return s==null?m.TypeLiteral.nop():m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:s,value:a.value})]}))}case"singleProperty":{let s=this.context.getRecord(a.value);if(s==null)return m.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:s[i.discriminantValue.wireValue]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:C(i)}}convertObject({object_:e,value:t,as:n}){var s;let a=this.context.associateByWireValue({parameters:e.properties,values:(s=this.context.getRecord(t))!=null?s:{}}),i=n==="request"?a.filter(o=>!this.context.isDirectLiteral(o.typeReference)):a;return m.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),parameters:i.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getMethodName(o.name.name),value:this.convert({typeReference:o.typeReference,value:o.value,as:n})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:t}){let n=this.getEnumValueName({enum_:e,value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),value:n})}getEnumValueName({enum_:e,value:t}){if(typeof t!="string"){this.context.errors.add({severity:O.Critical,message:`Expected enum value string, got: ${typeof t}`});return}let n=e.values.find(a=>a.wireValue===t);if(n==null){this.context.errors.add({severity:O.Critical,message:`An enum value named "${t}" does not exist in this context`});return}return this.context.getEnumName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t});return n==null?m.TypeLiteral.nop():this.context.isPrimitive(n.valueTypeReference)?m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]})):m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t}){var o;let n=[],a=[];for(let f of e.types)try{n.push(JSON.stringify(f));let d=this.convert({typeReference:f,value:t,inUndiscriminatedUnion:!0});return{valueTypeReference:f,typeInstantiation:d}}catch(d){a.push(`Type ${JSON.stringify(f)}: ${d instanceof Error?d.message:String(d)}`);continue}this.context.errors.add({severity:O.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof t}" value. Tried ${n.length} variants. Errors: ${a.join("; ")}`});let i=(o=e.declaration.name)!=null?o:"UnknownUnion",s=a.map((f,d)=>` ${d+1}. ${f}`).join(`
23
+ `);throw new Error(`Failed to match undiscriminated union "${i}" for ${typeof t} value.
24
+ Value: ${JSON.stringify(t)}
25
+ Attempted ${n.length} variants:
26
+ ${s}
27
+
28
+ This prevents invalid snippet code generation that would cause formatter errors.`)}getUndiscriminatedUnionFieldName({typeReference:e}){switch(e.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:e});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:e.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:e});case"named":{let t=this.context.resolveNamedType({typeId:e.value});return t==null?void 0:this.context.getClassName(t.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"nullable":return this.getUndiscriminatedUnionFieldNameForNullable({typeReference:e});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:e.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:e});case"unknown":return"Unknown";default:C(e)}}getUndiscriminatedUnionFieldNameForList({list:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`ListOf${t}`}getUndiscriminatedUnionFieldNameForMap({map:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e.key});if(t==null)return;let n=this.getUndiscriminatedUnionFieldName({typeReference:e.value});if(n!=null)return`MapOf${t}To${n}`}getUndiscriminatedUnionFieldNameForOptional({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Optional${t}`}getUndiscriminatedUnionFieldNameForNullable({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Nullable${t}`}getUndiscriminatedUnionFieldNameForSet({set:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`SetOf${t}`}getUndiscriminatedUnionFieldNameForLiteral({literal:e}){}getUndiscriminatedUnionFieldNameForPrimitive({primitive:e}){switch(e){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:C(e)}}convertUnknown({value:e}){return m.TypeLiteral.unknown(e)}convertPrimitive({primitive:e,value:t,as:n}){switch(e){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.integer(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.long(a)}case"FLOAT":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.float(a)}case"DOUBLE":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.double(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(a)}case"STRING":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.string(a)}case"DATE":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.dateTime(a)}case"UUID":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.uuid(a)}case"BASE_64":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.bytes(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.bigInteger(a)}default:C(e)}}getValueAsNumber({value:e,as:t}){let n=t==="mapKey"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:e,as:t}){let n=t==="mapKey"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:n})}};l();c();var Mt=class{constructor({context:e}){g(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return m.Type.list(this.convert({typeReference:e.typeReference}));case"literal":return this.convertLiteral({literal:e.typeReference.value});case"map":return m.Type.map(this.convert({typeReference:e.typeReference.key}),this.convert({typeReference:e.typeReference.value}));case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?this.convertUnknown():this.convertNamed({named:t})}case"optional":case"nullable":return m.Type.optional(this.convert({typeReference:e.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value});case"set":return m.Type.set(this.convert({typeReference:e.typeReference}));case"unknown":return this.convertUnknown();default:C(e.typeReference)}}convertNamed({named:e}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return m.Type.reference(m.classReference({name:this.context.getClassName(e.declaration.name),packageName:this.context.getTypesPackageName(e.declaration.fernFilepath)}));default:C(e)}}convertLiteral({literal:e}){switch(e.type){case"boolean":return m.Type.boolean();case"string":return m.Type.string()}}convertUnknown(){return m.Type.object()}convertPrimitive({primitive:e}){switch(e){case"INTEGER":return m.Type.integer();case"UINT":return m.Type.integer();case"LONG":return m.Type.long();case"UINT_64":return m.Type.long();case"FLOAT":return m.Type.float();case"DOUBLE":return m.Type.double();case"BOOLEAN":return m.Type.boolean();case"STRING":return m.Type.string();case"DATE":return m.Type.date();case"DATE_TIME":return m.Type.dateTime();case"UUID":return m.Type.uuid();case"BASE_64":return m.Type.bytes();case"BIG_INTEGER":return m.Type.bigInteger();default:C(e)}}};l();c();var Bt=class{constructor({context:e}){g(this,"context");this.context=e}getFilePropertyInfo({body:e,value:t}){var i;let n={fileFields:[],bodyPropertyFields:[]},a=(i=this.context.getRecord(t))!=null?i:{};for(let s of e.properties)switch(s.type){case"file":n.fileFields.push({name:this.context.getMethodName(s.name),value:this.getSingleFileProperty({property:s,record:a})});break;case"fileArray":n.fileFields.push({name:this.context.getMethodName(s.name),value:this.getArrayFileProperty({property:s,record:a})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getMethodName(s.name.name),value:this.getBodyProperty({property:s,record:a})});break;default:C(s)}return n}getSingleFileProperty({property:e,record:t}){let n=this.context.getSingleFileValue({property:e,record:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.reference(this.context.getFileStreamFromString(n))}getArrayFileProperty({property:e,record:t}){let n=this.context.getFileArrayValues({property:e,record:t});if(n==null)return m.TypeLiteral.nop();for(let a of n)return m.TypeLiteral.reference(this.context.getFileStreamFromString(a));return m.TypeLiteral.nop()}getBodyProperty({property:e,record:t}){let n=t[e.name.wireValue];return n==null?m.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:n})}};var Su=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),sr=class r extends ut{constructor({ir:t,config:n,options:a}){var i;super({ir:t,config:n,options:a});g(this,"ir");g(this,"customConfig");g(this,"dynamicTypeMapper");g(this,"dynamicTypeLiteralMapper");g(this,"filePropertyMapper");this.ir=t,this.customConfig=nr.parse((i=n.customConfig)!=null?i:{}),this.dynamicTypeMapper=new Mt({context:this}),this.dynamicTypeLiteralMapper=new Pt({context:this}),this.filePropertyMapper=new Bt({context:this})}clone(){return new r({ir:this.ir,config:this.config,options:this.options})}getClassName(t){return this.getName(t.pascalCase.safeName)}getEnumName(t){return this.getName(t.screamingSnakeCase.safeName)}getPropertyName(t){return this.getName(t.camelCase.safeName)}getMethodName(t){return this.getName(t.camelCase.safeName)}getRootClientClassReference(){return m.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["client-class-name"])!=null?n:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(t){let n=this.resolveEnvironmentName(t);if(n!=null)return m.codeblock(a=>{a.writeNode(this.getEnvironmentClassReference()),a.write("."),a.write(this.getEnumName(n))})}getEnvironmentClassReference(){return m.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:t}){return m.classReference({name:t.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(t.fernFilepath)})}getNullableClassReference(){return m.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return m.TypeLiteral.reference(m.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getFileStreamFromString(t){return m.TypeLiteral.reference(m.codeblock(n=>{n.write("new "),n.writeNode(this.getFileStreamClassReference()),n.write("("),n.writeNode(this.getByteArrayInputStreamClassReference()),n.write("("),n.writeNode(m.TypeLiteral.string(t)),n.write(".getBytes("),n.writeNode(this.getStandardCharsetsClassReference()),n.write(".UTF_8)))")}))}getFileStreamClassReference(){return m.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return m.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return m.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(t){switch(t.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(t.value);case"named":{let n=this.resolveNamedType({typeId:t.value});if(n==null)return!1;switch(n.type){case"alias":return this.isPrimitive(n.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:C(n)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:C(t)}}isDirectLiteral(t){return t.type==="literal"}sortTypeInstancesByRequiredFirst(t,n){let a=new Map;n.forEach((o,f)=>{a.set(o.name.wireValue,f)});let i=[],s=[];for(let o of t)this.isOptional(o.typeReference)?s.push(o):i.push(o);return i.sort((o,f)=>{var d,y;return((d=a.get(o.name.wireValue))!=null?d:0)-((y=a.get(f.name.wireValue))!=null?y:0)}),[...i,...s]}getRootPackageName(){let t=this.getPackagePrefixTokens();return this.joinPackageTokens(t)}getCorePackageName(){let t=this.getPackagePrefixTokens();return t.push("core"),this.joinPackageTokens(t)}getTypesPackageName(t){return this.getResourcesPackage(t,"types")}getRequestsPackageName(t){return this.getPackageLayout()==="flat"?this.getTypesPackageName(t):this.getResourcesPackage(t,"requests")}getResourcesPackage(t,n){let a=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":t!=null&&a.push(...t.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:t!=null&&t.allParts.length>0&&a.push("resources"),t!=null&&a.push(...t.allParts.map(i=>this.getPackageNameSegment(i)))}return n!=null&&a.push(n),this.joinPackageTokens(a)}getPackageName(t,n){let a=this.getPackageNameSegments(t);return a=n!=null?[...a,n]:a,[...this.getPackagePrefixTokens(),...a].join(".")}getPackageLayout(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["package-layout"])!=null?n:"nested"}shouldInlinePathParameters(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["inline-path-parameters"])!=null?n:!1}shouldInlineFileProperties(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["inline-file-properties"])!=null?n:!1}getPackageNameSegments(t){return t.packagePath.map(n=>this.getPackageNameSegment(n))}getPackageNameSegment(t){return t.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var n;if(((n=this.customConfig)==null?void 0:n["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let t=[];return t.push("com"),t.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),t.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),t}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return Ht(this.config.workspaceName)}startsWithNumber(t){return/^\d/.test(t)}splitOnNonAlphaNumericChar(t){return t.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(t){return t.replace(/-([a-z])/g,(n,a)=>a.toUpperCase()).replace(/^[a-z]/,n=>n.toUpperCase())}joinPackageTokens(t){return t.map(a=>this.startsWithNumber(a)?"_"+a:a).join(".")}getName(t){return this.isReservedName(t)?"_"+t:t}isReservedName(t){return Su.has(t)}};0&&(module.exports={DynamicSnippetsGeneratorContext});
16
29
  /*! Bundled license information:
17
30
 
18
31
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -34,3 +47,4 @@ lodash-es/lodash.js:
34
47
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
35
48
  *)
36
49
  */
50
+ //# sourceMappingURL=DynamicSnippetsGeneratorContext.cjs.map