@fern-api/swift-dynamic-snippets 0.1.0 → 0.25.4

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 (93) hide show
  1. package/dist/index.cjs +39 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +145 -0
  4. package/dist/index.d.ts +145 -0
  5. package/dist/index.js +39 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +11 -12
  8. package/cjs/Config.cjs +0 -12
  9. package/cjs/Config.cjs.map +0 -1
  10. package/cjs/Config.d.cts +0 -4
  11. package/cjs/DynamicSnippetsGenerator.cjs +0 -23
  12. package/cjs/DynamicSnippetsGenerator.cjs.map +0 -1
  13. package/cjs/DynamicSnippetsGenerator.d.cts +0 -18
  14. package/cjs/EndpointSnippetGenerator.cjs +0 -12
  15. package/cjs/EndpointSnippetGenerator.cjs.map +0 -1
  16. package/cjs/EndpointSnippetGenerator.d.cts +0 -54
  17. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +0 -23
  18. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +0 -1
  19. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +0 -4
  20. package/cjs/context/DynamicTypeLiteralMapper.cjs +0 -23
  21. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +0 -1
  22. package/cjs/context/DynamicTypeLiteralMapper.d.cts +0 -4
  23. package/cjs/context/DynamicTypeMapper.cjs +0 -23
  24. package/cjs/context/DynamicTypeMapper.cjs.map +0 -1
  25. package/cjs/context/DynamicTypeMapper.d.cts +0 -4
  26. package/cjs/context/FilePropertyMapper.cjs +0 -12
  27. package/cjs/context/FilePropertyMapper.cjs.map +0 -1
  28. package/cjs/context/FilePropertyMapper.d.cts +0 -4
  29. package/cjs/context/index.cjs +0 -23
  30. package/cjs/context/index.cjs.map +0 -1
  31. package/cjs/context/index.d.cts +0 -4
  32. package/cjs/index-DS-GXEiz.d.cts +0 -89
  33. package/cjs/index.cjs +0 -35
  34. package/cjs/index.cjs.map +0 -1
  35. package/cjs/index.d.cts +0 -7
  36. package/cjs/util/pascal-case.cjs +0 -23
  37. package/cjs/util/pascal-case.cjs.map +0 -1
  38. package/cjs/util/pascal-case.d.cts +0 -3
  39. package/esm/Config.d.ts +0 -4
  40. package/esm/Config.js +0 -2
  41. package/esm/Config.js.map +0 -1
  42. package/esm/DynamicSnippetsGenerator.d.ts +0 -18
  43. package/esm/DynamicSnippetsGenerator.js +0 -2
  44. package/esm/DynamicSnippetsGenerator.js.map +0 -1
  45. package/esm/EndpointSnippetGenerator.d.ts +0 -54
  46. package/esm/EndpointSnippetGenerator.js +0 -2
  47. package/esm/EndpointSnippetGenerator.js.map +0 -1
  48. package/esm/chunk-243PMR4C.js +0 -2
  49. package/esm/chunk-243PMR4C.js.map +0 -1
  50. package/esm/chunk-4YR7VIA5.js +0 -2
  51. package/esm/chunk-4YR7VIA5.js.map +0 -1
  52. package/esm/chunk-7GLUP3NF.js +0 -2
  53. package/esm/chunk-7GLUP3NF.js.map +0 -1
  54. package/esm/chunk-BGT34OGK.js +0 -15
  55. package/esm/chunk-BGT34OGK.js.map +0 -1
  56. package/esm/chunk-F6NGJ242.js +0 -2
  57. package/esm/chunk-F6NGJ242.js.map +0 -1
  58. package/esm/chunk-JBDWOK23.js +0 -2
  59. package/esm/chunk-JBDWOK23.js.map +0 -1
  60. package/esm/chunk-NEAKFXXW.js +0 -2
  61. package/esm/chunk-NEAKFXXW.js.map +0 -1
  62. package/esm/chunk-NH2Q3QVN.js +0 -2
  63. package/esm/chunk-NH2Q3QVN.js.map +0 -1
  64. package/esm/chunk-P4BOVZKM.js +0 -2
  65. package/esm/chunk-P4BOVZKM.js.map +0 -1
  66. package/esm/chunk-PKOEJ7HU.js +0 -12
  67. package/esm/chunk-PKOEJ7HU.js.map +0 -1
  68. package/esm/chunk-QKXS634U.js +0 -2
  69. package/esm/chunk-QKXS634U.js.map +0 -1
  70. package/esm/chunk-T6A4SG7G.js +0 -2
  71. package/esm/chunk-T6A4SG7G.js.map +0 -1
  72. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +0 -4
  73. package/esm/context/DynamicSnippetsGeneratorContext.js +0 -2
  74. package/esm/context/DynamicSnippetsGeneratorContext.js.map +0 -1
  75. package/esm/context/DynamicTypeLiteralMapper.d.ts +0 -4
  76. package/esm/context/DynamicTypeLiteralMapper.js +0 -2
  77. package/esm/context/DynamicTypeLiteralMapper.js.map +0 -1
  78. package/esm/context/DynamicTypeMapper.d.ts +0 -4
  79. package/esm/context/DynamicTypeMapper.js +0 -2
  80. package/esm/context/DynamicTypeMapper.js.map +0 -1
  81. package/esm/context/FilePropertyMapper.d.ts +0 -4
  82. package/esm/context/FilePropertyMapper.js +0 -2
  83. package/esm/context/FilePropertyMapper.js.map +0 -1
  84. package/esm/context/index.d.ts +0 -4
  85. package/esm/context/index.js +0 -2
  86. package/esm/context/index.js.map +0 -1
  87. package/esm/index-DS-GXEiz.d.ts +0 -89
  88. package/esm/index.d.ts +0 -7
  89. package/esm/index.js +0 -14
  90. package/esm/index.js.map +0 -1
  91. package/esm/util/pascal-case.d.ts +0 -3
  92. package/esm/util/pascal-case.js +0 -2
  93. package/esm/util/pascal-case.js.map +0 -1
