@fern-api/php-dynamic-snippets 0.0.5 → 0.0.7

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 (58) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +23 -15
  2. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -0
  3. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  4. package/cjs/{DynamicSnippetsGeneratorContext-7JXlOyjB.d.cts → DynamicSnippetsGeneratorContext-CwkDTYOI.d.cts} +3 -3
  5. package/cjs/EndpointSnippetGenerator.cjs +34 -15
  6. package/cjs/EndpointSnippetGenerator.cjs.map +1 -0
  7. package/cjs/EndpointSnippetGenerator.d.cts +7 -1
  8. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +22 -14
  9. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -0
  10. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  11. package/cjs/context/DynamicTypeLiteralMapper.cjs +33 -14
  12. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -0
  13. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  14. package/cjs/context/FilePropertyMapper.cjs +33 -14
  15. package/cjs/context/FilePropertyMapper.cjs.map +1 -0
  16. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  17. package/cjs/index.cjs +23 -27
  18. package/cjs/index.cjs.map +1 -0
  19. package/cjs/index.d.cts +2 -2
  20. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  21. package/esm/DynamicSnippetsGenerator.js +2 -1
  22. package/esm/DynamicSnippetsGenerator.js.map +1 -0
  23. package/esm/{DynamicSnippetsGeneratorContext-7JXlOyjB.d.ts → DynamicSnippetsGeneratorContext-CwkDTYOI.d.ts} +3 -3
  24. package/esm/EndpointSnippetGenerator.d.ts +7 -1
  25. package/esm/EndpointSnippetGenerator.js +2 -1
  26. package/esm/EndpointSnippetGenerator.js.map +1 -0
  27. package/esm/chunk-3LG5WCZI.js +2 -0
  28. package/esm/chunk-3LG5WCZI.js.map +1 -0
  29. package/esm/{chunk-2MVLIJOX.js → chunk-3QAUV5WT.js} +2 -1
  30. package/esm/chunk-3QAUV5WT.js.map +1 -0
  31. package/esm/chunk-CPIHNCS3.js +4 -0
  32. package/esm/chunk-CPIHNCS3.js.map +1 -0
  33. package/esm/chunk-DFQIKN25.js +2 -0
  34. package/esm/chunk-DFQIKN25.js.map +1 -0
  35. package/esm/{chunk-NXBUWG6C.js → chunk-EECVWAVT.js} +2 -1
  36. package/esm/chunk-EECVWAVT.js.map +1 -0
  37. package/esm/chunk-PYHFKEW4.js +47 -0
  38. package/esm/chunk-PYHFKEW4.js.map +1 -0
  39. package/esm/chunk-XX3MRTVI.js +2 -0
  40. package/esm/chunk-XX3MRTVI.js.map +1 -0
  41. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  42. package/esm/context/DynamicSnippetsGeneratorContext.js +2 -1
  43. package/esm/context/DynamicSnippetsGeneratorContext.js.map +1 -0
  44. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  45. package/esm/context/DynamicTypeLiteralMapper.js +2 -1
  46. package/esm/context/DynamicTypeLiteralMapper.js.map +1 -0
  47. package/esm/context/FilePropertyMapper.d.ts +1 -1
  48. package/esm/context/FilePropertyMapper.js +2 -1
  49. package/esm/context/FilePropertyMapper.js.map +1 -0
  50. package/esm/index.d.ts +2 -2
  51. package/esm/index.js +2 -13
  52. package/esm/index.js.map +1 -0
  53. package/package.json +1 -1
  54. package/esm/chunk-6U4ZJ2VA.js +0 -14
  55. package/esm/chunk-AEXR2D5H.js +0 -1
  56. package/esm/chunk-ESPGWZRY.js +0 -3
  57. package/esm/chunk-H4KXMOP7.js +0 -1
  58. package/esm/chunk-JCUQ3FQP.js +0 -28