@@ -1,4 +0,0 @@
1
- import '@fern-api/browser-compatible-base-generator';
2
- import '@fern-api/dynamic-ir-sdk';
3
- import '@fern-api/swift-codegen';
4
- export { D as DynamicSnippetsGeneratorContext } from '../index-DS-GXEiz.cjs';
@@ -1,23 +0,0 @@
1
- "use strict";var V=Object.defineProperty;var Dr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Lr=Object.prototype.hasOwnProperty;var kr=(t,e,r)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var X=(t,e)=>()=>(t&&(e=t(t=0)),e);var Or=(t,e)=>{for(var r in e)V(t,r,{get:e[r],enumerable:!0})},Pr=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Mr(e))!Lr.call(t,n)&&n!==r&&V(t,n,{get:()=>e[n],enumerable:!(o=Dr(e,n))||o.enumerable});return t};var Fr=t=>Pr(V({},"__esModule",{value:!0}),t);var W=(t,e,r)=>kr(t,typeof e!="symbol"?e+"":e,r);function se(){throw new Error("setTimeout has not been defined")}function pe(){throw new Error("clearTimeout has not been defined")}function le(t){if(C===setTimeout)return setTimeout(t,0);if((C===se||!C)&&setTimeout)return C=setTimeout,setTimeout(t,0);try{return C(t,0)}catch(e){try{return C.call(null,t,0)}catch(r){return C.call(this,t,0)}}}function Wr(t){if(N===clearTimeout)return clearTimeout(t);if((N===pe||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch(e){try{return N.call(null,t)}catch(r){return N.call(this,t)}}}function Yr(){!P||!D||(P=!1,D.length?I=D.concat(I):z=-1,I.length&&ce())}function ce(){if(!P){var t=le(Yr);P=!0;for(var e=I.length;e;){for(D=I,I=[];++z<e;)D&&D[z].run();z=-1,e=I.length}D=null,P=!1,Wr(t)}}function jr(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];I.push(new me(t,e)),I.length===1&&!P&&le(ce)}function me(t,e){this.fun=t,this.array=e}function M(){}function at(t){throw new Error("process.binding is not supported")}function it(){return"/"}function ft(t){throw new Error("process.chdir is not supported")}function ut(){return 0}function pt(t){var e=st.call(O)*.001,r=Math.floor(e),o=Math.floor(e%1*1e9);return t&&(r=r-t[0],o=o-t[1],o<0&&(r--,o+=1e9)),[r,o]}function ct(){var t=new Date,e=t-lt;return e/1e3}var C,N,I,P,D,z,Vr,zr,Gr,Zr,Jr,qr,Hr,$r,Kr,Qr,Xr,et,rt,tt,ot,nt,O,st,lt,m,ue,u=X(()=>{"use strict";C=se,N=pe;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);I=[],P=!1,z=-1;me.prototype.run=function(){this.fun.apply(null,this.array)};Vr="browser",zr="browser",Gr=!0,Zr={},Jr=[],qr="",Hr={},$r={},Kr={};Qr=M,Xr=M,et=M,rt=M,tt=M,ot=M,nt=M;O=globalThis.performance||{},st=O.now||O.mozNow||O.msNow||O.oNow||O.webkitNow||function(){return new Date().getTime()};lt=new Date;m={nextTick:jr,title:Vr,browser:Gr,env:Zr,argv:Jr,version:qr,versions:Hr,on:Qr,addListener:Xr,once:et,off:rt,removeListener:tt,removeAllListeners:ot,emit:nt,binding:at,cwd:it,chdir:ft,umask:ut,hrtime:pt,platform:zr,release:$r,config:Kr,uptime:ct},ue={};Object.keys(ue).forEach(t=>{let e=t.split("."),r=m;for(let o=0;o<e.length;o++){let n=e[o];o===e.length-1?r[n]=ue[t]:r=r[n]||(r[n]={})}})});function ye(){re=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)R[e]=t[e],E[t.charCodeAt(e)]=e;E[45]=62,E[95]=63}function xt(t){re||ye();var e,r,o,n,a,i,l=t.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[l-2]==="="?2:t[l-1]==="="?1:0,i=new mt(l*3/4-a),o=a>0?l-4:l;var c=0;for(e=0,r=0;e<o;e+=4,r+=3)n=E[t.charCodeAt(e)]<<18|E[t.charCodeAt(e+1)]<<12|E[t.charCodeAt(e+2)]<<6|E[t.charCodeAt(e+3)],i[c++]=n>>16&255,i[c++]=n>>8&255,i[c++]=n&255;return a===2?(n=E[t.charCodeAt(e)]<<2|E[t.charCodeAt(e+1)]>>4,i[c++]=n&255):a===1&&(n=E[t.charCodeAt(e)]<<10|E[t.charCodeAt(e+1)]<<4|E[t.charCodeAt(e+2)]>>2,i[c++]=n>>8&255,i[c++]=n&255),i}function dt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function ht(t,e,r){for(var o,n=[],a=e;a<r;a+=3)o=(t[a]<<16)+(t[a+1]<<8)+t[a+2],n.push(dt(o));return n.join("")}function xe(t){re||ye();for(var e,r=t.length,o=r%3,n="",a=[],i=16383,l=0,c=r-o;l<c;l+=i)a.push(ht(t,l,l+i>c?c:l+i));return o===1?(e=t[r-1],n+=R[e>>2],n+=R[e<<4&63],n+="=="):o===2&&(e=(t[r-2]<<8)+t[r-1],n+=R[e>>10],n+=R[e>>4&63],n+=R[e<<2&63],n+="="),a.push(n),a.join("")}function G(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function S(t,e){if(G()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=f.prototype):(t===null&&(t=new f(e)),t.length=e),t}function f(t,e,r){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return te(this,t)}return we(this,t,e,r)}function we(t,e,r,o){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?gt(t,e,r,o):typeof e=="string"?wt(t,e,r):vt(t,e)}function ge(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 yt(t,e,r,o){return ge(e),e<=0?S(t,e):r!==void 0?typeof o=="string"?S(t,e).fill(r,o):S(t,e).fill(r):S(t,e)}function te(t,e){if(ge(e),t=S(t,e<0?0:oe(e)|0),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function wt(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var o=ve(e,r)|0;t=S(t,o);var n=t.write(e,r);return n!==o&&(t=t.slice(0,n)),t}function ee(t,e){var r=e.length<0?0:oe(e.length)|0;t=S(t,r);for(var o=0;o<r;o+=1)t[o]=e[o]&255;return t}function gt(t,e,r,o){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(o||0))throw new RangeError("'length' is out of bounds");return r===void 0&&o===void 0?e=new Uint8Array(e):o===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,o),f.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=f.prototype):t=ee(t,e),t}function vt(t,e){if(b(e)){var r=oe(e.length)|0;return t=S(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Ft(e.length)?S(t,0):ee(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return ee(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function oe(t){if(t>=G())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G().toString(16)+" bytes");return t|0}function b(t){return!!(t!=null&&t._isBuffer)}function ve(t,e){if(b(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 r=t.length;if(r===0)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Se(t).length;default:if(o)return Z(t).length;e=(""+e).toLowerCase(),o=!0}}function Et(t,e,r){var o=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return _t(this,e,r);case"utf8":case"utf-8":return Ae(this,e,r);case"ascii":return Ct(this,e,r);case"latin1":case"binary":return Nt(this,e,r);case"base64":return St(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,e,r);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function L(t,e,r){var o=t[e];t[e]=t[r],t[r]=o}function Ee(t,e,r,o,n){if(t.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=f.from(e,o)),b(e))return e.length===0?-1:de(t,e,r,o,n);if(typeof e=="number")return e=e&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):de(t,[e],r,o,n);throw new TypeError("val must be string, number or Buffer")}function de(t,e,r,o,n){var a=1,i=t.length,l=e.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(t.length<2||e.length<2)return-1;a=2,i/=2,l/=2,r/=2}function c(v,k){return a===1?v[k]:v.readUInt16BE(k*a)}var d;if(n){var h=-1;for(d=r;d<i;d++)if(c(t,d)===c(e,h===-1?0:d-h)){if(h===-1&&(h=d),d-h+1===l)return h*a}else h!==-1&&(d-=d-h),h=-1}else for(r+l>i&&(r=i-l),d=r;d>=0;d--){for(var x=!0,A=0;A<l;A++)if(c(t,d+A)!==c(e,A)){x=!1;break}if(x)return d}return-1}function Tt(t,e,r,o){r=Number(r)||0;var n=t.length-r;o?(o=Number(o),o>n&&(o=n)):o=n;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");o>a/2&&(o=a/2);for(var i=0;i<o;++i){var l=parseInt(e.substr(i*2,2),16);if(isNaN(l))return i;t[r+i]=l}return i}function At(t,e,r,o){return H(Z(e,t.length-r),t,r,o)}function Te(t,e,r,o){return H(Ot(e),t,r,o)}function Rt(t,e,r,o){return Te(t,e,r,o)}function bt(t,e,r,o){return H(Se(e),t,r,o)}function It(t,e,r,o){return H(Pt(e,t.length-r),t,r,o)}function St(t,e,r){return e===0&&r===t.length?xe(t):xe(t.slice(e,r))}function Ae(t,e,r){r=Math.min(t.length,r);for(var o=[],n=e;n<r;){var a=t[n],i=null,l=a>239?4:a>223?3:a>191?2:1;if(n+l<=r){var c,d,h,x;switch(l){case 1:a<128&&(i=a);break;case 2:c=t[n+1],(c&192)===128&&(x=(a&31)<<6|c&63,x>127&&(i=x));break;case 3:c=t[n+1],d=t[n+2],(c&192)===128&&(d&192)===128&&(x=(a&15)<<12|(c&63)<<6|d&63,x>2047&&(x<55296||x>57343)&&(i=x));break;case 4:c=t[n+1],d=t[n+2],h=t[n+3],(c&192)===128&&(d&192)===128&&(h&192)===128&&(x=(a&15)<<18|(c&63)<<12|(d&63)<<6|h&63,x>65535&&x<1114112&&(i=x))}}i===null?(i=65533,l=1):i>65535&&(i-=65536,o.push(i>>>10&1023|55296),i=56320|i&1023),o.push(i),n+=l}return Ut(o)}function Ut(t){var e=t.length;if(e<=he)return String.fromCharCode.apply(String,t);for(var r="",o=0;o<e;)r+=String.fromCharCode.apply(String,t.slice(o,o+=he));return r}function Ct(t,e,r){var o="";r=Math.min(t.length,r);for(var n=e;n<r;++n)o+=String.fromCharCode(t[n]&127);return o}function Nt(t,e,r){var o="";r=Math.min(t.length,r);for(var n=e;n<r;++n)o+=String.fromCharCode(t[n]);return o}function _t(t,e,r){var o=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>o)&&(r=o);for(var n="",a=e;a<r;++a)n+=kt(t[a]);return n}function Bt(t,e,r){for(var o=t.slice(e,r),n="",a=0;a<o.length;a+=2)n+=String.fromCharCode(o[a]+o[a+1]*256);return n}function w(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function g(t,e,r,o,n,a){if(!b(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<a)throw new RangeError('"value" argument is out of bounds');if(r+o>t.length)throw new RangeError("Index out of range")}function J(t,e,r,o){e<0&&(e=65535+e+1);for(var n=0,a=Math.min(t.length-r,2);n<a;++n)t[r+n]=(e&255<<8*(o?n:1-n))>>>(o?n:1-n)*8}function q(t,e,r,o){e<0&&(e=4294967295+e+1);for(var n=0,a=Math.min(t.length-r,4);n<a;++n)t[r+n]=e>>>(o?n:3-n)*8&255}function Re(t,e,r,o,n,a){if(r+o>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function be(t,e,r,o,n){return n||Re(t,e,r,4,34028234663852886e22,-34028234663852886e22),Ce(t,e,r,o,23,4),r+4}function Ie(t,e,r,o,n){return n||Re(t,e,r,8,17976931348623157e292,-17976931348623157e292),Ce(t,e,r,o,52,8),r+8}function Mt(t){if(t=Lt(t).replace(Dt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Lt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function kt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,e){e=e||1/0;for(var r,o=t.length,n=null,a=[],i=0;i<o;++i){if(r=t.charCodeAt(i),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(i+1===o){(e-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Ot(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Pt(t,e){for(var r,o,n,a=[],i=0;i<t.length&&!((e-=2)<0);++i)r=t.charCodeAt(i),o=r>>8,n=r%256,a.push(n),a.push(o);return a}function Se(t){return xt(Mt(t))}function H(t,e,r,o){for(var n=0;n<o&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Ft(t){return t!==t}function Wt(t){return t!=null&&(!!t._isBuffer||Ue(t)||Yt(t))}function Ue(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Yt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Ue(t.slice(0,0))}function $(t,e,r,o,n){var a,i,l=n*8-o-1,c=(1<<l)-1,d=c>>1,h=-7,x=r?n-1:0,A=r?-1:1,v=t[e+x];for(x+=A,a=v&(1<<-h)-1,v>>=-h,h+=l;h>0;a=a*256+t[e+x],x+=A,h-=8);for(i=a&(1<<-h)-1,a>>=-h,h+=o;h>0;i=i*256+t[e+x],x+=A,h-=8);if(a===0)a=1-d;else{if(a===c)return i?NaN:(v?-1:1)*(1/0);i=i+Math.pow(2,o),a=a-d}return(v?-1:1)*i*Math.pow(2,a-o)}function Ce(t,e,r,o,n,a){var i,l,c,d=a*8-n-1,h=(1<<d)-1,x=h>>1,A=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=o?0:a-1,k=o?1:-1,Br=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,i=h):(i=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-i))<1&&(i--,c*=2),i+x>=1?e+=A/c:e+=A*Math.pow(2,1-x),e*c>=2&&(i++,c/=2),i+x>=h?(l=0,i=h):i+x>=1?(l=(e*c-1)*Math.pow(2,n),i=i+x):(l=e*Math.pow(2,x-1)*Math.pow(2,n),i=0));n>=8;t[r+v]=l&255,v+=k,l/=256,n-=8);for(i=i<<n|l,d+=n;d>0;t[r+v]=i&255,v+=k,i/=256,d-=8);t[r+v-k]|=Br*128}var R,E,mt,re,he,Dt,Ne=X(()=>{"use strict";u();s();R=[],E=[],mt=typeof Uint8Array!="undefined"?Uint8Array:Array,re=!1;f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;f.poolSize=8192;f._augment=function(t){return t.__proto__=f.prototype,t};f.from=function(t,e,r){return we(null,t,e,r)};f.kMaxLength=G();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]);f.alloc=function(t,e,r){return yt(null,t,e,r)};f.allocUnsafe=function(t){return te(null,t)};f.allocUnsafeSlow=function(t){return te(null,t)};f.isBuffer=Wt;f.compare=function(e,r){if(!b(e)||!b(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var o=e.length,n=r.length,a=0,i=Math.min(o,n);a<i;++a)if(e[a]!==r[a]){o=e[a],n=r[a];break}return o<n?-1:n<o?1:0};f.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};f.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return f.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<e.length;++o)r+=e[o].length;var n=f.allocUnsafe(r),a=0;for(o=0;o<e.length;++o){var i=e[o];if(!b(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,a),a+=i.length}return n};f.byteLength=ve;f.prototype._isBuffer=!0;f.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)L(this,r,r+1);return this};f.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)L(this,r,r+3),L(this,r+1,r+2);return this};f.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)L(this,r,r+7),L(this,r+1,r+6),L(this,r+2,r+5),L(this,r+3,r+4);return this};f.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Ae(this,0,e):Et.apply(this,arguments)};f.prototype.equals=function(e){if(!b(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:f.compare(this,e)===0};f.prototype.compare=function(e,r,o,n,a){if(!b(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),o===void 0&&(o=e?e.length:0),n===void 0&&(n=0),a===void 0&&(a=this.length),r<0||o>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&r>=o)return 0;if(n>=a)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,n>>>=0,a>>>=0,this===e)return 0;for(var i=a-n,l=o-r,c=Math.min(i,l),d=this.slice(n,a),h=e.slice(r,o),x=0;x<c;++x)if(d[x]!==h[x]){i=d[x],l=h[x];break}return i<l?-1:l<i?1:0};f.prototype.includes=function(e,r,o){return this.indexOf(e,r,o)!==-1};f.prototype.indexOf=function(e,r,o){return Ee(this,e,r,o,!0)};f.prototype.lastIndexOf=function(e,r,o){return Ee(this,e,r,o,!1)};f.prototype.write=function(e,r,o,n){if(r===void 0)n="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")n=r,o=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(o)?(o=o|0,n===void 0&&(n="utf8")):(n=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-r;if((o===void 0||o>a)&&(o=a),e.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return Tt(this,e,r,o);case"utf8":case"utf-8":return At(this,e,r,o);case"ascii":return Te(this,e,r,o);case"latin1":case"binary":return Rt(this,e,r,o);case"base64":return bt(this,e,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,e,r,o);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};he=4096;f.prototype.slice=function(e,r){var o=this.length;e=~~e,r=r===void 0?o:~~r,e<0?(e+=o,e<0&&(e=0)):e>o&&(e=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<e&&(r=e);var n;if(f.TYPED_ARRAY_SUPPORT)n=this.subarray(e,r),n.__proto__=f.prototype;else{var a=r-e;n=new f(a,void 0);for(var i=0;i<a;++i)n[i]=this[i+e]}return n};f.prototype.readUIntLE=function(e,r,o){e=e|0,r=r|0,o||w(e,r,this.length);for(var n=this[e],a=1,i=0;++i<r&&(a*=256);)n+=this[e+i]*a;return n};f.prototype.readUIntBE=function(e,r,o){e=e|0,r=r|0,o||w(e,r,this.length);for(var n=this[e+--r],a=1;r>0&&(a*=256);)n+=this[e+--r]*a;return n};f.prototype.readUInt8=function(e,r){return r||w(e,1,this.length),this[e]};f.prototype.readUInt16LE=function(e,r){return r||w(e,2,this.length),this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function(e,r){return r||w(e,2,this.length),this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function(e,r){return r||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function(e,r){return r||w(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function(e,r,o){e=e|0,r=r|0,o||w(e,r,this.length);for(var n=this[e],a=1,i=0;++i<r&&(a*=256);)n+=this[e+i]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*r)),n};f.prototype.readIntBE=function(e,r,o){e=e|0,r=r|0,o||w(e,r,this.length);for(var n=r,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};f.prototype.readInt8=function(e,r){return r||w(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};f.prototype.readInt16LE=function(e,r){r||w(e,2,this.length);var o=this[e]|this[e+1]<<8;return o&32768?o|4294901760:o};f.prototype.readInt16BE=function(e,r){r||w(e,2,this.length);var o=this[e+1]|this[e]<<8;return o&32768?o|4294901760:o};f.prototype.readInt32LE=function(e,r){return r||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function(e,r){return r||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function(e,r){return r||w(e,4,this.length),$(this,e,!0,23,4)};f.prototype.readFloatBE=function(e,r){return r||w(e,4,this.length),$(this,e,!1,23,4)};f.prototype.readDoubleLE=function(e,r){return r||w(e,8,this.length),$(this,e,!0,52,8)};f.prototype.readDoubleBE=function(e,r){return r||w(e,8,this.length),$(this,e,!1,52,8)};f.prototype.writeUIntLE=function(e,r,o,n){if(e=+e,r=r|0,o=o|0,!n){var a=Math.pow(2,8*o)-1;g(this,e,r,o,a,0)}var i=1,l=0;for(this[r]=e&255;++l<o&&(i*=256);)this[r+l]=e/i&255;return r+o};f.prototype.writeUIntBE=function(e,r,o,n){if(e=+e,r=r|0,o=o|0,!n){var a=Math.pow(2,8*o)-1;g(this,e,r,o,a,0)}var i=o-1,l=1;for(this[r+i]=e&255;--i>=0&&(l*=256);)this[r+i]=e/l&255;return r+o};f.prototype.writeUInt8=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};f.prototype.writeUInt16LE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):J(this,e,r,!0),r+2};f.prototype.writeUInt16BE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):J(this,e,r,!1),r+2};f.prototype.writeUInt32LE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):q(this,e,r,!0),r+4};f.prototype.writeUInt32BE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):q(this,e,r,!1),r+4};f.prototype.writeIntLE=function(e,r,o,n){if(e=+e,r=r|0,!n){var a=Math.pow(2,8*o-1);g(this,e,r,o,a-1,-a)}var i=0,l=1,c=0;for(this[r]=e&255;++i<o&&(l*=256);)e<0&&c===0&&this[r+i-1]!==0&&(c=1),this[r+i]=(e/l>>0)-c&255;return r+o};f.prototype.writeIntBE=function(e,r,o,n){if(e=+e,r=r|0,!n){var a=Math.pow(2,8*o-1);g(this,e,r,o,a-1,-a)}var i=o-1,l=1,c=0;for(this[r+i]=e&255;--i>=0&&(l*=256);)e<0&&c===0&&this[r+i+1]!==0&&(c=1),this[r+i]=(e/l>>0)-c&255;return r+o};f.prototype.writeInt8=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};f.prototype.writeInt16LE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):J(this,e,r,!0),r+2};f.prototype.writeInt16BE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):J(this,e,r,!1),r+2};f.prototype.writeInt32LE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):q(this,e,r,!0),r+4};f.prototype.writeInt32BE=function(e,r,o){return e=+e,r=r|0,o||g(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):q(this,e,r,!1),r+4};f.prototype.writeFloatLE=function(e,r,o){return be(this,e,r,!0,o)};f.prototype.writeFloatBE=function(e,r,o){return be(this,e,r,!1,o)};f.prototype.writeDoubleLE=function(e,r,o){return Ie(this,e,r,!0,o)};f.prototype.writeDoubleBE=function(e,r,o){return Ie(this,e,r,!1,o)};f.prototype.copy=function(e,r,o,n){if(o||(o=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<o&&(n=o),n===o||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-o&&(n=e.length-r+o);var a=n-o,i;if(this===e&&o<r&&r<n)for(i=a-1;i>=0;--i)e[i+r]=this[i+o];else if(a<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+r]=this[i+o];else Uint8Array.prototype.set.call(e,this.subarray(o,o+a),r);return a};f.prototype.fill=function(e,r,o,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,o=this.length):typeof o=="string"&&(n=o,o=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,e||(e=0);var i;if(typeof e=="number")for(i=r;i<o;++i)this[i]=e;else{var l=b(e)?e:Z(new f(e,n).toString()),c=l.length;for(i=0;i<o-r;++i)this[i+r]=l[i%c]}return this};Dt=/[^+\/0-9A-Za-z-_]/g});var s=X(()=>{"use strict";Ne()});var Cn={};Or(Cn,{DynamicTypeLiteralMapper:()=>fe});module.exports=Fr(Cn);u();s();u();s();u();s();function T(t){throw new Error("Unexpected value: "+JSON.stringify(t))}u();s();u();s();u();s();u();s();u();s();u();s();var jt=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,_e=jt;var Vt=typeof self=="object"&&self&&self.Object===Object&&self,zt=_e||Vt||Function("return this")(),Be=zt;var Gt=Be.Symbol,U=Gt;u();s();var De=Object.prototype,Zt=De.hasOwnProperty,Jt=De.toString,Y=U?U.toStringTag:void 0;function qt(t){var e=Zt.call(t,Y),r=t[Y];try{t[Y]=void 0;var o=!0}catch(a){}var n=Jt.call(t);return o&&(e?t[Y]=r:delete t[Y]),n}var Me=qt;u();s();var Ht=Object.prototype,$t=Ht.toString;function Kt(t){return $t.call(t)}var Le=Kt;var Qt="[object Null]",Xt="[object Undefined]",ke=U?U.toStringTag:void 0;function eo(t){return t==null?t===void 0?Xt:Qt:ke&&ke in Object(t)?Me(t):Le(t)}var Oe=eo;u();s();function ro(t){return t!=null&&typeof t=="object"}var Pe=ro;var to="[object Symbol]";function oo(t){return typeof t=="symbol"||Pe(t)&&Oe(t)==to}var Fe=oo;u();s();u();s();function no(t,e){for(var r=-1,o=t==null?0:t.length,n=Array(o);++r<o;)n[r]=e(t[r],r,t);return n}var We=no;u();s();var ao=Array.isArray,Ye=ao;var io=1/0,je=U?U.prototype:void 0,Ve=je?je.toString:void 0;function ze(t){if(typeof t=="string")return t;if(Ye(t))return We(t,ze)+"";if(Fe(t))return Ve?Ve.call(t):"";var e=t+"";return e=="0"&&1/t==-io?"-0":e}var Ge=ze;u();s();function fo(t){return t==null?"":Ge(t)}var _=fo;u();s();u();s();u();s();u();s();u();s();u();s();function uo(t,e,r){var o=-1,n=t.length;e<0&&(e=-e>n?0:n+e),r=r>n?n:r,r<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(n);++o<n;)a[o]=t[o+e];return a}var Ze=uo;function so(t,e,r){var o=t.length;return r=r===void 0?o:r,!e&&r>=o?t:Ze(t,e,r)}var Je=so;u();s();var po="\\ud800-\\udfff",lo="\\u0300-\\u036f",co="\\ufe20-\\ufe2f",mo="\\u20d0-\\u20ff",xo=lo+co+mo,ho="\\ufe0e\\ufe0f",yo="\\u200d",wo=RegExp("["+yo+po+xo+ho+"]");function go(t){return wo.test(t)}var K=go;u();s();u();s();function vo(t){return t.split("")}var qe=vo;u();s();var He="\\ud800-\\udfff",Eo="\\u0300-\\u036f",To="\\ufe20-\\ufe2f",Ao="\\u20d0-\\u20ff",Ro=Eo+To+Ao,bo="\\ufe0e\\ufe0f",Io="["+He+"]",ne="["+Ro+"]",ae="\\ud83c[\\udffb-\\udfff]",So="(?:"+ne+"|"+ae+")",$e="[^"+He+"]",Ke="(?:\\ud83c[\\udde6-\\uddff]){2}",Qe="[\\ud800-\\udbff][\\udc00-\\udfff]",Uo="\\u200d",Xe=So+"?",er="["+bo+"]?",Co="(?:"+Uo+"(?:"+[$e,Ke,Qe].join("|")+")"+er+Xe+")*",No=er+Xe+Co,_o="(?:"+[$e+ne+"?",ne,Ke,Qe,Io].join("|")+")",Bo=RegExp(ae+"(?="+ae+")|"+_o+No,"g");function Do(t){return t.match(Bo)||[]}var rr=Do;function Mo(t){return K(t)?rr(t):qe(t)}var tr=Mo;function Lo(t){return function(e){e=_(e);var r=K(e)?tr(e):void 0,o=r?r[0]:e.charAt(0),n=r?Je(r,1).join(""):e.slice(1);return o[t]()+n}}var or=Lo;var ko=or("toUpperCase"),j=ko;function Oo(t){return j(_(t).toLowerCase())}var nr=Oo;u();s();u();s();function Po(t,e,r,o){var n=-1,a=t==null?0:t.length;for(o&&a&&(r=t[++n]);++n<a;)r=e(r,t[n],n,t);return r}var ar=Po;u();s();u();s();u();s();function Fo(t){return function(e){return t==null?void 0:t[e]}}var ir=Fo;var Wo={\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"},Yo=ir(Wo),fr=Yo;var jo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vo="\\u0300-\\u036f",zo="\\ufe20-\\ufe2f",Go="\\u20d0-\\u20ff",Zo=Vo+zo+Go,Jo="["+Zo+"]",qo=RegExp(Jo,"g");function Ho(t){return t=_(t),t&&t.replace(jo,fr).replace(qo,"")}var ur=Ho;u();s();u();s();var $o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ko(t){return t.match($o)||[]}var sr=Ko;u();s();var Qo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Xo(t){return Qo.test(t)}var pr=Xo;u();s();var dr="\\ud800-\\udfff",en="\\u0300-\\u036f",rn="\\ufe20-\\ufe2f",tn="\\u20d0-\\u20ff",on=en+rn+tn,hr="\\u2700-\\u27bf",yr="a-z\\xdf-\\xf6\\xf8-\\xff",nn="\\xac\\xb1\\xd7\\xf7",an="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fn="\\u2000-\\u206f",un=" \\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",wr="A-Z\\xc0-\\xd6\\xd8-\\xde",sn="\\ufe0e\\ufe0f",gr=nn+an+fn+un,vr="['\u2019]",lr="["+gr+"]",pn="["+on+"]",Er="\\d+",ln="["+hr+"]",Tr="["+yr+"]",Ar="[^"+dr+gr+Er+hr+yr+wr+"]",cn="\\ud83c[\\udffb-\\udfff]",mn="(?:"+pn+"|"+cn+")",xn="[^"+dr+"]",Rr="(?:\\ud83c[\\udde6-\\uddff]){2}",br="[\\ud800-\\udbff][\\udc00-\\udfff]",F="["+wr+"]",dn="\\u200d",cr="(?:"+Tr+"|"+Ar+")",hn="(?:"+F+"|"+Ar+")",mr="(?:"+vr+"(?:d|ll|m|re|s|t|ve))?",xr="(?:"+vr+"(?:D|LL|M|RE|S|T|VE))?",Ir=mn+"?",Sr="["+sn+"]?",yn="(?:"+dn+"(?:"+[xn,Rr,br].join("|")+")"+Sr+Ir+")*",wn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vn=Sr+Ir+yn,En="(?:"+[ln,Rr,br].join("|")+")"+vn,Tn=RegExp([F+"?"+Tr+"+"+mr+"(?="+[lr,F,"$"].join("|")+")",hn+"+"+xr+"(?="+[lr,F+cr,"$"].join("|")+")",F+"?"+cr+"+"+mr,F+"+"+xr,gn,wn,Er,En].join("|"),"g");function An(t){return t.match(Tn)||[]}var Ur=An;function Rn(t,e,r){return t=_(t),e=r?void 0:e,e===void 0?pr(t)?Ur(t):sr(t):t.match(e)||[]}var Cr=Rn;var bn="['\u2019]",In=RegExp(bn,"g");function Sn(t){return function(e){return ar(Cr(ur(e).replace(In,"")),t,"")}}var Nr=Sn;var Un=Nr(function(t,e,r){return e=e.toLowerCase(),t+(r?nr(e):e)}),ie=Un;u();s();u();s();var B={Critical:"CRITICAL",Warning:"WARNING"};var p=require("@fern-api/swift-codegen");u();s();var y=require("@fern-api/swift-codegen");u();s();function _r(t){return j(ie(t))}var Q=class{constructor({context:e}){W(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return y.swift.Type.array(this.convert({typeReference:e.typeReference.value}));case"literal":return this.convertLiteral({literal:e.typeReference.value});case"map":return y.swift.Type.dictionary(this.convert({typeReference:e.typeReference.key}),this.convert({typeReference:e.typeReference.value}));case"named":{let r=this.context.resolveNamedType({typeId:e.typeReference.value});return r==null?this.convertUnknown():this.convertNamed({named:r})}case"optional":return y.swift.Type.optional(this.convert({typeReference:e.typeReference.value}));case"nullable":return y.swift.Type.nullable(this.convert({typeReference:e.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value});case"set":return y.swift.Type.jsonValue();case"unknown":return this.convertUnknown();default:T(e.typeReference)}}convertNamed({named:e}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return y.swift.Type.custom(e.declaration.name.pascalCase.unsafeName);default:T(e)}}convertLiteral({literal:e}){switch(e.type){case"boolean":return y.swift.Type.bool();case"string":return y.swift.Type.custom(_r(e.value))}}convertUnknown(){return y.swift.Type.jsonValue()}convertPrimitive({primitive:e}){switch(e){case"INTEGER":return y.swift.Type.int();case"UINT":return y.swift.Type.int();case"LONG":return y.swift.Type.int64();case"UINT_64":return y.swift.Type.uint64();case"FLOAT":return y.swift.Type.float();case"DOUBLE":return y.swift.Type.double();case"BOOLEAN":return y.swift.Type.bool();case"STRING":return y.swift.Type.string();case"DATE":return y.swift.Type.date();case"DATE_TIME":return y.swift.Type.date();case"UUID":return y.swift.Type.uuid();case"BASE_64":return y.swift.Type.string();case"BIG_INTEGER":return y.swift.Type.string();default:T(e)}}};var fe=class{constructor({context:e}){W(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":{if(e.typeReference.value.type==="string")return p.swift.Expression.enumCaseShorthand(p.LiteralEnum.generateEnumCaseLabel(e.typeReference.value.value));if(e.typeReference.value.type==="boolean")return p.swift.Expression.nop();T(e.typeReference.value);break}case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let r=this.context.resolveNamedType({typeId:e.typeReference.value});return r==null?p.swift.Expression.nop():this.convertNamed({named:r,value:e.value,as:e.as})}case"nullable":return this.convertNullable({nullable:e.typeReference,value:e.value,as:e.as});case"optional":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return p.swift.Expression.nop();case"unknown":return this.convertUnknown(e.value);default:T(e.typeReference)}}convertList({list:e,value:r}){return Array.isArray(r)?p.swift.Expression.arrayLiteral({elements:r.map((o,n)=>{this.context.errors.scope({index:n});try{return this.convert({typeReference:e,value:o})}finally{this.context.errors.unscope()}}),multiline:!0}):(this.context.errors.add({severity:B.Critical,message:`Expected array but got: ${typeof r}`}),p.swift.Expression.nop())}convertMap({map:e,value:r}){return typeof r!="object"||r==null?(this.context.errors.add({severity:B.Critical,message:`Expected object but got: ${r==null?"null":typeof r}`}),p.swift.Expression.nop()):p.swift.Expression.dictionaryLiteral({entries:Object.entries(r).map(([o,n])=>{this.context.errors.scope(o);try{return[this.convert({typeReference:e.key,value:o,as:"mapKey"}),this.convert({typeReference:e.value,value:n,as:"mapValue"})]}finally{this.context.errors.unscope()}}),multiline:!0})}convertNamed({named:e,value:r,as:o}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:r,as:o});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:r});case"enum":return this.convertEnum({enum_:e,value:r});case"object":return this.convertObject({object_:e,value:r,as:o});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r});default:T(e)}}convertNullable({nullable:e,value:r,as:o}){return r==null?p.swift.Expression.enumCaseShorthand("null"):p.swift.Expression.contextualMethodCall({methodName:"value",arguments_:[p.swift.functionArgument({value:this.convert({typeReference:e.value,value:r,as:o})})]})}convertDiscriminatedUnion({discriminatedUnion:e,value:r}){let o=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r});if(o==null)return p.swift.Expression.nop();let n=o.singleDiscriminatedUnionType,a=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:o,unionVariant:n});return a==null?p.swift.Expression.nop():p.swift.Expression.methodCall({target:p.swift.Expression.reference(e.declaration.name.pascalCase.unsafeName),methodName:p.EnumWithAssociatedValues.sanitizeToCamelCase(n.discriminantValue.name.camelCase.unsafeName),arguments_:[p.swift.functionArgument({value:p.swift.Expression.contextualMethodCall({methodName:"init",arguments_:a,multiline:!0})})],multiline:!0})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:e,unionVariant:r}){var n;let o=this.getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:r});switch(r.type){case"samePropertiesAsObject":{let a=this.context.resolveNamedType({typeId:r.typeId});if(a==null)return;let i=this.convertNamed({named:a,value:e.value});if(!i.isStructInitialization()){this.context.errors.add({severity:B.Critical,message:"Internal error; expected union value to be a struct"});return}let l=i.asStructInitializationOrThrow();return[...o,...(n=l.arguments_)!=null?n:[]]}case"singleProperty":try{this.context.errors.scope(r.discriminantValue.wireValue);let a=this.context.getRecord(e.value);return a==null?[...o]:[...o,p.swift.functionArgument({label:(0,p.sanitizeSelf)(p.EnumWithAssociatedValues.sanitizeToCamelCase(r.discriminantValue.name.camelCase.unsafeName)),value:this.convert({typeReference:r.typeReference,value:a[r.discriminantValue.wireValue]})})]}finally{this.context.errors.unscope()}case"noProperties":return o;default:T(r)}}getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:r}){var n;return this.context.getExampleObjectProperties({parameters:(n=r.properties)!=null?n:[],snippetObject:e.value}).map(a=>{this.context.errors.scope(a.name.wireValue);try{return p.swift.functionArgument({label:(0,p.sanitizeSelf)(a.name.name.camelCase.unsafeName),value:this.convert(a)})}finally{this.context.errors.unscope()}})}convertEnum({enum_:e,value:r}){let o=this.getEnumValue({enum_:e,value:r});return o==null?p.swift.Expression.nop():p.swift.Expression.enumCaseShorthand(o.name.camelCase.unsafeName)}getEnumValue({enum_:e,value:r}){if(typeof r!="string"){this.context.errors.add({severity:B.Critical,message:`Expected enum value string, got: ${typeof r}`});return}let o=e.values.find(n=>n.wireValue===r);if(o==null){this.context.errors.add({severity:B.Critical,message:`An enum value named "${r}" does not exist in this context`});return}return o}convertObject({object_:e,value:r,as:o}){return p.swift.Expression.structInitialization({unsafeName:e.declaration.name.pascalCase.unsafeName,arguments_:this.context.getExampleObjectProperties({parameters:e.properties,snippetObject:r}).map(n=>this.convert(n).isNop()?null:p.swift.functionArgument({label:(0,p.sanitizeSelf)(n.name.name.camelCase.unsafeName),value:this.convert(n)})).filter(n=>n!=null),multiline:!0})}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r}){let o=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r});return o==null?p.swift.Expression.nop():o}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r}){for(let o of e.types)try{let n=this.convert({typeReference:o,value:r}),i=new Q({context:this.context}).convert({typeReference:o});return p.swift.Expression.methodCall({target:p.swift.Expression.reference(e.declaration.name.pascalCase.unsafeName),methodName:i.toCaseName(),arguments_:[p.swift.functionArgument({value:n})],multiline:!0})}catch(n){continue}this.context.errors.add({severity:B.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof r}" value`})}convertUnknown(e){switch(typeof e){case"boolean":return p.swift.Expression.contextualMethodCall({methodName:"bool",arguments_:[p.swift.functionArgument({value:p.swift.Expression.boolLiteral(e)})]});case"string":return p.swift.Expression.contextualMethodCall({methodName:"string",arguments_:[p.swift.functionArgument({value:p.swift.Expression.stringLiteral(e)})]});case"number":return p.swift.Expression.contextualMethodCall({methodName:"number",arguments_:[p.swift.functionArgument({value:p.swift.Expression.numberLiteral(e)})]});case"object":return e===null?p.swift.Expression.enumCaseShorthand("null"):Array.isArray(e)?p.swift.Expression.contextualMethodCall({methodName:"array",arguments_:[p.swift.functionArgument({value:p.swift.Expression.arrayLiteral({elements:e.map(r=>this.convertUnknown(r)),multiline:!0})})]}):p.swift.Expression.contextualMethodCall({methodName:"object",arguments_:[p.swift.functionArgument({value:p.swift.Expression.dictionaryLiteral({entries:Object.entries(e).map(([r,o])=>[p.swift.Expression.stringLiteral(r),this.convertUnknown(o)]),multiline:!0})})]});default:throw new Error(`Internal error; unsupported unknown type: ${typeof e}`)}}convertPrimitive({primitive:e,value:r,as:o}){switch(e){case"INTEGER":case"UINT":case"LONG":case"UINT_64":case"FLOAT":case"DOUBLE":{let n=this.getValueAsNumber({value:r,as:o});return n==null?p.swift.Expression.nop():p.swift.Expression.numberLiteral(n)}case"BOOLEAN":{let n=this.getValueAsBoolean({value:r,as:o});return n==null?p.swift.Expression.nop():p.swift.Expression.boolLiteral(n)}case"STRING":{let n=this.context.getValueAsString({value:r});return n==null?p.swift.Expression.nop():p.swift.Expression.stringLiteral(n)}case"DATE":{let n=this.context.getValueAsString({value:r});return n==null?p.swift.Expression.nop():p.swift.Expression.calendarDateLiteral(n)}case"DATE_TIME":{let n=this.context.getValueAsString({value:r});if(n==null)return p.swift.Expression.nop();let a=new Date(n).getTime(),i=Math.round(a/1e3),c=new Date(i*1e3).toISOString().replace(/\.\d{3}Z$/,"Z");return p.swift.Expression.dateLiteral(c)}case"UUID":{let n=this.context.getValueAsString({value:r});return n==null?p.swift.Expression.nop():p.swift.Expression.uuidLiteral(n)}case"BASE_64":{let n=this.context.getValueAsString({value:r});return n==null?p.swift.Expression.nop():p.swift.Expression.stringLiteral(n)}case"BIG_INTEGER":return this.context.getValueAsString({value:r})==null?p.swift.Expression.nop():p.swift.Expression.nop();default:T(e)}}getValueAsNumber({value:e,as:r}){let o=r==="mapKey"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:o})}getValueAsBoolean({value:e,as:r}){let o=(()=>{switch(r){case"mapKey":return e==="true"?!0:e==="false"?!1:e;case"mapValue":case void 0:return e;default:T(r)}})();return this.context.getValueAsBoolean({value:o})}};0&&(module.exports={DynamicTypeLiteralMapper});
2
- /*! Bundled license information:
3
-
4
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
5
- (*!
6
- * The buffer module from node.js, for the browser.
7
- *
8
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9
- * @license MIT
10
- *)
11
-
12
- lodash-es/lodash.js:
13
- (**
14
- * @license
15
- * Lodash (Custom Build) <https://lodash.com/>
16
- * Build: `lodash modularize exports="es" -o ./`
17
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
18
- * Released under MIT license <https://lodash.com/license>
19
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
20
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
21
- *)
22
- */
23
- //# sourceMappingURL=DynamicTypeLiteralMapper.cjs.map