package/cjs/index.cjs CHANGED
@@ -1,35 +1,30 @@
1
- "use strict";var Cf=Object.create;var cr=Object.defineProperty,Ff=Object.defineProperties,Of=Object.getOwnPropertyDescriptor,Lf=Object.getOwnPropertyDescriptors,Bf=Object.getOwnPropertyNames,Gr=Object.getOwnPropertySymbols,Uf=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var Vt=(t,r,e)=>r in t?cr(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,je=(t,r)=>{for(var e in r||(r={}))zt.call(r,e)&&Vt(t,e,r[e]);if(Gr)for(var e of Gr(r))Eo.call(r,e)&&Vt(t,e,r[e]);return t},Ge=(t,r)=>Ff(t,Lf(r));var Ro=t=>typeof t=="symbol"?t:t+"",Po=(t,r)=>{var e={};for(var n in t)zt.call(t,n)&&r.indexOf(n)<0&&(e[n]=t[n]);if(t!=null&&Gr)for(var n of Gr(t))r.indexOf(n)<0&&Eo.call(t,n)&&(e[n]=t[n]);return e};var Ve=(t,r)=>()=>(t&&(r=t(t=0)),r);var h=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Yt=(t,r)=>{for(var e in r)cr(t,e,{get:r[e],enumerable:!0})},Io=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Bf(r))!zt.call(t,o)&&o!==e&&cr(t,o,{get:()=>r[o],enumerable:!(n=Of(r,o))||n.enumerable});return t};var qf=(t,r,e)=>(e=t!=null?Cf(Uf(t)):{},Io(r||!t||!t.__esModule?cr(e,"default",{value:t,enumerable:!0}):e,t)),No=t=>Io(cr({},"__esModule",{value:!0}),t);var d=(t,r,e)=>Vt(t,typeof r!="symbol"?r+"":r,e);function Fo(){throw new Error("setTimeout has not been defined")}function Oo(){throw new Error("clearTimeout has not been defined")}function Lo(t){if(ce===setTimeout)return setTimeout(t,0);if((ce===Fo||!ce)&&setTimeout)return ce=setTimeout,setTimeout(t,0);try{return ce(t,0)}catch(r){try{return ce.call(null,t,0)}catch(e){return ce.call(this,t,0)}}}function $f(t){if(de===clearTimeout)return clearTimeout(t);if((de===Oo||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(t);try{return de(t)}catch(r){try{return de.call(null,t)}catch(e){return de.call(this,t)}}}function kf(){!Ye||!Se||(Ye=!1,Se.length?ee=Se.concat(ee):Vr=-1,ee.length&&Bo())}function Bo(){if(!Ye){var t=Lo(kf);Ye=!0;for(var r=ee.length;r;){for(Se=ee,ee=[];++Vr<r;)Se&&Se[Vr].run();Vr=-1,r=ee.length}Se=null,Ye=!1,$f(t)}}function _f(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];ee.push(new Uo(t,r)),ee.length===1&&!Ye&&Lo(Bo)}function Uo(t,r){this.fun=t,this.array=r}function Te(){}function tl(t){throw new Error("process.binding is not supported")}function nl(){return"/"}function ol(t){throw new Error("process.chdir is not supported")}function il(){return 0}function sl(t){var r=al.call(ze)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}function pl(){var t=new Date,r=t-ul;return r/1e3}var ce,de,ee,Ye,Se,Vr,Mf,Df,Wf,jf,Gf,Vf,zf,Yf,Hf,Jf,Kf,Zf,Qf,Xf,el,rl,ze,al,ul,l,Co,a=Ve(()=>{"use strict";ce=Fo,de=Oo;typeof globalThis.setTimeout=="function"&&(ce=setTimeout);typeof globalThis.clearTimeout=="function"&&(de=clearTimeout);ee=[],Ye=!1,Vr=-1;Uo.prototype.run=function(){this.fun.apply(null,this.array)};Mf="browser",Df="browser",Wf=!0,jf={},Gf=[],Vf="",zf={},Yf={},Hf={};Jf=Te,Kf=Te,Zf=Te,Qf=Te,Xf=Te,el=Te,rl=Te;ze=globalThis.performance||{},al=ze.now||ze.mozNow||ze.msNow||ze.oNow||ze.webkitNow||function(){return new Date().getTime()};ul=new Date;l={nextTick:_f,title:Mf,browser:Wf,env:jf,argv:Gf,version:Vf,versions:zf,on:Jf,addListener:Kf,once:Zf,off:Qf,removeListener:Xf,removeAllListeners:el,emit:rl,binding:tl,cwd:nl,chdir:ol,umask:il,hrtime:sl,platform:Df,release:Yf,config:Hf,uptime:pl},Co={};Object.keys(Co).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=Co[t]:e=e[o]||(e[o]={})}})});function _o(){Jt=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)j[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function ll(t){Jt||_o();var r,e,n,o,i,u,f=t.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[f-2]==="="?2:t[f-1]==="="?1:0,u=new fl(f*3/4-i),n=i>0?f-4:f;var c=0;for(r=0,e=0;r<n;r+=4,e+=3)o=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],u[c++]=o>>16&255,u[c++]=o>>8&255,u[c++]=o&255;return i===2?(o=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,u[c++]=o&255):i===1&&(o=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,u[c++]=o>>8&255,u[c++]=o&255),u}function cl(t){return j[t>>18&63]+j[t>>12&63]+j[t>>6&63]+j[t&63]}function dl(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(cl(n));return o.join("")}function qo(t){Jt||_o();for(var r,e=t.length,n=e%3,o="",i=[],u=16383,f=0,c=e-n;f<c;f+=u)i.push(dl(t,f,f+u>c?c:f+u));return n===1?(r=t[e-1],o+=j[r>>2],o+=j[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=j[r>>10],o+=j[r>>4&63],o+=j[r<<2&63],o+="="),i.push(o),i.join("")}function zr(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function re(t,r){if(zr()<r)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=p.prototype):(t===null&&(t=new p(r)),t.length=r),t}function p(t,r,e){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Kt(this,t)}return Mo(this,t,r,e)}function Mo(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?hl(t,r,e,n):typeof r=="string"?ml(t,r,e):gl(t,r)}function Do(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function yl(t,r,e,n){return Do(r),r<=0?re(t,r):e!==void 0?typeof n=="string"?re(t,r).fill(e,n):re(t,r).fill(e):re(t,r)}function Kt(t,r){if(Do(r),t=re(t,r<0?0:Zt(r)|0),!p.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function ml(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Wo(r,e)|0;t=re(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function Ht(t,r){var e=r.length<0?0:Zt(r.length)|0;t=re(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function hl(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),p.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=p.prototype):t=Ht(t,r),t}function gl(t,r){if(G(r)){var e=Zt(r.length)|0;return t=re(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ql(r.length)?re(t,0):Ht(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return Ht(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Zt(t){if(t>=zr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+zr().toString(16)+" bytes");return t|0}function G(t){return!!(t!=null&&t._isBuffer)}function Wo(t,r){if(G(t))return t.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Yr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Jo(t).length;default:if(n)return Yr(t).length;r=(""+r).toLowerCase(),n=!0}}function xl(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Il(this,r,e);case"utf8":case"utf-8":return Vo(this,r,e);case"ascii":return Rl(this,r,e);case"latin1":case"binary":return Pl(this,r,e);case"base64":return Tl(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nl(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function Ee(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function jo(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=p.from(r,n)),G(r))return r.length===0?-1:$o(t,r,e,n,o);if(typeof r=="number")return r=r&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):$o(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function $o(t,r,e,n,o){var i=1,u=t.length,f=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,u/=2,f/=2,e/=2}function c(b,E){return i===1?b[E]:b.readUInt16BE(E*i)}var y;if(o){var m=-1;for(y=e;y<u;y++)if(c(t,y)===c(r,m===-1?0:y-m)){if(m===-1&&(m=y),y-m+1===f)return m*i}else m!==-1&&(y-=y-m),m=-1}else for(e+f>u&&(e=u-f),y=e;y>=0;y--){for(var g=!0,v=0;v<f;v++)if(c(t,y+v)!==c(r,v)){g=!1;break}if(g)return y}return-1}function vl(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(u*2,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function wl(t,r,e,n){return Kr(Yr(r,t.length-e),t,e,n)}function Go(t,r,e,n){return Kr(Bl(r),t,e,n)}function bl(t,r,e,n){return Go(t,r,e,n)}function Al(t,r,e,n){return Kr(Jo(r),t,e,n)}function Sl(t,r,e,n){return Kr(Ul(r,t.length-e),t,e,n)}function Tl(t,r,e){return r===0&&e===t.length?qo(t):qo(t.slice(r,e))}function Vo(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],u=null,f=i>239?4:i>223?3:i>191?2:1;if(o+f<=e){var c,y,m,g;switch(f){case 1:i<128&&(u=i);break;case 2:c=t[o+1],(c&192)===128&&(g=(i&31)<<6|c&63,g>127&&(u=g));break;case 3:c=t[o+1],y=t[o+2],(c&192)===128&&(y&192)===128&&(g=(i&15)<<12|(c&63)<<6|y&63,g>2047&&(g<55296||g>57343)&&(u=g));break;case 4:c=t[o+1],y=t[o+2],m=t[o+3],(c&192)===128&&(y&192)===128&&(m&192)===128&&(g=(i&15)<<18|(c&63)<<12|(y&63)<<6|m&63,g>65535&&g<1114112&&(u=g))}}u===null?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),o+=f}return El(n)}function El(t){var r=t.length;if(r<=ko)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=ko));return e}function Rl(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Pl(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Il(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Ll(t[i]);return o}function Nl(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}function N(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function q(t,r,e,n,o,i){if(!G(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function Hr(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}function Jr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}function zo(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Yo(t,r,e,n,o){return o||zo(t,r,e,4,34028234663852886e22,-34028234663852886e22),Zo(t,r,e,n,23,4),e+4}function Ho(t,r,e,n,o){return o||zo(t,r,e,8,17976931348623157e292,-17976931348623157e292),Zo(t,r,e,n,52,8),e+8}function Fl(t){if(t=Ol(t).replace(Cl,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ol(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ll(t){return t<16?"0"+t.toString(16):t.toString(16)}function Yr(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],u=0;u<n;++u){if(e=t.charCodeAt(u),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(u+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=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 Bl(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ul(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Jo(t){return ll(Fl(t))}function Kr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ql(t){return t!==t}function $l(t){return t!=null&&(!!t._isBuffer||Ko(t)||kl(t))}function Ko(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function kl(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Ko(t.slice(0,0))}function Zr(t,r,e,n,o){var i,u,f=o*8-n-1,c=(1<<f)-1,y=c>>1,m=-7,g=e?o-1:0,v=e?-1:1,b=t[r+g];for(g+=v,i=b&(1<<-m)-1,b>>=-m,m+=f;m>0;i=i*256+t[r+g],g+=v,m-=8);for(u=i&(1<<-m)-1,i>>=-m,m+=n;m>0;u=u*256+t[r+g],g+=v,m-=8);if(i===0)i=1-y;else{if(i===c)return u?NaN:(b?-1:1)*(1/0);u=u+Math.pow(2,n),i=i-y}return(b?-1:1)*u*Math.pow(2,i-n)}function Zo(t,r,e,n,o,i){var u,f,c,y=i*8-o-1,m=(1<<y)-1,g=m>>1,v=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:i-1,E=n?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=m):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+g>=1?r+=v/c:r+=v*Math.pow(2,1-g),r*c>=2&&(u++,c/=2),u+g>=m?(f=0,u=m):u+g>=1?(f=(r*c-1)*Math.pow(2,o),u=u+g):(f=r*Math.pow(2,g-1)*Math.pow(2,o),u=0));o>=8;t[e+b]=f&255,b+=E,f/=256,o-=8);for(u=u<<o|f,y+=o;y>0;t[e+b]=u&255,b+=E,u/=256,y-=8);t[e+b-E]|=P*128}var j,_,fl,Jt,ko,Cl,Qo=Ve(()=>{"use strict";a();s();j=[],_=[],fl=typeof Uint8Array!="undefined"?Uint8Array:Array,Jt=!1;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};p.from=function(t,r,e){return Mo(null,t,r,e)};p.kMaxLength=zr();p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&p[Symbol.species]);p.alloc=function(t,r,e){return yl(null,t,r,e)};p.allocUnsafe=function(t){return Kt(null,t)};p.allocUnsafeSlow=function(t){return Kt(null,t)};p.isBuffer=$l;p.compare=function(r,e){if(!G(r)||!G(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,u=Math.min(n,o);i<u;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};p.isEncoding=function(r){switch(String(r).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}};p.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return p.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=p.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var u=r[n];if(!G(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(o,i),i+=u.length}return o};p.byteLength=Wo;p.prototype._isBuffer=!0;p.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)Ee(this,e,e+1);return this};p.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)Ee(this,e,e+3),Ee(this,e+1,e+2);return this};p.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)Ee(this,e,e+7),Ee(this,e+1,e+6),Ee(this,e+2,e+5),Ee(this,e+3,e+4);return this};p.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Vo(this,0,r):xl.apply(this,arguments)};p.prototype.equals=function(r){if(!G(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:p.compare(this,r)===0};p.prototype.compare=function(r,e,n,o,i){if(!G(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var u=i-o,f=n-e,c=Math.min(u,f),y=this.slice(o,i),m=r.slice(e,n),g=0;g<c;++g)if(y[g]!==m[g]){u=y[g],f=m[g];break}return u<f?-1:f<u?1:0};p.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};p.prototype.indexOf=function(r,e,n){return jo(this,r,e,n,!0)};p.prototype.lastIndexOf=function(r,e,n){return jo(this,r,e,n,!1)};p.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var u=!1;;)switch(o){case"hex":return vl(this,r,e,n);case"utf8":case"utf-8":return wl(this,r,e,n);case"ascii":return Go(this,r,e,n);case"latin1":case"binary":return bl(this,r,e,n);case"base64":return Al(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sl(this,r,e,n);default:if(u)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),u=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};ko=4096;p.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(p.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=p.prototype;else{var i=e-r;o=new p(i,void 0);for(var u=0;u<i;++u)o[u]=this[u+r]}return o};p.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||N(r,e,this.length);for(var o=this[r],i=1,u=0;++u<e&&(i*=256);)o+=this[r+u]*i;return o};p.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||N(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};p.prototype.readUInt8=function(r,e){return e||N(r,1,this.length),this[r]};p.prototype.readUInt16LE=function(r,e){return e||N(r,2,this.length),this[r]|this[r+1]<<8};p.prototype.readUInt16BE=function(r,e){return e||N(r,2,this.length),this[r]<<8|this[r+1]};p.prototype.readUInt32LE=function(r,e){return e||N(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};p.prototype.readUInt32BE=function(r,e){return e||N(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};p.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||N(r,e,this.length);for(var o=this[r],i=1,u=0;++u<e&&(i*=256);)o+=this[r+u]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};p.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||N(r,e,this.length);for(var o=e,i=1,u=this[r+--o];o>0&&(i*=256);)u+=this[r+--o]*i;return i*=128,u>=i&&(u-=Math.pow(2,8*e)),u};p.prototype.readInt8=function(r,e){return e||N(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};p.prototype.readInt16LE=function(r,e){e||N(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(r,e){e||N(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(r,e){return e||N(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};p.prototype.readInt32BE=function(r,e){return e||N(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};p.prototype.readFloatLE=function(r,e){return e||N(r,4,this.length),Zr(this,r,!0,23,4)};p.prototype.readFloatBE=function(r,e){return e||N(r,4,this.length),Zr(this,r,!1,23,4)};p.prototype.readDoubleLE=function(r,e){return e||N(r,8,this.length),Zr(this,r,!0,52,8)};p.prototype.readDoubleBE=function(r,e){return e||N(r,8,this.length),Zr(this,r,!1,52,8)};p.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;q(this,r,e,n,i,0)}var u=1,f=0;for(this[e]=r&255;++f<n&&(u*=256);)this[e+f]=r/u&255;return e+n};p.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;q(this,r,e,n,i,0)}var u=n-1,f=1;for(this[e+u]=r&255;--u>=0&&(f*=256);)this[e+u]=r/f&255;return e+n};p.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,1,255,0),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};p.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Hr(this,r,e,!0),e+2};p.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Hr(this,r,e,!1),e+2};p.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Jr(this,r,e,!0),e+4};p.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Jr(this,r,e,!1),e+4};p.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);q(this,r,e,n,i-1,-i)}var u=0,f=1,c=0;for(this[e]=r&255;++u<n&&(f*=256);)r<0&&c===0&&this[e+u-1]!==0&&(c=1),this[e+u]=(r/f>>0)-c&255;return e+n};p.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);q(this,r,e,n,i-1,-i)}var u=n-1,f=1,c=0;for(this[e+u]=r&255;--u>=0&&(f*=256);)r<0&&c===0&&this[e+u+1]!==0&&(c=1),this[e+u]=(r/f>>0)-c&255;return e+n};p.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};p.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Hr(this,r,e,!0),e+2};p.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Hr(this,r,e,!1),e+2};p.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Jr(this,r,e,!0),e+4};p.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||q(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Jr(this,r,e,!1),e+4};p.prototype.writeFloatLE=function(r,e,n){return Yo(this,r,e,!0,n)};p.prototype.writeFloatBE=function(r,e,n){return Yo(this,r,e,!1,n)};p.prototype.writeDoubleLE=function(r,e,n){return Ho(this,r,e,!0,n)};p.prototype.writeDoubleBE=function(r,e,n){return Ho(this,r,e,!1,n)};p.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,u;if(this===r&&n<e&&e<o)for(u=i-1;u>=0;--u)r[u+e]=this[u+n];else if(i<1e3||!p.TYPED_ARRAY_SUPPORT)for(u=0;u<i;++u)r[u+e]=this[u+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};p.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!p.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var u;if(typeof r=="number")for(u=e;u<n;++u)this[u]=r;else{var f=G(r)?r:Yr(new p(r,o).toString()),c=f.length;for(u=0;u<n-e;++u)this[u+e]=f[u%c]}return this};Cl=/[^+\/0-9A-Za-z-_]/g});var s=Ve(()=>{"use strict";Qo()});var ri=h((Vx,ei)=>{"use strict";a();s();var _l="Function.prototype.bind called on incompatible ",Ml=Object.prototype.toString,Dl=Math.max,Wl="[object Function]",Xo=function(r,e){for(var n=[],o=0;o<r.length;o+=1)n[o]=r[o];for(var i=0;i<e.length;i+=1)n[i+r.length]=e[i];return n},jl=function(r,e){for(var n=[],o=e||0,i=0;o<r.length;o+=1,i+=1)n[i]=r[o];return n},Gl=function(t,r){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=r);return e};ei.exports=function(r){var e=this;if(typeof e!="function"||Ml.apply(e)!==Wl)throw new TypeError(_l+e);for(var n=jl(arguments,1),o,i=function(){if(this instanceof o){var m=e.apply(this,Xo(n,arguments));return Object(m)===m?m:this}return e.apply(r,Xo(n,arguments))},u=Dl(0,e.length-n.length),f=[],c=0;c<u;c++)f[c]="$"+c;if(o=Function("binder","return function ("+Gl(f,",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var y=function(){};y.prototype=e.prototype,o.prototype=new y,y.prototype=null}return o}});var Re=h((Hx,ti)=>{"use strict";a();s();var Vl=ri();ti.exports=Function.prototype.bind||Vl});var Qt=h((Zx,ni)=>{"use strict";a();s();ni.exports=Error});var Xt=h((e0,oi)=>{"use strict";a();s();oi.exports=EvalError});var en=h((n0,ii)=>{"use strict";a();s();ii.exports=RangeError});var rn=h((a0,ai)=>{"use strict";a();s();ai.exports=ReferenceError});var Qr=h((p0,si)=>{"use strict";a();s();si.exports=SyntaxError});var I=h((c0,ui)=>{"use strict";a();s();ui.exports=TypeError});var tn=h((m0,pi)=>{"use strict";a();s();pi.exports=URIError});var li=h((x0,fi)=>{"use strict";a();s();fi.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;r[e]=o;for(e in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var i=Object.getOwnPropertySymbols(r);if(i.length!==1||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(r,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(r,e);if(u.value!==o||u.enumerable!==!0)return!1}return!0}});var nn=h((b0,di)=>{"use strict";a();s();var ci=typeof Symbol!="undefined"&&Symbol,zl=li();di.exports=function(){return typeof ci!="function"||typeof Symbol!="function"||typeof ci("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:zl()}});var mi=h((T0,yi)=>{"use strict";a();s();var on={__proto__:null,foo:{}},Yl=Object;yi.exports=function(){return{__proto__:on}.foo===on.foo&&!(on instanceof Yl)}});var an=h((P0,hi)=>{"use strict";a();s();var Hl=Function.prototype.call,Jl=Object.prototype.hasOwnProperty,Kl=Re();hi.exports=Kl.call(Hl,Jl)});var V=h((C0,bi)=>{"use strict";a();s();var S,Zl=Qt(),Ql=Xt(),Xl=en(),ec=rn(),Ze=Qr(),Ke=I(),rc=tn(),wi=Function,sn=function(t){try{return wi('"use strict"; return ('+t+").constructor;")()}catch(r){}},Pe=Object.getOwnPropertyDescriptor;if(Pe)try{Pe({},"")}catch(t){Pe=null}var un=function(){throw new Ke},tc=Pe?function(){try{return arguments.callee,un}catch(t){try{return Pe(arguments,"callee").get}catch(r){return un}}}():un,He=nn()(),nc=mi()(),C=Object.getPrototypeOf||(nc?function(t){return t.__proto__}:null),Je={},oc=typeof Uint8Array=="undefined"||!C?S:C(Uint8Array),Ie={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?S:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?S:ArrayBuffer,"%ArrayIteratorPrototype%":He&&C?C([][Symbol.iterator]()):S,"%AsyncFromSyncIteratorPrototype%":S,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics=="undefined"?S:Atomics,"%BigInt%":typeof BigInt=="undefined"?S:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?S:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?S:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?S:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Zl,"%eval%":eval,"%EvalError%":Ql,"%Float32Array%":typeof Float32Array=="undefined"?S:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?S:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?S:FinalizationRegistry,"%Function%":wi,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array=="undefined"?S:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?S:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?S:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":He&&C?C(C([][Symbol.iterator]())):S,"%JSON%":typeof JSON=="object"?JSON:S,"%Map%":typeof Map=="undefined"?S:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!He||!C?S:C(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?S:Promise,"%Proxy%":typeof Proxy=="undefined"?S:Proxy,"%RangeError%":Xl,"%ReferenceError%":ec,"%Reflect%":typeof Reflect=="undefined"?S:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?S:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!He||!C?S:C(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?S:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":He&&C?C(""[Symbol.iterator]()):S,"%Symbol%":He?Symbol:S,"%SyntaxError%":Ze,"%ThrowTypeError%":tc,"%TypedArray%":oc,"%TypeError%":Ke,"%Uint8Array%":typeof Uint8Array=="undefined"?S:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?S:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?S:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?S:Uint32Array,"%URIError%":rc,"%WeakMap%":typeof WeakMap=="undefined"?S:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?S:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?S:WeakSet};if(C)try{null.error}catch(t){gi=C(C(t)),Ie["%Error.prototype%"]=gi}var gi,ic=function t(r){var e;if(r==="%AsyncFunction%")e=sn("async function () {}");else if(r==="%GeneratorFunction%")e=sn("function* () {}");else if(r==="%AsyncGeneratorFunction%")e=sn("async function* () {}");else if(r==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&C&&(e=C(o.prototype))}return Ie[r]=e,e},xi={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},dr=Re(),Xr=an(),ac=dr.call(Function.call,Array.prototype.concat),sc=dr.call(Function.apply,Array.prototype.splice),vi=dr.call(Function.call,String.prototype.replace),et=dr.call(Function.call,String.prototype.slice),uc=dr.call(Function.call,RegExp.prototype.exec),pc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fc=/\\(\\)?/g,lc=function(r){var e=et(r,0,1),n=et(r,-1);if(e==="%"&&n!=="%")throw new Ze("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Ze("invalid intrinsic syntax, expected opening `%`");var o=[];return vi(r,pc,function(i,u,f,c){o[o.length]=f?vi(c,fc,"$1"):u||i}),o},cc=function(r,e){var n=r,o;if(Xr(xi,n)&&(o=xi[n],n="%"+o[0]+"%"),Xr(Ie,n)){var i=Ie[n];if(i===Je&&(i=ic(n)),typeof i=="undefined"&&!e)throw new Ke("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Ze("intrinsic "+r+" does not exist!")};bi.exports=function(r,e){if(typeof r!="string"||r.length===0)throw new Ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ke('"allowMissing" argument must be a boolean');if(uc(/^%?[^%]*%?$/,r)===null)throw new Ze("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=lc(r),o=n.length>0?n[0]:"",i=cc("%"+o+"%",e),u=i.name,f=i.value,c=!1,y=i.alias;y&&(o=y[0],sc(n,ac([0,1],y)));for(var m=1,g=!0;m<n.length;m+=1){var v=n[m],b=et(v,0,1),E=et(v,-1);if((b==='"'||b==="'"||b==="`"||E==='"'||E==="'"||E==="`")&&b!==E)throw new Ze("property names with quotes must have matching quotes");if((v==="constructor"||!g)&&(c=!0),o+="."+v,u="%"+o+"%",Xr(Ie,u))f=Ie[u];else if(f!=null){if(!(v in f)){if(!e)throw new Ke("base intrinsic for "+r+" exists, but the property is not available.");return}if(Pe&&m+1>=n.length){var P=Pe(f,v);g=!!P,g&&"get"in P&&!("originalValue"in P.get)?f=P.get:f=f[v]}else g=Xr(f,v),f=f[v];g&&!c&&(Ie[u]=f)}}return f}});var pn=h((L0,Ai)=>{"use strict";a();s();Ai.exports=Object});var Ti=h((q0,Si)=>{"use strict";a();s();Si.exports=Math.abs});var Ri=h((_0,Ei)=>{"use strict";a();s();Ei.exports=Math.floor});var Ii=h((W0,Pi)=>{"use strict";a();s();Pi.exports=Math.max});var Ci=h((V0,Ni)=>{"use strict";a();s();Ni.exports=Math.min});var Oi=h((H0,Fi)=>{"use strict";a();s();Fi.exports=Math.pow});var Bi=h((Z0,Li)=>{"use strict";a();s();Li.exports=Math.round});var qi=h((ev,Ui)=>{"use strict";a();s();Ui.exports=Number.isNaN||function(r){return r!==r}});var ki=h((nv,$i)=>{"use strict";a();s();var dc=qi();$i.exports=function(r){return dc(r)||r===0?r:r<0?-1:1}});var Mi=h((av,_i)=>{"use strict";a();s();_i.exports=Object.getOwnPropertyDescriptor});var yr=h((pv,Di)=>{"use strict";a();s();var rt=Mi();if(rt)try{rt([],"length")}catch(t){rt=null}Di.exports=rt});var nt=h((cv,Wi)=>{"use strict";a();s();var tt=Object.defineProperty||!1;if(tt)try{tt({},"a",{value:1})}catch(t){tt=!1}Wi.exports=tt});var fn=h((mv,ji)=>{"use strict";a();s();ji.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;r[e]=o;for(var i in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var u=Object.getOwnPropertySymbols(r);if(u.length!==1||u[0]!==e||!Object.prototype.propertyIsEnumerable.call(r,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(r,e);if(f.value!==o||f.enumerable!==!0)return!1}return!0}});var zi=h((xv,Vi)=>{"use strict";a();s();var Gi=typeof Symbol!="undefined"&&Symbol,yc=fn();Vi.exports=function(){return typeof Gi!="function"||typeof Symbol!="function"||typeof Gi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yc()}});var ln=h((bv,Yi)=>{"use strict";a();s();Yi.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var cn=h((Tv,Hi)=>{"use strict";a();s();var mc=pn();Hi.exports=mc.getPrototypeOf||null});var ot=h((Pv,Ji)=>{"use strict";a();s();Ji.exports=Function.prototype.call});var dn=h((Cv,Ki)=>{"use strict";a();s();Ki.exports=Function.prototype.apply});var Qi=h((Lv,Zi)=>{"use strict";a();s();Zi.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var ea=h((qv,Xi)=>{"use strict";a();s();var hc=Re(),gc=dn(),xc=ot(),vc=Qi();Xi.exports=vc||hc.call(xc,gc)});var ta=h((_v,ra)=>{"use strict";a();s();var wc=Re(),bc=I(),Ac=ot(),Sc=ea();ra.exports=function(r){if(r.length<1||typeof r[0]!="function")throw new bc("a function is required");return Sc(wc,Ac,r)}});var ua=h((Wv,sa)=>{"use strict";a();s();var Tc=ta(),na=yr(),ia;try{ia=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var yn=!!ia&&na&&na(Object.prototype,"__proto__"),aa=Object,oa=aa.getPrototypeOf;sa.exports=yn&&typeof yn.get=="function"?Tc([yn.get]):typeof oa=="function"?function(r){return oa(r==null?r:aa(r))}:!1});var da=h((Vv,ca)=>{"use strict";a();s();var pa=ln(),fa=cn(),la=ua();ca.exports=pa?function(r){return pa(r)}:fa?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return fa(r)}:la?function(r){return la(r)}:null});var gn=h((Hv,va)=>{"use strict";a();s();var T,Ec=pn(),Rc=Qt(),Pc=Xt(),Ic=en(),Nc=rn(),rr=Qr(),er=I(),Cc=tn(),Fc=Ti(),Oc=Ri(),Lc=Ii(),Bc=Ci(),Uc=Oi(),qc=Bi(),$c=ki(),ga=Function,mn=function(t){try{return ga('"use strict"; return ('+t+").constructor;")()}catch(r){}},mr=yr(),kc=nt(),hn=function(){throw new er},_c=mr?function(){try{return arguments.callee,hn}catch(t){try{return mr(arguments,"callee").get}catch(r){return hn}}}():hn,Qe=zi()(),F=da(),Mc=cn(),Dc=ln(),xa=dn(),hr=ot(),Xe={},Wc=typeof Uint8Array=="undefined"||!F?T:F(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?T:ArrayBuffer,"%ArrayIteratorPrototype%":Qe&&F?F([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Xe,"%AsyncGenerator%":Xe,"%AsyncGeneratorFunction%":Xe,"%AsyncIteratorPrototype%":Xe,"%Atomics%":typeof Atomics=="undefined"?T:Atomics,"%BigInt%":typeof BigInt=="undefined"?T:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?T:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?T:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Rc,"%eval%":eval,"%EvalError%":Pc,"%Float32Array%":typeof Float32Array=="undefined"?T:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?T:FinalizationRegistry,"%Function%":ga,"%GeneratorFunction%":Xe,"%Int8Array%":typeof Int8Array=="undefined"?T:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?T:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Qe&&F?F(F([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map=="undefined"?T:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Qe||!F?T:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ec,"%Object.getOwnPropertyDescriptor%":mr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?T:Promise,"%Proxy%":typeof Proxy=="undefined"?T:Proxy,"%RangeError%":Ic,"%ReferenceError%":Nc,"%Reflect%":typeof Reflect=="undefined"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?T:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Qe||!F?T:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Qe&&F?F(""[Symbol.iterator]()):T,"%Symbol%":Qe?Symbol:T,"%SyntaxError%":rr,"%ThrowTypeError%":_c,"%TypedArray%":Wc,"%TypeError%":er,"%Uint8Array%":typeof Uint8Array=="undefined"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?T:Uint32Array,"%URIError%":Cc,"%WeakMap%":typeof WeakMap=="undefined"?T:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?T:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?T:WeakSet,"%Function.prototype.call%":hr,"%Function.prototype.apply%":xa,"%Object.defineProperty%":kc,"%Object.getPrototypeOf%":Mc,"%Math.abs%":Fc,"%Math.floor%":Oc,"%Math.max%":Lc,"%Math.min%":Bc,"%Math.pow%":Uc,"%Math.round%":qc,"%Math.sign%":$c,"%Reflect.getPrototypeOf%":Dc};if(F)try{null.error}catch(t){ya=F(F(t)),Ne["%Error.prototype%"]=ya}var ya,jc=function t(r){var e;if(r==="%AsyncFunction%")e=mn("async function () {}");else if(r==="%GeneratorFunction%")e=mn("function* () {}");else if(r==="%AsyncGeneratorFunction%")e=mn("async function* () {}");else if(r==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&F&&(e=F(o.prototype))}return Ne[r]=e,e},ma={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gr=Re(),it=an(),Gc=gr.call(hr,Array.prototype.concat),Vc=gr.call(xa,Array.prototype.splice),ha=gr.call(hr,String.prototype.replace),at=gr.call(hr,String.prototype.slice),zc=gr.call(hr,RegExp.prototype.exec),Yc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Hc=/\\(\\)?/g,Jc=function(r){var e=at(r,0,1),n=at(r,-1);if(e==="%"&&n!=="%")throw new rr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new rr("invalid intrinsic syntax, expected opening `%`");var o=[];return ha(r,Yc,function(i,u,f,c){o[o.length]=f?ha(c,Hc,"$1"):u||i}),o},Kc=function(r,e){var n=r,o;if(it(ma,n)&&(o=ma[n],n="%"+o[0]+"%"),it(Ne,n)){var i=Ne[n];if(i===Xe&&(i=jc(n)),typeof i=="undefined"&&!e)throw new er("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new rr("intrinsic "+r+" does not exist!")};va.exports=function(r,e){if(typeof r!="string"||r.length===0)throw new er("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new er('"allowMissing" argument must be a boolean');if(zc(/^%?[^%]*%?$/,r)===null)throw new rr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Jc(r),o=n.length>0?n[0]:"",i=Kc("%"+o+"%",e),u=i.name,f=i.value,c=!1,y=i.alias;y&&(o=y[0],Vc(n,Gc([0,1],y)));for(var m=1,g=!0;m<n.length;m+=1){var v=n[m],b=at(v,0,1),E=at(v,-1);if((b==='"'||b==="'"||b==="`"||E==='"'||E==="'"||E==="`")&&b!==E)throw new rr("property names with quotes must have matching quotes");if((v==="constructor"||!g)&&(c=!0),o+="."+v,u="%"+o+"%",it(Ne,u))f=Ne[u];else if(f!=null){if(!(v in f)){if(!e)throw new er("base intrinsic for "+r+" exists, but the property is not available.");return}if(mr&&m+1>=n.length){var P=mr(f,v);g=!!P,g&&"get"in P&&!("originalValue"in P.get)?f=P.get:f=f[v]}else g=it(f,v),f=f[v];g&&!c&&(Ne[u]=f)}}return f}});var xn=h((Zv,Aa)=>{"use strict";a();s();var wa=nt(),Zc=Qr(),tr=I(),ba=yr();Aa.exports=function(r,e,n){if(!r||typeof r!="object"&&typeof r!="function")throw new tr("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new tr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new tr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new tr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new tr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new tr("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,c=!!ba&&ba(r,e);if(wa)wa(r,e,{configurable:u===null&&c?c.configurable:!u,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:i===null&&c?c.writable:!i});else if(f||!o&&!i&&!u)r[e]=n;else throw new Zc("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var wn=h((ew,Ta)=>{"use strict";a();s();var vn=nt(),Sa=function(){return!!vn};Sa.hasArrayLengthDefineBug=function(){if(!vn)return null;try{return vn([],"length",{value:1}).length!==1}catch(r){return!0}};Ta.exports=Sa});var Na=h((nw,Ia)=>{"use strict";a();s();var Qc=gn(),Ea=xn(),Xc=wn()(),Ra=yr(),Pa=I(),ed=Qc("%Math.floor%");Ia.exports=function(r,e){if(typeof r!="function")throw new Pa("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||ed(e)!==e)throw new Pa("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in r&&Ra){var u=Ra(r,"length");u&&!u.configurable&&(o=!1),u&&!u.writable&&(i=!1)}return(o||i||!n)&&(Xc?Ea(r,"length",e,!0,!0):Ea(r,"length",e)),r}});var Fa=h((aw,Ca)=>{"use strict";a();s();var rd=gn(),st=rd("%Object.defineProperty%",!0)||!1;if(st)try{st({},"a",{value:1})}catch(t){st=!1}Ca.exports=st});var ft=h((pw,ut)=>{"use strict";a();s();var bn=Re(),pt=V(),td=Na(),nd=I(),Ba=pt("%Function.prototype.apply%"),Ua=pt("%Function.prototype.call%"),qa=pt("%Reflect.apply%",!0)||bn.call(Ua,Ba),Oa=Fa(),od=pt("%Math.max%");ut.exports=function(r){if(typeof r!="function")throw new nd("a function is required");var e=qa(bn,Ua,arguments);return td(e,1+od(0,r.length-(arguments.length-1)),!0)};var La=function(){return qa(bn,Ba,arguments)};Oa?Oa(ut.exports,"apply",{value:La}):ut.exports.apply=La});var An=h((cw,ka)=>{"use strict";a();s();var $a=Object.prototype.toString;ka.exports=function(r){var e=$a.call(r),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&$a.call(r.callee)==="[object Function]"),n}});var Ya=h((mw,za)=>{"use strict";a();s();var Va;Object.keys||(xr=Object.prototype.hasOwnProperty,Sn=Object.prototype.toString,_a=An(),Tn=Object.prototype.propertyIsEnumerable,Ma=!Tn.call({toString:null},"toString"),Da=Tn.call(function(){},"prototype"),vr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lt=function(t){var r=t.constructor;return r&&r.prototype===t},Wa={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},ja=function(){if(typeof window=="undefined")return!1;for(var t in window)try{if(!Wa["$"+t]&&xr.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{lt(window[t])}catch(r){return!0}}catch(r){return!0}return!1}(),Ga=function(t){if(typeof window=="undefined"||!ja)return lt(t);try{return lt(t)}catch(r){return!1}},Va=function(r){var e=r!==null&&typeof r=="object",n=Sn.call(r)==="[object Function]",o=_a(r),i=e&&Sn.call(r)==="[object String]",u=[];if(!e&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var f=Da&&n;if(i&&r.length>0&&!xr.call(r,0))for(var c=0;c<r.length;++c)u.push(String(c));if(o&&r.length>0)for(var y=0;y<r.length;++y)u.push(String(y));else for(var m in r)!(f&&m==="prototype")&&xr.call(r,m)&&u.push(String(m));if(Ma)for(var g=Ga(r),v=0;v<vr.length;++v)!(g&&vr[v]==="constructor")&&xr.call(r,vr[v])&&u.push(vr[v]);return u});var xr,Sn,_a,Tn,Ma,Da,vr,lt,Wa,ja,Ga;za.exports=Va});var Za=h((xw,Ka)=>{"use strict";a();s();var id=Array.prototype.slice,ad=An(),Ha=Object.keys,ct=Ha?function(r){return Ha(r)}:Ya(),Ja=Object.keys;ct.shim=function(){if(Object.keys){var r=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);r||(Object.keys=function(n){return ad(n)?Ja(id.call(n)):Ja(n)})}else Object.keys=ct;return Object.keys||ct};Ka.exports=ct});var wr=h((bw,rs)=>{"use strict";a();s();var sd=Za(),ud=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",pd=Object.prototype.toString,fd=Array.prototype.concat,Qa=xn(),ld=function(t){return typeof t=="function"&&pd.call(t)==="[object Function]"},Xa=wn()(),cd=function(t,r,e,n){if(r in t){if(n===!0){if(t[r]===e)return}else if(!ld(n)||!n())return}Xa?Qa(t,r,e,!0):Qa(t,r,e)},es=function(t,r){var e=arguments.length>2?arguments[2]:{},n=sd(r);ud&&(n=fd.call(n,Object.getOwnPropertySymbols(r)));for(var o=0;o<n.length;o+=1)cd(t,n[o],r[n[o]],e[n[o]])};es.supportsDescriptors=!!Xa;rs.exports=es});var M=h((Tw,os)=>{"use strict";a();s();var ts=V(),ns=ft(),dd=ns(ts("String.prototype.indexOf"));os.exports=function(r,e){var n=ts(r,!!e);return typeof n=="function"&&dd(r,".prototype.")>-1?ns(n):n}});var ss=h((Pw,as)=>{"use strict";a();s();var yd=V(),is=yd("%Array%"),md=!is.isArray&&M()("Object.prototype.toString");as.exports=is.isArray||function(r){return md(r)==="[object Array]"}});var En=h((Cw,us)=>{"use strict";a();s();us.exports=ss()});var fs=h((Lw,ps)=>{"use strict";a();s();var hd=V(),gd=M(),xd=I(),vd=En(),wd=hd("%Reflect.apply%",!0)||gd("Function.prototype.apply");ps.exports=function(r,e){var n=arguments.length>2?arguments[2]:[];if(!vd(n))throw new xd("Assertion failed: optional `argumentsList`, if provided, must be a List");return wd(r,e,n)}});function ls(){throw new Error("setTimeout has not been defined")}function cs(){throw new Error("clearTimeout has not been defined")}function ds(t){if(ye===setTimeout)return setTimeout(t,0);if((ye===ls||!ye)&&setTimeout)return ye=setTimeout,setTimeout(t,0);try{return ye(t,0)}catch(r){try{return ye.call(null,t,0)}catch(e){return ye.call(this,t,0)}}}function bd(t){if(me===clearTimeout)return clearTimeout(t);if((me===cs||!me)&&clearTimeout)return me=clearTimeout,clearTimeout(t);try{return me(t)}catch(r){try{return me.call(null,t)}catch(e){return me.call(this,t)}}}function Ad(){!or||!Ce||(or=!1,Ce.length?te=Ce.concat(te):dt=-1,te.length&&ys())}function ys(){if(!or){var t=ds(Ad);or=!0;for(var r=te.length;r;){for(Ce=te,te=[];++dt<r;)Ce&&Ce[dt].run();dt=-1,r=te.length}Ce=null,or=!1,bd(t)}}function Sd(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];te.push(new ms(t,r)),te.length===1&&!or&&ds(ys)}function ms(t,r){this.fun=t,this.array=r}function Fe(){}function Md(t){throw new Error("process.binding is not supported")}function Dd(){return"/"}function Wd(t){throw new Error("process.chdir is not supported")}function jd(){return 0}function Vd(t){var r=Gd.call(nr)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}function Yd(){var t=new Date,r=t-zd;return r/1e3}var ye,me,te,or,Ce,dt,Td,Ed,Rd,Pd,Id,Nd,Cd,Fd,Od,Ld,Bd,Ud,qd,$d,kd,_d,nr,Gd,zd,Hd,br,hs=Ve(()=>{"use strict";a();s();ye=ls,me=cs;typeof globalThis.setTimeout=="function"&&(ye=setTimeout);typeof globalThis.clearTimeout=="function"&&(me=clearTimeout);te=[],or=!1,dt=-1;ms.prototype.run=function(){this.fun.apply(null,this.array)};Td="browser",Ed="browser",Rd=!0,Pd={},Id=[],Nd="",Cd={},Fd={},Od={};Ld=Fe,Bd=Fe,Ud=Fe,qd=Fe,$d=Fe,kd=Fe,_d=Fe;nr=globalThis.performance||{},Gd=nr.now||nr.mozNow||nr.msNow||nr.oNow||nr.webkitNow||function(){return new Date().getTime()};zd=new Date;Hd={nextTick:Sd,title:Td,browser:Rd,env:Pd,argv:Id,version:Nd,versions:Cd,on:Ld,addListener:Bd,once:Ud,off:qd,removeListener:$d,removeAllListeners:kd,emit:_d,binding:Md,cwd:Dd,chdir:Wd,umask:jd,hrtime:Vd,platform:Ed,release:Fd,config:Od,uptime:Yd},br=Hd});var Rn,Pn,gs=Ve(()=>{"use strict";a();s();typeof Object.create=="function"?Rn=function(r,e){r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:Rn=function(r,e){r.super_=e;var n=function(){};n.prototype=e.prototype,r.prototype=new n,r.prototype.constructor=r};Pn=Rn});var Es={};Yt(Es,{_extend:()=>qn,debuglog:()=>xs,default:()=>oy,deprecate:()=>On,format:()=>gt,inherits:()=>Pn,inspect:()=>Y,isArray:()=>Ln,isBoolean:()=>xt,isBuffer:()=>As,isDate:()=>ht,isError:()=>Sr,isFunction:()=>Tr,isNull:()=>Er,isNullOrUndefined:()=>vs,isNumber:()=>Bn,isObject:()=>Oe,isPrimitive:()=>bs,isRegExp:()=>Ar,isString:()=>Rr,isSymbol:()=>ws,isUndefined:()=>z,log:()=>Ss});function gt(t){if(!Rr(t)){for(var r=[],e=0;e<arguments.length;e++)r.push(Y(arguments[e]));return r.join(" ")}for(var e=1,n=arguments,o=n.length,i=String(t).replace(Jd,function(f){if(f==="%%")return"%";if(e>=o)return f;switch(f){case"%s":return String(n[e++]);case"%d":return Number(n[e++]);case"%j":try{return JSON.stringify(n[e++])}catch(c){return"[Circular]"}default:return f}}),u=n[e];e<o;u=n[++e])Er(u)||!Oe(u)?i+=" "+u:i+=" "+Y(u);return i}function On(t,r){if(z(globalThis.process))return function(){return On(t,r).apply(this,arguments)};if(br.noDeprecation===!0)return t;var e=!1;function n(){if(!e){if(br.throwDeprecation)throw new Error(r);br.traceDeprecation?console.trace(r):console.error(r),e=!0}return t.apply(this,arguments)}return n}function xs(t){if(z(In)&&(In=br.env.NODE_DEBUG||""),t=t.toUpperCase(),!yt[t])if(new RegExp("\\b"+t+"\\b","i").test(In)){var r=0;yt[t]=function(){var e=gt.apply(null,arguments);console.error("%s %d: %s",t,r,e)}}else yt[t]=function(){};return yt[t]}function Y(t,r){var e={seen:[],stylize:Zd};return arguments.length>=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),xt(r)?e.showHidden=r:r&&qn(e,r),z(e.showHidden)&&(e.showHidden=!1),z(e.depth)&&(e.depth=2),z(e.colors)&&(e.colors=!1),z(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=Kd),mt(e,t,e.depth)}function Kd(t,r){var e=Y.styles[r];return e?"\x1B["+Y.colors[e][0]+"m"+t+"\x1B["+Y.colors[e][1]+"m":t}function Zd(t,r){return t}function Qd(t){var r={};return t.forEach(function(e,n){r[e]=!0}),r}function mt(t,r,e){if(t.customInspect&&r&&Tr(r.inspect)&&r.inspect!==Y&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(e,t);return Rr(n)||(n=mt(t,n,e)),n}var o=Xd(t,r);if(o)return o;var i=Object.keys(r),u=Qd(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(r)),Sr(r)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Nn(r);if(i.length===0){if(Tr(r)){var f=r.name?": "+r.name:"";return t.stylize("[Function"+f+"]","special")}if(Ar(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(ht(r))return t.stylize(Date.prototype.toString.call(r),"date");if(Sr(r))return Nn(r)}var c="",y=!1,m=["{","}"];if(Ln(r)&&(y=!0,m=["[","]"]),Tr(r)){var g=r.name?": "+r.name:"";c=" [Function"+g+"]"}if(Ar(r)&&(c=" "+RegExp.prototype.toString.call(r)),ht(r)&&(c=" "+Date.prototype.toUTCString.call(r)),Sr(r)&&(c=" "+Nn(r)),i.length===0&&(!y||r.length==0))return m[0]+c+m[1];if(e<0)return Ar(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var v;return y?v=ey(t,r,e,u,i):v=i.map(function(b){return Fn(t,r,e,u,b,y)}),t.seen.pop(),ry(v,c,m)}function Xd(t,r){if(z(r))return t.stylize("undefined","undefined");if(Rr(r)){var e="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(e,"string")}if(Bn(r))return t.stylize(""+r,"number");if(xt(r))return t.stylize(""+r,"boolean");if(Er(r))return t.stylize("null","null")}function Nn(t){return"["+Error.prototype.toString.call(t)+"]"}function ey(t,r,e,n,o){for(var i=[],u=0,f=r.length;u<f;++u)Ts(r,String(u))?i.push(Fn(t,r,e,n,String(u),!0)):i.push("");return o.forEach(function(c){c.match(/^\d+$/)||i.push(Fn(t,r,e,n,c,!0))}),i}function Fn(t,r,e,n,o,i){var u,f,c;if(c=Object.getOwnPropertyDescriptor(r,o)||{value:r[o]},c.get?c.set?f=t.stylize("[Getter/Setter]","special"):f=t.stylize("[Getter]","special"):c.set&&(f=t.stylize("[Setter]","special")),Ts(n,o)||(u="["+o+"]"),f||(t.seen.indexOf(c.value)<0?(Er(e)?f=mt(t,c.value,null):f=mt(t,c.value,e-1),f.indexOf(`
2
- `)>-1&&(i?f=f.split(`
3
- `).map(function(y){return" "+y}).join(`
4
- `).substr(2):f=`
5
- `+f.split(`
6
- `).map(function(y){return" "+y}).join(`
7
- `))):f=t.stylize("[Circular]","special")),z(u)){if(i&&o.match(/^\d+$/))return f;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=t.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=t.stylize(u,"string"))}return u+": "+f}function ry(t,r,e){var n=0,o=t.reduce(function(i,u){return n++,u.indexOf(`
8
- `)>=0&&n++,i+u.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?e[0]+(r===""?"":r+`
9
- `)+" "+t.join(`,
10
- `)+" "+e[1]:e[0]+r+" "+t.join(", ")+" "+e[1]}function Ln(t){return Array.isArray(t)}function xt(t){return typeof t=="boolean"}function Er(t){return t===null}function vs(t){return t==null}function Bn(t){return typeof t=="number"}function Rr(t){return typeof t=="string"}function ws(t){return typeof t=="symbol"}function z(t){return t===void 0}function Ar(t){return Oe(t)&&Un(t)==="[object RegExp]"}function Oe(t){return typeof t=="object"&&t!==null}function ht(t){return Oe(t)&&Un(t)==="[object Date]"}function Sr(t){return Oe(t)&&(Un(t)==="[object Error]"||t instanceof Error)}function Tr(t){return typeof t=="function"}function bs(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t=="undefined"}function As(t){return p.isBuffer(t)}function Un(t){return Object.prototype.toString.call(t)}function Cn(t){return t<10?"0"+t.toString(10):t.toString(10)}function ny(){var t=new Date,r=[Cn(t.getHours()),Cn(t.getMinutes()),Cn(t.getSeconds())].join(":");return[t.getDate(),ty[t.getMonth()],r].join(" ")}function Ss(){console.log("%s - %s",ny(),gt.apply(null,arguments))}function qn(t,r){if(!r||!Oe(r))return t;for(var e=Object.keys(r),n=e.length;n--;)t[e[n]]=r[e[n]];return t}function Ts(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var Jd,yt,In,ty,oy,Rs=Ve(()=>{"use strict";a();s();hs();gs();Jd=/%[sdj%]/g;yt={};Y.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Y.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};ty=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];oy={inherits:Pn,_extend:qn,log:Ss,isBuffer:As,isPrimitive:bs,isFunction:Tr,isError:Sr,isDate:ht,isObject:Oe,isRegExp:Ar,isUndefined:z,isSymbol:ws,isString:Rr,isNumber:Bn,isNullOrUndefined:vs,isNull:Er,isBoolean:xt,isArray:Ln,inspect:Y,deprecate:On,format:gt,debuglog:xs}});var Ps=h((zw,vt)=>{"use strict";a();s();var Le=(Rs(),No(Es));if(Le&&Le.default){vt.exports=Le.default;for(let t in Le)vt.exports[t]=Le[t]}else Le&&(vt.exports=Le)});var Ns=h((Jw,Is)=>{"use strict";a();s();Is.exports=Ps().inspect});var Cr=h((Qw,Js)=>{"use strict";a();s();var zn=typeof Map=="function"&&Map.prototype,$n=Object.getOwnPropertyDescriptor&&zn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,bt=zn&&$n&&typeof $n.get=="function"?$n.get:null,Cs=zn&&Map.prototype.forEach,Yn=typeof Set=="function"&&Set.prototype,kn=Object.getOwnPropertyDescriptor&&Yn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,At=Yn&&kn&&typeof kn.get=="function"?kn.get:null,Fs=Yn&&Set.prototype.forEach,iy=typeof WeakMap=="function"&&WeakMap.prototype,Ir=iy?WeakMap.prototype.has:null,ay=typeof WeakSet=="function"&&WeakSet.prototype,Nr=ay?WeakSet.prototype.has:null,sy=typeof WeakRef=="function"&&WeakRef.prototype,Os=sy?WeakRef.prototype.deref:null,uy=Boolean.prototype.valueOf,py=Object.prototype.toString,fy=Function.prototype.toString,ly=String.prototype.match,Hn=String.prototype.slice,he=String.prototype.replace,cy=String.prototype.toUpperCase,Ls=String.prototype.toLowerCase,Ws=RegExp.prototype.test,Bs=Array.prototype.concat,H=Array.prototype.join,dy=Array.prototype.slice,Us=Math.floor,Dn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,_n=Object.getOwnPropertySymbols,Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ir=typeof Symbol=="function"&&typeof Symbol.iterator=="object",L=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ir||!0)?Symbol.toStringTag:null,js=Object.prototype.propertyIsEnumerable,qs=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $s(t,r){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Ws.call(/e/,r))return r;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Us(-t):Us(t);if(n!==t){var o=String(n),i=Hn.call(r,o.length+1);return he.call(o,e,"$&_")+"."+he.call(he.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return he.call(r,e,"$&_")}var jn=Ns(),ks=jn.custom,_s=zs(ks)?ks:null,Gs={__proto__:null,double:'"',single:"'"},yy={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Js.exports=function t(r,e,n,o){var i=e||{};if(ne(i,"quoteStyle")&&!ne(Gs,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ne(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=ne(i,"customInspect")?i.customInspect:!0;if(typeof u!="boolean"&&u!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ne(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ne(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=i.numericSeparator;if(typeof r=="undefined")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return Hs(r,i);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var c=String(r);return f?$s(r,c):c}if(typeof r=="bigint"){var y=String(r)+"n";return f?$s(r,y):y}var m=typeof i.depth=="undefined"?5:i.depth;if(typeof n=="undefined"&&(n=0),n>=m&&m>0&&typeof r=="object")return Gn(r)?"[Array]":"[Object]";var g=Oy(i,n);if(typeof o=="undefined")o=[];else if(Ys(o,r)>=0)return"[Circular]";function v(We,jr,Nf){if(jr&&(o=dy.call(o),o.push(jr)),Nf){var To={depth:i.depth};return ne(i,"quoteStyle")&&(To.quoteStyle=i.quoteStyle),t(We,To,n+1,o)}return t(We,i,n+1,o)}if(typeof r=="function"&&!Ms(r)){var b=Sy(r),E=wt(r,v);return"[Function"+(b?": "+b:" (anonymous)")+"]"+(E.length>0?" { "+H.call(E,", ")+" }":"")}if(zs(r)){var P=ir?he.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):Wn.call(r);return typeof r=="object"&&!ir?Pr(P):P}if(Ny(r)){for(var U="<"+Ls.call(String(r.nodeName)),$=r.attributes||[],X=0;X<$.length;X++)U+=" "+$[X].name+"="+Vs(my($[X].value),"double",i);return U+=">",r.childNodes&&r.childNodes.length&&(U+="..."),U+="</"+Ls.call(String(r.nodeName))+">",U}if(Gn(r)){if(r.length===0)return"[]";var Ae=wt(r,v);return g&&!Fy(Ae)?"["+Vn(Ae,g)+"]":"[ "+H.call(Ae,", ")+" ]"}if(gy(r)){var lr=wt(r,v);return!("cause"in Error.prototype)&&"cause"in r&&!js.call(r,"cause")?"{ ["+String(r)+"] "+H.call(Bs.call("[cause]: "+v(r.cause),lr),", ")+" }":lr.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+H.call(lr,", ")+" }"}if(typeof r=="object"&&u){if(_s&&typeof r[_s]=="function"&&jn)return jn(r,{depth:m-n});if(u!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(Ty(r)){var Wr=[];return Cs&&Cs.call(r,function(We,jr){Wr.push(v(jr,r,!0)+" => "+v(We,r))}),Ds("Map",bt.call(r),Wr,g)}if(Py(r)){var bo=[];return Fs&&Fs.call(r,function(We){bo.push(v(We,r))}),Ds("Set",At.call(r),bo,g)}if(Ey(r))return Mn("WeakMap");if(Iy(r))return Mn("WeakSet");if(Ry(r))return Mn("WeakRef");if(vy(r))return Pr(v(Number(r)));if(by(r))return Pr(v(Dn.call(r)));if(wy(r))return Pr(uy.call(r));if(xy(r))return Pr(v(String(r)));if(typeof window!="undefined"&&r===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&r===globalThis||typeof globalThis!="undefined"&&r===globalThis)return"{ [object globalThis] }";if(!hy(r)&&!Ms(r)){var Wt=wt(r,v),Ao=qs?qs(r)===Object.prototype:r instanceof Object||r.constructor===Object,jt=r instanceof Object?"":"null prototype",So=!Ao&&L&&Object(r)===r&&L in r?Hn.call(ge(r),8,-1):jt?"Object":"",If=Ao||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",Gt=If+(So||jt?"["+H.call(Bs.call([],So||[],jt||[]),": ")+"] ":"");return Wt.length===0?Gt+"{}":g?Gt+"{"+Vn(Wt,g)+"}":Gt+"{ "+H.call(Wt,", ")+" }"}return String(r)};function Vs(t,r,e){var n=e.quoteStyle||r,o=Gs[n];return o+t+o}function my(t){return he.call(String(t),/"/g,"&quot;")}function Gn(t){return ge(t)==="[object Array]"&&(!L||!(typeof t=="object"&&L in t))}function hy(t){return ge(t)==="[object Date]"&&(!L||!(typeof t=="object"&&L in t))}function Ms(t){return ge(t)==="[object RegExp]"&&(!L||!(typeof t=="object"&&L in t))}function gy(t){return ge(t)==="[object Error]"&&(!L||!(typeof t=="object"&&L in t))}function xy(t){return ge(t)==="[object String]"&&(!L||!(typeof t=="object"&&L in t))}function vy(t){return ge(t)==="[object Number]"&&(!L||!(typeof t=="object"&&L in t))}function wy(t){return ge(t)==="[object Boolean]"&&(!L||!(typeof t=="object"&&L in t))}function zs(t){if(ir)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Wn)return!1;try{return Wn.call(t),!0}catch(r){}return!1}function by(t){if(!t||typeof t!="object"||!Dn)return!1;try{return Dn.call(t),!0}catch(r){}return!1}var Ay=Object.prototype.hasOwnProperty||function(t){return t in this};function ne(t,r){return Ay.call(t,r)}function ge(t){return py.call(t)}function Sy(t){if(t.name)return t.name;var r=ly.call(fy.call(t),/^function\s*([\w$]+)/);return r?r[1]:null}function Ys(t,r){if(t.indexOf)return t.indexOf(r);for(var e=0,n=t.length;e<n;e++)if(t[e]===r)return e;return-1}function Ty(t){if(!bt||!t||typeof t!="object")return!1;try{bt.call(t);try{At.call(t)}catch(r){return!0}return t instanceof Map}catch(r){}return!1}function Ey(t){if(!Ir||!t||typeof t!="object")return!1;try{Ir.call(t,Ir);try{Nr.call(t,Nr)}catch(r){return!0}return t instanceof WeakMap}catch(r){}return!1}function Ry(t){if(!Os||!t||typeof t!="object")return!1;try{return Os.call(t),!0}catch(r){}return!1}function Py(t){if(!At||!t||typeof t!="object")return!1;try{At.call(t);try{bt.call(t)}catch(r){return!0}return t instanceof Set}catch(r){}return!1}function Iy(t){if(!Nr||!t||typeof t!="object")return!1;try{Nr.call(t,Nr);try{Ir.call(t,Ir)}catch(r){return!0}return t instanceof WeakSet}catch(r){}return!1}function Ny(t){return!t||typeof t!="object"?!1:typeof HTMLElement!="undefined"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Hs(t,r){if(t.length>r.maxStringLength){var e=t.length-r.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return Hs(Hn.call(t,0,r.maxStringLength),r)+n}var o=yy[r.quoteStyle||"single"];o.lastIndex=0;var i=he.call(he.call(t,o,"\\$1"),/[\x00-\x1f]/g,Cy);return Vs(i,"single",r)}function Cy(t){var r=t.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return e?"\\"+e:"\\x"+(r<16?"0":"")+cy.call(r.toString(16))}function Pr(t){return"Object("+t+")"}function Mn(t){return t+" { ? }"}function Ds(t,r,e,n){var o=n?Vn(e,n):H.call(e,", ");return t+" ("+r+") {"+o+"}"}function Fy(t){for(var r=0;r<t.length;r++)if(Ys(t[r],`
11
- `)>=0)return!1;return!0}function Oy(t,r){var e;if(t.indent===" ")e=" ";else if(typeof t.indent=="number"&&t.indent>0)e=H.call(Array(t.indent+1)," ");else return null;return{base:e,prev:H.call(Array(r+1),e)}}function Vn(t,r){if(t.length===0)return"";var e=`
12
- `+r.prev+r.base;return e+H.call(t,","+e)+`
13
- `+r.prev}function wt(t,r){var e=Gn(t),n=[];if(e){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=ne(t,o)?r(t[o],t):""}var i=typeof _n=="function"?_n(t):[],u;if(ir){u={};for(var f=0;f<i.length;f++)u["$"+i[f]]=i[f]}for(var c in t)ne(t,c)&&(e&&String(Number(c))===c&&c<t.length||ir&&u["$"+c]instanceof Symbol||(Ws.call(/[^\w$]/,c)?n.push(r(c,t)+": "+r(t[c],t)):n.push(c+": "+r(t[c],t))));if(typeof _n=="function")for(var y=0;y<i.length;y++)js.call(t,i[y])&&n.push("["+r(i[y])+"]: "+r(t[i[y]],t));return n}});var St=h((rb,Ks)=>{"use strict";a();s();Ks.exports=function(r){return typeof r=="string"||typeof r=="symbol"}});var Qs=h((ob,Zs)=>{"use strict";a();s();var Ly=I(),By=Cr(),Uy=St();Zs.exports=function(r,e){if(!Uy(e))throw new Ly("Assertion failed: IsPropertyKey(P) is not true, got "+By(e));return r[e]}});var tu=h((sb,ru)=>{"use strict";a();s();var eu=Function.prototype.toString,ar=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Kn,Tt;if(typeof ar=="function"&&typeof Object.defineProperty=="function")try{Kn=Object.defineProperty({},"length",{get:function(){throw Tt}}),Tt={},ar(function(){throw 42},null,Kn)}catch(t){t!==Tt&&(ar=null)}else ar=null;var qy=/^\s*class\b/,Zn=function(r){try{var e=eu.call(r);return qy.test(e)}catch(n){return!1}},Jn=function(r){try{return Zn(r)?!1:(eu.call(r),!0)}catch(e){return!1}},Et=Object.prototype.toString,$y="[object Object]",ky="[object Function]",_y="[object GeneratorFunction]",My="[object HTMLAllCollection]",Dy="[object HTML document.all class]",Wy="[object HTMLCollection]",jy=typeof Symbol=="function"&&!!Symbol.toStringTag,Gy=!(0 in[,]),Qn=function(){return!1};typeof document=="object"&&(Xs=document.all,Et.call(Xs)===Et.call(document.all)&&(Qn=function(r){if((Gy||!r)&&(typeof r=="undefined"||typeof r=="object"))try{var e=Et.call(r);return(e===My||e===Dy||e===Wy||e===$y)&&r("")==null}catch(n){}return!1}));var Xs;ru.exports=ar?function(r){if(Qn(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;try{ar(r,null,Kn)}catch(e){if(e!==Tt)return!1}return!Zn(r)&&Jn(r)}:function(r){if(Qn(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;if(jy)return Jn(r);if(Zn(r))return!1;var e=Et.call(r);return e!==ky&&e!==_y&&!/^\[object HTML/.test(e)?!1:Jn(r)}});var Xn=h((fb,nu)=>{"use strict";a();s();nu.exports=tu()});var su=h((db,au)=>{"use strict";a();s();var ou=I(),Vy=Qs(),zy=Xn(),Yy=St(),iu=Cr();au.exports=function(r,e){if(!Yy(e))throw new ou("Assertion failed: IsPropertyKey(P) is not true");var n=Vy(r,e);if(n!=null){if(!zy(n))throw new ou(iu(e)+" is not a function: "+iu(n));return n}}});var pu=h((hb,uu)=>{"use strict";a();s();var Hy=fn();uu.exports=function(){return Hy()&&!!Symbol.toStringTag}});var no=h((vb,du)=>{"use strict";a();s();var eo=M(),fu=pu()(),lu,cu,ro,to;fu&&(lu=eo("Object.prototype.hasOwnProperty"),cu=eo("RegExp.prototype.exec"),ro={},Rt=function(){throw ro},to={toString:Rt,valueOf:Rt},typeof Symbol.toPrimitive=="symbol"&&(to[Symbol.toPrimitive]=Rt));var Rt,Jy=eo("Object.prototype.toString"),Ky=Object.getOwnPropertyDescriptor,Zy="[object RegExp]";du.exports=fu?function(r){if(!r||typeof r!="object")return!1;var e=Ky(r,"lastIndex"),n=e&&lu(e,"value");if(!n)return!1;try{cu(r,to)}catch(o){return o===ro}}:function(r){return!r||typeof r!="object"&&typeof r!="function"?!1:Jy(r)===Zy}});var oo=h((Ab,yu)=>{"use strict";a();s();var Qy=M(),Xy=no(),em=Qy("RegExp.prototype.exec"),rm=I();yu.exports=function(r){if(!Xy(r))throw new rm("`regex` must be a RegExp");return function(n){return em(r,n)!==null}}});var hu=h((Eb,mu)=>{"use strict";a();s();mu.exports=function(r,e){for(var n=0;n<r.length;n+=1)if(!e(r[n],n,r))return!1;return!0}});var xu=h((Ib,gu)=>{"use strict";a();s();gu.exports=function(r){if(r===null)return"Null";if(typeof r=="undefined")return"Undefined";if(typeof r=="function"||typeof r=="object")return"Object";if(typeof r=="number")return"Number";if(typeof r=="boolean")return"Boolean";if(typeof r=="string")return"String"}});var io=h((Fb,vu)=>{"use strict";a();s();var tm=xu();vu.exports=function(r){return typeof r=="symbol"?"Symbol":typeof r=="bigint"?"BigInt":tm(r)}});var Au=h((Bb,bu)=>{"use strict";a();s();var wu=I(),nm=Cr(),om=St(),im=io();bu.exports=function(r,e){if(im(r)!=="Object")throw new wu("Assertion failed: Type(O) is not Object");if(!om(e))throw new wu("Assertion failed: IsPropertyKey(P) is not true, got "+nm(e));return r[e]}});var Tu=h(($b,Su)=>{"use strict";a();s();var am=V();Su.exports=am("%Math.min%")});var ao=h((Mb,Eu)=>{"use strict";a();s();Eu.exports=Number.isNaN||function(r){return r!==r}});var Pu=h((jb,Ru)=>{"use strict";a();s();var sm=ao();Ru.exports=function(t){return(typeof t=="number"||typeof t=="bigint")&&!sm(t)&&t!==1/0&&t!==-1/0}});var Pt=h((zb,Nu)=>{"use strict";a();s();var Iu=V(),um=Iu("%Math.abs%"),pm=Iu("%Math.floor%"),fm=ao(),lm=Pu();Nu.exports=function(r){if(typeof r!="number"||fm(r)||!lm(r))return!1;var e=um(r);return pm(e)===e}});var uo=h((Jb,Cu)=>{"use strict";a();s();var cm=M(),so=I(),dm=Pt(),ym=cm("String.prototype.slice");Cu.exports=function(r,e,n){if(typeof r!="string")throw new so("Assertion failed: `string` must be a String");if(typeof e!="string")throw new so("Assertion failed: `searchValue` must be a String");if(!dm(n)||n<0)throw new so("Assertion failed: `fromIndex` must be a non-negative integer");var o=r.length;if(e===""&&n<=o)return n;for(var i=e.length,u=n;u<=o-i;u+=1){var f=ym(r,u,u+i);if(f===e)return u}return-1}});var It=h((Qb,Fu)=>{"use strict";a();s();var mm=I();Fu.exports=function(r){if(r==null)throw new mm(arguments.length>0&&arguments[1]||"Cannot call method on "+r);return r}});var Nt=h((rA,Ou)=>{"use strict";a();s();var hm=V(),gm=hm("%String%"),xm=I();Ou.exports=function(r){if(typeof r=="symbol")throw new xm("Cannot convert a Symbol value to a string");return gm(r)}});var po=h((oA,Uu)=>{"use strict";a();s();var vm=It(),wm=Nt(),bm=M(),Lu=bm("String.prototype.replace"),Bu=/^\s$/.test("\u180E"),Am=Bu?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Sm=Bu?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;Uu.exports=function(){var r=wm(vm(this));return Lu(Lu(r,Am,""),Sm,"")}});var fo=h((sA,$u)=>{"use strict";a();s();var Tm=po(),qu="\u200B",sr="\u180E";$u.exports=function(){return String.prototype.trim&&qu.trim()===qu&&sr.trim()===sr&&("_"+sr).trim()==="_"+sr&&(sr+"_").trim()===sr+"_"?String.prototype.trim:Tm}});var _u=h((fA,ku)=>{"use strict";a();s();var Em=wr(),Rm=fo();ku.exports=function(){var r=Rm();return Em(String.prototype,{trim:r},{trim:function(){return String.prototype.trim!==r}}),r}});var ju=h((dA,Wu)=>{"use strict";a();s();var Pm=ft(),Im=wr(),Nm=It(),Cm=po(),Mu=fo(),Fm=_u(),Om=Pm(Mu()),Du=function(r){return Nm(r),Om(r)};Im(Du,{getPolyfill:Mu,implementation:Cm,shim:Fm});Wu.exports=Du});var Yu=h((hA,zu)=>{"use strict";a();s();var co=V(),lo=co("%Number%"),Lm=co("%RegExp%"),Bm=I(),Gu=co("%parseInt%"),Um=M(),Ct=oo(),Vu=Um("String.prototype.slice"),qm=Ct(/^0b[01]+$/i),$m=Ct(/^0o[0-7]+$/i),km=Ct(/^[-+]0x[0-9a-f]+$/i),_m=["\x85","\u200B","\uFFFE"].join(""),Mm=new Lm("["+_m+"]","g"),Dm=Ct(Mm),Wm=ju();zu.exports=function t(r){if(typeof r!="string")throw new Bm("Assertion failed: `argument` is not a String");if(qm(r))return lo(Gu(Vu(r,2),2));if($m(r))return lo(Gu(Vu(r,2),8));if(Dm(r)||km(r))return NaN;var e=Wm(r);return e!==r?t(e):lo(r)}});var Ku=h((vA,Ju)=>{"use strict";a();s();var jm=I(),Hu=Pt(),Gm=M(),Vm=Gm("String.prototype.slice");Ju.exports=function(r,e,n){if(typeof r!="string"||!Hu(e)||arguments.length>2&&!Hu(n))throw new jm("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return Vm(r,e,arguments.length>2?n:r.length)}});var Qu=h((AA,Zu)=>{"use strict";a();s();Zu.exports=function(r){return typeof r=="string"||typeof r=="undefined"}});var ep=h((EA,Xu)=>{"use strict";a();s();var zm=M()("String.prototype.slice");Xu.exports=function(r,e){return r===e?!0:r.length>e.length?!1:zm(e,0,r.length)===r}});var ip=h((IA,op)=>{"use strict";a();s();var oe=I(),np=oo(),Ym=hu(),yo=Cr(),Hm=Au(),Jm=En(),Km=Tu(),Zm=uo(),rp=Yu(),ie=Ku(),Qm=Nt(),tp=io(),Xm=Pt(),eh=Qu(),Fr=ep(),rh=np(/^\$[0-9]/),th=np(/^\$[0-9][0-9]/);op.exports=function(r,e,n,o,i,u){if(typeof r!="string")throw new oe("Assertion failed: `matched` must be a String");if(typeof e!="string")throw new oe("Assertion failed: `str` must be a String");if(!Xm(n)||n<0)throw new oe("Assertion failed: `position` must be a nonnegative integer, got "+yo(n));if(!Jm(o)||!Ym(o,eh))throw new oe("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+yo(o));if(typeof i!="undefined"&&tp(i)!=="Object")throw new oe("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof u!="string")throw new oe("Assertion failed: `replacementTemplate` must be a String");var f=e.length;if(n>f)throw new oe("Assertion failed: position > stringLength, got "+yo(n));for(var c=u,y="";c!=="";){var m,g,v;if(Fr("$$",c))m="$$",g="$";else if(Fr("$`",c))m="$`",g=ie(e,0,n);else if(Fr("$&",c))m="$&",g=r;else if(Fr("$'",c)){m="$'";var b=r.length,E=n+b;g=ie(e,Km(E,f))}else if(rh(c)){var P=th(c)?2:1,U=ie(c,1,1+P),$=rp(U);if($<0||$>99)throw new oe("Assertion failed: `index` must be >= 0 and <= 99");var X=o.length;$>X&&P===2&&(P=1,U=ie(U,0,1),$=rp(U)),m=ie(c,0,1+P),1<=$&&$<=X?(v=o[$-1],typeof v=="undefined"?g="":g=v):g=m}else if(Fr("$<",c)){var Ae=Zm(c,">",0);if(Ae===-1||typeof i=="undefined")m="$<",g=m;else{m=ie(c,0,Ae+1);var lr=ie(c,2,Ae);if(tp(i)!=="Object")throw new oe("Assertion failed: Type(namedCaptures) is not Object");v=Hm(i,lr),typeof v=="undefined"?g="":g=Qm(v)}}else m=ie(c,0,1),g=m;var Wr=m.length;c=ie(c,Wr),y+=g}return y}});var ho=h((FA,pp)=>{"use strict";a();s();var ap=fs(),nh=su(),oh=ip(),ih=Xn(),ah=It(),Ft=Nt(),sp=uo(),sh=V(),Ot=M(),uh=nn()(),ph=no(),fh=sh("%Math.max%"),up=I(),lh=Ot("Array.prototype.push"),mo=Ot("String.prototype.slice"),ch=Ot("String.prototype.indexOf"),dh=Ot("String.prototype.replace");pp.exports=function(r,e){var n=ah(this),o=ph(r);if(o&&ch(mo(r,r.source.length+2),"g")===-1)throw new up("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(uh&&Symbol.replace){if(r!=null){var i=nh(r,Symbol.replace);if(typeof i!="undefined")return ap(i,r,[n,e])}}else if(o)return dh(n,r,e);var u=Ft(n),f=Ft(r),c=ih(e);c||(e=Ft(e));for(var y=f.length,m=fh(1,y),g=[],v=sp(u,f,0);v!==-1;)lh(g,v),v=sp(u,f,v+m);for(var b=0,E="",P=0;P<g.length;P+=1){var U;if(c)U=Ft(ap(e,void 0,[f,g[P],u]));else{if(typeof e!="string")throw new up("Assertion failed: `replaceValue` should be a string at this point");var $=[];U=oh(f,u,g[P],$,void 0,e)}var X=mo(u,b,g[P]);E+=X+U,b=g[P]+y}return b<u.length&&(E+=mo(u,b)),E}});var go=h((BA,fp)=>{"use strict";a();s();var yh=ho();fp.exports=function(){return String.prototype.replaceAll||yh}});var cp=h(($A,lp)=>{"use strict";a();s();var mh=wr(),hh=go();lp.exports=function(){var r=hh();return mh(String.prototype,{replaceAll:r},{replaceAll:function(){return String.prototype.replaceAll!==r}}),r}});var hp=h((MA,mp)=>{"use strict";a();s();var gh=ft(),xh=wr(),dp=ho(),vh=go(),wh=cp(),yp=gh(dp);xh(yp,{getPolyfill:vh,implementation:dp,shim:wh});mp.exports=yp});var $x={};Yt($x,{DynamicSnippetsGenerator:()=>Dt});module.exports=No($x);a();s();var lC=qf(hp(),1);a();s();a();s();a();s();function R(t){throw new Error("Unexpected value: "+JSON.stringify(t))}a();s();function Or(t){return Object.keys(t)}a();s();a();s();a();s();a();s();a();s();a();s();var bh=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,gp=bh;var Ah=typeof self=="object"&&self&&self.Object===Object&&self,Sh=gp||Ah||Function("return this")(),xp=Sh;var Th=xp.Symbol,ae=Th;a();s();var vp=Object.prototype,Eh=vp.hasOwnProperty,Rh=vp.toString,Lr=ae?ae.toStringTag:void 0;function Ph(t){var r=Eh.call(t,Lr),e=t[Lr];try{t[Lr]=void 0;var n=!0}catch(i){}var o=Rh.call(t);return n&&(r?t[Lr]=e:delete t[Lr]),o}var wp=Ph;a();s();var Ih=Object.prototype,Nh=Ih.toString;function Ch(t){return Nh.call(t)}var bp=Ch;var Fh="[object Null]",Oh="[object Undefined]",Ap=ae?ae.toStringTag:void 0;function Lh(t){return t==null?t===void 0?Oh:Fh:Ap&&Ap in Object(t)?wp(t):bp(t)}var Sp=Lh;a();s();function Bh(t){return t!=null&&typeof t=="object"}var Tp=Bh;var Uh="[object Symbol]";function qh(t){return typeof t=="symbol"||Tp(t)&&Sp(t)==Uh}var Ep=qh;a();s();a();s();function $h(t,r){for(var e=-1,n=t==null?0:t.length,o=Array(n);++e<n;)o[e]=r(t[e],e,t);return o}var Rp=$h;a();s();var kh=Array.isArray,Pp=kh;var _h=1/0,Ip=ae?ae.prototype:void 0,Np=Ip?Ip.toString:void 0;function Cp(t){if(typeof t=="string")return t;if(Pp(t))return Rp(t,Cp)+"";if(Ep(t))return Np?Np.call(t):"";var r=t+"";return r=="0"&&1/t==-_h?"-0":r}var Fp=Cp;a();s();function Mh(t){return t==null?"":Fp(t)}var xe=Mh;a();s();a();s();a();s();a();s();a();s();a();s();function Dh(t,r,e){var n=-1,o=t.length;r<0&&(r=-r>o?0:o+r),e=e>o?o:e,e<0&&(e+=o),o=r>e?0:e-r>>>0,r>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+r];return i}var Op=Dh;function Wh(t,r,e){var n=t.length;return e=e===void 0?n:e,!r&&e>=n?t:Op(t,r,e)}var Lp=Wh;a();s();var jh="\\ud800-\\udfff",Gh="\\u0300-\\u036f",Vh="\\ufe20-\\ufe2f",zh="\\u20d0-\\u20ff",Yh=Gh+Vh+zh,Hh="\\ufe0e\\ufe0f",Jh="\\u200d",Kh=RegExp("["+Jh+jh+Yh+Hh+"]");function Zh(t){return Kh.test(t)}var Lt=Zh;a();s();a();s();function Qh(t){return t.split("")}var Bp=Qh;a();s();var Up="\\ud800-\\udfff",Xh="\\u0300-\\u036f",eg="\\ufe20-\\ufe2f",rg="\\u20d0-\\u20ff",tg=Xh+eg+rg,ng="\\ufe0e\\ufe0f",og="["+Up+"]",xo="["+tg+"]",vo="\\ud83c[\\udffb-\\udfff]",ig="(?:"+xo+"|"+vo+")",qp="[^"+Up+"]",$p="(?:\\ud83c[\\udde6-\\uddff]){2}",kp="[\\ud800-\\udbff][\\udc00-\\udfff]",ag="\\u200d",_p=ig+"?",Mp="["+ng+"]?",sg="(?:"+ag+"(?:"+[qp,$p,kp].join("|")+")"+Mp+_p+")*",ug=Mp+_p+sg,pg="(?:"+[qp+xo+"?",xo,$p,kp,og].join("|")+")",fg=RegExp(vo+"(?="+vo+")|"+pg+ug,"g");function lg(t){return t.match(fg)||[]}var Dp=lg;function cg(t){return Lt(t)?Dp(t):Bp(t)}var Wp=cg;function dg(t){return function(r){r=xe(r);var e=Lt(r)?Wp(r):void 0,n=e?e[0]:r.charAt(0),o=e?Lp(e,1).join(""):r.slice(1);return n[t]()+o}}var jp=dg;var yg=jp("toUpperCase"),ur=yg;function mg(t){return ur(xe(t).toLowerCase())}var Gp=mg;a();s();a();s();function hg(t,r,e,n){var o=-1,i=t==null?0:t.length;for(n&&i&&(e=t[++o]);++o<i;)e=r(e,t[o],o,t);return e}var Vp=hg;a();s();a();s();a();s();function gg(t){return function(r){return t==null?void 0:t[r]}}var zp=gg;var xg={\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"},vg=zp(xg),Yp=vg;var wg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bg="\\u0300-\\u036f",Ag="\\ufe20-\\ufe2f",Sg="\\u20d0-\\u20ff",Tg=bg+Ag+Sg,Eg="["+Tg+"]",Rg=RegExp(Eg,"g");function Pg(t){return t=xe(t),t&&t.replace(wg,Yp).replace(Rg,"")}var Hp=Pg;a();s();a();s();var Ig=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ng(t){return t.match(Ig)||[]}var Jp=Ng;a();s();var Cg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Fg(t){return Cg.test(t)}var Kp=Fg;a();s();var rf="\\ud800-\\udfff",Og="\\u0300-\\u036f",Lg="\\ufe20-\\ufe2f",Bg="\\u20d0-\\u20ff",Ug=Og+Lg+Bg,tf="\\u2700-\\u27bf",nf="a-z\\xdf-\\xf6\\xf8-\\xff",qg="\\xac\\xb1\\xd7\\xf7",$g="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kg="\\u2000-\\u206f",_g=" \\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",of="A-Z\\xc0-\\xd6\\xd8-\\xde",Mg="\\ufe0e\\ufe0f",af=qg+$g+kg+_g,sf="['\u2019]",Zp="["+af+"]",Dg="["+Ug+"]",uf="\\d+",Wg="["+tf+"]",pf="["+nf+"]",ff="[^"+rf+af+uf+tf+nf+of+"]",jg="\\ud83c[\\udffb-\\udfff]",Gg="(?:"+Dg+"|"+jg+")",Vg="[^"+rf+"]",lf="(?:\\ud83c[\\udde6-\\uddff]){2}",cf="[\\ud800-\\udbff][\\udc00-\\udfff]",pr="["+of+"]",zg="\\u200d",Qp="(?:"+pf+"|"+ff+")",Yg="(?:"+pr+"|"+ff+")",Xp="(?:"+sf+"(?:d|ll|m|re|s|t|ve))?",ef="(?:"+sf+"(?:D|LL|M|RE|S|T|VE))?",df=Gg+"?",yf="["+Mg+"]?",Hg="(?:"+zg+"(?:"+[Vg,lf,cf].join("|")+")"+yf+df+")*",Jg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Zg=yf+df+Hg,Qg="(?:"+[Wg,lf,cf].join("|")+")"+Zg,Xg=RegExp([pr+"?"+pf+"+"+Xp+"(?="+[Zp,pr,"$"].join("|")+")",Yg+"+"+ef+"(?="+[Zp,pr+Qp,"$"].join("|")+")",pr+"?"+Qp+"+"+Xp,pr+"+"+ef,Kg,Jg,uf,Qg].join("|"),"g");function ex(t){return t.match(Xg)||[]}var mf=ex;function rx(t,r,e){return t=xe(t),r=e?void 0:r,r===void 0?Kp(t)?mf(t):Jp(t):t.match(r)||[]}var hf=rx;var tx="['\u2019]",nx=RegExp(tx,"g");function ox(t){return function(r){return Vp(hf(Hp(r).replace(nx,"")),t,"")}}var gf=ox;var ix=gf(function(t,r,e){return r=r.toLowerCase(),t+(e?Gp(r):r)}),Bt=ix;a();s();a();s();var se=class{};a();s();a();s();var J=class extends se{constructor(e){super();d(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var ax=4,Br=class{constructor(){d(this,"buffer","");d(this,"indentLevel",0);d(this,"hasWrittenAnything",!1);d(this,"lastCharacterIsNewline",!1)}write(r){let e=r.length>0&&r.endsWith(`
14
- `),n=e?r.substring(0,r.length-1):r,o=this.getIndentString(),i=n.replaceAll(`
1
+ "use strict";var rt=Object.defineProperty,go=Object.defineProperties,wo=Object.getOwnPropertyDescriptor,vo=Object.getOwnPropertyDescriptors,To=Object.getOwnPropertyNames,tt=Object.getOwnPropertySymbols;var jt=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable;var $t=(r,t,e)=>t in r?rt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ne=(r,t)=>{for(var e in t||(t={}))jt.call(t,e)&&$t(r,e,t[e]);if(tt)for(var e of tt(t))ur.call(t,e)&&$t(r,e,t[e]);return r},Le=(r,t)=>go(r,vo(t));var pr=r=>typeof r=="symbol"?r:r+"",lr=(r,t)=>{var e={};for(var n in r)jt.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&tt)for(var n of tt(r))t.indexOf(n)<0&&ur.call(r,n)&&(e[n]=r[n]);return e};var qt=(r,t)=>()=>(r&&(t=r(r=0)),t);var cr=(r,t)=>{for(var e in t)rt(r,e,{get:t[e],enumerable:!0})},bo=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of To(t))!jt.call(r,i)&&i!==e&&rt(r,i,{get:()=>t[i],enumerable:!(n=wo(t,i))||n.enumerable});return r};var Ao=r=>bo(rt({},"__esModule",{value:!0}),r);var c=(r,t,e)=>$t(r,typeof t!="symbol"?t+"":t,e);function dr(){throw new Error("setTimeout has not been defined")}function hr(){throw new Error("clearTimeout has not been defined")}function yr(r){if(ie===setTimeout)return setTimeout(r,0);if((ie===dr||!ie)&&setTimeout)return ie=setTimeout,setTimeout(r,0);try{return ie(r,0)}catch(t){try{return ie.call(null,r,0)}catch(e){return ie.call(this,r,0)}}}function Eo(r){if(oe===clearTimeout)return clearTimeout(r);if((oe===hr||!oe)&&clearTimeout)return oe=clearTimeout,clearTimeout(r);try{return oe(r)}catch(t){try{return oe.call(null,r)}catch(e){return oe.call(this,r)}}}function Ro(){!_e||!xe||(_e=!1,xe.length?H=xe.concat(H):nt=-1,H.length&&xr())}function xr(){if(!_e){var r=yr(Ro);_e=!0;for(var t=H.length;t;){for(xe=H,H=[];++nt<t;)xe&&xe[nt].run();nt=-1,t=H.length}xe=null,_e=!1,Eo(r)}}function Co(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];H.push(new gr(r,t)),H.length===1&&!_e&&yr(xr)}function gr(r,t){this.fun=r,this.array=t}function ge(){}function Wo(r){throw new Error("process.binding is not supported")}function Vo(){return"/"}function Go(r){throw new Error("process.chdir is not supported")}function zo(){return 0}function Yo(r){var t=Ho.call(Pe)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function Jo(){var r=new Date,t=r-Ko;return t/1e3}var ie,oe,H,_e,xe,nt,Io,So,No,Lo,Po,_o,Fo,Bo,ko,Uo,Oo,Mo,Do,$o,jo,qo,Pe,Ho,Ko,p,mr,a=qt(()=>{"use strict";ie=dr,oe=hr;typeof globalThis.setTimeout=="function"&&(ie=setTimeout);typeof globalThis.clearTimeout=="function"&&(oe=clearTimeout);H=[],_e=!1,nt=-1;gr.prototype.run=function(){this.fun.apply(null,this.array)};Io="browser",So="browser",No=!0,Lo={},Po=[],_o="",Fo={},Bo={},ko={};Uo=ge,Oo=ge,Mo=ge,Do=ge,$o=ge,jo=ge,qo=ge;Pe=globalThis.performance||{},Ho=Pe.now||Pe.mozNow||Pe.msNow||Pe.oNow||Pe.webkitNow||function(){return new Date().getTime()};Ko=new Date;p={nextTick:Co,title:Io,browser:No,env:Lo,argv:Po,version:_o,versions:Fo,on:Uo,addListener:Oo,once:Mo,off:Do,removeListener:$o,removeAllListeners:jo,emit:qo,binding:Wo,cwd:Vo,chdir:Go,umask:zo,hrtime:Yo,platform:So,release:Bo,config:ko,uptime:Jo},mr={};Object.keys(mr).forEach(r=>{let t=r.split("."),e=p;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=mr[r]:e=e[i]||(e[i]={})}})});function br(){Vt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)j[t]=r[t],_[r.charCodeAt(t)]=t;_[45]=62,_[95]=63}function Qo(r){Vt||br();var t,e,n,i,o,f,l=r.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[l-2]==="="?2:r[l-1]==="="?1:0,f=new Zo(l*3/4-o),n=o>0?l-4:l;var m=0;for(t=0,e=0;t<n;t+=4,e+=3)i=_[r.charCodeAt(t)]<<18|_[r.charCodeAt(t+1)]<<12|_[r.charCodeAt(t+2)]<<6|_[r.charCodeAt(t+3)],f[m++]=i>>16&255,f[m++]=i>>8&255,f[m++]=i&255;return o===2?(i=_[r.charCodeAt(t)]<<2|_[r.charCodeAt(t+1)]>>4,f[m++]=i&255):o===1&&(i=_[r.charCodeAt(t)]<<10|_[r.charCodeAt(t+1)]<<4|_[r.charCodeAt(t+2)]>>2,f[m++]=i>>8&255,f[m++]=i&255),f}function Xo(r){return j[r>>18&63]+j[r>>12&63]+j[r>>6&63]+j[r&63]}function ea(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16)+(r[o+1]<<8)+r[o+2],i.push(Xo(n));return i.join("")}function wr(r){Vt||br();for(var t,e=r.length,n=e%3,i="",o=[],f=16383,l=0,m=e-n;l<m;l+=f)o.push(ea(r,l,l+f>m?m:l+f));return n===1?(t=r[e-1],i+=j[t>>2],i+=j[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=j[t>>10],i+=j[t>>4&63],i+=j[t<<2&63],i+="="),o.push(i),o.join("")}function it(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Y(r,t){if(it()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=u.prototype):(r===null&&(r=new u(t)),r.length=t),r}function u(r,t,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Gt(this,r)}return Ar(this,r,t,e)}function Ar(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?na(r,t,e,n):typeof t=="string"?ra(r,t,e):ia(r,t)}function Er(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 ta(r,t,e,n){return Er(t),t<=0?Y(r,t):e!==void 0?typeof n=="string"?Y(r,t).fill(e,n):Y(r,t).fill(e):Y(r,t)}function Gt(r,t){if(Er(t),r=Y(r,t<0?0:zt(t)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function ra(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Rr(t,e)|0;r=Y(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function Wt(r,t){var e=t.length<0?0:zt(t.length)|0;r=Y(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function na(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),u.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=u.prototype):r=Wt(r,t),r}function ia(r,t){if(q(t)){var e=zt(t.length)|0;return r=Y(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Aa(t.length)?Y(r,0):Wt(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Wt(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function zt(r){if(r>=it())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+it().toString(16)+" bytes");return r|0}function q(r){return!!(r!=null&&r._isBuffer)}function Rr(r,t){if(q(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return ot(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return _r(r).length;default:if(n)return ot(r).length;t=(""+t).toLowerCase(),n=!0}}function oa(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return ha(this,t,e);case"utf8":case"utf-8":return Sr(this,t,e);case"ascii":return ma(this,t,e);case"latin1":case"binary":return da(this,t,e);case"base64":return la(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ya(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function we(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function Cr(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=u.from(t,n)),q(t))return t.length===0?-1:vr(r,t,e,n,i);if(typeof t=="number")return t=t&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):vr(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function vr(r,t,e,n,i){var o=1,f=r.length,l=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,f/=2,l/=2,e/=2}function m(T,b){return o===1?T[b]:T.readUInt16BE(b*o)}var d;if(i){var y=-1;for(d=e;d<f;d++)if(m(r,d)===m(t,y===-1?0:d-y)){if(y===-1&&(y=d),d-y+1===l)return y*o}else y!==-1&&(d-=d-y),y=-1}else for(e+l>f&&(e=f-l),d=e;d>=0;d--){for(var x=!0,g=0;g<l;g++)if(m(r,d+g)!==m(t,g)){x=!1;break}if(x)return d}return-1}function aa(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var f=0;f<n;++f){var l=parseInt(t.substr(f*2,2),16);if(isNaN(l))return f;r[e+f]=l}return f}function sa(r,t,e,n){return ft(ot(t,r.length-e),r,e,n)}function Ir(r,t,e,n){return ft(Ta(t),r,e,n)}function fa(r,t,e,n){return Ir(r,t,e,n)}function ua(r,t,e,n){return ft(_r(t),r,e,n)}function pa(r,t,e,n){return ft(ba(t,r.length-e),r,e,n)}function la(r,t,e){return t===0&&e===r.length?wr(r):wr(r.slice(t,e))}function Sr(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],f=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=e){var m,d,y,x;switch(l){case 1:o<128&&(f=o);break;case 2:m=r[i+1],(m&192)===128&&(x=(o&31)<<6|m&63,x>127&&(f=x));break;case 3:m=r[i+1],d=r[i+2],(m&192)===128&&(d&192)===128&&(x=(o&15)<<12|(m&63)<<6|d&63,x>2047&&(x<55296||x>57343)&&(f=x));break;case 4:m=r[i+1],d=r[i+2],y=r[i+3],(m&192)===128&&(d&192)===128&&(y&192)===128&&(x=(o&15)<<18|(m&63)<<12|(d&63)<<6|y&63,x>65535&&x<1114112&&(f=x))}}f===null?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|f&1023),n.push(f),i+=l}return ca(n)}function ca(r){var t=r.length;if(t<=Tr)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Tr));return e}function ma(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function da(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function ha(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=t;o<e;++o)i+=va(r[o]);return i}function ya(r,t,e){for(var n=r.slice(t,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function R(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function L(r,t,e,n,i,o){if(!q(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function at(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(r.length-e,2);i<o;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function st(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(r.length-e,4);i<o;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function Nr(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Lr(r,t,e,n,i){return i||Nr(r,t,e,4,34028234663852886e22,-34028234663852886e22),Br(r,t,e,n,23,4),e+4}function Pr(r,t,e,n,i){return i||Nr(r,t,e,8,17976931348623157e292,-17976931348623157e292),Br(r,t,e,n,52,8),e+8}function ga(r){if(r=wa(r).replace(xa,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function wa(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function va(r){return r<16?"0"+r.toString(16):r.toString(16)}function ot(r,t){t=t||1/0;for(var e,n=r.length,i=null,o=[],f=0;f<n;++f){if(e=r.charCodeAt(f),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(f+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Ta(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function ba(r,t){for(var e,n,i,o=[],f=0;f<r.length&&!((t-=2)<0);++f)e=r.charCodeAt(f),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function _r(r){return Qo(ga(r))}function ft(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function Aa(r){return r!==r}function Ea(r){return r!=null&&(!!r._isBuffer||Fr(r)||Ra(r))}function Fr(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Ra(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Fr(r.slice(0,0))}function ut(r,t,e,n,i){var o,f,l=i*8-n-1,m=(1<<l)-1,d=m>>1,y=-7,x=e?i-1:0,g=e?-1:1,T=r[t+x];for(x+=g,o=T&(1<<-y)-1,T>>=-y,y+=l;y>0;o=o*256+r[t+x],x+=g,y-=8);for(f=o&(1<<-y)-1,o>>=-y,y+=n;y>0;f=f*256+r[t+x],x+=g,y-=8);if(o===0)o=1-d;else{if(o===m)return f?NaN:(T?-1:1)*(1/0);f=f+Math.pow(2,n),o=o-d}return(T?-1:1)*f*Math.pow(2,o-n)}function Br(r,t,e,n,i,o){var f,l,m,d=o*8-i-1,y=(1<<d)-1,x=y>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=n?0:o-1,b=n?1:-1,S=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,f=y):(f=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-f))<1&&(f--,m*=2),f+x>=1?t+=g/m:t+=g*Math.pow(2,1-x),t*m>=2&&(f++,m/=2),f+x>=y?(l=0,f=y):f+x>=1?(l=(t*m-1)*Math.pow(2,i),f=f+x):(l=t*Math.pow(2,x-1)*Math.pow(2,i),f=0));i>=8;r[e+T]=l&255,T+=b,l/=256,i-=8);for(f=f<<i|l,d+=i;d>0;r[e+T]=f&255,T+=b,f/=256,d-=8);r[e+T-b]|=S*128}var j,_,Zo,Vt,Tr,xa,kr=qt(()=>{"use strict";a();s();j=[],_=[],Zo=typeof Uint8Array!="undefined"?Uint8Array:Array,Vt=!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,t,e){return Ar(null,r,t,e)};u.kMaxLength=it();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]);u.alloc=function(r,t,e){return ta(null,r,t,e)};u.allocUnsafe=function(r){return Gt(null,r)};u.allocUnsafeSlow=function(r){return Gt(null,r)};u.isBuffer=Ea;u.compare=function(t,e){if(!q(t)||!q(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,o=0,f=Math.min(n,i);o<f;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};u.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}};u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=u.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var f=t[n];if(!q(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(i,o),o+=f.length}return i};u.byteLength=Rr;u.prototype._isBuffer=!0;u.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)we(this,e,e+1);return this};u.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)we(this,e,e+3),we(this,e+1,e+2);return this};u.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)we(this,e,e+7),we(this,e+1,e+6),we(this,e+2,e+5),we(this,e+3,e+4);return this};u.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?Sr(this,0,t):oa.apply(this,arguments)};u.prototype.equals=function(t){if(!q(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.compare=function(t,e,n,i,o){if(!q(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var f=o-i,l=n-e,m=Math.min(f,l),d=this.slice(i,o),y=t.slice(e,n),x=0;x<m;++x)if(d[x]!==y[x]){f=d[x],l=y[x];break}return f<l?-1:l<f?1:0};u.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};u.prototype.indexOf=function(t,e,n){return Cr(this,t,e,n,!0)};u.prototype.lastIndexOf=function(t,e,n){return Cr(this,t,e,n,!1)};u.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return aa(this,t,e,n);case"utf8":case"utf-8":return sa(this,t,e,n);case"ascii":return Ir(this,t,e,n);case"latin1":case"binary":return fa(this,t,e,n);case"base64":return ua(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pa(this,t,e,n);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Tr=4096;u.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=u.prototype;else{var o=e-t;i=new u(o,void 0);for(var f=0;f<o;++f)i[f]=this[f+t]}return i};u.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t],o=1,f=0;++f<e&&(o*=256);)i+=this[t+f]*o;return i};u.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};u.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]};u.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t],o=1,f=0;++f<e&&(o*=256);)i+=this[t+f]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=e,o=1,f=this[t+--i];i>0&&(o*=256);)f+=this[t+--i]*o;return o*=128,f>=o&&(f-=Math.pow(2,8*e)),f};u.prototype.readInt8=function(t,e){return e||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),ut(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),ut(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),ut(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),ut(this,t,!1,52,8)};u.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;L(this,t,e,n,o,0)}var f=1,l=0;for(this[e]=t&255;++l<n&&(f*=256);)this[e+l]=t/f&255;return e+n};u.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;L(this,t,e,n,o,0)}var f=n-1,l=1;for(this[e+f]=t&255;--f>=0&&(l*=256);)this[e+f]=t/l&255;return e+n};u.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):at(this,t,e,!0),e+2};u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):at(this,t,e,!1),e+2};u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):st(this,t,e,!0),e+4};u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):st(this,t,e,!1),e+4};u.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);L(this,t,e,n,o-1,-o)}var f=0,l=1,m=0;for(this[e]=t&255;++f<n&&(l*=256);)t<0&&m===0&&this[e+f-1]!==0&&(m=1),this[e+f]=(t/l>>0)-m&255;return e+n};u.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);L(this,t,e,n,o-1,-o)}var f=n-1,l=1,m=0;for(this[e+f]=t&255;--f>=0&&(l*=256);)t<0&&m===0&&this[e+f+1]!==0&&(m=1),this[e+f]=(t/l>>0)-m&255;return e+n};u.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};u.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):at(this,t,e,!0),e+2};u.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):at(this,t,e,!1),e+2};u.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):st(this,t,e,!0),e+4};u.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):st(this,t,e,!1),e+4};u.prototype.writeFloatLE=function(t,e,n){return Lr(this,t,e,!0,n)};u.prototype.writeFloatBE=function(t,e,n){return Lr(this,t,e,!1,n)};u.prototype.writeDoubleLE=function(t,e,n){return Pr(this,t,e,!0,n)};u.prototype.writeDoubleBE=function(t,e,n){return Pr(this,t,e,!1,n)};u.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var o=i-n,f;if(this===t&&n<e&&e<i)for(f=o-1;f>=0;--f)t[f+e]=this[f+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(f=0;f<o;++f)t[f+e]=this[f+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o};u.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var f;if(typeof t=="number")for(f=e;f<n;++f)this[f]=t;else{var l=q(t)?t:ot(new u(t,i).toString()),m=l.length;for(f=0;f<n-e;++f)this[f+e]=l[f%m]}return this};xa=/[^+\/0-9A-Za-z-_]/g});var s=qt(()=>{"use strict";kr()});var ic={};cr(ic,{DynamicSnippetsGenerator:()=>Dt});module.exports=Ao(ic);a();s();a();s();a();s();a();s();function A(r){throw new Error("Unexpected value: "+JSON.stringify(r))}a();s();a();s();a();s();a();s();a();s();a();s();var Ca=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,pt=Ca;var Ia=typeof self=="object"&&self&&self.Object===Object&&self,Sa=pt||Ia||Function("return this")(),C=Sa;var Na=C.Symbol,F=Na;a();s();var Ur=Object.prototype,La=Ur.hasOwnProperty,Pa=Ur.toString,je=F?F.toStringTag:void 0;function _a(r){var t=La.call(r,je),e=r[je];try{r[je]=void 0;var n=!0}catch(o){}var i=Pa.call(r);return n&&(t?r[je]=e:delete r[je]),i}var Or=_a;a();s();var Fa=Object.prototype,Ba=Fa.toString;function ka(r){return Ba.call(r)}var Mr=ka;var Ua="[object Null]",Oa="[object Undefined]",Dr=F?F.toStringTag:void 0;function Ma(r){return r==null?r===void 0?Oa:Ua:Dr&&Dr in Object(r)?Or(r):Mr(r)}var k=Ma;a();s();function Da(r){return r!=null&&typeof r=="object"}var U=Da;var $a="[object Symbol]";function ja(r){return typeof r=="symbol"||U(r)&&k(r)==$a}var $r=ja;a();s();a();s();function qa(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i}var jr=qa;a();s();var Wa=Array.isArray,K=Wa;var Va=1/0,qr=F?F.prototype:void 0,Wr=qr?qr.toString:void 0;function Vr(r){if(typeof r=="string")return r;if(K(r))return jr(r,Vr)+"";if($r(r))return Wr?Wr.call(r):"";var t=r+"";return t=="0"&&1/r==-Va?"-0":t}var Gr=Vr;a();s();function Ga(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var lt=Ga;a();s();a();s();a();s();a();s();var za="[object AsyncFunction]",Ha="[object Function]",Ya="[object GeneratorFunction]",Ka="[object Proxy]";function Ja(r){if(!lt(r))return!1;var t=k(r);return t==Ha||t==Ya||t==za||t==Ka}var ct=Ja;a();s();a();s();var Za=C["__core-js_shared__"],mt=Za;var zr=(function(){var r=/[^.]+$/.exec(mt&&mt.keys&&mt.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function Qa(r){return!!zr&&zr in r}var Hr=Qa;a();s();var Xa=Function.prototype,es=Xa.toString;function ts(r){if(r!=null){try{return es.call(r)}catch(t){}try{return r+""}catch(t){}}return""}var J=ts;var rs=/[\\^$.*+?()[\]{}|]/g,ns=/^\[object .+?Constructor\]$/,is=Function.prototype,os=Object.prototype,as=is.toString,ss=os.hasOwnProperty,fs=RegExp("^"+as.call(ss).replace(rs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function us(r){if(!lt(r)||Hr(r))return!1;var t=ct(r)?fs:ns;return t.test(J(r))}var Yr=us;a();s();function ps(r,t){return r==null?void 0:r[t]}var Kr=ps;function ls(r,t){var e=Kr(r,t);return Yr(e)?e:void 0}var B=ls;var cs=B(C,"WeakMap"),dt=cs;a();s();function ms(){}var Jr=ms;a();s();a();s();a();s();function ds(r,t,e,n){for(var i=r.length,o=e+(n?1:-1);n?o--:++o<i;)if(t(r[o],o,r))return o;return-1}var Zr=ds;a();s();function hs(r){return r!==r}var Qr=hs;a();s();function ys(r,t,e){for(var n=e-1,i=r.length;++n<i;)if(r[n]===t)return n;return-1}var Xr=ys;function xs(r,t,e){return t===t?Xr(r,t,e):Zr(r,Qr,e)}var en=xs;function gs(r,t){var e=r==null?0:r.length;return!!e&&en(r,t,0)>-1}var tn=gs;a();s();var ws=9007199254740991,vs=/^(?:0|[1-9]\d*)$/;function Ts(r,t){var e=typeof r;return t=t==null?ws:t,!!t&&(e=="number"||e!="symbol"&&vs.test(r))&&r>-1&&r%1==0&&r<t}var rn=Ts;a();s();function bs(r,t){return r===t||r!==r&&t!==t}var ht=bs;a();s();a();s();var As=9007199254740991;function Es(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=As}var yt=Es;function Rs(r){return r!=null&&yt(r.length)&&!ct(r)}var nn=Rs;a();s();var Cs=Object.prototype;function Is(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Cs;return r===e}var on=Is;a();s();a();s();a();s();function Ss(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}var an=Ss;a();s();a();s();var Ns="[object Arguments]";function Ls(r){return U(r)&&k(r)==Ns}var Ht=Ls;var sn=Object.prototype,Ps=sn.hasOwnProperty,_s=sn.propertyIsEnumerable,Fs=Ht((function(){return arguments})())?Ht:function(r){return U(r)&&Ps.call(r,"callee")&&!_s.call(r,"callee")},fn=Fs;a();s();a();s();function Bs(){return!1}var un=Bs;var cn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,pn=cn&&typeof module=="object"&&module&&!module.nodeType&&module,ks=pn&&pn.exports===cn,ln=ks?C.Buffer:void 0,Us=ln?ln.isBuffer:void 0,Os=Us||un,qe=Os;a();s();a();s();var Ms="[object Arguments]",Ds="[object Array]",$s="[object Boolean]",js="[object Date]",qs="[object Error]",Ws="[object Function]",Vs="[object Map]",Gs="[object Number]",zs="[object Object]",Hs="[object RegExp]",Ys="[object Set]",Ks="[object String]",Js="[object WeakMap]",Zs="[object ArrayBuffer]",Qs="[object DataView]",Xs="[object Float32Array]",ef="[object Float64Array]",tf="[object Int8Array]",rf="[object Int16Array]",nf="[object Int32Array]",of="[object Uint8Array]",af="[object Uint8ClampedArray]",sf="[object Uint16Array]",ff="[object Uint32Array]",E={};E[Xs]=E[ef]=E[tf]=E[rf]=E[nf]=E[of]=E[af]=E[sf]=E[ff]=!0;E[Ms]=E[Ds]=E[Zs]=E[$s]=E[Qs]=E[js]=E[qs]=E[Ws]=E[Vs]=E[Gs]=E[zs]=E[Hs]=E[Ys]=E[Ks]=E[Js]=!1;function uf(r){return U(r)&&yt(r.length)&&!!E[k(r)]}var mn=uf;a();s();function pf(r){return function(t){return r(t)}}var dn=pf;a();s();var hn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,We=hn&&typeof module=="object"&&module&&!module.nodeType&&module,lf=We&&We.exports===hn,Yt=lf&&pt.process,cf=(function(){try{var r=We&&We.require&&We.require("util").types;return r||Yt&&Yt.binding&&Yt.binding("util")}catch(t){}})(),Kt=cf;var yn=Kt&&Kt.isTypedArray,mf=yn?dn(yn):mn,xt=mf;var df=Object.prototype,hf=df.hasOwnProperty;function yf(r,t){var e=K(r),n=!e&&fn(r),i=!e&&!n&&qe(r),o=!e&&!n&&!i&&xt(r),f=e||n||i||o,l=f?an(r.length,String):[],m=l.length;for(var d in r)(t||hf.call(r,d))&&!(f&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||rn(d,m)))&&l.push(d);return l}var xn=yf;a();s();a();s();a();s();function xf(r,t){return function(e){return r(t(e))}}var gn=xf;var gf=gn(Object.keys,Object),wn=gf;var wf=Object.prototype,vf=wf.hasOwnProperty;function Tf(r){if(!on(r))return wn(r);var t=[];for(var e in Object(r))vf.call(r,e)&&e!="constructor"&&t.push(e);return t}var vn=Tf;function bf(r){return nn(r)?xn(r):vn(r)}var Tn=bf;a();s();a();s();a();s();a();s();a();s();var Af=B(Object,"create"),Z=Af;function Ef(){this.__data__=Z?Z(null):{},this.size=0}var bn=Ef;a();s();function Rf(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var An=Rf;a();s();var Cf="__lodash_hash_undefined__",If=Object.prototype,Sf=If.hasOwnProperty;function Nf(r){var t=this.__data__;if(Z){var e=t[r];return e===Cf?void 0:e}return Sf.call(t,r)?t[r]:void 0}var En=Nf;a();s();var Lf=Object.prototype,Pf=Lf.hasOwnProperty;function _f(r){var t=this.__data__;return Z?t[r]!==void 0:Pf.call(t,r)}var Rn=_f;a();s();var Ff="__lodash_hash_undefined__";function Bf(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Z&&t===void 0?Ff:t,this}var Cn=Bf;function Fe(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Fe.prototype.clear=bn;Fe.prototype.delete=An;Fe.prototype.get=En;Fe.prototype.has=Rn;Fe.prototype.set=Cn;var Jt=Fe;a();s();a();s();function kf(){this.__data__=[],this.size=0}var In=kf;a();s();a();s();function Uf(r,t){for(var e=r.length;e--;)if(ht(r[e][0],t))return e;return-1}var ae=Uf;var Of=Array.prototype,Mf=Of.splice;function Df(r){var t=this.__data__,e=ae(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Mf.call(t,e,1),--this.size,!0}var Sn=Df;a();s();function $f(r){var t=this.__data__,e=ae(t,r);return e<0?void 0:t[e][1]}var Nn=$f;a();s();function jf(r){return ae(this.__data__,r)>-1}var Ln=jf;a();s();function qf(r,t){var e=this.__data__,n=ae(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}var Pn=qf;function Be(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Be.prototype.clear=In;Be.prototype.delete=Sn;Be.prototype.get=Nn;Be.prototype.has=Ln;Be.prototype.set=Pn;var se=Be;a();s();var Wf=B(C,"Map"),fe=Wf;function Vf(){this.size=0,this.__data__={hash:new Jt,map:new(fe||se),string:new Jt}}var _n=Vf;a();s();a();s();a();s();function Gf(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var Fn=Gf;function zf(r,t){var e=r.__data__;return Fn(t)?e[typeof t=="string"?"string":"hash"]:e.map}var ue=zf;function Hf(r){var t=ue(this,r).delete(r);return this.size-=t?1:0,t}var Bn=Hf;a();s();function Yf(r){return ue(this,r).get(r)}var kn=Yf;a();s();function Kf(r){return ue(this,r).has(r)}var Un=Kf;a();s();function Jf(r,t){var e=ue(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}var On=Jf;function ke(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ke.prototype.clear=_n;ke.prototype.delete=Bn;ke.prototype.get=kn;ke.prototype.has=Un;ke.prototype.set=On;var gt=ke;a();s();function Zf(r){return r==null?"":Gr(r)}var pe=Zf;a();s();function Qf(r,t){for(var e=-1,n=t.length,i=r.length;++e<n;)r[i+e]=t[e];return r}var Mn=Qf;a();s();a();s();a();s();a();s();a();s();a();s();function Xf(r,t,e){var n=-1,i=r.length;t<0&&(t=-t>i?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=r[n+t];return o}var Dn=Xf;function eu(r,t,e){var n=r.length;return e=e===void 0?n:e,!t&&e>=n?r:Dn(r,t,e)}var $n=eu;a();s();var tu="\\ud800-\\udfff",ru="\\u0300-\\u036f",nu="\\ufe20-\\ufe2f",iu="\\u20d0-\\u20ff",ou=ru+nu+iu,au="\\ufe0e\\ufe0f",su="\\u200d",fu=RegExp("["+su+tu+ou+au+"]");function uu(r){return fu.test(r)}var wt=uu;a();s();a();s();function pu(r){return r.split("")}var jn=pu;a();s();var qn="\\ud800-\\udfff",lu="\\u0300-\\u036f",cu="\\ufe20-\\ufe2f",mu="\\u20d0-\\u20ff",du=lu+cu+mu,hu="\\ufe0e\\ufe0f",yu="["+qn+"]",Zt="["+du+"]",Qt="\\ud83c[\\udffb-\\udfff]",xu="(?:"+Zt+"|"+Qt+")",Wn="[^"+qn+"]",Vn="(?:\\ud83c[\\udde6-\\uddff]){2}",Gn="[\\ud800-\\udbff][\\udc00-\\udfff]",gu="\\u200d",zn=xu+"?",Hn="["+hu+"]?",wu="(?:"+gu+"(?:"+[Wn,Vn,Gn].join("|")+")"+Hn+zn+")*",vu=Hn+zn+wu,Tu="(?:"+[Wn+Zt+"?",Zt,Vn,Gn,yu].join("|")+")",bu=RegExp(Qt+"(?="+Qt+")|"+Tu+vu,"g");function Au(r){return r.match(bu)||[]}var Yn=Au;function Eu(r){return wt(r)?Yn(r):jn(r)}var Kn=Eu;function Ru(r){return function(t){t=pe(t);var e=wt(t)?Kn(t):void 0,n=e?e[0]:t.charAt(0),i=e?$n(e,1).join(""):t.slice(1);return n[r]()+i}}var Jn=Ru;var Cu=Jn("toUpperCase"),Ue=Cu;function Iu(r){return Ue(pe(r).toLowerCase())}var Zn=Iu;a();s();a();s();function Su(r,t,e,n){var i=-1,o=r==null?0:r.length;for(n&&o&&(e=r[++i]);++i<o;)e=t(e,r[i],i,r);return e}var Qn=Su;a();s();a();s();a();s();function Nu(r){return function(t){return r==null?void 0:r[t]}}var Xn=Nu;var Lu={\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"},Pu=Xn(Lu),ei=Pu;var _u=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fu="\\u0300-\\u036f",Bu="\\ufe20-\\ufe2f",ku="\\u20d0-\\u20ff",Uu=Fu+Bu+ku,Ou="["+Uu+"]",Mu=RegExp(Ou,"g");function Du(r){return r=pe(r),r&&r.replace(_u,ei).replace(Mu,"")}var ti=Du;a();s();a();s();var $u=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ju(r){return r.match($u)||[]}var ri=ju;a();s();var qu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Wu(r){return qu.test(r)}var ni=Wu;a();s();var fi="\\ud800-\\udfff",Vu="\\u0300-\\u036f",Gu="\\ufe20-\\ufe2f",zu="\\u20d0-\\u20ff",Hu=Vu+Gu+zu,ui="\\u2700-\\u27bf",pi="a-z\\xdf-\\xf6\\xf8-\\xff",Yu="\\xac\\xb1\\xd7\\xf7",Ku="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ju="\\u2000-\\u206f",Zu=" \\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",li="A-Z\\xc0-\\xd6\\xd8-\\xde",Qu="\\ufe0e\\ufe0f",ci=Yu+Ku+Ju+Zu,mi="['\u2019]",ii="["+ci+"]",Xu="["+Hu+"]",di="\\d+",ep="["+ui+"]",hi="["+pi+"]",yi="[^"+fi+ci+di+ui+pi+li+"]",tp="\\ud83c[\\udffb-\\udfff]",rp="(?:"+Xu+"|"+tp+")",np="[^"+fi+"]",xi="(?:\\ud83c[\\udde6-\\uddff]){2}",gi="[\\ud800-\\udbff][\\udc00-\\udfff]",Oe="["+li+"]",ip="\\u200d",oi="(?:"+hi+"|"+yi+")",op="(?:"+Oe+"|"+yi+")",ai="(?:"+mi+"(?:d|ll|m|re|s|t|ve))?",si="(?:"+mi+"(?:D|LL|M|RE|S|T|VE))?",wi=rp+"?",vi="["+Qu+"]?",ap="(?:"+ip+"(?:"+[np,xi,gi].join("|")+")"+vi+wi+")*",sp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",up=vi+wi+ap,pp="(?:"+[ep,xi,gi].join("|")+")"+up,lp=RegExp([Oe+"?"+hi+"+"+ai+"(?="+[ii,Oe,"$"].join("|")+")",op+"+"+si+"(?="+[ii,Oe+oi,"$"].join("|")+")",Oe+"?"+oi+"+"+ai,Oe+"+"+si,fp,sp,di,pp].join("|"),"g");function cp(r){return r.match(lp)||[]}var Ti=cp;function mp(r,t,e){return r=pe(r),t=e?void 0:t,t===void 0?ni(r)?Ti(r):ri(r):r.match(t)||[]}var bi=mp;var dp="['\u2019]",hp=RegExp(dp,"g");function yp(r){return function(t){return Qn(bi(ti(t).replace(hp,"")),r,"")}}var Ai=yp;var xp=Ai(function(r,t,e){return t=t.toLowerCase(),r+(e?Zn(t):t)}),vt=xp;a();s();a();s();function gp(){this.__data__=new se,this.size=0}var Ei=gp;a();s();function wp(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}var Ri=wp;a();s();function vp(r){return this.__data__.get(r)}var Ci=vp;a();s();function Tp(r){return this.__data__.has(r)}var Ii=Tp;a();s();var bp=200;function Ap(r,t){var e=this.__data__;if(e instanceof se){var n=e.__data__;if(!fe||n.length<bp-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new gt(n)}return e.set(r,t),this.size=e.size,this}var Si=Ap;function Me(r){var t=this.__data__=new se(r);this.size=t.size}Me.prototype.clear=Ei;Me.prototype.delete=Ri;Me.prototype.get=Ci;Me.prototype.has=Ii;Me.prototype.set=Si;var Tt=Me;a();s();a();s();function Ep(r,t){for(var e=-1,n=r==null?0:r.length,i=0,o=[];++e<n;){var f=r[e];t(f,e,r)&&(o[i++]=f)}return o}var Ni=Ep;a();s();function Rp(){return[]}var Li=Rp;var Cp=Object.prototype,Ip=Cp.propertyIsEnumerable,Pi=Object.getOwnPropertySymbols,Sp=Pi?function(r){return r==null?[]:(r=Object(r),Ni(Pi(r),function(t){return Ip.call(r,t)}))}:Li,_i=Sp;a();s();a();s();function Np(r,t,e){var n=t(r);return K(r)?n:Mn(n,e(r))}var Fi=Np;function Lp(r){return Fi(r,Tn,_i)}var Xt=Lp;a();s();a();s();var Pp=B(C,"DataView"),bt=Pp;a();s();var _p=B(C,"Promise"),At=_p;a();s();var Fp=B(C,"Set"),le=Fp;var Bi="[object Map]",Bp="[object Object]",ki="[object Promise]",Ui="[object Set]",Oi="[object WeakMap]",Mi="[object DataView]",kp=J(bt),Up=J(fe),Op=J(At),Mp=J(le),Dp=J(dt),ve=k;(bt&&ve(new bt(new ArrayBuffer(1)))!=Mi||fe&&ve(new fe)!=Bi||At&&ve(At.resolve())!=ki||le&&ve(new le)!=Ui||dt&&ve(new dt)!=Oi)&&(ve=function(r){var t=k(r),e=t==Bp?r.constructor:void 0,n=e?J(e):"";if(n)switch(n){case kp:return Mi;case Up:return Bi;case Op:return ki;case Mp:return Ui;case Dp:return Oi}return t});var er=ve;a();s();var $p=C.Uint8Array,tr=$p;a();s();a();s();a();s();a();s();a();s();var jp="__lodash_hash_undefined__";function qp(r){return this.__data__.set(r,jp),this}var Di=qp;a();s();function Wp(r){return this.__data__.has(r)}var $i=Wp;function Et(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new gt;++t<e;)this.add(r[t])}Et.prototype.add=Et.prototype.push=Di;Et.prototype.has=$i;var Rt=Et;a();s();function Vp(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1}var ji=Vp;a();s();function Gp(r,t){return r.has(t)}var Ct=Gp;var zp=1,Hp=2;function Yp(r,t,e,n,i,o){var f=e&zp,l=r.length,m=t.length;if(l!=m&&!(f&&m>l))return!1;var d=o.get(r),y=o.get(t);if(d&&y)return d==t&&y==r;var x=-1,g=!0,T=e&Hp?new Rt:void 0;for(o.set(r,t),o.set(t,r);++x<l;){var b=r[x],S=t[x];if(n)var $=f?n(S,b,x,t,r,o):n(b,S,x,r,t,o);if($!==void 0){if($)continue;g=!1;break}if(T){if(!ji(t,function(he,ye){if(!Ct(T,ye)&&(b===he||i(b,he,e,n,o)))return T.push(ye)})){g=!1;break}}else if(!(b===S||i(b,S,e,n,o))){g=!1;break}}return o.delete(r),o.delete(t),g}var It=Yp;a();s();a();s();function Kp(r){var t=-1,e=Array(r.size);return r.forEach(function(n,i){e[++t]=[i,n]}),e}var qi=Kp;a();s();function Jp(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e}var De=Jp;var Zp=1,Qp=2,Xp="[object Boolean]",el="[object Date]",tl="[object Error]",rl="[object Map]",nl="[object Number]",il="[object RegExp]",ol="[object Set]",al="[object String]",sl="[object Symbol]",fl="[object ArrayBuffer]",ul="[object DataView]",Wi=F?F.prototype:void 0,rr=Wi?Wi.valueOf:void 0;function pl(r,t,e,n,i,o,f){switch(e){case ul:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case fl:return!(r.byteLength!=t.byteLength||!o(new tr(r),new tr(t)));case Xp:case el:case nl:return ht(+r,+t);case tl:return r.name==t.name&&r.message==t.message;case il:case al:return r==t+"";case rl:var l=qi;case ol:var m=n&Zp;if(l||(l=De),r.size!=t.size&&!m)return!1;var d=f.get(r);if(d)return d==t;n|=Qp,f.set(r,t);var y=It(l(r),l(t),n,i,o,f);return f.delete(r),y;case sl:if(rr)return rr.call(r)==rr.call(t)}return!1}var Vi=pl;a();s();var ll=1,cl=Object.prototype,ml=cl.hasOwnProperty;function dl(r,t,e,n,i,o){var f=e&ll,l=Xt(r),m=l.length,d=Xt(t),y=d.length;if(m!=y&&!f)return!1;for(var x=m;x--;){var g=l[x];if(!(f?g in t:ml.call(t,g)))return!1}var T=o.get(r),b=o.get(t);if(T&&b)return T==t&&b==r;var S=!0;o.set(r,t),o.set(t,r);for(var $=f;++x<m;){g=l[x];var he=r[g],ye=t[g];if(n)var fr=f?n(ye,he,g,t,r,o):n(he,ye,g,r,t,o);if(!(fr===void 0?he===ye||i(he,ye,e,n,o):fr)){S=!1;break}$||($=g=="constructor")}if(S&&!$){var Xe=r.constructor,et=t.constructor;Xe!=et&&"constructor"in r&&"constructor"in t&&!(typeof Xe=="function"&&Xe instanceof Xe&&typeof et=="function"&&et instanceof et)&&(S=!1)}return o.delete(r),o.delete(t),S}var Gi=dl;var hl=1,zi="[object Arguments]",Hi="[object Array]",St="[object Object]",yl=Object.prototype,Yi=yl.hasOwnProperty;function xl(r,t,e,n,i,o){var f=K(r),l=K(t),m=f?Hi:er(r),d=l?Hi:er(t);m=m==zi?St:m,d=d==zi?St:d;var y=m==St,x=d==St,g=m==d;if(g&&qe(r)){if(!qe(t))return!1;f=!0,y=!1}if(g&&!y)return o||(o=new Tt),f||xt(r)?It(r,t,e,n,i,o):Vi(r,t,m,e,n,i,o);if(!(e&hl)){var T=y&&Yi.call(r,"__wrapped__"),b=x&&Yi.call(t,"__wrapped__");if(T||b){var S=T?r.value():r,$=b?t.value():t;return o||(o=new Tt),i(S,$,e,n,o)}}return g?(o||(o=new Tt),Gi(r,t,e,n,i,o)):!1}var Ki=xl;function Ji(r,t,e,n,i){return r===t?!0:r==null||t==null||!U(r)&&!U(t)?r!==r&&t!==t:Ki(r,t,e,n,Ji,i)}var Zi=Ji;a();s();function gl(r,t,e){for(var n=-1,i=r==null?0:r.length;++n<i;)if(e(t,r[n]))return!0;return!1}var Qi=gl;a();s();function wl(r,t){return Zi(r,t)}var Nt=wl;a();s();a();s();var vl=1/0,Tl=le&&1/De(new le([,-0]))[1]==vl?function(r){return new le(r)}:Jr,Xi=Tl;var bl=200;function Al(r,t,e){var n=-1,i=tn,o=r.length,f=!0,l=[],m=l;if(e)f=!1,i=Qi;else if(o>=bl){var d=t?null:Xi(r);if(d)return De(d);f=!1,i=Ct,m=new Rt}else m=t?[]:l;e:for(;++n<o;){var y=r[n],x=t?t(y):y;if(y=e||y!==0?y:0,f&&x===x){for(var g=m.length;g--;)if(m[g]===x)continue e;t&&m.push(x),l.push(y)}else i(m,x,e)||(m!==l&&m.push(x),l.push(y))}return l}var eo=Al;a();s();function El(r,t){return t=typeof t=="function"?t:void 0,r&&r.length?eo(r,void 0,t):[]}var Lt=El;a();s();function Ve(r){return Object.keys(r)}a();s();a();s();a();s();var to,ro,Ge=(ro=(to=p.env.FERN_STACK_TRACK)==null?void 0:to.toLowerCase())!=null?ro:"",W=Ge!==""&&Ge!=="0"&&Ge!=="false",nr=["single","multiline","box"].includes(Ge)?Ge:"single";W&&(Error.stackTraceLimit=50);var Rl=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),Cl=new Set(["stacktrace"]);function _t({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:o=!0,filterJs:f=!0,formatFilename:l=m=>m}={}){var d;if(!W)return[];n=[...n,...Rl],e=[...e,...Cl],i=[...i,"runInteractiveTask"];let m=!1;return((d=new Error().stack)!=null?d:"").split(`
2
+ `).map(y=>{let x=y.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(x&&x.length===5){let[,g,T,b,S]=x;if(!g||!T||!b||!S)return;if(m||i.some($=>g==null?void 0:g.includes($))){m=!0;return}switch(g){case"Object.<anonymous>":g="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":g=`${g.substring(g.indexOf(".")+1)}()=> { ... }`;break}return{fn:g,path:l(T),position:`${b}:${S}`}}}).filter(y=>{var x,g;return y&&!n.some(T=>y.fn.includes(T))&&!(o&&((x=y.path)!=null&&x.startsWith("node:")))&&!(f&&((g=y.path)!=null&&g.endsWith(".js")))&&!e.some(T=>y.path.includes(T))}).slice(t,t+r)}var Pt=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:n=[],filterFunctions:i=[],stopOn:o=[],filterNode:f=!0,filterJs:l=!0,multiline:m=!1,formatFilename:d=y=>y}={}){c(this,"maxFrames");c(this,"skip");c(this,"filterPaths");c(this,"filterFunctions");c(this,"stopOn");c(this,"filterNode");c(this,"filterJs");c(this,"multiline");c(this,"formatFilename");c(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=n,this.filterFunctions=i,this.stopOn=o,this.filterNode=f,this.filterJs=l,this.multiline=m,this.formatFilename=d}tag(t){let e=this.tracking.get(t)||new Set;_t({maxFrames:this.maxFrames,skip:this.skip,filterPaths:this.filterPaths,filterFunctions:this.filterFunctions,stopOn:this.stopOn,filterNode:this.filterNode,filterJs:this.filterJs,formatFilename:this.formatFilename}).forEach(n=>e.add(n)),this.tracking.set(t,e)}trace(t){if(!W)return"";let e=this.tracking.get(t);return e?[...e].map(n=>`${this.multiline?`
3
+ `:""}${n.fn} - ${n.path}:${n.position}`).join(""):""}frames(t){let e=this.tracking.get(t);return e?[...e]:[]}free(t){this.tracking.delete(t)}clear(){this.tracking=new WeakMap}},Q;function no({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:o=!0,filterJs:f=!0,multiline:l=!1,formatFilename:m=d=>d}={}){W&&(Q!=null||(Q=new Pt({maxFrames:r,skip:t,filterPaths:e,filterFunctions:n,stopOn:i,filterNode:o,filterJs:f,multiline:l,formatFilename:m})))}function io(r){Q==null||Q.tag(r)}function ir(r){var t;return(t=Q==null?void 0:Q.frames(r))!=null?t:[]}var X=class{constructor(){io(this)}};a();s();a();s();a();s();var O=class extends X{constructor(e){super();c(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var Il=4;no({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var ze=class{constructor(){c(this,"lineBuffer",[]);c(this,"indentLevel",0);c(this,"hasWrittenAnything",!1);c(this,"lastCharacterIsSemicolon",!1);c(this,"lastCharacterIsNewline",!1);c(this,"nodeStackFrames",[])}get buffer(){return W&&this.nodeStackFrames.length>0&&this.writeInternal(`
4
+ `),this.lineBuffer.join(`
5
+ `)+(this.lastCharacterIsNewline?`
6
+ `:"")}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let n=e.length>0&&e.endsWith(`
7
+ `),i=n?e.substring(0,e.length-1):e,o=this.getIndentString(),f=i.replaceAll(`
15
8
  `,`
16
- ${o}`);this.isAtStartOfLine()&&(i=o+i),e&&(i+=`
17
- `),this.writeInternal(i)}writeNoIndent(r){let e=this.indentLevel;this.indentLevel=0,this.write(r),this.indentLevel=e}writeNode(r){r.write(this)}writeNodeOrString(r){if(typeof r=="string"){this.write(r);return}this.writeNode(r)}writeNodeStatement(r){r.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(r){new J(r).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(r,e){new J(r).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(r,e){this.dedent(),this.write("} "),new J(r).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(r){this.dedent(),this.write("} "),new J(r).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(r,e="{",n,o="}"){let i=r.filter(u=>u!==void 0).join(" ");i?this.write(`${i} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),n(),this.dedent()}finally{this.write(o!=null?o:"")}}writeLine(r=""){this.write(r),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
18
- `)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
19
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:r,delimiter:e,writeFunction:n}){if(r.length>0){let o=r[0];o!=null&&n(o);for(let i=1;i<r.length;i++){this.write(e);let u=r[i];u!=null&&n(u)}}}toString(){return this.buffer}writeInternal(r){return r.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=r.endsWith(`
20
- `)),this.buffer+=r}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*ax)}};a();s();function wo(t){return(t==null?void 0:t.name)!=null}a();s();var Ur=class extends se{constructor({condition:e,true_:n,false_:o}){super();d(this,"condition");d(this,"true_");d(this,"false_");this.condition=e,this.true_=n,this.false_=o}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};a();s();a();s();a();s();var qr=class{constructor(){d(this,"reporter");d(this,"snippet");d(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:r,snippet:e}){(this.reporter==null||this.reporter.size()>r.errors.size())&&(this.reporter=r.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:r}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${r.method} ${r.path}"`)}};var $r=class{constructor(r){d(this,"context");this.context=r}async generate(r){let e=this.context.resolveEndpointLocationOrThrow(r.endpoint);if(e.length===0)throw new Error(`No endpoints found that match "${r.endpoint.method} ${r.endpoint.path}"`);let n=new qr;for(let o of e){let i=this.context.clone(),u=this.createSnippetGenerator(i);try{let f=await u.generateSnippet({endpoint:o,request:r});if(i.errors.empty())return{snippet:f,errors:void 0};n.update({context:i,snippet:f})}catch(f){n.err==null&&(n.err=f)}}return n.getResponseOrThrow({endpoint:r.endpoint})}generateSync(r){let e=this.context.resolveEndpointLocationOrThrow(r.endpoint);if(e.length===0)throw new Error(`No endpoints found that match "${r.endpoint.method} ${r.endpoint.path}"`);let n=new qr;for(let o of e){let i=this.context.clone(),u=this.createSnippetGenerator(i);try{let f=u.generateSnippetSync({endpoint:o,request:r});if(i.errors.empty())return{snippet:f,errors:void 0};n.update({context:i,snippet:f})}catch(f){n.err==null&&(n.err=f)}}return n.getResponseOrThrow({endpoint:r.endpoint})}};a();s();a();s();a();s();var kr=class{constructor(){d(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}validate(r){return this.REFERENCE_REGEX.test(r)?{type:"valid"}:{type:"invalid"}}tryParse(r){if(this.validate(r).type==="invalid")return;let n=r.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};a();s();var A={Critical:"CRITICAL",Warning:"WARNING"},_r=class t{constructor(){d(this,"errors");d(this,"path");this.errors=[],this.path=[]}add(r){this.errors.push(Ge(je({},r),{path:[...this.path]}))}scope(r){this.path.push(r)}unscope(){this.path.pop()}getBySeverity(r){return this.errors.filter(e=>e.severity===r)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let r=new t;return r.errors=[...this.errors],r.path=[...this.path],r}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(r=>({severity:r.severity,path:r.path!=null?this.pathToStringArray(r.path):void 0,message:r.message}))}pathToStringArray(r){let e=[];for(let n of r){if(typeof n=="string"){e.push(n);continue}e[e.length-1]+=`[${n.index}]`}return e}};var Mr=class{constructor({ir:r,config:e}){d(this,"config");d(this,"errors");d(this,"_ir");d(this,"httpEndpointReferenceParser");this._ir=r,this.config=e,this.errors=new _r,this.httpEndpointReferenceParser=new kr}associateQueryParametersByWireValue({parameters:r,values:e}){let n=[];for(let[o,i]of Object.entries(e)){this.errors.scope(o);try{let u=r.find(c=>c.name.wireValue===o);if(u==null)throw this.newParameterNotRecognizedError(o);let f=this.isListTypeReference(u.typeReference)&&!Array.isArray(i)?[i]:i;n.push({name:u.name,typeReference:u.typeReference,value:f})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:r,values:e,ignoreMissingParameters:n}){let o=[];for(let[i,u]of Object.entries(e)){this.errors.scope(i);try{let f=r.find(c=>c.name.wireValue===i);if(f==null){if(n)continue;this.errors.add({severity:A.Critical,message:this.newParameterNotRecognizedError(i).message});continue}o.push({name:f.name,typeReference:f.typeReference,value:u})}finally{this.errors.unscope()}}return o}getSingleFileValue({property:r,record:e}){let n=e[r.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:A.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:r,record:e}){let n=e[r.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:A.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let o=[];for(let i of n){if(typeof i!="string"){this.errors.add({severity:A.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}o.push(i)}return o}getRecord(r){if(typeof r!="object"||Array.isArray(r)){this.errors.add({severity:A.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(r)?"array":typeof r}`});return}return r==null?{}:r}resolveNamedType({typeId:r}){let e=this._ir.types[r];if(e==null){this.errors.add({severity:A.Critical,message:`Type identified by "${r}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:r,value:e}){let n=this.getRecord(e);if(n==null)return;let o=r.discriminant.wireValue,i=n[o];if(i==null){this.errors.add({severity:A.Critical,message:this.newParameterNotRecognizedError(o).message});return}if(typeof i!="string"){this.errors.add({severity:A.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let u=r.types[i];if(u==null){this.errors.add({severity:A.Critical,message:`No type found for discriminant value "${i}"`});return}let y=n,{[o]:f}=y,c=Po(y,[Ro(o)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.discriminantValue,value:c}}resolveEndpointOrThrow(r){let e=this.httpEndpointReferenceParser.tryParse(r);if(e==null)throw new Error(`Failed to parse endpoint reference "${r}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocationOrThrow(r){let e=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:r})&&e.push(n);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${r.method} ${r.path}"`);return e}needsRequestParameter({request:r,inlinePathParameters:e,inlineFileProperties:n}){var o;return this.includePathParametersInWrappedRequest({request:r,inlinePathParameters:e})||r.queryParameters!=null&&r.queryParameters.length>0||r.headers!=null&&r.headers.length>0?!0:r.body!=null?this.includeRequestBodyInWrappedRequest({body:r.body,inlineFileProperties:n}):!((o=r.metadata)!=null&&o.onlyPathParameters)}includePathParametersInWrappedRequest({request:r,inlinePathParameters:e}){var n,o;return e&&((o=(n=r.metadata)==null?void 0:n.includePathParameters)!=null?o:!1)}isFileUploadRequestBody(r){switch(r.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:R(r)}}resolveEnvironmentName(r){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let n=e.environments.find(o=>o.id===r);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=e.environments.find(o=>o.id===r);return n==null?void 0:n.name}default:R(e)}}isSingleEnvironmentID(r){return typeof r=="string"}isMultiEnvironmentValues(r){return typeof r=="object"}validateMultiEnvironmentUrlValues(r){if(this._ir.environments==null)return this.errors.add({severity:A.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:A.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=e.environments[0];if(n==null)return this.errors.add({severity:A.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let o=new Set(Or(n.urls));for(let i of Or(r))o.has(i)&&o.delete(i);return o.size>0?(this.errors.add({severity:A.Critical,message:`The provided environments are invalid; got: [${Object.keys(r).join(", ")}], expected: [${Or(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:r}){if(typeof r!="number"){this.errors.add({severity:A.Critical,message:this.newTypeMismatchError({expected:"number",value:r}).message});return}return r}getValueAsBoolean({value:r}){if(typeof r!="boolean"){this.errors.add({severity:A.Critical,message:this.newTypeMismatchError({expected:"boolean",value:r}).message});return}return r}getValueAsString({value:r}){if(typeof r!="string"){this.errors.add({severity:A.Critical,message:this.newTypeMismatchError({expected:"string",value:r}).message});return}return r}isOptional(r){switch(r.type){case"nullable":return this.isOptional(r.value);case"optional":return!0;case"named":{let e=this.resolveNamedType({typeId:r.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}isNullable(r){switch(r.type){case"nullable":return!0;case"optional":return this.isNullable(r.value);case"named":{let e=this.resolveNamedType({typeId:r.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}newAuthMismatchError({auth:r,values:e}){return new Error(`Expected auth type ${r.type}, got ${e.type}`)}newParameterNotRecognizedError(r){return new Error(`"${r}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:r,value:e}){return new Error(`Expected ${r}, got ${typeof e}`)}includeRequestBodyInWrappedRequest({body:r,inlineFileProperties:e}){switch(r.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:r,inlineFileProperties:e});default:R(r)}}includeFileUploadBodyInWrappedRequest({fileUpload:r,inlineFileProperties:e}){return this.fileUploadHasBodyProperties({fileUpload:r})||e&&this.fileUploadHasFileProperties({fileUpload:r})}fileUploadHasBodyProperties({fileUpload:r}){return r.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:R(e)}})}fileUploadHasFileProperties({fileUpload:r}){return r.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:R(e)}})}isListTypeReference(r){return r.type==="optional"?this.isListTypeReference(r.value):r.type==="list"||r.type==="set"}parsedEndpointMatches({endpoint:r,parsedEndpoint:e}){return r.location.method===e.method&&r.location.path===e.path}};a();s();var K={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();s();a();s();a();s();var Dr="",xf="self",vf="static";var x={};Yt(x,{Access:()=>ve,Array:()=>Be,AstNode:()=>w,Attribute:()=>Ue,Class:()=>ue,ClassInstantiation:()=>Q,ClassReference:()=>O,CodeBlock:()=>B,DataClass:()=>$e,Enum:()=>ke,Field:()=>_e,Map:()=>Me,Method:()=>le,MethodInvocation:()=>fe,Parameter:()=>pe,Trait:()=>qe,Type:()=>W,TypeLiteral:()=>D,Writer:()=>Z,array:()=>yx,assignVariable:()=>Ix,attribute:()=>mx,classReference:()=>xx,class_:()=>hx,codeblock:()=>De,dataClass:()=>vx,enum_:()=>wx,field:()=>bx,instantiateClass:()=>Ef,invokeMethod:()=>Ax,map:()=>Tx,mergeArrays:()=>Fx,method:()=>Ex,parameter:()=>Rx,string:()=>Cx,ternary:()=>Px,this_:()=>Ox,throwException:()=>Sx,trait:()=>gx,variable:()=>Nx});a();s();a();s();a();s();var ve={Public:"public",PublicReadonly:"public readonly",Protected:"protected",Private:"private"};a();s();a();s();a();s();function wf(t){return{namespace:t.substring(0,t.lastIndexOf("\\")),name:t.substring(t.lastIndexOf("\\")+1)}}var Z=class extends Br{constructor({namespace:e,rootNamespace:n,customConfig:o}){super();d(this,"namespace");d(this,"rootNamespace");d(this,"customConfig");d(this,"references",{});this.namespace=e,this.rootNamespace=n,this.customConfig=o}addReference(e){var u,f;if(e.namespace==null)return;if(Object.keys(this.references).filter(c=>{let y=wf(c);return y.namespace!==e.namespace&&y.name===e.name}).length>0){e.requireFullyQualified();return}let o=e.namespace===Dr?e.name:`${e.namespace}\\${e.name}`;((f=(u=this.references)[o])!=null?f:u[o]=[]).push(e)}toString(){let e=`namespace ${this.namespace};`,n=this.stringifyImports();return n.length>0?`${e}
9
+ ${o}`);this.isAtStartOfLine()&&(f=o+f),n&&(f+=`
10
+ `),this.writeInternal(f)}else this.writeNode(e)}writeStatement(...t){this.write(...t),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){W&&this.nodeStackFrames.push(...ir(t)),t.write(this),W&&nr!=="single"&&this.writeInternal(`
11
+ `)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){this.writeNode(t),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new O(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new O(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new O(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new O(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new O(t).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(t=!0){this.dedent(),this.writeNewLineIfLastLineNot(),t?this.writeLine("}"):this.write("}")}writeLine(...t){this.write(...t.length===0?[""]:t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
12
+ `)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
13
+ `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let o=1;o<t.length;o++){this.write(e);let f=t[o];f!=null&&n(f)}}}toString(){return this.buffer}writeInternal(t){if(t.length===0)return;let e=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
14
+ `),this.lastCharacterIsSemicolon=t.endsWith(";");let n=t.split(`
15
+ `),i=W&&!this.shouldSkipTracking(n)&&this.lastCharacterIsNewline;e&&(this.lastLine=`${this.lastLine}${n.shift()||""}`),this.lastCharacterIsNewline&&n.pop(),this.lineBuffer.push(...n),i&&this.appendTrackingComment()}set lastLine(t){this.lineBuffer.length>0?this.lineBuffer[this.lineBuffer.length-1]=t:this.lineBuffer.push(t)}get lastLine(){return this.lineBuffer[this.lineBuffer.length-1]||""}shouldSkipTracking(t){return!1}formatStack(t,e=""){return t.map(n=>`${e?`(${e}) `:""} ${n.fn} - ${n.path} : ${n.position}`)}filterStack(t){return t.filter(e=>!e.fn.startsWith(`${this.constructor.name}.`))}appendTrackingComment(){let t=[...this.formatStack(this.filterStack(_t({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,nr){case"single":return this.singleLineTrackingComment(t);case"multiline":return this.multiLineTrackingComment(t);case"box":return this.boxTrackingComment(t)}}singleLineTrackingComment(t){this.lastLine=`${this.lastLine} // ${t.join(" ")}`}multiLineTrackingComment(t){this.lineBuffer.push(...t.map(e=>` // ${e}`))}boxTrackingComment(t){this.lineBuffer.push("/*",...t.map(e=>` ${e}`),"*/")}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return Il}};a();s();function or(r){return(r==null?void 0:r.name)!=null&&(r==null?void 0:r.assignment)!=null}a();s();var He=class extends X{constructor({condition:e,true_:n,false_:i}){super();c(this,"condition");c(this,"true_");c(this,"false_");this.condition=e,this.true_=n,this.false_=i}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};a();s();a();s();a();s();var Ye=class{constructor(){c(this,"reporter");c(this,"snippet");c(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:t,snippet:e}){this.shouldUpdate({snippet:e,reporter:t.errors})&&(this.reporter=t.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:t}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${t.method} ${t.path}"`)}shouldUpdate({snippet:t,reporter:e}){var n,i;return this.reporter==null||this.reporter.size()>0&&e.size()===0?!0:t.length>((i=(n=this.snippet)==null?void 0:n.length)!=null?i:0)}};var Ke=class{constructor(t){c(this,"context");this.context=t}async generate(t,e={}){let n=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new Ye;for(let o of n){let f=this.context.clone(),l=this.createSnippetGenerator(f);try{let m=await l.generateSnippet({endpoint:o,request:t,options:e});if(f.errors.empty())return{snippet:m,errors:void 0};i.update({context:f,snippet:m})}catch(m){i.err==null&&(i.err=m)}}return i.getResponseOrThrow({endpoint:t.endpoint})}generateSync(t,e={}){let n=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new Ye;for(let o of n){let f=this.context.clone(),l=this.createSnippetGenerator(f);try{let m=l.generateSnippetSync({endpoint:o,request:t,options:e});if(f.errors.empty())return{snippet:m,errors:void 0};i.update({context:f,snippet:m})}catch(m){i.err==null&&(i.err=m)}}return i.getResponseOrThrow({endpoint:t.endpoint})}};a();s();a();s();a();s();var Je=class{constructor(){c(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let n=t.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};a();s();var v={Critical:"CRITICAL",Warning:"WARNING"},Ze=class r{constructor(){c(this,"errors");c(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(Le(Ne({},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 r;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 n of t){if(typeof n=="string"){e.push(n);continue}e[e.length-1]+=`[${n.index}]`}return e}};var Qe=class{constructor({ir:t,config:e,options:n={}}){c(this,"config");c(this,"options");c(this,"errors");c(this,"_ir");c(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=n,this.errors=new Ze,this.httpEndpointReferenceParser=new Je}associateQueryParametersByWireValue({parameters:t,values:e}){let n=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let f=t.find(m=>m.name.wireValue===i);if(f==null)throw this.newParameterNotRecognizedError(i);let l=this.isListTypeReference(f.typeReference)&&!Array.isArray(o)?[o]:o;n.push({name:f.name,typeReference:f.typeReference,value:l})}finally{this.errors.unscope()}}return n}associateByWireValueOrDefault({parameters:t,values:e}){let n=[];for(let i of t){this.errors.scope(i.name.wireValue);try{let o=e[i.name.wireValue];if(o==null)if(i.typeReference.type==="primitive"&&i.typeReference.value==="STRING")o=`<${i.name.wireValue}>`;else{this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(i.name.wireValue).message});continue}n.push({name:i.name,typeReference:i.typeReference,value:o})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:n}){let i=[];for(let[o,f]of Object.entries(e)){this.errors.scope(o);try{let l=t.find(m=>m.name.wireValue===o);if(l==null){if(n)continue;this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:l.name,typeReference:l.typeReference,value:f})}finally{this.errors.unscope()}}return i}getExampleObjectProperties({parameters:t,snippetObject:e}){let n=typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{},i=[];for(let o of t){let f=n[o.name.wireValue];f==null?o.typeReference.type==="nullable"&&i.push({name:o.name,typeReference:o.typeReference,value:null}):i.push({name:o.name,typeReference:o.typeReference,value:f})}return i}getSingleFileValue({property:t,record:e}){let n=e[t.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:v.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:t,record:e}){let n=e[t.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let i=[];for(let o of n){if(typeof o!="string"){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity: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 n=this.getRecord(e);if(n==null)return;let i=t.discriminant.wireValue,o=n[i];if(o==null){this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:v.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let f=t.types[o];if(f==null){this.errors.add({severity:v.Critical,message:`No type found for discriminant value "${o}"`});return}let d=n,{[i]:l}=d,m=lr(d,[pr(i)]);return{singleDiscriminatedUnionType:f,discriminantValue:f.discriminantValue,value:m}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocation(t){let e=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:t})&&e.push(n);return e}resolveEndpointLocationOrThrow(t){let e=this.resolveEndpointLocation(t);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`);return e}needsRequestParameter({request:t,inlinePathParameters:e,inlineFileProperties:n}){var i;return this.includePathParametersInWrappedRequest({request:t,inlinePathParameters:e})||t.queryParameters!=null&&t.queryParameters.length>0||t.headers!=null&&t.headers.length>0?!0:t.body!=null?this.includeRequestBodyInWrappedRequest({body:t.body,inlineFileProperties:n}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var n,i;return e&&((i=(n=t.metadata)==null?void 0:n.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:A(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}default:A(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 n=e.environments[0];if(n==null)return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(Ve(n.urls));for(let o of Ve(t))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:v.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${Ve(n.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:A(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:A(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:A(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}};a();s();var V={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();s();a();s();a();s();var oo="self",ao="static";a();s();var so=new Set(["abstract","and","array","as","break","callable","case","catch","class","clone","const","continue","declare","default","die","do","echo","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","eval","exit","extends","final","finally","fn","for","foreach","function","global","goto","if","implements","include","include_once","instanceof","insteadof","interface","isset","list","match","namespace","new","or","print","private","protected","public","readonly","require","require_once","return","static","switch","throw","trait","try","unset","use","var","while","xor","yield","yield_from","__halt_compiler"]);var h={};cr(h,{Access:()=>ce,Array:()=>Te,AstNode:()=>w,Attribute:()=>be,Class:()=>ee,ClassInstantiation:()=>z,ClassReference:()=>I,CodeBlock:()=>N,DataClass:()=>Ae,Enum:()=>Ee,Field:()=>Re,Map:()=>Ce,Method:()=>ne,MethodInvocation:()=>re,Parameter:()=>te,Trait:()=>Ie,Type:()=>D,TypeLiteral:()=>M,Writer:()=>G,array:()=>kl,assignVariable:()=>Kl,attribute:()=>Ul,classReference:()=>Dl,class_:()=>Ol,codeblock:()=>Se,dataClass:()=>$l,enum_:()=>jl,escapePhpString:()=>ar,field:()=>ql,instantiateClass:()=>ho,invokeMethod:()=>Wl,map:()=>Gl,mergeArrays:()=>Ql,method:()=>zl,parameter:()=>Hl,string:()=>Zl,ternary:()=>Yl,this_:()=>Xl,throwException:()=>Vl,trait:()=>Ml,variable:()=>Jl});a();s();a();s();a();s();var ce={Public:"public",PublicReadonly:"public readonly",Protected:"protected",Private:"private"};a();s();a();s();a();s();function fo(r){return{namespace:r.substring(0,r.lastIndexOf("\\")),name:r.substring(r.lastIndexOf("\\")+1)}}var G=class extends ze{constructor({namespace:e,rootNamespace:n,customConfig:i}){super();c(this,"namespace");c(this,"rootNamespace");c(this,"customConfig");c(this,"references",{});this.namespace=e,this.rootNamespace=n,this.customConfig=i}addReference(e){var f,l;if(e.namespace==null)return;if(Object.keys(this.references).filter(m=>{let d=fo(m);return d.namespace!==e.namespace&&d.name===e.name}).length>0){e.requireFullyQualified();return}let i=e.namespace===""?e.name:`${e.namespace}\\${e.name}`;((l=(f=this.references)[i])!=null?l:f[i]=[]).push(e)}toString(e=!1){if(e)return this.buffer;let n=`namespace ${this.namespace};`,i=this.stringifyImports();return i.length>0?`${n}
21
16
 
22
- ${n}
17
+ ${i}
23
18
 
24
- ${this.buffer}`:e+`
19
+ ${this.buffer}`:n+`
25
20
 
26
- `+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(n=>wf(n).namespace!==this.namespace).map(n=>`use ${n};`).join(`
27
- `)}};var w=class extends se{toString(r){if(r==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:n,customConfig:o}=r,i=new Z({namespace:e,rootNamespace:n,customConfig:o});return this.write(i),i.toString()}async toStringAsync({namespace:r,rootNamespace:e,customConfig:n}){let o=new Z({namespace:r,rootNamespace:e,customConfig:n});return this.write(o),o.toString()}};var Be=class extends w{constructor({entries:e}){super();d(this,"entries");this.entries=e!=null?e:[]}write(e){e.write("["),this.entries.forEach((n,o)=>{o>0&&e.write(", "),n.write(e)}),e.write("]")}};a();s();var Ue=class extends w{constructor(e){var n;super();d(this,"reference");d(this,"arguments");this.reference=e.reference,this.arguments=(n=e.arguments)!=null?n:[]}write(e){e.addReference(this.reference),e.write(`${this.reference.name}`),this.arguments.length>0&&(e.write("("),this.arguments.forEach((n,o)=>{o>0&&e.write(","),typeof n=="string"?e.write(n):n.write(e)}),e.write(")"))}};a();s();a();s();var O=class extends w{constructor({name:e,namespace:n,generics:o}){super();d(this,"name");d(this,"namespace");d(this,"generics");d(this,"fullyQualified");this.name=e,this.namespace=n,this.generics=o,this.fullyQualified=!1}requireFullyQualified(){this.fullyQualified=!0}write(e){e.addReference(this);let n=this.fullyQualified?`\\${this.namespace}\\${this.name}`:this.name;e.write(`${n}`)}};a();s();a();s();function we(t){return t.startsWith("$")?t:`$${t}`}var k=class extends w{constructor({docs:e}={}){super();d(this,"docs");d(this,"tags",[]);this.docs=e}addTag(e){this.tags.push(Ge(je({},e),{name:e.name!=null?we(e.name):void 0}))}write(e){e.writeLine("/**"),this.docs!=null&&(this.docs.split(`
28
- `).forEach(n=>{e.writeLine(` * ${n}`)}),this.tags.length>0&&e.writeLine(" *"));for(let n of this.tags)this.writeTag({writer:e,tag:n});e.writeLine(" */")}writeTag({writer:e,tag:n}){let o=n.docs!=null?n.docs.split(`
29
- `):void 0;o!=null&&o.length>1&&(o.forEach(i=>{e.writeLine(` * ${i}`)}),e.writeLine(" *")),e.write(` * @${n.tagType} `),n.type.write(e,{comment:!0}),n.name!=null&&e.write(` ${n.name}`),o!=null&&o.length===1&&e.write(` ${o[0]}`),e.newLine()}};a();s();function be(t){return sx(t,[ve.Public,ve.PublicReadonly,ve.Protected,ve.Private])}function sx(t,r){return r.reduce((e,n)=>[...e,...t.filter(o=>o.access===n)],[])}var ue=class extends w{constructor({name:e,namespace:n,abstract:o,docs:i,parentClassReference:u,traits:f}){super();d(this,"name");d(this,"namespace");d(this,"abstract");d(this,"docs");d(this,"parentClassReference");d(this,"traits");d(this,"fields",[]);d(this,"methods",[]);d(this,"constructor_");this.name=e,this.namespace=n,this.abstract=o!=null?o:!1,this.docs=i,this.parentClassReference=u,this.traits=f!=null?f:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addMethods(e){this.methods.push(...e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new O({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((n,o)=>{o>0&&e.write(","),e.writeNode(n)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:be(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:be(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new k({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:n}){var o;this.writeConstructorComment({writer:e,constructor:n}),n.access!=null&&e.write(`${n.access} `),e.write("function __construct("),e.indent(),n.parameters.forEach((i,u)=>{u===0&&e.newLine(),i.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(o=n.body)==null||o.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:n}){if(n.parameters.length===0)return;let o=new k;for(let i of n.parameters)o.addTag(i.getCommentTag());o.write(e)}writeFields({writer:e,fields:n}){n.filter(o=>!o.inherited).forEach((o,i)=>{i>0&&e.newLine(),o.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:n}){n.forEach((o,i)=>{i>0&&e.newLine(),o.write(e),e.writeNewLineIfLastLineNot()})}};a();s();var qe=class extends w{constructor({name:e,namespace:n,docs:o,traits:i}){super();d(this,"name");d(this,"namespace");d(this,"docs");d(this,"traits");d(this,"fields",[]);d(this,"methods",[]);this.name=e,this.namespace=n,this.docs=o,this.traits=i!=null?i:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((n,o)=>{o>0&&e.write(","),e.writeNode(n)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:be(this.fields)}),this.fields.length>0&&this.methods.length>0&&e.newLine(),this.writeMethods({writer:e,methods:be(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){let n=new k({docs:this.docs});for(let o of this.fields)n.addTag({tagType:"property",type:o.type,name:o.name});n.write(e)}writeFields({writer:e,fields:n}){n.forEach((o,i)=>{i>0&&e.newLine(),o.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:n}){n.forEach((o,i)=>{i>0&&e.newLine(),o.write(e),e.writeNewLineIfLastLineNot()})}};a();s();a();s();function fr({writer:t,arguments_:r,multiline:e}){if(r.length===0){t.write("()");return}if(e){ux({writer:t,arguments_:r});return}px({writer:t,arguments_:r})}function ux({writer:t,arguments_:r}){t.writeLine("("),t.indent();for(let e of r)bf({writer:t,argument:e,writeCompact:!1}),t.writeLine(",");t.dedent(),t.write(")")}function px({writer:t,arguments_:r}){t.write("("),r.forEach((e,n)=>{n>0&&t.write(", "),bf({writer:t,argument:e,writeCompact:!0})}),t.write(")")}function bf({writer:t,argument:r,writeCompact:e}){wo(r)?(r.docs&&(e?t.write(`/* ${r.docs} */ `):t.writeLine(`/* ${r.docs} */`)),t.write(`${r.name}: `),t.writeNodeOrString(r.assignment)):r.write(t)}var Q=class extends w{constructor({classReference:e,arguments_:n,multiline:o}){super();d(this,"classReference");d(this,"arguments_");d(this,"multiline");this.classReference=e,this.arguments_=n,this.multiline=o!=null?o:!1}write(e){e.write("new "),e.writeNode(this.classReference),fr({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};a();s();var B=class extends w{constructor(e){super();d(this,"arg");this.arg=e}write(e){return new J(this.arg).write(e)}};a();s();a();s();var pe=class extends w{constructor({name:e,type:n,docs:o,initializer:i,access:u,readonly_:f}){super();d(this,"name");d(this,"type");d(this,"docs");d(this,"initializer");d(this,"access");d(this,"readonly_");this.name=we(e),this.type=n,this.docs=o,this.initializer=i,this.access=u,this.readonly_=f!=null?f:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};a();s();a();s();a();s();var fe=class extends w{constructor({method:e,arguments_:n,static_:o,multiline:i,on:u}){super();d(this,"method");d(this,"arguments_");d(this,"multiline");d(this,"static_");d(this,"on");this.method=e,this.arguments_=n,this.static_=o!=null?o:!1,this.multiline=i!=null?i:!1,this.on=u}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),fr({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};a();s();var D=class t extends w{constructor(e){super();d(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(lx({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(fx({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
30
- `)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}if(this.internalType.value.includes("'")){e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}e.write(`'${this.internalType.value}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:R(this.internalType)}}isClass(){return this.internalType.type==="class"}asClassOrThrow(){if(this.isClass())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a class")}writeStringWithHeredoc({writer:e,value:n}){e.writeLine("<<<EOT"),e.writeNoIndent(n),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:n}){e.writeNode(new Q({classReference:n.reference,arguments_:[t.map({entries:n.fields.map(o=>({key:t.string(o.name),value:o.value}))})]}))}writeList({writer:e,list:n}){let o=dx({values:n.values});if(o.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of o)i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:n}){let o=cx({entries:n.entries});if(o.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of o)i.key.write(e),e.write(" => "),i.value.write(e),e.writeLine(",");e.dedent(),e.write("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:n}){return new this({type:"class",reference:e,fields:n})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:e,value:n});return}this.writeUnknownMap({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:e,value:n}){if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of n)e.writeNode(t.unknown(o)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:n}){let o=Object.entries(n);if(o.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[i,u]of o)e.write(`'${i}' => `),e.writeNode(t.unknown(u)),e.writeLine(",");e.dedent(),e.write("]")}};function fx({writer:t,value:r}){return new Q({classReference:new O({name:"DateTime",namespace:""}),arguments_:[new B(`'${r}'`)]})}function lx({writer:t,value:r}){return new fe({on:new O({name:"File",namespace:`${t.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new B(`"${r}"`)]})}function cx({entries:t}){return t.filter(r=>!D.isNop(r.key)&&!D.isNop(r.value))}function dx({values:t}){return t.filter(r=>!D.isNop(r))}var W=class t extends w{constructor(e){super();d(this,"internalType");this.internalType=e}write(e,{comment:n}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(Af),e.write("DateTime");break;case"dateTime":e.addReference(Af),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!n){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:n}),e.write(">");break;case"map":{if(!n){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:n}),e.write(", "),this.internalType.valueType.write(e,{comment:n}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!n){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");let o=this.internalType.entries.filter(f=>!f.valueType.isOptional()),i=this.internalType.entries.filter(f=>f.valueType.isOptional()),u=[...o,...i];for(let f of u)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:f,comment:n}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((o,i)=>{i>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:o,comment:n})}),e.write("}");break}case"union":{let o=this.getUniqueTypes({types:this.internalType.types,comment:n,writer:e}),i=o.filter(u=>u.underlyingType().internalType.type==="mixed").length>0;if(i&&!n){e.write("mixed");break}o.length>0&&n?(e.writeLine("("),o.forEach((u,f)=>{f>0?e.write(" * |"):e.write(" * "),i&&(u=u.underlyingType()),u.write(e,{comment:n}),e.writeLine(),f++}),e.write(" * )")):o.forEach((u,f)=>{f>0&&e.write("|"),i&&(u=u.underlyingType()),u.write(e,{comment:n}),f++});break}case"optional":{let o=this.internalType.value.internalType.type==="mixed",i=this.internalType.value.internalType.type==="union";!i&&!o&&e.write("?"),this.internalType.value.write(e,{comment:n}),i&&(e.write("|"),e.writeNode(t.null()));break}case"reference":if(n){e.writeNode(this.internalType.value);let o=this.internalType.value.generics;o&&o.length>0&&(e.write("<"),o.forEach((i,u)=>{u>0&&e.write(", "),i.write(e,{comment:n})}),e.write(">"))}else e.writeNode(this.internalType.value);break;case"enumString":n?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;case"literal":if(n)e.writeNode(this.internalType.value);else switch(this.internalType.value.internalType.type){case"string":e.write("string");break;case"boolean":e.write("bool");break;default:R(this.internalType.value.internalType)}break;default:R(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:t.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}getClassReference(){switch(this.internalType.type){case"date":case"dateTime":return new O({name:"DateTime",namespace:Dr});case"enumString":case"reference":return this.internalType.value;case"int":case"string":case"bool":case"float":case"object":case"map":case"array":case"null":case"mixed":case"optional":case"typeDict":case"union":case"literal":throw new Error("Cannot get class reference for "+this.internalType.type);default:R(this.internalType)}}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,n){return new this({type:"map",keyType:e,valueType:n})}static typeDict(e,{multiline:n}={}){return new this({type:"typeDict",entries:e,multiline:n})}static union(e){return new this({type:"union",types:e})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static literalString(e){return new this({type:"literal",value:D.string(e)})}static literalBoolean(e){return new this({type:"literal",value:D.boolean(e)})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeTypeDictEntry({writer:e,entry:n,comment:o}){e.write(n.key),n.optional&&e.write("?"),e.write(": "),n.valueType.write(e,{comment:o})}getUniqueTypes({writer:e,types:n,comment:o}){let i=new Set;return n.filter(u=>{let f=u.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig,comment:o});return i.has(f)?!1:(i.add(f),!0)})}toString({namespace:e,rootNamespace:n,customConfig:o,comment:i}){let u=new Z({namespace:e,rootNamespace:n,customConfig:o});return this.write(u,{comment:i!=null?i:!1}),u.toString()}},Af=new O({namespace:Dr,name:"DateTime"});a();s();function Sf(t){return t.startsWith("$")?t.slice(1):t}var Tf="values",$e=class extends w{constructor({name:e,namespace:n,abstract:o,docs:i,parentClassReference:u,traits:f,constructorAccess:c}){super();d(this,"name");d(this,"namespace");d(this,"constructorAccess");d(this,"class_");this.name=e,this.namespace=n,this.constructorAccess=c!=null?c:"public",this.class_=new ue({name:e,namespace:n,abstract:o,docs:i,parentClassReference:u,traits:f})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let n=be(this.class_.fields).map(o=>Ge(je({},o),{name:Sf(o.name)}));n.length>0&&this.class_.addConstructor({access:this.constructorAccess,parameters:this.getConstructorParameters({orderedFields:n}),body:x.codeblock(o=>{for(let i of n)o.write(`$this->${i.name} = $${Tf}['${i.name}']`),i.type.isOptional()&&o.write(" ?? null"),o.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new pe({name:Tf,type:W.typeDict(e.map(n=>({key:n.name,valueType:n.type,optional:n.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new B("[]"):void 0})]}};a();s();a();s();var le=class extends w{constructor({name:e,access:n,parameters:o,throws:i,return_:u,body:f,docs:c,classReference:y,static_:m}){super();d(this,"name");d(this,"access");d(this,"parameters");d(this,"throws");d(this,"return_");d(this,"body");d(this,"docs");d(this,"classReference");d(this,"static_");this.name=e,this.access=n,this.parameters=o,this.throws=i!=null?i:[],this.return_=u,this.body=f,this.docs=c,this.classReference=y,this.static_=m!=null?m:!1}write(e){var u;this.writeComment(e),e.write(`${this.access}${this.static_?" static":""} function ${this.name}(`);let n=this.parameters.filter(f=>!f.type.isOptional()),o=this.parameters.filter(f=>f.type.isOptional());[...n,...o].forEach((f,c)=>{c>0&&e.write(", "),f.write(e)}),e.write("): "),this.return_!=null?e.writeNodeOrString(this.return_):e.write("void"),e.writeLine(" {"),e.indent(),(u=this.body)==null||u.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let n=new k({docs:this.docs});for(let o of this.parameters)n.addTag({tagType:"param",type:o.type,name:o.name,docs:o.docs});this.return_!=null&&this.return_!==xf&&this.return_!==vf&&n.addTag({tagType:"return",type:this.return_});for(let o of this.throws)n.addTag({tagType:"throws",type:W.reference(o)});e.writeNode(n)}};var ke=class extends w{constructor({name:e,namespace:n,backing:o,docs:i,serializable:u}){super();d(this,"name");d(this,"namespace");d(this,"backing");d(this,"docs");d(this,"members",[]);d(this,"serializable");this.name=e,this.namespace=n,this.backing=o,this.docs=i,this.serializable=u!=null?u:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new O({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let n of this.members)e.write(`case ${n.name}`),n.value!=null&&(typeof n.value=="string"?e.write(` = "${n.value}"`):e.write(` = ${n.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new le({name:"jsonSerialize",return_:W.string(),access:"public",parameters:[],body:new B("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new k({docs:this.docs}).write(e)}};a();s();var _e=class extends w{constructor({name:e,type:n,access:o,readonly_:i,initializer:u,docs:f,inlineDocs:c,attributes:y,inherited:m}){super();d(this,"name");d(this,"type");d(this,"access");d(this,"readonly_");d(this,"initializer");d(this,"docs");d(this,"inlineDocs");d(this,"attributes");d(this,"inherited");this.name=we(e),this.type=n,this.access=o,this.readonly_=i!=null?i:!1,this.initializer=u,this.docs=f,this.inlineDocs=c,this.attributes=y!=null?y:[],this.inherited=m!=null?m:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let n=new k;n.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),n.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((n,o)=>{o>0&&e.write(", "),n.write(e)}),e.writeLine("]"))}};a();s();var Me=class extends w{constructor({entries:e,multiline:n}){super();d(this,"entries");d(this,"multiline");this.entries=e!=null?e:[],this.multiline=n!=null?n:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:n,value:o}of this.entries)n.write(e),e.write(" => "),o.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[n,{key:o,value:i}]of this.entries.entries())n>0&&e.write(", "),o.write(e),e.write(" => "),i.write(e);e.write("]")}};a();s();var Ut=class extends w{constructor(e){super();d(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),fr({writer:e,arguments_:this.arrays.map(n=>De(o=>{if(typeof n=="string"||n instanceof w){o.writeNodeOrString(n);return}o.writeNodeOrString(n.ref),n.fallback&&(o.write(" ?? "),o.writeNodeOrString(n.fallback))}))})}};function yx(t){return new Be(t)}function mx(t){return new Ue(t)}function hx(t){return new ue(t)}function gx(t){return new qe(t)}function xx(t){return new O(t)}function De(t){return new B(t)}function vx(t){return new $e(t)}function wx(t){return new ke(t)}function bx(t){return new _e(t)}function Ef(t){return new Q(t)}function Ax(t){return new fe(t)}function Sx(t){return De(r=>{r.write("throw "),r.writeNode(Ef(t))})}function Tx(t){return new Me(t)}function Ex(t){return new le(t)}function Rx(t){return new pe(t)}function Px(t){return new Ur(t)}function Ix(t,r){return De(e=>{e.writeNodeOrString(t),e.write(" = "),e.writeNodeOrString(r)})}function Nx(t){return De(we(t))}function Cx(t){return De(`"${t}"`)}function Fx(...t){return new Ut(t)}function Ox(){return new B(t=>{t.write("$this")})}var Rf="$client",qt="Example",Pf=`<?php
21
+ `+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(n=>fo(n).namespace!==this.namespace).map(n=>`use ${n};`).join(`
22
+ `)}};var w=class extends X{toString(t){if(t==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:n,customConfig:i,skipImports:o=!1}=t,f=new G({namespace:e,rootNamespace:n,customConfig:i});return this.write(f),f.toString(o)}async toStringAsync({namespace:t,rootNamespace:e,customConfig:n}){let i=new G({namespace:t,rootNamespace:e,customConfig:n});return this.write(i),i.toString()}};var Te=class extends w{constructor({entries:e}){super();c(this,"entries");this.entries=e!=null?e:[]}write(e){e.write("["),this.entries.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write("]")}};a();s();var be=class extends w{constructor(e){var n;super();c(this,"reference");c(this,"arguments");this.reference=e.reference,this.arguments=(n=e.arguments)!=null?n:[]}write(e){e.addReference(this.reference),e.write(`${this.reference.name}`),this.arguments.length>0&&(e.write("("),this.arguments.forEach((n,i)=>{i>0&&e.write(","),typeof n=="string"?e.write(n):n.write(e)}),e.write(")"))}};a();s();a();s();var I=class extends w{constructor({name:e,namespace:n,generics:i}){super();c(this,"name");c(this,"namespace");c(this,"generics");c(this,"fullyQualified");this.name=e,this.namespace=n,this.generics=i,this.fullyQualified=!1}requireFullyQualified(){this.fullyQualified=!0}write(e){e.addReference(this);let n=this.fullyQualified?`\\${this.namespace}\\${this.name}`:this.name;e.write(`${n}`)}};a();s();a();s();function me(r){return r.startsWith("$")?r:`$${r}`}var P=class extends w{constructor({docs:e}={}){super();c(this,"docs");c(this,"tags",[]);this.docs=e}addTag(e){this.tags.push(Le(Ne({},e),{name:e.name!=null?me(e.name):void 0}))}write(e){e.writeLine("/**"),this.docs!=null&&(this.docs.split(`
23
+ `).forEach(n=>{e.writeLine(` * ${n}`)}),this.tags.length>0&&e.writeLine(" *"));for(let n of this.tags)this.writeTag({writer:e,tag:n});e.writeLine(" */")}writeTag({writer:e,tag:n}){let i=n.docs!=null?n.docs.split(`
24
+ `):void 0;i!=null&&i.length>1&&(i.forEach(o=>{e.writeLine(` * ${o}`)}),e.writeLine(" *")),e.write(` * @${n.tagType} `),n.type.write(e,{comment:!0}),n.name!=null&&e.write(` ${n.name}`),i!=null&&i.length===1&&e.write(` ${i[0]}`),e.newLine()}};a();s();function de(r){return Sl(r,[ce.Public,ce.PublicReadonly,ce.Protected,ce.Private])}function Sl(r,t){return t.reduce((e,n)=>[...e,...r.filter(i=>i.access===n)],[])}var ee=class extends w{constructor({name:e,namespace:n,abstract:i,docs:o,parentClassReference:f,traits:l}){super();c(this,"name");c(this,"namespace");c(this,"abstract");c(this,"docs");c(this,"parentClassReference");c(this,"traits");c(this,"fields",[]);c(this,"methods",[]);c(this,"constructor_");this.name=e,this.namespace=n,this.abstract=i!=null?i:!1,this.docs=o,this.parentClassReference=f,this.traits=l!=null?l:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addMethods(e){this.methods.push(...e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new I({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((n,i)=>{i>0&&e.write(","),e.writeNode(n)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:de(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:de(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new P({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:n}){var i;this.writeConstructorComment({writer:e,constructor:n}),n.access!=null&&e.write(`${n.access} `),e.write("function __construct("),e.indent(),n.parameters.forEach((o,f)=>{f===0&&e.newLine(),o.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(i=n.body)==null||i.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:n}){if(n.parameters.length===0)return;let i=new P;for(let o of n.parameters)i.addTag(o.getCommentTag());i.write(e)}writeFields({writer:e,fields:n}){n.filter(i=>!i.inherited).forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:n}){n.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};a();s();a();s();function $e({writer:r,arguments_:t,multiline:e}){if(t.length===0){r.write("()");return}if(e){Nl({writer:r,arguments_:t});return}Ll({writer:r,arguments_:t})}function Nl({writer:r,arguments_:t}){r.writeLine("("),r.indent();for(let e of t)po({writer:r,argument:e,writeCompact:!1}),r.writeLine(",");r.dedent(),r.write(")")}function Ll({writer:r,arguments_:t}){r.write("("),t.forEach((e,n)=>{n>0&&r.write(", "),po({writer:r,argument:e,writeCompact:!0})}),r.write(")")}function po({writer:r,argument:t,writeCompact:e}){or(t)?(t.docs&&(e?r.write(`/* ${t.docs} */ `):r.writeLine(`/* ${t.docs} */`)),r.write(`${t.name}: `),r.writeNodeOrString(t.assignment)):t.write(r)}var z=class extends w{constructor({classReference:e,arguments_:n,multiline:i}){super();c(this,"classReference");c(this,"arguments_");c(this,"multiline");this.classReference=e,this.arguments_=n,this.multiline=i!=null?i:!1}write(e){e.write("new "),e.writeNode(this.classReference),$e({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};a();s();var N=class extends w{constructor(e){super();c(this,"arg");this.arg=e}write(e){return new O(this.arg).write(e)}};a();s();a();s();var te=class extends w{constructor({name:e,type:n,docs:i,initializer:o,access:f,readonly_:l}){super();c(this,"name");c(this,"type");c(this,"docs");c(this,"initializer");c(this,"access");c(this,"readonly_");this.name=me(e),this.type=n,this.docs=i,this.initializer=o,this.access=f,this.readonly_=l!=null?l:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};a();s();a();s();a();s();a();s();var re=class extends w{constructor({method:e,arguments_:n,static_:i,multiline:o,on:f}){super();c(this,"method");c(this,"arguments_");c(this,"multiline");c(this,"static_");c(this,"on");this.method=e,this.arguments_=n,this.static_=i!=null?i:!1,this.multiline=o!=null?o:!1,this.on=f}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),$e({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};var M=class r extends w{constructor(e){super();c(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(_l({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(Pl({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
25
+ `)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}if(this.internalType.value.includes("'")){e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}e.write(`'${this.internalType.value}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:A(this.internalType)}}isClass(){return this.internalType.type==="class"}asClassOrThrow(){if(this.isClass())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a class")}writeStringWithHeredoc({writer:e,value:n}){e.writeLine("<<<EOT"),e.writeNoIndent(n),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:n}){e.writeNode(new z({classReference:n.reference,arguments_:[r.map({entries:n.fields.map(i=>({key:r.string(i.name),value:i.value}))})]}))}writeList({writer:e,list:n}){let i=Bl({values:n.values});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:n}){let i=Fl({entries:n.entries});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.key.write(e),e.write(" => "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:n}){return new this({type:"class",reference:e,fields:n})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:e,value:n});return}this.writeUnknownMap({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:e,value:n}){if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of n)e.writeNode(r.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:n}){let i=Object.entries(n);if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[o,f]of i)e.write(`'${o}' => `),e.writeNode(r.unknown(f)),e.writeLine(",");e.dedent(),e.write("]")}};function Pl({writer:r,value:t}){return new z({classReference:new I({name:"DateTime",namespace:""}),arguments_:[new N(`'${t}'`)]})}function _l({writer:r,value:t}){return new re({on:new I({name:"File",namespace:`${r.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new N(`"${t}"`)]})}function Fl({entries:r}){return r.filter(t=>!M.isNop(t.key)&&!M.isNop(t.value))}function Bl({values:r}){return r.filter(t=>!M.isNop(t))}var D=class r extends w{constructor(e){super();c(this,"internalType");this.internalType=e}write(e,{comment:n}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(lo),e.write("DateTime");break;case"dateTime":e.addReference(lo),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!n){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:n}),e.write(">");break;case"map":{if(!n){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:n}),e.write(", "),this.internalType.valueType.write(e,{comment:n}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!n){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");let i=this.internalType.entries.filter(l=>!l.valueType.isOptional()),o=this.internalType.entries.filter(l=>l.valueType.isOptional()),f=[...i,...o];for(let l of f)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:l,comment:n}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((i,o)=>{o>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:i,comment:n})}),e.write("}");break}case"union":{this.writeUnion({writer:e,unionTypes:this.internalType.types,comment:n});break}case"optional":{let i=this.internalType.value.internalType,o=i.type==="mixed",f=i.type==="union";!f&&!o&&e.write("?"),this.internalType.value.write(e,{comment:n}),f&&!this.unionHasOptional(i.types)&&(e.write("|"),e.writeNode(r.null()));break}case"reference":if(n){e.writeNode(this.internalType.value);let i=this.internalType.value.generics;i&&i.length>0&&(e.write("<"),i.forEach((o,f)=>{f>0&&e.write(", "),o.write(e,{comment:n})}),e.write(">"))}else e.writeNode(this.internalType.value);break;case"enumString":n?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;case"literal":if(n)e.writeNode(this.internalType.value);else switch(this.internalType.value.internalType.type){case"string":e.write("string");break;case"boolean":e.write("bool");break;default:A(this.internalType.value.internalType)}break;default:A(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:r.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}getClassReference(){switch(this.internalType.type){case"date":case"dateTime":return new I({name:"DateTime",namespace:""});case"enumString":case"reference":return this.internalType.value;case"int":case"string":case"bool":case"float":case"object":case"map":case"array":case"null":case"mixed":case"optional":case"typeDict":case"union":case"literal":throw new Error("Cannot get class reference for "+this.internalType.type);default:A(this.internalType)}}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,n){return new this({type:"map",keyType:e,valueType:n})}static typeDict(e,{multiline:n}={}){return new this({type:"typeDict",entries:e,multiline:n})}static union(e){let n=this.flattenUnionTypes(e),i=Lt(n,Nt);return new this({type:"union",types:i})}static flattenUnionTypes(e){let n=[];for(let i of e)i.internalType.type==="union"?n.push(...this.flattenUnionTypes(i.internalType.types)):n.push(i);return n}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static literalString(e){return new this({type:"literal",value:M.string(e)})}static literalBoolean(e){return new this({type:"literal",value:M.boolean(e)})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeUnion({writer:e,unionTypes:n,comment:i}){let o=this.getUniqueTypes({types:n,comment:i,writer:e}),f=this.unwrapOptionalTypes(o),l=f.filter(m=>m.underlyingType().internalType.type==="mixed").length>0;if(l&&!i){e.write("mixed");return}if(f.length>0&&i){e.writeLine("("),f.forEach((m,d)=>{d>0?e.write(" * |"):e.write(" * "),l&&(m=m.underlyingType()),m.write(e,{comment:i}),e.writeLine(),d++}),e.write(" * )");return}f.forEach((m,d)=>{d>0&&e.write("|"),l&&(m=m.underlyingType()),m.write(e,{comment:i}),d++})}writeTypeDictEntry({writer:e,entry:n,comment:i}){e.write(n.key),n.optional&&e.write("?"),e.write(": "),n.valueType.write(e,{comment:i})}getUniqueTypes({writer:e,types:n,comment:i}){let o=Lt(n,Nt),f=new Set;return o.filter(l=>{let m=l.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig,comment:i});return f.has(m)?!1:(f.add(m),!0)})}unwrapOptionalTypes(e){let n=!1,i=e.map(o=>o.internalType.type==="optional"?(n=!0,o.internalType.value):o);return n&&i.push(r.null()),i}unionHasOptional(e){return e.filter(n=>n.internalType.type==="optional").length>0}toString({namespace:e,rootNamespace:n,customConfig:i,comment:o}){let f=new G({namespace:e,rootNamespace:n,customConfig:i});return this.write(f,{comment:o!=null?o:!1}),f.toString()}},lo=new I({namespace:"",name:"DateTime"});a();s();function co(r){return r.startsWith("$")?r.slice(1):r}var mo="values",Ae=class extends w{constructor({name:e,namespace:n,abstract:i,docs:o,parentClassReference:f,traits:l,constructorAccess:m}){super();c(this,"name");c(this,"namespace");c(this,"constructorAccess");c(this,"class_");this.name=e,this.namespace=n,this.constructorAccess=m!=null?m:"public",this.class_=new ee({name:e,namespace:n,abstract:i,docs:o,parentClassReference:f,traits:l})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let n=de(this.class_.fields).map(i=>Le(Ne({},i),{name:co(i.name)}));n.length>0&&this.class_.addConstructor({access:this.constructorAccess,parameters:this.getConstructorParameters({orderedFields:n}),body:h.codeblock(i=>{for(let o of n)i.write(`$this->${o.name} = $${mo}['${o.name}']`),o.type.isOptional()&&i.write(" ?? null"),i.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new te({name:mo,type:D.typeDict(e.map(n=>({key:n.name,valueType:n.type,optional:n.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new N("[]"):void 0})]}};a();s();a();s();var ne=class extends w{constructor({name:e,access:n,parameters:i,throws:o,return_:f,body:l,docs:m,classReference:d,static_:y}){super();c(this,"name");c(this,"access");c(this,"parameters");c(this,"throws");c(this,"return_");c(this,"body");c(this,"docs");c(this,"classReference");c(this,"static_");this.name=e,this.access=n,this.parameters=i,this.throws=o!=null?o:[],this.return_=f,this.body=l,this.docs=m,this.classReference=d,this.static_=y!=null?y:!1}write(e){var f;this.writeComment(e),e.write(`${this.access}${this.static_?" static":""} function ${this.name}(`);let n=this.parameters.filter(l=>!l.type.isOptional()),i=this.parameters.filter(l=>l.type.isOptional());[...n,...i].forEach((l,m)=>{m>0&&e.write(", "),l.write(e)}),e.write("): "),this.return_!=null?e.writeNodeOrString(this.return_):e.write("void"),e.writeLine(" {"),e.indent(),(f=this.body)==null||f.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let n=new P({docs:this.docs});for(let i of this.parameters)n.addTag({tagType:"param",type:i.type,name:i.name,docs:i.docs});this.return_!=null&&this.return_!==oo&&this.return_!==ao&&n.addTag({tagType:"return",type:this.return_});for(let i of this.throws)n.addTag({tagType:"throws",type:D.reference(i)});e.writeNode(n)}};var Ee=class extends w{constructor({name:e,namespace:n,backing:i,docs:o,serializable:f}){super();c(this,"name");c(this,"namespace");c(this,"backing");c(this,"docs");c(this,"members",[]);c(this,"serializable");this.name=e,this.namespace=n,this.backing=i,this.docs=o,this.serializable=f!=null?f:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new I({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let n of this.members){if(e.write(`case ${n.name}`),n.value!=null)if(typeof n.value=="string"){let i=ar(n.value);e.write(` = "${i}"`)}else e.write(` = ${n.value}`);e.writeTextStatement("")}this.serializable&&(e.newLine(),e.writeNode(new ne({name:"jsonSerialize",return_:D.string(),access:"public",parameters:[],body:new N("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new P({docs:this.docs}).write(e)}};a();s();var Re=class extends w{constructor({name:e,type:n,access:i,readonly_:o,initializer:f,docs:l,inlineDocs:m,attributes:d,inherited:y}){super();c(this,"name");c(this,"type");c(this,"access");c(this,"readonly_");c(this,"initializer");c(this,"docs");c(this,"inlineDocs");c(this,"attributes");c(this,"inherited");this.name=me(e),this.type=n,this.access=i,this.readonly_=o!=null?o:!1,this.initializer=f,this.docs=l,this.inlineDocs=m,this.attributes=d!=null?d:[],this.inherited=y!=null?y:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let n=new P;n.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),n.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.writeLine("]"))}};a();s();var Ce=class extends w{constructor({entries:e,multiline:n}){super();c(this,"entries");c(this,"multiline");this.entries=e!=null?e:[],this.multiline=n!=null?n:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:n,value:i}of this.entries)n.write(e),e.write(" => "),i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[n,{key:i,value:o}]of this.entries.entries())n>0&&e.write(", "),i.write(e),e.write(" => "),o.write(e);e.write("]")}};a();s();var Ie=class extends w{constructor({name:e,namespace:n,docs:i,traits:o}){super();c(this,"name");c(this,"namespace");c(this,"docs");c(this,"traits");c(this,"fields",[]);c(this,"methods",[]);this.name=e,this.namespace=n,this.docs=i,this.traits=o!=null?o:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((n,i)=>{i>0&&e.write(","),e.writeNode(n)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:de(this.fields)}),this.fields.length>0&&this.methods.length>0&&e.newLine(),this.writeMethods({writer:e,methods:de(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){let n=new P({docs:this.docs});for(let i of this.fields)n.addTag({tagType:"property",type:i.type,name:i.name});n.write(e)}writeFields({writer:e,fields:n}){n.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:n}){n.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};a();s();var Ft=class extends w{constructor(e){super();c(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),$e({writer:e,arguments_:this.arrays.map(n=>Se(i=>{if(typeof n=="string"||n instanceof w){i.writeNodeOrString(n);return}i.writeNodeOrString(n.ref),n.fallback&&(i.write(" ?? "),i.writeNodeOrString(n.fallback))}))})}};function kl(r){return new Te(r)}function Ul(r){return new be(r)}function Ol(r){return new ee(r)}function Ml(r){return new Ie(r)}function Dl(r){return new I(r)}function Se(r){return new N(r)}function $l(r){return new Ae(r)}function jl(r){return new Ee(r)}function ql(r){return new Re(r)}function ho(r){return new z(r)}function Wl(r){return new re(r)}function Vl(r){return Se(t=>{t.write("throw "),t.writeNode(ho(r))})}function Gl(r){return new Ce(r)}function zl(r){return new ne(r)}function Hl(r){return new te(r)}function Yl(r){return new He(r)}function Kl(r,t){return Se(e=>{e.writeNodeOrString(r),e.write(" = "),e.writeNodeOrString(t)})}function Jl(r){return Se(me(r))}function Zl(r){return Se(`"${r}"`)}function Ql(...r){return new Ft(r)}function ar(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\$/g,"\\$")}function Xl(){return new N(r=>{r.write("$this")})}a();s();function sr(r){return so.has(r.toLowerCase())?`${r}_`:r}a();s();var Bt=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?h.TypeLiteral.null():(this.context.errors.add({severity:v.Critical,message:"Expected non-null value, but got null"}),h.TypeLiteral.nop());if(t.value===void 0)return h.TypeLiteral.nop();switch(t.typeReference.type){case"list":case"set":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literalType:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?h.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"nullable":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"unknown":return this.convertUnknown({value:t.value});default:A(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let n=this.context.getValueAsBoolean({value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.string(n)}default:A(t)}}convertList({list:t,value:e}){return Array.isArray(e)?h.TypeLiteral.list({values:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:v.Critical,message:`Expected array but got: ${typeof e}`}),h.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}`}),h.TypeLiteral.nop()):h.TypeLiteral.map({entries:Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:t.key,value:n,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:n}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:t,value:e});case"enum":return this.convertEnum({enum_:t,value:e});case"object":return this.convertObject({object_:t,value:e});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:A(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(n==null)return h.TypeLiteral.nop();let i=n.singleDiscriminatedUnionType,o=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});return o==null?h.TypeLiteral.nop():h.TypeLiteral.reference(h.codeblock(f=>{f.writeNode(h.invokeMethod({on:h.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),method:this.context.getMethodName(i.discriminantValue.name),arguments_:this.convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:n,unionVariant:i,unionProperties:o}),static_:!0}))}))}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){switch(e.type){case"samePropertiesAsObject":{let n=this.context.resolveNamedType({typeId:e.typeId});if(n==null)return;let i=this.convertNamed({named:n,value:t.value});if(!i.isClass()){this.context.errors.add({severity:v.Critical,message:"Internal error; expected union value to be an object"});return}return i.asClassOrThrow().fields}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let n=this.context.getRecord(t.value);return n==null?[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:t.value})}]:[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:n[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return[];default:A(e)}}convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:t,unionVariant:e,unionProperties:n}){let i=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});if(e.type==="singleProperty"&&this.context.getRecord(t.value)==null&&n.length===1)return[...i,this.convert({typeReference:e.typeReference,value:t.value})];if(e.type==="samePropertiesAsObject"){let o=this.context.resolveNamedType({typeId:e.typeId});return o==null?[]:[...i,h.TypeLiteral.class_({reference:h.classReference({name:this.context.getClassName(o.declaration.name),namespace:this.context.getTypesNamespace(o.declaration.fernFilepath)}),fields:n})]}return i}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i,o;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(o=this.context.getRecord(t.value))!=null?o:{},ignoreMissingParameters:!0}).map(f=>{this.context.errors.scope(f.name.wireValue);try{return this.convert(f)}finally{this.context.errors.unscope()}})}convertObject({object_:t,value:e}){var i;let n=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return h.TypeLiteral.class_({reference:h.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),fields:n.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getPropertyName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let n=this.getEnumValueName({enum_:t,value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.reference(h.codeblock(i=>{i.writeNode(h.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)})),i.write("::"),i.write(n),i.write("->value")}))}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 n=t.values.find(i=>i.wireValue===e);if(n==null){this.context.errors.add({severity:v.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return n==null?h.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{return this.convert({typeReference:n,value:e})}catch(i){continue}this.context.errors.add({severity:v.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return h.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:n}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:n});return i==null?h.TypeLiteral.nop():h.TypeLiteral.number(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?h.TypeLiteral.nop():h.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:n});return i==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(i)}case"DATE":case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?h.TypeLiteral.nop():h.TypeLiteral.datetime(i)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?h.TypeLiteral.nop():h.TypeLiteral.string(i)}default:A(t)}}getValueAsNumber({value:t,as:e}){let n=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:t,as:e}){let n=e==="key"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:n})}};a();s();var kt=class{constructor({context:t}){c(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let n={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let f of t.properties)switch(f.type){case"file":n.fileFields.push({name:this.context.getPropertyName(f.name),value:this.getSingleFileProperty({property:f,record:i})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(f.name),value:this.getArrayFileProperty({property:f,record:i})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(f.name.name),value:this.getBodyProperty({property:f,record:i})});break;default:A(f)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.file(n)}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.list({values:n.map(i=>h.TypeLiteral.file(i))})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?h.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:n})}};var ec=["use","clone","list"],tc="Requests",rc="Types",Ut=class r extends Qe{constructor({ir:e,config:n}){var i;super({ir:e,config:n});c(this,"ir");c(this,"customConfig");c(this,"dynamicTypeLiteralMapper");c(this,"filePropertyMapper");c(this,"rootNamespace");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new Bt({context:this}),this.filePropertyMapper=new kt({context:this}),this.rootNamespace=nc({organization:n.organization,namespaceOverride:(i=this.customConfig)==null?void 0:i.namespace})}clone(){return new r({ir:this.ir,config:this.config})}getParameterName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getPropertyName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getMethodName(e){let n=e.camelCase.unsafeName;return ec.includes(n)?n:e.camelCase.safeName}getClassName(e){return sr(e.pascalCase.safeName)}getRootClientClassName(){var e,n,i;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((n=this.customConfig)==null?void 0:n["client-class-name"])!=null?(i=this.customConfig)==null?void 0:i["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return h.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,tc)}getTypesNamespace(e){return this.getNamespace(e,rc)}getNamespace(e,n){let i=e.allParts.map(o=>o.pascalCase.safeName);return i=n!=null?[...i,n]:i,[this.rootNamespace,...i].join("\\")}getEnvironmentClassAccessFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return h.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference(n)),i.write("::"),i.write(this.getClassName(n))})}getEnvironmentClassReference(e){return h.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${Ue(vt(this.config.organization))}`}};function nc({organization:r,namespaceOverride:t}){return t!=null?t:`${Ue(vt(r))}`}a();s();var yo="$client",Ot="Example",xo=`<?php
31
26
 
32
- `,$t=class{constructor({context:r}){d(this,"context");this.context=r}async generateSnippet({endpoint:r,request:e}){var o;let n=this.buildCodeBlock({endpoint:r,snippet:e});return Pf+await n.toStringAsync({namespace:qt,rootNamespace:qt,customConfig:(o=this.context.customConfig)!=null?o:{}})}generateSnippetSync({endpoint:r,request:e}){var o;let n=this.buildCodeBlock({endpoint:r,snippet:e});return Pf+n.toString({namespace:qt,rootNamespace:qt,customConfig:(o=this.context.customConfig)!=null?o:{}})}buildCodeBlock({endpoint:r,snippet:e}){return x.codeblock(n=>{n.writeNodeStatement(this.constructClient({endpoint:r,snippet:e})),n.writeNodeStatement(this.callMethod({endpoint:r,snippet:e}))})}constructClient({endpoint:r,snippet:e}){return x.codeblock(n=>{n.write(`${Rf} = `),n.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:r,snippet:e})))})}callMethod({endpoint:r,snippet:e}){return x.invokeMethod({on:x.codeblock(Rf),method:this.getMethod({endpoint:r}),arguments_:this.getMethodArgs({endpoint:r,snippet:e}),multiline:!0})}getConstructorArgs({endpoint:r,snippet:e}){let n=[];r.auth!=null&&(e.auth!=null?n.push(...this.getConstructorAuthArgs({auth:r.auth,values:e.auth})):this.context.errors.add({severity:A.Warning,message:`Auth with ${r.auth.type} configuration is required for this endpoint`}));let o=[],i=this.getConstructorBaseUrlArgs({baseUrl:e.baseURL,environment:e.environment});return i.length>0&&o.push(...i),this.context.errors.scope(K.Headers),this.context.ir.headers!=null&&e.headers!=null&&o.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:e.headers})),this.context.errors.unscope(),o.length===0?n:[...n,{name:"options",assignment:x.TypeLiteral.map({entries:o.map(u=>({key:x.TypeLiteral.string(u.name),value:u.value}))})}]}getConstructorAuthArgs({auth:r,values:e}){switch(r.type){case"basic":return e.type!=="basic"?(this.context.errors.add({severity:A.Critical,message:this.context.newAuthMismatchError({auth:r,values:e}).message}),[]):this.getConstructorBasicAuthArgs({auth:r,values:e});case"bearer":return e.type!=="bearer"?(this.context.errors.add({severity:A.Critical,message:this.context.newAuthMismatchError({auth:r,values:e}).message}),[]):this.getConstructorBearerAuthArgs({auth:r,values:e});case"header":return e.type!=="header"?(this.context.errors.add({severity:A.Critical,message:this.context.newAuthMismatchError({auth:r,values:e}).message}),[]):this.getConstructorHeaderAuthArgs({auth:r,values:e});case"oauth":return e.type!=="oauth"?(this.context.errors.add({severity:A.Critical,message:this.context.newAuthMismatchError({auth:r,values:e}).message}),[]):(this.context.errors.add({severity:A.Warning,message:"The PHP SDK doesn't support OAuth client credentials yet"}),[]);default:R(r)}}getConstructorBasicAuthArgs({auth:r,values:e}){return[{name:this.context.getPropertyName(r.username),assignment:x.TypeLiteral.string(e.username)},{name:this.context.getPropertyName(r.password),assignment:x.TypeLiteral.string(e.password)}]}getConstructorBaseUrlArgs({baseUrl:r,environment:e}){let n=this.getBaseUrlArg({baseUrl:r,environment:e});return x.TypeLiteral.isNop(n)?[]:[{name:"baseUrl",value:n}]}getBaseUrlArg({baseUrl:r,environment:e}){if(r!=null&&e!=null)return this.context.errors.add({severity:A.Critical,message:"Cannot specify both baseUrl and environment options"}),x.TypeLiteral.nop();if(r!=null)return x.TypeLiteral.string(r);if(e!=null){if(this.context.isSingleEnvironmentID(e)){let n=this.context.getEnvironmentClassAccessFromID(e);return n==null?(this.context.errors.add({severity:A.Warning,message:`Environment ${JSON.stringify(e)} was not found`}),x.TypeLiteral.nop()):x.TypeLiteral.reference(x.codeblock(o=>{o.writeNode(n),o.write("->value")}))}this.context.isMultiEnvironmentValues(e)&&this.context.errors.add({severity:A.Warning,message:"The PHP SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}return x.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:r,values:e}){return[{name:this.context.getPropertyName(r.token),assignment:x.TypeLiteral.string(e.token)}]}getConstructorHeaderAuthArgs({auth:r,values:e}){return[{name:this.context.getPropertyName(r.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:r.header.typeReference,value:e.value})}]}getConstructorHeaderArgs({headers:r,values:e}){let n=[];for(let o of r){let i=this.getConstructorHeaderArg({header:o,value:e.value});i!=null&&n.push({name:this.context.getPropertyName(o.name.name),value:i})}return n}getConstructorHeaderArg({header:r,value:e}){let n=this.context.dynamicTypeLiteralMapper.convert({typeReference:r.typeReference,value:e});if(!x.TypeLiteral.isNop(n))return n}getMethodArgs({endpoint:r,snippet:e}){switch(r.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:r.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:r.request,snippet:e});default:R(r.request)}}getMethodArgsForBodyRequest({request:r,snippet:e}){var i,u;let n=[];this.context.errors.scope(K.PathParameters);let o=[...(i=this.context.ir.pathParameters)!=null?i:[],...(u=r.pathParameters)!=null?u:[]];return o.length>0&&n.push(...this.getPathParameters({namedParameters:o,snippet:e}).map(f=>f.value)),this.context.errors.unscope(),this.context.errors.scope(K.RequestBody),r.body!=null&&n.push(this.getBodyRequestArg({body:r.body,value:e.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:r,value:e}){switch(r.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:r.value,value:e});default:R(r)}}getBytesBodyRequestArg({value:r}){return this.context.errors.add({severity:A.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),x.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:r,snippet:e}){var c,y,m,g;let n=[],o=(y=(c=this.context.customConfig)==null?void 0:c.inlinePathParameters)!=null?y:!1;this.context.errors.scope(K.PathParameters);let i=[],u=[...(m=this.context.ir.pathParameters)!=null?m:[],...(g=r.pathParameters)!=null?g:[]];u.length>0&&i.push(...this.getPathParameters({namedParameters:u,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(K.RequestBody);let f=this.getFilePropertyInfo({request:r,snippet:e});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:r,inlinePathParameters:o})||n.push(...i.map(v=>v.value)),this.context.needsRequestParameter({request:r,inlinePathParameters:o,inlineFileProperties:!0})&&n.push(this.getInlinedRequestArg({request:r,snippet:e,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:r,inlinePathParameters:o})?i:[],filePropertyInfo:f})),n}getFilePropertyInfo({request:r,snippet:e}){return r.body==null||!this.context.isFileUploadRequestBody(r.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:r.body,value:e.requestBody})}getInlinedRequestArg({request:r,snippet:e,pathParameterFields:n,filePropertyInfo:o}){var m,g,v,b;this.context.errors.scope(K.QueryParameters);let u=this.context.associateQueryParametersByWireValue({parameters:(m=r.queryParameters)!=null?m:[],values:(g=e.queryParameters)!=null?g:{}}).map(E=>({name:this.context.getPropertyName(E.name.name),value:this.context.dynamicTypeLiteralMapper.convert(E)}));this.context.errors.unscope(),this.context.errors.scope(K.Headers);let c=this.context.associateByWireValue({parameters:(v=r.headers)!=null?v:[],values:(b=e.headers)!=null?b:{}}).map(E=>({name:this.context.getPropertyName(E.name.name),value:this.context.dynamicTypeLiteralMapper.convert(E)}));this.context.errors.unscope(),this.context.errors.scope(K.RequestBody);let y=r.body!=null?this.getInlinedRequestBodyConstructorFields({body:r.body,value:e.requestBody,filePropertyInfo:o}):[];return this.context.errors.unscope(),x.TypeLiteral.class_({reference:x.classReference({name:this.context.getClassName(r.declaration.name),namespace:this.context.getRequestNamespace(r.declaration.fernFilepath)}),fields:[...n,...u,...c,...y]})}getInlinedRequestBodyConstructorFields({body:r,value:e,filePropertyInfo:n}){switch(r.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:r.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:r,value:e})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:n});default:R(r)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:r}){return[...r.fileFields,...r.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:r,value:e}){return{name:this.context.getPropertyName(r.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:r.bodyType,value:e})}}getReferencedRequestBodyPropertyTypeLiteral({body:r,value:e}){switch(r.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:r.value,value:e});default:R(r)}}getInlinedRequestBodyPropertyConstructorFields({parameters:r,value:e}){var i;let n=[],o=this.context.associateByWireValue({parameters:r,values:(i=this.context.getRecord(e))!=null?i:{}});for(let u of o)n.push({name:this.context.getPropertyName(u.name.name),value:this.context.dynamicTypeLiteralMapper.convert(u)});return n}getPathParameters({namedParameters:r,snippet:e}){var i;let n=[],o=this.context.associateByWireValue({parameters:r,values:(i=e.pathParameters)!=null?i:{}});for(let u of o)n.push({name:this.context.getPropertyName(u.name.name),value:this.context.dynamicTypeLiteralMapper.convert(u)});return n}getMethod({endpoint:r}){return r.declaration.fernFilepath.allParts.length>0?`${r.declaration.fernFilepath.allParts.map(e=>this.context.getPropertyName(e)).join("->")}->${this.context.getMethodName(r.declaration.name)}`:this.context.getMethodName(r.declaration.name)}getRootClientClassInstantiation(r){return x.instantiateClass({classReference:x.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:r,multiline:!0})}};a();s();a();s();var kt=class{constructor({context:r}){d(this,"context");this.context=r}convert(r){if(r.value===null)return this.context.isNullable(r.typeReference)?x.TypeLiteral.null():(this.context.errors.add({severity:A.Critical,message:"Expected non-null value, but got null"}),x.TypeLiteral.nop());if(r.value===void 0)return x.TypeLiteral.nop();switch(r.typeReference.type){case"list":case"set":return this.convertList({list:r.typeReference.value,value:r.value});case"literal":return this.convertLiteral({literalType:r.typeReference.value,value:r.value});case"map":return this.convertMap({map:r.typeReference,value:r.value});case"named":{let e=this.context.resolveNamedType({typeId:r.typeReference.value});return e==null?x.TypeLiteral.nop():this.convertNamed({named:e,value:r.value,as:r.as})}case"optional":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"nullable":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"primitive":return this.convertPrimitive({primitive:r.typeReference.value,value:r.value,as:r.as});case"unknown":return this.convertUnknown({value:r.value});default:R(r.typeReference)}}convertLiteral({literalType:r,value:e}){switch(r.type){case"boolean":{let n=this.context.getValueAsBoolean({value:e});return n==null?x.TypeLiteral.nop():x.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:e});return n==null?x.TypeLiteral.nop():x.TypeLiteral.string(n)}default:R(r)}}convertList({list:r,value:e}){return Array.isArray(e)?x.TypeLiteral.list({values:e.map((n,o)=>{this.context.errors.scope({index:o});try{return this.convert({typeReference:r,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:A.Critical,message:`Expected array but got: ${typeof e}`}),x.TypeLiteral.nop())}convertMap({map:r,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:A.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),x.TypeLiteral.nop()):x.TypeLiteral.map({entries:Object.entries(e).map(([n,o])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:r.key,value:n,as:"key"}),value:this.convert({typeReference:r.value,value:o})}}finally{this.context.errors.unscope()}})})}convertNamed({named:r,value:e,as:n}){switch(r.type){case"alias":return this.convert({typeReference:r.typeReference,value:e,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:r,value:e});case"enum":return this.convertEnum({enum_:r,value:e});case"object":return this.convertObject({object_:r,value:e});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:r,value:e});default:R(r)}}convertDiscriminatedUnion({discriminatedUnion:r,value:e}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:r,value:e});if(n==null)return x.TypeLiteral.nop();let o=n.singleDiscriminatedUnionType,i=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:o});return i==null?x.TypeLiteral.nop():x.TypeLiteral.reference(x.codeblock(u=>{u.writeNode(x.invokeMethod({on:x.classReference({name:this.context.getClassName(r.declaration.name),namespace:this.context.getTypesNamespace(r.declaration.fernFilepath)}),method:this.context.getMethodName(o.discriminantValue.name),arguments_:this.convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:n,unionVariant:o,unionProperties:i}),static_:!0}))}))}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:r,unionVariant:e}){switch(e.type){case"samePropertiesAsObject":{let n=this.context.resolveNamedType({typeId:e.typeId});if(n==null)return;let o=this.convertNamed({named:n,value:r.value});if(!o.isClass()){this.context.errors.add({severity:A.Critical,message:"Internal error; expected union value to be an object"});return}return o.asClassOrThrow().fields}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let n=this.context.getRecord(r.value);return n==null?[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:r.value})}]:[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:n[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return[];default:R(e)}}convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:r,unionVariant:e,unionProperties:n}){let o=this.getBaseFields({discriminatedUnionTypeInstance:r,singleDiscriminatedUnionType:e});if(e.type==="singleProperty"&&this.context.getRecord(r.value)==null&&n.length===1)return[...o,this.convert({typeReference:e.typeReference,value:r.value})];if(e.type==="samePropertiesAsObject"){let i=this.context.resolveNamedType({typeId:e.typeId});return i==null?[]:[...o,x.TypeLiteral.class_({reference:x.classReference({name:this.context.getClassName(i.declaration.name),namespace:this.context.getTypesNamespace(i.declaration.fernFilepath)}),fields:n})]}return o}getBaseFields({discriminatedUnionTypeInstance:r,singleDiscriminatedUnionType:e}){var o,i;return this.context.associateByWireValue({parameters:(o=e.properties)!=null?o:[],values:(i=this.context.getRecord(r.value))!=null?i:{},ignoreMissingParameters:!0}).map(u=>{this.context.errors.scope(u.name.wireValue);try{return this.convert(u)}finally{this.context.errors.unscope()}})}convertObject({object_:r,value:e}){var o;let n=this.context.associateByWireValue({parameters:r.properties,values:(o=this.context.getRecord(e))!=null?o:{}});return x.TypeLiteral.class_({reference:x.classReference({name:this.context.getClassName(r.declaration.name),namespace:this.context.getTypesNamespace(r.declaration.fernFilepath)}),fields:n.map(i=>{this.context.errors.scope(i.name.wireValue);try{return{name:this.context.getPropertyName(i.name.name),value:this.convert(i)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:r,value:e}){let n=this.getEnumValueName({enum_:r,value:e});return n==null?x.TypeLiteral.nop():x.TypeLiteral.reference(x.codeblock(o=>{o.writeNode(x.classReference({name:this.context.getClassName(r.declaration.name),namespace:this.context.getTypesNamespace(r.declaration.fernFilepath)})),o.write("::"),o.write(n),o.write("->value")}))}getEnumValueName({enum_:r,value:e}){if(typeof e!="string"){this.context.errors.add({severity:A.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let n=r.values.find(o=>o.wireValue===e);if(n==null){this.context.errors.add({severity:A.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:r,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:r,value:e});return n==null?x.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:r,value:e}){for(let n of r.types)try{return this.convert({typeReference:n,value:e})}catch(o){continue}this.context.errors.add({severity:A.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:r}){return x.TypeLiteral.unknown(r)}convertPrimitive({primitive:r,value:e,as:n}){switch(r){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let o=this.getValueAsNumber({value:e,as:n});return o==null?x.TypeLiteral.nop():x.TypeLiteral.number(o)}case"FLOAT":case"DOUBLE":{let o=this.getValueAsNumber({value:e});return o==null?x.TypeLiteral.nop():x.TypeLiteral.float(o)}case"BOOLEAN":{let o=this.getValueAsBoolean({value:e,as:n});return o==null?x.TypeLiteral.nop():x.TypeLiteral.boolean(o)}case"DATE":case"DATE_TIME":{let o=this.context.getValueAsString({value:e});return o==null?x.TypeLiteral.nop():x.TypeLiteral.datetime(o)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let o=this.context.getValueAsString({value:e});return o==null?x.TypeLiteral.nop():x.TypeLiteral.string(o)}default:R(r)}}getValueAsNumber({value:r,as:e}){let n=e==="key"&&typeof r=="string"?Number(r):r;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:r,as:e}){let n=e==="key"?typeof r=="string"?r==="true":r==="false"?!1:r:r;return this.context.getValueAsBoolean({value:n})}};a();s();var _t=class{constructor({context:r}){d(this,"context");this.context=r}getFilePropertyInfo({body:r,value:e}){var i;let n={fileFields:[],bodyPropertyFields:[]},o=(i=this.context.getRecord(e))!=null?i:{};for(let u of r.properties)switch(u.type){case"file":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getSingleFileProperty({property:u,record:o})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getArrayFileProperty({property:u,record:o})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(u.name.name),value:this.getBodyProperty({property:u,record:o})});break;default:R(u)}return n}getSingleFileProperty({property:r,record:e}){let n=this.context.getSingleFileValue({property:r,record:e});return n==null?x.TypeLiteral.nop():x.TypeLiteral.file(n)}getArrayFileProperty({property:r,record:e}){let n=this.context.getFileArrayValues({property:r,record:e});return n==null?x.TypeLiteral.nop():x.TypeLiteral.list({values:n.map(o=>x.TypeLiteral.file(o))})}getBodyProperty({property:r,record:e}){let n=e[r.name.wireValue];return n==null?x.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:r.typeReference,value:n})}};var Lx=["use","clone","list"],Bx="Requests",Ux="Types",Mt=class t extends Mr{constructor({ir:e,config:n}){var o;super({ir:e,config:n});d(this,"ir");d(this,"customConfig");d(this,"dynamicTypeLiteralMapper");d(this,"filePropertyMapper");d(this,"rootNamespace");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new kt({context:this}),this.filePropertyMapper=new _t({context:this}),this.rootNamespace=qx({organization:n.organization,namespaceOverride:(o=this.customConfig)==null?void 0:o.namespace})}clone(){return new t({ir:this.ir,config:this.config})}getParameterName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getPropertyName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getMethodName(e){let n=e.camelCase.unsafeName;return Lx.includes(n)?n:e.camelCase.safeName}getClassName(e){return e.pascalCase.safeName}getRootClientClassName(){var e,n,o;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((n=this.customConfig)==null?void 0:n["client-class-name"])!=null?(o=this.customConfig)==null?void 0:o["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return x.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,Bx)}getTypesNamespace(e){return this.getNamespace(e,Ux)}getNamespace(e,n){let o=e.allParts.map(i=>i.pascalCase.safeName);return o=n!=null?[...o,n]:o,[this.rootNamespace,...o].join("\\")}getEnvironmentClassAccessFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return x.codeblock(o=>{o.writeNode(this.getEnvironmentClassReference(n)),o.write("::"),o.write(this.getClassName(n))})}getEnvironmentClassReference(e){return x.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${ur(Bt(this.config.organization))}`}};function qx({organization:t,namespaceOverride:r}){return r!=null?r:`${ur(Bt(t))}`}var Dt=class extends $r{constructor({ir:r,config:e}){super(new Mt({ir:r,config:e}))}async generate(r){return super.generate(r)}generateSync(r){return super.generateSync(r)}createSnippetGenerator(r){return new $t({context:r})}};0&&(module.exports={DynamicSnippetsGenerator});
27
+ `,Mt=class{constructor({context:t}){c(this,"context");this.context=t}async generateSnippet({endpoint:t,request:e}){var i;let n=this.buildCodeBlock({endpoint:t,snippet:e});return xo+await n.toStringAsync({namespace:Ot,rootNamespace:Ot,customConfig:(i=this.context.customConfig)!=null?i:{}})}generateSnippetSync({endpoint:t,request:e}){var i;let n=this.buildCodeBlock({endpoint:t,snippet:e});return xo+n.toString({namespace:Ot,rootNamespace:Ot,customConfig:(i=this.context.customConfig)!=null?i:{}})}buildCodeBlock({endpoint:t,snippet:e}){return h.codeblock(n=>{n.writeNodeStatement(this.constructClient({endpoint:t,snippet:e})),n.writeNodeStatement(this.callMethod({endpoint:t,snippet:e}))})}constructClient({endpoint:t,snippet:e}){return h.codeblock(n=>{n.write(`${yo} = `),n.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:t,snippet:e})))})}callMethod({endpoint:t,snippet:e}){return h.invokeMethod({on:h.codeblock(yo),method:this.getMethod({endpoint:t}),arguments_:this.getMethodArgs({endpoint:t,snippet:e}),multiline:!0})}getConstructorArgs({endpoint:t,snippet:e}){var m;let n=[];t.auth!=null&&(e.auth!=null?n.push(...this.getConstructorAuthArgs({auth:t.auth,values:e.auth})):this.context.errors.add({severity:v.Warning,message:`Auth with ${t.auth.type} configuration is required for this endpoint`}));let i=((m=this.context.ir.environments)==null?void 0:m.environments.type)==="multipleBaseUrls",o=this.getConstructorEnvironmentArg({environment:e.environment,hasMultiUrlEnvironments:i}),f=[];if(!i){let d=this.getConstructorBaseUrlArgs({baseUrl:e.baseURL,environment:e.environment});d.length>0&&f.push(...d)}this.context.errors.scope(V.Headers),this.context.ir.headers!=null&&e.headers!=null&&f.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:e.headers})),this.context.errors.unscope();let l=[...n];return o!=null&&l.push(o),f.length>0&&l.push({name:"options",assignment:h.TypeLiteral.map({entries:f.map(d=>({key:h.TypeLiteral.string(d.name),value:d.value}))})}),l}getConstructorAuthArgs({auth:t,values:e}){if(e.type!==t.type)return this.addError(this.context.newAuthMismatchError({auth:t,values:e}).message),[];switch(t.type){case"basic":return e.type==="basic"?this.getConstructorBasicAuthArgs({auth:t,values:e}):[];case"bearer":return e.type==="bearer"?this.getConstructorBearerAuthArgs({auth:t,values:e}):[];case"header":return e.type==="header"?this.getConstructorHeaderAuthArgs({auth:t,values:e}):[];case"oauth":return this.addWarning("The PHP SDK doesn't support OAuth client credentials yet"),[];case"inferred":return this.addWarning("The PHP SDK Generator does not support Inferred auth scheme yet"),[];default:A(t)}}addError(t){this.context.errors.add({severity:v.Critical,message:t})}addWarning(t){this.context.errors.add({severity:v.Warning,message:t})}getConstructorBasicAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.username),assignment:h.TypeLiteral.string(e.username)},{name:this.context.getPropertyName(t.password),assignment:h.TypeLiteral.string(e.password)}]}getConstructorEnvironmentArg({environment:t,hasMultiUrlEnvironments:e}){if(!e)return;let n=this.context.getEnvironmentsClassReference();if(t!=null){if(this.context.isSingleEnvironmentID(t)){let o=this.context.resolveEnvironmentName(t);if(o==null){this.addWarning(`Environment "${t}" was not found`);return}let f=this.context.getClassName(o);return{name:"environment",assignment:h.TypeLiteral.reference(h.codeblock(l=>{l.writeNode(n),l.write("::"),l.write(f),l.write("()")}))}}if(this.context.isMultiEnvironmentValues(t)){let o=this.resolveMultiEnvironmentName(t);if(o==null){this.addWarning("Invalid multi url environment");return}return o.type==="named"?{name:"environment",assignment:h.TypeLiteral.reference(h.codeblock(f=>{f.writeNode(n),f.write("::"),f.write(o.name),f.write("()")}))}:{name:"environment",assignment:h.TypeLiteral.reference(h.codeblock(f=>{f.writeNode(n),f.write("::custom(");let l=Object.entries(o.urls);l.forEach(([m,d],y)=>{f.write(`${m}: '${d}'`),y<l.length-1&&f.write(", ")}),f.write(")")}))}}}let i=this.getDefaultEnvironmentName();if(i!=null)return{name:"environment",assignment:h.TypeLiteral.reference(h.codeblock(o=>{o.writeNode(n),o.write("::"),o.write(i),o.write("()")}))}}getDefaultEnvironmentName(){var i;if(((i=this.context.ir.environments)==null?void 0:i.environments.type)!=="multipleBaseUrls")return;let t=this.context.ir.environments.environments;if(t.type!=="multipleBaseUrls")return;let e=t.environments;if(e.length===0)return;for(let o of e){let f=this.context.getClassName(o.name);if(f==="Production")return f}let n=e[0];if(n!=null)return this.context.getClassName(n.name)}resolveMultiEnvironmentName(t){let e=Object.keys(t);if(e.length===0)return;let n=e[0];if(n==null)return;let i=t[n];if(i==null)return;if(this.context.isSingleEnvironmentID(i)){let l=this.context.resolveEnvironmentName(i);if(l==null)return;if(e.every(d=>{let y=t[d];return y!=null&&this.context.isSingleEnvironmentID(y)&&y===i}))return{type:"named",name:this.context.getClassName(l)}}let o={},f=!1;for(let l of e){let m=t[l];if(m!=null&&!this.context.isSingleEnvironmentID(m)){f=!0;let d=this.getBaseUrlPropertyName(l);o[d]=m}}if(f&&Object.keys(o).length>0)return{type:"custom",urls:o}}getBaseUrlPropertyName(t){var i;if(((i=this.context.ir.environments)==null?void 0:i.environments.type)!=="multipleBaseUrls")return t;let e=this.context.ir.environments.environments;if(e.type!=="multipleBaseUrls")return t;let n=e.baseUrls.find(o=>o.id===t);return n==null?t:n.name.camelCase.safeName}getConstructorBaseUrlArgs({baseUrl:t,environment:e}){let n=this.getBaseUrlArg({baseUrl:t,environment:e});return h.TypeLiteral.isNop(n)?[]:[{name:"baseUrl",value:n}]}getBaseUrlArg({baseUrl:t,environment:e}){var n;if(t!=null&&e!=null)return this.context.errors.add({severity:v.Critical,message:"Cannot specify both baseUrl and environment options"}),h.TypeLiteral.nop();if(t!=null)return h.TypeLiteral.string(t);if(e!=null){if(this.context.isSingleEnvironmentID(e)){let i=this.context.getEnvironmentClassAccessFromID(e);return i==null?(this.context.errors.add({severity:v.Warning,message:`Environment ${JSON.stringify(e)} was not found`}),h.TypeLiteral.nop()):h.TypeLiteral.reference(h.codeblock(o=>{o.writeNode(i),o.write("->value")}))}if(((n=this.context.ir.environments)==null?void 0:n.environments.type)==="multipleBaseUrls")return h.TypeLiteral.nop()}return h.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.token),assignment:h.TypeLiteral.string(e.token)}]}getConstructorHeaderAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.header.typeReference,value:e.value})}]}getConstructorHeaderArgs({headers:t,values:e}){let n=[];for(let i of t){let o=this.getConstructorHeaderArg({header:i,value:e.value});o!=null&&n.push({name:this.context.getPropertyName(i.name.name),value:o})}return n}getConstructorHeaderArg({header:t,value:e}){let n=this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:e});if(!h.TypeLiteral.isNop(n))return n}getMethodArgs({endpoint:t,snippet:e}){switch(t.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:t.request,snippet:e});default:A(t.request)}}getMethodArgsForBodyRequest({request:t,snippet:e}){var o,f;let n=[];this.context.errors.scope(V.PathParameters);let i=[...(o=this.context.ir.pathParameters)!=null?o:[],...(f=t.pathParameters)!=null?f:[]];return i.length>0&&n.push(...this.getPathParameters({namedParameters:i,snippet:e}).map(l=>l.value)),this.context.errors.unscope(),this.context.errors.scope(V.RequestBody),t.body!=null&&n.push(this.getBodyRequestArg({body:t.body,value:e.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:A(t)}}getBytesBodyRequestArg({value:t}){return this.context.errors.add({severity:v.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),h.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:t,snippet:e}){var m,d,y,x;let n=[],i=(d=(m=this.context.customConfig)==null?void 0:m.inlinePathParameters)!=null?d:!1;this.context.errors.scope(V.PathParameters);let o=[],f=[...(y=this.context.ir.pathParameters)!=null?y:[],...(x=t.pathParameters)!=null?x:[]];f.length>0&&o.push(...this.getPathParameters({namedParameters:f,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(V.RequestBody);let l=this.getFilePropertyInfo({request:t,snippet:e});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:t,inlinePathParameters:i})||n.push(...o.map(g=>g.value)),this.context.needsRequestParameter({request:t,inlinePathParameters:i,inlineFileProperties:!0})&&n.push(this.getInlinedRequestArg({request:t,snippet:e,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:t,inlinePathParameters:i})?o:[],filePropertyInfo:l})),n}getFilePropertyInfo({request:t,snippet:e}){return t.body==null||!this.context.isFileUploadRequestBody(t.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:t.body,value:e.requestBody})}getInlinedRequestArg({request:t,snippet:e,pathParameterFields:n,filePropertyInfo:i}){var y,x,g,T;this.context.errors.scope(V.QueryParameters);let f=this.context.associateQueryParametersByWireValue({parameters:(y=t.queryParameters)!=null?y:[],values:(x=e.queryParameters)!=null?x:{}}).map(b=>({name:this.context.getPropertyName(b.name.name),value:this.context.dynamicTypeLiteralMapper.convert(b)}));this.context.errors.unscope(),this.context.errors.scope(V.Headers);let m=this.context.associateByWireValue({parameters:(g=t.headers)!=null?g:[],values:(T=e.headers)!=null?T:{}}).map(b=>({name:this.context.getPropertyName(b.name.name),value:this.context.dynamicTypeLiteralMapper.convert(b)}));this.context.errors.unscope(),this.context.errors.scope(V.RequestBody);let d=t.body!=null?this.getInlinedRequestBodyConstructorFields({body:t.body,value:e.requestBody,filePropertyInfo:i}):[];return this.context.errors.unscope(),h.TypeLiteral.class_({reference:h.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getRequestNamespace(t.declaration.fernFilepath)}),fields:[...n,...f,...m,...d]})}getInlinedRequestBodyConstructorFields({body:t,value:e,filePropertyInfo:n}){switch(t.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:t.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:t,value:e})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:n});default:A(t)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:t}){return[...t.fileFields,...t.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:t,value:e}){return{name:this.context.getPropertyName(t.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:t.bodyType,value:e})}}getReferencedRequestBodyPropertyTypeLiteral({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:A(t)}}getInlinedRequestBodyPropertyConstructorFields({parameters:t,value:e}){var o;let n=[],i=this.context.associateByWireValue({parameters:t,values:(o=this.context.getRecord(e))!=null?o:{}});for(let f of i)n.push({name:this.context.getPropertyName(f.name.name),value:this.context.dynamicTypeLiteralMapper.convert(f)});return n}getPathParameters({namedParameters:t,snippet:e}){var o;let n=[],i=this.context.associateByWireValue({parameters:t,values:(o=e.pathParameters)!=null?o:{}});for(let f of i)n.push({name:this.context.getPropertyName(f.name.name),value:this.context.dynamicTypeLiteralMapper.convert(f)});return n}getMethod({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${t.declaration.fernFilepath.allParts.map(e=>this.context.getPropertyName(e)).join("->")}->${this.context.getMethodName(t.declaration.name)}`:this.context.getMethodName(t.declaration.name)}getRootClientClassInstantiation(t){return h.instantiateClass({classReference:h.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:t,multiline:!0})}};var Dt=class extends Ke{constructor({ir:t,config:e}){super(new Ut({ir:t,config:e}))}async generate(t){return super.generate(t)}generateSync(t){return super.generateSync(t)}createSnippetGenerator(t){return new Mt({context:t})}};0&&(module.exports={DynamicSnippetsGenerator});
33
28
  /*! Bundled license information:
34
29
 
35
30
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -51,3 +46,4 @@ lodash-es/lodash.js:
51
46
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
52
47
  *)
53
48
  */
49
+ //# sourceMappingURL=index.cjs.map