@ultrade/shared 1.0.8 → 1.0.9

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 (123) hide show
  1. package/dist/browser/common/auth.helper.js +17 -0
  2. package/dist/browser/common/big-number.helper.js +11 -0
  3. package/dist/browser/common/index.js +17 -0
  4. package/dist/browser/common/mappers/codexAsset.mapper.js +11 -0
  5. package/dist/browser/common/mappers/codexBalance.mapper.js +11 -0
  6. package/dist/browser/common/mappers/index.js +11 -0
  7. package/dist/browser/common/mappers/trade.mapper.js +11 -0
  8. package/dist/browser/common/utils/assert.js +11 -0
  9. package/dist/browser/common/utils/decode.js +11 -0
  10. package/dist/browser/common/utils/index.js +11 -0
  11. package/dist/browser/common/utils/social.js +11 -0
  12. package/dist/browser/common/utils/stat.js +11 -0
  13. package/dist/browser/constants/index.js +11 -0
  14. package/dist/browser/enums/index.js +11 -0
  15. package/dist/browser/helpers/Encoding.js +17 -0
  16. package/dist/browser/helpers/algo.helper.js +17 -0
  17. package/dist/browser/helpers/assert.helper.js +11 -0
  18. package/dist/browser/helpers/atomic.helper.js +11 -0
  19. package/dist/browser/helpers/balance.helper.js +17 -0
  20. package/dist/browser/helpers/codex/common.helper.js +18 -0
  21. package/dist/browser/helpers/codex/index.js +18 -0
  22. package/dist/browser/helpers/codex/mbr.helper.js +17 -0
  23. package/dist/browser/helpers/codex/mna.helper.js +17 -0
  24. package/dist/browser/helpers/codex/order.helper.js +17 -0
  25. package/dist/browser/helpers/codex/setGlobal.helper.js +17 -0
  26. package/dist/browser/helpers/codex/transfer.helper.js +18 -0
  27. package/dist/browser/helpers/codex/txn.helper.js +17 -0
  28. package/dist/browser/helpers/codex.helper.js +24 -0
  29. package/dist/browser/helpers/eth.helper.js +18 -0
  30. package/dist/browser/helpers/index.js +11 -0
  31. package/dist/browser/helpers/interval.helpers.js +11 -0
  32. package/dist/browser/helpers/liquidity.helper.js +11 -0
  33. package/dist/browser/helpers/order.helper.js +11 -0
  34. package/dist/browser/helpers/pair.helper.js +11 -0
  35. package/dist/browser/helpers/pointSystem.helper.js +11 -0
  36. package/dist/browser/helpers/ticker.helpers.js +11 -0
  37. package/dist/browser/helpers/vaa.helper.js +11 -0
  38. package/dist/browser/helpers/withdraw.helper.js +18 -0
  39. package/dist/browser/interfaces/index.js +11 -0
  40. package/dist/browser/types/index.js +11 -0
  41. package/dist/node/common/auth.helper.js +1 -0
  42. package/dist/node/common/big-number.helper.js +1 -0
  43. package/dist/node/common/index.js +1 -0
  44. package/dist/node/common/mappers/codexAsset.mapper.js +1 -0
  45. package/dist/node/common/mappers/codexBalance.mapper.js +1 -0
  46. package/dist/node/common/mappers/index.js +1 -0
  47. package/dist/node/common/mappers/trade.mapper.js +1 -0
  48. package/dist/node/common/utils/assert.js +1 -0
  49. package/dist/node/common/utils/decode.js +1 -0
  50. package/dist/node/common/utils/index.js +1 -0
  51. package/dist/node/common/utils/social.js +1 -0
  52. package/dist/node/common/utils/stat.js +1 -0
  53. package/dist/node/constants/index.js +1 -0
  54. package/dist/node/enums/index.js +1 -0
  55. package/dist/node/helpers/Encoding.js +1 -0
  56. package/dist/node/helpers/algo.helper.js +1 -0
  57. package/dist/node/helpers/assert.helper.js +1 -0
  58. package/dist/node/helpers/atomic.helper.js +1 -0
  59. package/dist/node/helpers/balance.helper.js +1 -0
  60. package/dist/node/helpers/codex/common.helper.js +2 -0
  61. package/dist/node/helpers/codex/index.js +2 -0
  62. package/dist/node/helpers/codex/mbr.helper.js +1 -0
  63. package/dist/node/helpers/codex/mna.helper.js +1 -0
  64. package/dist/node/helpers/codex/order.helper.js +1 -0
  65. package/dist/node/helpers/codex/setGlobal.helper.js +1 -0
  66. package/dist/node/helpers/codex/transfer.helper.js +2 -0
  67. package/dist/node/helpers/codex/txn.helper.js +1 -0
  68. package/dist/node/helpers/codex.helper.js +8 -0
  69. package/dist/node/helpers/eth.helper.js +2 -0
  70. package/dist/node/helpers/index.js +1 -0
  71. package/dist/node/helpers/interval.helpers.js +1 -0
  72. package/dist/node/helpers/liquidity.helper.js +1 -0
  73. package/dist/node/helpers/order.helper.js +1 -0
  74. package/dist/node/helpers/pair.helper.js +1 -0
  75. package/dist/node/helpers/pointSystem.helper.js +1 -0
  76. package/dist/node/helpers/ticker.helpers.js +1 -0
  77. package/dist/node/helpers/vaa.helper.js +0 -0
  78. package/dist/node/helpers/withdraw.helper.js +2 -0
  79. package/dist/node/interfaces/index.js +1 -0
  80. package/dist/node/types/index.js +1 -0
  81. package/dist/src/helpers/codex/common.helper.d.ts +1 -1
  82. package/dist/src/helpers/vaa.helper.d.ts +0 -2
  83. package/package.json +25 -47
  84. package/dist/common/auth.helper.js +0 -1
  85. package/dist/common/big-number.helper.js +0 -1
  86. package/dist/common/index.js +0 -1
  87. package/dist/common/mappers/codexAsset.mapper.js +0 -1
  88. package/dist/common/mappers/codexBalance.mapper.js +0 -1
  89. package/dist/common/mappers/index.js +0 -1
  90. package/dist/common/mappers/trade.mapper.js +0 -1
  91. package/dist/common/utils/assert.js +0 -1
  92. package/dist/common/utils/decode.js +0 -1
  93. package/dist/common/utils/index.js +0 -1
  94. package/dist/common/utils/social.js +0 -1
  95. package/dist/common/utils/stat.js +0 -1
  96. package/dist/constants/index.js +0 -1
  97. package/dist/enums/index.js +0 -1
  98. package/dist/helpers/Encoding.js +0 -1
  99. package/dist/helpers/algo.helper.js +0 -1
  100. package/dist/helpers/assert.helper.js +0 -1
  101. package/dist/helpers/atomic.helper.js +0 -1
  102. package/dist/helpers/balance.helper.js +0 -1
  103. package/dist/helpers/codex/common.helper.js +0 -2
  104. package/dist/helpers/codex/index.js +0 -2
  105. package/dist/helpers/codex/mbr.helper.js +0 -1
  106. package/dist/helpers/codex/mna.helper.js +0 -1
  107. package/dist/helpers/codex/order.helper.js +0 -1
  108. package/dist/helpers/codex/setGlobal.helper.js +0 -1
  109. package/dist/helpers/codex/transfer.helper.js +0 -2
  110. package/dist/helpers/codex/txn.helper.js +0 -1
  111. package/dist/helpers/codex.helper.js +0 -8
  112. package/dist/helpers/eth.helper.js +0 -2
  113. package/dist/helpers/index.js +0 -1
  114. package/dist/helpers/interval.helpers.js +0 -1
  115. package/dist/helpers/liquidity.helper.js +0 -1
  116. package/dist/helpers/order.helper.js +0 -1
  117. package/dist/helpers/pair.helper.js +0 -1
  118. package/dist/helpers/pointSystem.helper.js +0 -1
  119. package/dist/helpers/ticker.helpers.js +0 -1
  120. package/dist/helpers/vaa.helper.js +0 -1
  121. package/dist/helpers/withdraw.helper.js +0 -2
  122. package/dist/interfaces/index.js +0 -1
  123. package/dist/types/index.js +0 -1
@@ -0,0 +1,11 @@
1
+ function K(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var b=K,R=X;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(R=clearTimeout);function q(t){if(b===setTimeout)return setTimeout(t,0);if((b===K||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch{try{return b.call(null,t,0)}catch{return b.call(this,t,0)}}}function _r(t){if(R===clearTimeout)return clearTimeout(t);if((R===X||!R)&&clearTimeout)return R=clearTimeout,clearTimeout(t);try{return R(t)}catch{try{return R.call(null,t)}catch{return R.call(this,t)}}}var g=[],y=!1,N,S=-1;function gr(){!y||!N||(y=!1,N.length?g=N.concat(g):S=-1,g.length&&z())}function z(){if(!y){var t=q(gr);y=!0;for(var r=g.length;r;){for(N=g,g=[];++S<r;)N&&N[S].run();S=-1,r=g.length}N=null,y=!1,_r(t)}}function wr(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];g.push(new J(t,r)),g.length===1&&!y&&q(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var br="browser",Rr="browser",Nr=!0,Cr={},Or=[],Dr="",Lr={},yr={},Sr={};function C(){}var Ur=C,vr=C,Pr=C,Br=C,kr=C,Mr=C,Fr=C;function Yr(t){throw new Error("process.binding is not supported")}function Gr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Wr(){return 0}var L=globalThis.performance||{},Hr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function Kr(t){var r=Hr.call(L)*.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]}var Xr=new Date;function qr(){var t=new Date,r=t-Xr;return r/1e3}var h={nextTick:wr,title:br,browser:Nr,env:Cr,argv:Or,version:Dr,versions:Lr,on:Ur,addListener:vr,once:Pr,off:Br,removeListener:kr,removeAllListeners:Mr,emit:Fr,binding:Yr,cwd:Gr,chdir:Vr,umask:Wr,hrtime:Kr,platform:Rr,release:yr,config:Sr,uptime:qr},H={};Object.keys(H).forEach(t=>{let r=t.split("."),e=h;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=H[t]:e=e[i]||(e[i]={})}});var A=[],x=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function j(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],x[t.charCodeAt(r)]=r;x[45]=62,x[95]=63}function Jr(t){Y||j();var r,e,n,i,o,p,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,p=new zr(s*3/4-o),n=o>0?s-4:s;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)i=x[t.charCodeAt(r)]<<18|x[t.charCodeAt(r+1)]<<12|x[t.charCodeAt(r+2)]<<6|x[t.charCodeAt(r+3)],p[u++]=i>>16&255,p[u++]=i>>8&255,p[u++]=i&255;return o===2?(i=x[t.charCodeAt(r)]<<2|x[t.charCodeAt(r+1)]>>4,p[u++]=i&255):o===1&&(i=x[t.charCodeAt(r)]<<10|x[t.charCodeAt(r+1)]<<4|x[t.charCodeAt(r+2)]>>2,p[u++]=i>>8&255,p[u++]=i&255),p}function Qr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Zr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Qr(n));return i.join("")}function Q(t){Y||j();for(var r,e=t.length,n=e%3,i="",o=[],p=16383,s=0,u=e-n;s<u;s+=p)o.push(Zr(t,s,s+p>u?u:s+p));return n===1?(r=t[e-1],i+=A[r>>2],i+=A[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=A[r>>10],i+=A[r>>4&63],i+=A[r<<2&63],i+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function U(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(t,r){if(U()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 G(this,t)}return rr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function rr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?re(t,r,e,n):typeof r=="string"?jr(t,r,e):ee(t,r)}a.from=function(t,r,e){return rr(null,t,r,e)};a.kMaxLength=U();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function er(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 $r(t,r,e,n){return er(r),r<=0?w(t,r):e!==void 0?typeof n=="string"?w(t,r).fill(e,n):w(t,r).fill(e):w(t,r)}a.alloc=function(t,r,e){return $r(null,t,r,e)};function G(t,r){if(er(r),t=w(t,r<0?0:V(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return G(null,t)};a.allocUnsafeSlow=function(t){return G(null,t)};function jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=tr(r,e)|0;t=w(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function F(t,r){var e=r.length<0?0:V(r.length)|0;t=w(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function re(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),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=F(t,r),t}function ee(t,r){if(T(r)){var e=V(r.length)|0;return t=w(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Te(r.length)?w(t,0):F(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(t){if(t>=U())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U().toString(16)+" bytes");return t|0}a.isBuffer=_e;function T(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!T(r)||!T(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,p=Math.min(n,i);o<p;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};a.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}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var p=r[n];if(!T(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(i,o),o+=p.length}return i};function tr(t,r){if(T(t))return t.length;if(typeof ArrayBuffer<"u"&&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 v(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return v(t).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=tr;function te(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 le(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return se(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function O(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}a.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)O(this,e,e+1);return this};a.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)O(this,e,e+3),O(this,e+1,e+2);return this};a.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)O(this,e,e+7),O(this,e+1,e+6),O(this,e+2,e+5),O(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):te.apply(this,arguments)};a.prototype.equals=function(r){if(!T(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,n,i,o){if(!T(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.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===r)return 0;for(var p=o-i,s=n-e,u=Math.min(p,s),l=this.slice(i,o),f=r.slice(e,n),c=0;c<u;++c)if(l[c]!==f[c]){p=l[c],s=f[c];break}return p<s?-1:s<p?1:0};function nr(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=a.from(r,n)),T(r))return r.length===0?-1:Z(t,r,e,n,i);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,n,i){var o=1,p=t.length,s=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;o=2,p/=2,s/=2,e/=2}function u(d,D){return o===1?d[D]:d.readUInt16BE(D*o)}var l;if(i){var f=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===s)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+s>p&&(e=p-s),l=e;l>=0;l--){for(var c=!0,I=0;I<s;I++)if(u(t,l+I)!==u(r,I)){c=!1;break}if(c)return l}return-1}a.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};a.prototype.indexOf=function(r,e,n){return nr(this,r,e,n,!0)};a.prototype.lastIndexOf=function(r,e,n){return nr(this,r,e,n,!1)};function ne(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var p=0;p<n;++p){var s=parseInt(r.substr(p*2,2),16);if(isNaN(s))return p;t[e+p]=s}return p}function ie(t,r,e,n){return k(v(r,t.length-e),t,e,n)}function ir(t,r,e,n){return k(Ie(r),t,e,n)}function oe(t,r,e,n){return ir(t,r,e,n)}function pe(t,r,e,n){return k(ur(r),t,e,n)}function ae(t,r,e,n){return k(Ae(r,t.length-e),t,e,n)}a.prototype.write=function(r,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),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return ne(this,r,e,n);case"utf8":case"utf-8":return ie(this,r,e,n);case"ascii":return ir(this,r,e,n);case"latin1":case"binary":return oe(this,r,e,n);case"base64":return pe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],p=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var u,l,f,c;switch(s){case 1:o<128&&(p=o);break;case 2:u=t[i+1],(u&192)===128&&(c=(o&31)<<6|u&63,c>127&&(p=c));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(c=(o&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(p=c));break;case 4:u=t[i+1],l=t[i+2],f=t[i+3],(u&192)===128&&(l&192)===128&&(f&192)===128&&(c=(o&15)<<18|(u&63)<<12|(l&63)<<6|f&63,c>65535&&c<1114112&&(p=c))}}p===null?(p=65533,s=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=s}return ue(n)}var $=4096;function ue(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function ce(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function he(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function le(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=xe(t[o]);return i}function fe(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.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 i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=a.prototype;else{var o=e-r;i=new a(o,void 0);for(var p=0;p<o;++p)i[p]=this[p+r]}return i};function m(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")}a.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return i};a.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};a.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,e){return e||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,e){return e||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,o=1,p=this[r+--i];i>0&&(o*=256);)p+=this[r+--i]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(r,e){e||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(r,e){return e||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,e){return e||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),M(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),M(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),M(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),M(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!T(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var p=1,s=0;for(this[e]=r&255;++s<n&&(p*=256);)this[e+s]=r/p&255;return e+n};a.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var p=n-1,s=1;for(this[e+p]=r&255;--p>=0&&(s*=256);)this[e+p]=r/s&255;return e+n};a.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function P(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):P(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):P(this,r,e,!1),e+2};function B(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):B(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var p=0,s=1,u=0;for(this[e]=r&255;++p<n&&(s*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var p=n-1,s=1,u=0;for(this[e+p]=r&255;--p>=0&&(s*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):P(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):P(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):B(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};function pr(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),hr(t,r,e,n,23,4),e+4}a.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};a.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function sr(t,r,e,n,i){return i||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),hr(t,r,e,n,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};a.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};a.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,p;if(this===r&&n<e&&e<i)for(p=o-1;p>=0;--p)r[p+e]=this[p+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};a.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof 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 p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var s=T(r)?r:v(new a(r,i).toString()),u=s.length;for(p=0;p<n-e;++p)this[p+e]=s[p%u]}return this};var me=/[^+\/0-9A-Za-z-_]/g;function Ee(t){if(t=de(t).replace(me,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function xe(t){return t<16?"0"+t.toString(16):t.toString(16)}function v(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=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 Ie(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ae(t,r){for(var e,n,i,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ur(t){return Jr(Ee(t))}function k(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Te(t){return t!==t}function _e(t){return t!=null&&(!!t._isBuffer||cr(t)||ge(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ge(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function M(t,r,e,n,i){var o,p,s=i*8-n-1,u=(1<<s)-1,l=u>>1,f=-7,c=e?i-1:0,I=e?-1:1,d=t[r+c];for(c+=I,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=o*256+t[r+c],c+=I,f-=8);for(p=o&(1<<-f)-1,o>>=-f,f+=n;f>0;p=p*256+t[r+c],c+=I,f-=8);if(o===0)o=1-l;else{if(o===u)return p?NaN:(d?-1:1)*(1/0);p=p+Math.pow(2,n),o=o-l}return(d?-1:1)*p*Math.pow(2,o-n)}function hr(t,r,e,n,i,o){var p,s,u,l=o*8-i-1,f=(1<<l)-1,c=f>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,D=n?1:-1,Tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,p=f):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+c>=1?r+=I/u:r+=I*Math.pow(2,1-c),r*u>=2&&(p++,u/=2),p+c>=f?(s=0,p=f):p+c>=1?(s=(r*u-1)*Math.pow(2,i),p=p+c):(s=r*Math.pow(2,c-1)*Math.pow(2,i),p=0));i>=8;t[e+d]=s&255,d+=D,s/=256,i-=8);for(p=p<<i|s,l+=i;l>0;t[e+d]=p&255,d+=D,p/=256,l-=8);t[e+d-D]|=Tr*128}function Se(t,r){return{id:t.id,address:t.address,chainId:t.chainId,name:t.name,unitName:t.unitName,decimals:t.decimals,isGas:t.isGas,img:t.img,cmcLink:t.cmcLink,isArchived:r?r(t):!1}}function Be(t){return{hash:t.hash,loginAddress:t.loginAddress,loginChainId:t.loginChainId,tokenId:t.token?.id,tokenAddress:t.tokenId,tokenChainId:t.tokenChainId,amount:t.amount,lockedAmount:t.lockedAmount}}var lr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(lr||{}),_=lr;var fr=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(fr||{}),mr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(mr||{}),Wt={...fr,...mr};function Er(t){switch(t){case _.Buy:return"B";case _.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}var dr=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();import W from"bignumber.js";W.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function xr(t,r){return be(t,r,"+")}function be(t,r,e){switch(t=new W(String(t)),r=new W(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}function oi(t,r,e){let n=t.buyOrder&&t.sellOrder?t.buyOrderId>t.sellOrderId?t.buyOrder:t.sellOrder:t.buyOrder||t.sellOrder;return{pairId:t.pairId,orderId:n?.id,orderSide:n&&Er(n.side),...Ir(r,e),...Ar(t,n)}}function pi(t,r,e,n,i){return{id:t.id,pairId:t.pairId,pair:e||t.pair?.pairKey,...Ir(n,i),amount:t.amount,price:t.price,total:t.total,filledAmount:t.filledAmount,filledTotal:t.filledTotal,avgPrice:t.excutedPrice,status:t.status,side:t.side,type:t.type,userId:t.userId,createdAt:t.createdAt?.getTime(),completedAt:t.completedAt?.getTime()||null,updatedAt:t.updatedAt?.getTime(),trades:r&&r.map(o=>Ar(o,t))}}function Ir(t,r){return{baseTokenId:t?.id,baseTokenDecimal:t?.decimals,quoteTokenId:r?.id,quoteTokenDecimal:r?.decimals}}function Ar(t,r){return{tradeId:t.tradeId,status:t.txStatus,amount:t.amount,total:t.total,price:t.price,fee:r&&t.tradeFees.filter(e=>dr(e.address,r.userId)).reduce((e,n)=>xr(e,n.fee),"0"),createdAt:t.createdAt?.getTime(),updatedAt:t.updatedAt?.getTime(),isBuyer:r&&r.side===_.Buy,isMaker:r&&Re(r.side,t.tradeSide)}}function Re(t,r){return t===_.Buy&&r===_.Sell||t===_.Sell&&r===_.Buy}export{Re as isMaker,Se as mapToCodexAssetDto,Be as mapToCodexBalanceDto,pi as mapToOrderTradeDto,oi as mapToUserTradeDto};
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
+ */
@@ -0,0 +1,11 @@
1
+ function K(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var b=K,R=X;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(R=clearTimeout);function q(t){if(b===setTimeout)return setTimeout(t,0);if((b===K||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch{try{return b.call(null,t,0)}catch{return b.call(this,t,0)}}}function _r(t){if(R===clearTimeout)return clearTimeout(t);if((R===X||!R)&&clearTimeout)return R=clearTimeout,clearTimeout(t);try{return R(t)}catch{try{return R.call(null,t)}catch{return R.call(this,t)}}}var g=[],L=!1,N,S=-1;function gr(){!L||!N||(L=!1,N.length?g=N.concat(g):S=-1,g.length&&z())}function z(){if(!L){var t=q(gr);L=!0;for(var r=g.length;r;){for(N=g,g=[];++S<r;)N&&N[S].run();S=-1,r=g.length}N=null,L=!1,_r(t)}}function wr(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];g.push(new J(t,r)),g.length===1&&!L&&q(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var br="browser",Rr="browser",Nr=!0,Or={},Cr=[],Dr="",yr={},Lr={},Sr={};function O(){}var Ur=O,vr=O,Pr=O,Br=O,Mr=O,Fr=O,kr=O;function Yr(t){throw new Error("process.binding is not supported")}function Gr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Wr(){return 0}var y=globalThis.performance||{},Hr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Kr(t){var r=Hr.call(y)*.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]}var Xr=new Date;function qr(){var t=new Date,r=t-Xr;return r/1e3}var h={nextTick:wr,title:br,browser:Nr,env:Or,argv:Cr,version:Dr,versions:yr,on:Ur,addListener:vr,once:Pr,off:Br,removeListener:Mr,removeAllListeners:Fr,emit:kr,binding:Yr,cwd:Gr,chdir:Vr,umask:Wr,hrtime:Kr,platform:Rr,release:Lr,config:Sr,uptime:qr},H={};Object.keys(H).forEach(t=>{let r=t.split("."),e=h;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=H[t]:e=e[i]||(e[i]={})}});var A=[],x=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function j(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],x[t.charCodeAt(r)]=r;x[45]=62,x[95]=63}function Jr(t){Y||j();var r,e,n,i,o,p,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,p=new zr(s*3/4-o),n=o>0?s-4:s;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)i=x[t.charCodeAt(r)]<<18|x[t.charCodeAt(r+1)]<<12|x[t.charCodeAt(r+2)]<<6|x[t.charCodeAt(r+3)],p[u++]=i>>16&255,p[u++]=i>>8&255,p[u++]=i&255;return o===2?(i=x[t.charCodeAt(r)]<<2|x[t.charCodeAt(r+1)]>>4,p[u++]=i&255):o===1&&(i=x[t.charCodeAt(r)]<<10|x[t.charCodeAt(r+1)]<<4|x[t.charCodeAt(r+2)]>>2,p[u++]=i>>8&255,p[u++]=i&255),p}function Qr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Zr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Qr(n));return i.join("")}function Q(t){Y||j();for(var r,e=t.length,n=e%3,i="",o=[],p=16383,s=0,u=e-n;s<u;s+=p)o.push(Zr(t,s,s+p>u?u:s+p));return n===1?(r=t[e-1],i+=A[r>>2],i+=A[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=A[r>>10],i+=A[r>>4&63],i+=A[r<<2&63],i+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function U(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(t,r){if(U()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 G(this,t)}return rr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function rr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?re(t,r,e,n):typeof r=="string"?jr(t,r,e):ee(t,r)}a.from=function(t,r,e){return rr(null,t,r,e)};a.kMaxLength=U();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function er(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 $r(t,r,e,n){return er(r),r<=0?w(t,r):e!==void 0?typeof n=="string"?w(t,r).fill(e,n):w(t,r).fill(e):w(t,r)}a.alloc=function(t,r,e){return $r(null,t,r,e)};function G(t,r){if(er(r),t=w(t,r<0?0:V(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return G(null,t)};a.allocUnsafeSlow=function(t){return G(null,t)};function jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=tr(r,e)|0;t=w(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:V(r.length)|0;t=w(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function re(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),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=k(t,r),t}function ee(t,r){if(T(r)){var e=V(r.length)|0;return t=w(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Te(r.length)?w(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(t){if(t>=U())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U().toString(16)+" bytes");return t|0}a.isBuffer=_e;function T(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!T(r)||!T(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,p=Math.min(n,i);o<p;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};a.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}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var p=r[n];if(!T(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(i,o),o+=p.length}return i};function tr(t,r){if(T(t))return t.length;if(typeof ArrayBuffer<"u"&&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 v(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return v(t).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=tr;function te(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 le(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return se(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}a.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)C(this,e,e+1);return this};a.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)C(this,e,e+3),C(this,e+1,e+2);return this};a.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)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):te.apply(this,arguments)};a.prototype.equals=function(r){if(!T(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,n,i,o){if(!T(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.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===r)return 0;for(var p=o-i,s=n-e,u=Math.min(p,s),l=this.slice(i,o),f=r.slice(e,n),c=0;c<u;++c)if(l[c]!==f[c]){p=l[c],s=f[c];break}return p<s?-1:s<p?1:0};function nr(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=a.from(r,n)),T(r))return r.length===0?-1:Z(t,r,e,n,i);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,n,i){var o=1,p=t.length,s=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;o=2,p/=2,s/=2,e/=2}function u(d,D){return o===1?d[D]:d.readUInt16BE(D*o)}var l;if(i){var f=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===s)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+s>p&&(e=p-s),l=e;l>=0;l--){for(var c=!0,I=0;I<s;I++)if(u(t,l+I)!==u(r,I)){c=!1;break}if(c)return l}return-1}a.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};a.prototype.indexOf=function(r,e,n){return nr(this,r,e,n,!0)};a.prototype.lastIndexOf=function(r,e,n){return nr(this,r,e,n,!1)};function ne(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var p=0;p<n;++p){var s=parseInt(r.substr(p*2,2),16);if(isNaN(s))return p;t[e+p]=s}return p}function ie(t,r,e,n){return M(v(r,t.length-e),t,e,n)}function ir(t,r,e,n){return M(Ie(r),t,e,n)}function oe(t,r,e,n){return ir(t,r,e,n)}function pe(t,r,e,n){return M(ur(r),t,e,n)}function ae(t,r,e,n){return M(Ae(r,t.length-e),t,e,n)}a.prototype.write=function(r,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),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return ne(this,r,e,n);case"utf8":case"utf-8":return ie(this,r,e,n);case"ascii":return ir(this,r,e,n);case"latin1":case"binary":return oe(this,r,e,n);case"base64":return pe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],p=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var u,l,f,c;switch(s){case 1:o<128&&(p=o);break;case 2:u=t[i+1],(u&192)===128&&(c=(o&31)<<6|u&63,c>127&&(p=c));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(c=(o&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(p=c));break;case 4:u=t[i+1],l=t[i+2],f=t[i+3],(u&192)===128&&(l&192)===128&&(f&192)===128&&(c=(o&15)<<18|(u&63)<<12|(l&63)<<6|f&63,c>65535&&c<1114112&&(p=c))}}p===null?(p=65533,s=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=s}return ue(n)}var $=4096;function ue(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function ce(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function he(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function le(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=xe(t[o]);return i}function fe(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.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 i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=a.prototype;else{var o=e-r;i=new a(o,void 0);for(var p=0;p<o;++p)i[p]=this[p+r]}return i};function m(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")}a.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return i};a.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};a.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,e){return e||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,e){return e||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,o=1,p=this[r+--i];i>0&&(o*=256);)p+=this[r+--i]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(r,e){e||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(r,e){return e||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,e){return e||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),F(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),F(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),F(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),F(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!T(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var p=1,s=0;for(this[e]=r&255;++s<n&&(p*=256);)this[e+s]=r/p&255;return e+n};a.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var p=n-1,s=1;for(this[e+p]=r&255;--p>=0&&(s*=256);)this[e+p]=r/s&255;return e+n};a.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function P(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):P(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):P(this,r,e,!1),e+2};function B(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):B(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var p=0,s=1,u=0;for(this[e]=r&255;++p<n&&(s*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var p=n-1,s=1,u=0;for(this[e+p]=r&255;--p>=0&&(s*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):P(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):P(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):B(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};function pr(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),hr(t,r,e,n,23,4),e+4}a.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};a.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function sr(t,r,e,n,i){return i||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),hr(t,r,e,n,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};a.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};a.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,p;if(this===r&&n<e&&e<i)for(p=o-1;p>=0;--p)r[p+e]=this[p+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};a.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof 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 p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var s=T(r)?r:v(new a(r,i).toString()),u=s.length;for(p=0;p<n-e;++p)this[p+e]=s[p%u]}return this};var me=/[^+\/0-9A-Za-z-_]/g;function Ee(t){if(t=de(t).replace(me,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function xe(t){return t<16?"0"+t.toString(16):t.toString(16)}function v(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=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 Ie(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ae(t,r){for(var e,n,i,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ur(t){return Jr(Ee(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Te(t){return t!==t}function _e(t){return t!=null&&(!!t._isBuffer||cr(t)||ge(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ge(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function F(t,r,e,n,i){var o,p,s=i*8-n-1,u=(1<<s)-1,l=u>>1,f=-7,c=e?i-1:0,I=e?-1:1,d=t[r+c];for(c+=I,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=o*256+t[r+c],c+=I,f-=8);for(p=o&(1<<-f)-1,o>>=-f,f+=n;f>0;p=p*256+t[r+c],c+=I,f-=8);if(o===0)o=1-l;else{if(o===u)return p?NaN:(d?-1:1)*(1/0);p=p+Math.pow(2,n),o=o-l}return(d?-1:1)*p*Math.pow(2,o-n)}function hr(t,r,e,n,i,o){var p,s,u,l=o*8-i-1,f=(1<<l)-1,c=f>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,D=n?1:-1,Tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,p=f):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+c>=1?r+=I/u:r+=I*Math.pow(2,1-c),r*u>=2&&(p++,u/=2),p+c>=f?(s=0,p=f):p+c>=1?(s=(r*u-1)*Math.pow(2,i),p=p+c):(s=r*Math.pow(2,c-1)*Math.pow(2,i),p=0));i>=8;t[e+d]=s&255,d+=D,s/=256,i-=8);for(p=p<<i|s,l+=i;l>0;t[e+d]=p&255,d+=D,p/=256,l-=8);t[e+d-D]|=Tr*128}var lr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(lr||{}),_=lr;var fr=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(fr||{}),mr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(mr||{}),Pt={...fr,...mr};function Er(t){switch(t){case _.Buy:return"B";case _.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}var dr=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();import W from"bignumber.js";W.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function xr(t,r){return be(t,r,"+")}function be(t,r,e){switch(t=new W(String(t)),r=new W(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}function Zn(t,r,e){let n=t.buyOrder&&t.sellOrder?t.buyOrderId>t.sellOrderId?t.buyOrder:t.sellOrder:t.buyOrder||t.sellOrder;return{pairId:t.pairId,orderId:n?.id,orderSide:n&&Er(n.side),...Ir(r,e),...Ar(t,n)}}function $n(t,r,e,n,i){return{id:t.id,pairId:t.pairId,pair:e||t.pair?.pairKey,...Ir(n,i),amount:t.amount,price:t.price,total:t.total,filledAmount:t.filledAmount,filledTotal:t.filledTotal,avgPrice:t.excutedPrice,status:t.status,side:t.side,type:t.type,userId:t.userId,createdAt:t.createdAt?.getTime(),completedAt:t.completedAt?.getTime()||null,updatedAt:t.updatedAt?.getTime(),trades:r&&r.map(o=>Ar(o,t))}}function Ir(t,r){return{baseTokenId:t?.id,baseTokenDecimal:t?.decimals,quoteTokenId:r?.id,quoteTokenDecimal:r?.decimals}}function Ar(t,r){return{tradeId:t.tradeId,status:t.txStatus,amount:t.amount,total:t.total,price:t.price,fee:r&&t.tradeFees.filter(e=>dr(e.address,r.userId)).reduce((e,n)=>xr(e,n.fee),"0"),createdAt:t.createdAt?.getTime(),updatedAt:t.updatedAt?.getTime(),isBuyer:r&&r.side===_.Buy,isMaker:r&&Re(r.side,t.tradeSide)}}function Re(t,r){return t===_.Buy&&r===_.Sell||t===_.Sell&&r===_.Buy}export{Re as isMaker,$n as mapToOrderTradeDto,Zn as mapToUserTradeDto};
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
+ */
@@ -0,0 +1,11 @@
1
+ function G(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=G,_=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function O(n){if(R===setTimeout)return setTimeout(n,0);if((R===G||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch{try{return R.call(null,n,0)}catch{return R.call(this,n,0)}}}function lr(n){if(_===clearTimeout)return clearTimeout(n);if((_===J||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(n);try{return _(n)}catch{try{return _.call(null,n)}catch{return _.call(this,n)}}}var y=[],Y=!1,v,S=-1;function pr(){!Y||!v||(Y=!1,v.length?y=v.concat(y):S=-1,y.length&&Q())}function Q(){if(!Y){var n=O(pr);Y=!0;for(var r=y.length;r;){for(v=y,y=[];++S<r;)v&&v[S].run();S=-1,r=y.length}v=null,Y=!1,lr(n)}}function sr(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];y.push(new X(n,r)),y.length===1&&!Y&&O(Q)}function X(n,r){this.fun=n,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function I(){}var _r=I,vr=I,Ir=I,Ur=I,Br=I,dr=I,Yr=I;function Sr(n){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Mr(n){throw new Error("process.chdir is not supported")}function Dr(){return 0}var d=globalThis.performance||{},Cr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function kr(n){var r=Cr.call(d)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}var Nr=new Date;function Lr(){var n=new Date,r=n-Nr;return r/1e3}var L={nextTick:sr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:_r,addListener:vr,once:Ir,off:Ur,removeListener:Br,removeAllListeners:dr,emit:Yr,binding:Sr,cwd:Pr,chdir:Mr,umask:Dr,hrtime:kr,platform:xr,release:Tr,config:Rr,uptime:Lr},z={};Object.keys(z).forEach(n=>{let r=n.split("."),i=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=z[n]:i=i[t]||(i[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function K(){W=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(n){W||K();var r,i,e,t,f,u,h=n.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=n[h-2]==="="?2:n[h-1]==="="?1:0,u=new Fr(h*3/4-f),e=f>0?h-4:h;var a=0;for(r=0,i=0;r<e;r+=4,i+=3)t=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=t&255;return f===2?(t=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,u[a++]=t&255):f===1&&(t=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,u[a++]=t>>8&255,u[a++]=t&255),u}function Hr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function Vr(n,r,i){for(var e,t=[],f=r;f<i;f+=3)e=(n[f]<<16)+(n[f+1]<<8)+n[f+2],t.push(Hr(e));return t.join("")}function q(n){W||K();for(var r,i=n.length,e=i%3,t="",f=[],u=16383,h=0,a=i-e;h<a;h+=u)f.push(Vr(n,h,h+u>a?a:h+u));return e===1?(r=n[i-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=o.prototype):(n===null&&(n=new o(r)),n.length=r),n}function o(n,r,i){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,n)}return b(this,n,r,i)}o.poolSize=8192;o._augment=function(n){return n.__proto__=o.prototype,n};function b(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(n,r,i,e):typeof r=="string"?Gr(n,r,i):Or(n,r)}o.from=function(n,r,i){return b(null,n,r,i)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function zr(n,r,i,e){return j(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}o.alloc=function(n,r,i){return zr(null,n,r,i)};function H(n,r){if(j(r),n=T(n,r<0?0:V(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}o.allocUnsafe=function(n){return H(null,n)};o.allocUnsafeSlow=function(n){return H(null,n)};function Gr(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function F(n,r){var i=r.length<0?0:V(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function Jr(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),o.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=o.prototype):n=F(n,r),n}function Or(n,r){if(g(r)){var i=V(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ci(r.length)?T(n,0):F(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(n){if(n>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return n|0}o.isBuffer=li;function g(n){return!!(n!=null&&n._isBuffer)}o.compare=function(r,i){if(!g(r)||!g(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==i[f]){e=r[f],t=i[f];break}return e<t?-1:t<e?1:0};o.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}};o.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=o.allocUnsafe(i),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(n,r){if(g(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return M(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return or(n).length;default:if(e)return M(n).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return ni(this,r,i);case"utf8":case"utf-8":return er(this,r,i);case"ascii":return ri(this,r,i);case"latin1":case"binary":return ii(this,r,i);case"base64":return br(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ei(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}o.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 i=0;i<r;i+=2)U(this,i,i+1);return this};o.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 i=0;i<r;i+=4)U(this,i,i+3),U(this,i+1,i+2);return this};o.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 i=0;i<r;i+=8)U(this,i,i+7),U(this,i+1,i+6),U(this,i+2,i+5),U(this,i+3,i+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,i,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),i<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&i>=e)return 0;if(t>=f)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,h=e-i,a=Math.min(u,h),l=this.slice(t,f),p=r.slice(i,e),c=0;c<a;++c)if(l[c]!==p[c]){u=l[c],h=p[c];break}return u<h?-1:h<u?1:0};function ir(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(n,r,i,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):Z(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(n,r,i,e,t){var f=1,u=n.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;f=2,u/=2,h/=2,i/=2}function a(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=i;l<u;l++)if(a(n,l)===a(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===h)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(i+h>u&&(i=u-h),l=i;l>=0;l--){for(var c=!0,m=0;m<h;m++)if(a(n,l+m)!==a(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};o.prototype.indexOf=function(r,i,e){return ir(this,r,i,e,!0)};o.prototype.lastIndexOf=function(r,i,e){return ir(this,r,i,e,!1)};function Xr(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var h=parseInt(r.substr(u*2,2),16);if(isNaN(h))return u;n[i+u]=h}return u}function qr(n,r,i,e){return k(M(r,n.length-i),n,i,e)}function nr(n,r,i,e){return k(hi(r),n,i,e)}function Zr(n,r,i,e){return nr(n,r,i,e)}function $r(n,r,i,e){return k(or(r),n,i,e)}function Kr(n,r,i,e){return k(ai(r,n.length-i),n,i,e)}o.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-i;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,i,e);case"utf8":case"utf-8":return qr(this,r,i,e);case"ascii":return nr(this,r,i,e);case"latin1":case"binary":return Zr(this,r,i,e);case"base64":return $r(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kr(this,r,i,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(n,r,i){return r===0&&i===n.length?q(n):q(n.slice(r,i))}function er(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var f=n[t],u=null,h=f>239?4:f>223?3:f>191?2:1;if(t+h<=i){var a,l,p,c;switch(h){case 1:f<128&&(u=f);break;case 2:a=n[t+1],(a&192)===128&&(c=(f&31)<<6|a&63,c>127&&(u=c));break;case 3:a=n[t+1],l=n[t+2],(a&192)===128&&(l&192)===128&&(c=(f&15)<<12|(a&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:a=n[t+1],l=n[t+2],p=n[t+3],(a&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(a&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=h}return jr(e)}var $=4096;function jr(n){var r=n.length;if(r<=$)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=$));return i}function ri(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function ii(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function ni(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",f=r;f<i;++f)t+=oi(n[f]);return t}function ei(n,r,i){for(var e=n.slice(r,i),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=o.prototype;else{var f=i-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r+--i],f=1;i>0&&(f*=256);)t+=this[r+--i]*f;return t};o.prototype.readUInt8=function(r,i){return i||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,i){return i||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,i){return i||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,i){return i||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,i){return i||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*i)),t};o.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=i,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*i)),u};o.prototype.readInt8=function(r,i){return i||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,i){i||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,i){i||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,i){return i||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,i){return i||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,i){return i||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,i){return i||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,i){return i||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,i){return i||s(r,8,this.length),N(this,r,!1,52,8)};function w(n,r,i,e,t,f){if(!g(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=1,h=0;for(this[i]=r&255;++h<e&&(u*=256);)this[i+h]=r/u&255;return i+e};o.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=e-1,h=1;for(this[i+u]=r&255;--u>=0&&(h*=256);)this[i+u]=r/h&255;return i+e};o.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function D(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(n.length-i,2);t<f;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};function C(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(n.length-i,4);t<f;++t)n[i+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):C(this,r,i,!0),i+4};o.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):C(this,r,i,!1),i+4};o.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=0,h=1,a=0;for(this[i]=r&255;++u<e&&(h*=256);)r<0&&a===0&&this[i+u-1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=e-1,h=1,a=0;for(this[i+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[i+u+1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};o.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};o.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):C(this,r,i,!0),i+4};o.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):C(this,r,i,!1),i+4};function tr(n,r,i,e,t,f){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function fr(n,r,i,e,t){return t||tr(n,r,i,4,34028234663852886e22,-34028234663852886e22),ar(n,r,i,e,23,4),i+4}o.prototype.writeFloatLE=function(r,i,e){return fr(this,r,i,!0,e)};o.prototype.writeFloatBE=function(r,i,e){return fr(this,r,i,!1,e)};function ur(n,r,i,e,t){return t||tr(n,r,i,8,17976931348623157e292,-17976931348623157e292),ar(n,r,i,e,52,8),i+8}o.prototype.writeDoubleLE=function(r,i,e){return ur(this,r,i,!0,e)};o.prototype.writeDoubleBE=function(r,i,e){return ur(this,r,i,!1,e)};o.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var f=t-e,u;if(this===r&&e<i&&i<t)for(u=f-1;u>=0;--u)r[u+i]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+i]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),i);return f};o.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=i;u<e;++u)this[u]=r;else{var h=g(r)?r:M(new o(r,t).toString()),a=h.length;for(u=0;u<e-i;++u)this[u+i]=h[u%a]}return this};var ti=/[^+\/0-9A-Za-z-_]/g;function fi(n){if(n=ui(n).replace(ti,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function ui(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function oi(n){return n<16?"0"+n.toString(16):n.toString(16)}function M(n,r){r=r||1/0;for(var i,e=n.length,t=null,f=[],u=0;u<e;++u){if(i=n.charCodeAt(u),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&f.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;f.push(i)}else if(i<2048){if((r-=2)<0)break;f.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;f.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;f.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return f}function hi(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function ai(n,r){for(var i,e,t,f=[],u=0;u<n.length&&!((r-=2)<0);++u)i=n.charCodeAt(u),e=i>>8,t=i%256,f.push(t),f.push(e);return f}function or(n){return Wr(fi(n))}function k(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function ci(n){return n!==n}function li(n){return n!=null&&(!!n._isBuffer||hr(n)||pi(n))}function hr(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function pi(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&hr(n.slice(0,0))}function N(n,r,i,e,t){var f,u,h=t*8-e-1,a=(1<<h)-1,l=a>>1,p=-7,c=i?t-1:0,m=i?-1:1,x=n[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=h;p>0;f=f*256+n[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+n[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function ar(n,r,i,e,t,f){var u,h,a,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(u++,a/=2),u+c>=p?(h=0,u=p):u+c>=1?(h=(r*a-1)*Math.pow(2,t),u=u+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;n[i+x]=h&255,x+=B,h/=256,t-=8);for(u=u<<t|h,l+=t;l>0;n[i+x]=u&255,x+=B,u/=256,l-=8);n[i+x-B]|=cr*128}var gi=(n,r)=>{if(!n)throw new Error(`Assertion error: ${r}`)};export{gi as assert};
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
+ */
@@ -0,0 +1,11 @@
1
+ function H(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}var R=H,d=V;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(d=clearTimeout);function G(i){if(R===setTimeout)return setTimeout(i,0);if((R===H||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch{try{return R.call(null,i,0)}catch{return R.call(this,i,0)}}}function wr(i){if(d===clearTimeout)return clearTimeout(i);if((d===V||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(i);try{return d(i)}catch{try{return d.call(null,i)}catch{return d.call(this,i)}}}var g=[],S=!1,_,Y=-1;function xr(){!S||!_||(S=!1,_.length?g=_.concat(g):Y=-1,g.length&&J())}function J(){if(!S){var i=G(xr);S=!0;for(var r=g.length;r;){for(_=g,g=[];++Y<r;)_&&_[Y].run();Y=-1,r=g.length}_=null,S=!1,wr(i)}}function Er(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];g.push(new Q(i,r)),g.length===1&&!S&&G(J)}function Q(i,r){this.fun=i,this.array=r}Q.prototype.run=function(){this.fun.apply(null,this.array)};var mr="browser",yr="browser",Ar=!0,gr={},Tr=[],Rr="",dr={},_r={},Ir={};function I(){}var Ur=I,vr=I,Br=I,Sr=I,Yr=I,kr=I,Pr=I;function Dr(i){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Cr(i){throw new Error("process.chdir is not supported")}function Nr(){return 0}var B=globalThis.performance||{},Lr=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return new Date().getTime()};function Fr(i){var r=Lr.call(B)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var zr=new Date;function Wr(){var i=new Date,r=i-zr;return r/1e3}var L={nextTick:Er,title:mr,browser:Ar,env:gr,argv:Tr,version:Rr,versions:dr,on:Ur,addListener:vr,once:Br,off:Sr,removeListener:Yr,removeAllListeners:kr,emit:Pr,binding:Dr,cwd:Mr,chdir:Cr,umask:Nr,hrtime:Fr,platform:yr,release:_r,config:Ir,uptime:Wr},O={};Object.keys(O).forEach(i=>{let r=i.split("."),n=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=O[i]:n=n[t]||(n[t]={})}});var y=[],E=[],br=typeof Uint8Array<"u"?Uint8Array:Array,z=!1;function K(){z=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)y[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Or(i){z||K();var r,n,e,t,u,o,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u=i[a-2]==="="?2:i[a-1]==="="?1:0,o=new br(a*3/4-u),e=u>0?a-4:a;var c=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return u===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,o[c++]=t&255):u===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function Hr(i){return y[i>>18&63]+y[i>>12&63]+y[i>>6&63]+y[i&63]}function Vr(i,r,n){for(var e,t=[],u=r;u<n;u+=3)e=(i[u]<<16)+(i[u+1]<<8)+i[u+2],t.push(Hr(e));return t.join("")}function X(i){z||K();for(var r,n=i.length,e=n%3,t="",u=[],o=16383,a=0,c=n-e;a<c;a+=o)u.push(Vr(i,a,a+o>c?c:a+o));return e===1?(r=i[n-1],t+=y[r>>2],t+=y[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=y[r>>10],t+=y[r>>4&63],t+=y[r<<2&63],t+="="),u.push(t),u.join("")}f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(k()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=f.prototype):(i===null&&(i=new f(r)),i.length=r),i}function f(i,r,n){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return W(this,i)}return $(this,i,r,n)}f.poolSize=8192;f._augment=function(i){return i.__proto__=f.prototype,i};function $(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Qr(i,r,n,e):typeof r=="string"?Jr(i,r,n):Xr(i,r)}f.from=function(i,r,n){return $(null,i,r,n)};f.kMaxLength=k();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&f[Symbol.species]);function j(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Gr(i,r,n,e){return j(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}f.alloc=function(i,r,n){return Gr(null,i,r,n)};function W(i,r){if(j(r),i=T(i,r<0?0:b(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}f.allocUnsafe=function(i){return W(null,i)};f.allocUnsafeSlow=function(i){return W(null,i)};function Jr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:b(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Qr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),f.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=f.prototype):i=F(i,r),i}function Xr(i,r){if(A(r)){var n=b(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||wn(r.length)?T(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function b(i){if(i>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return i|0}f.isBuffer=xn;function A(i){return!!(i!=null&&i._isBuffer)}f.compare=function(r,n){if(!A(r)||!A(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,u=0,o=Math.min(e,t);u<o;++u)if(r[u]!==n[u]){e=r[u],t=n[u];break}return e<t?-1:t<e?1:0};f.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}};f.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=f.allocUnsafe(n),u=0;for(e=0;e<r.length;++e){var o=r[e];if(!A(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(t,u),u+=o.length}return t};function rr(i,r){if(A(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return fr(i).length;default:if(e)return P(i).length;r=(""+r).toLowerCase(),e=!0}}f.byteLength=rr;function qr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return un(this,r,n);case"utf8":case"utf-8":return er(this,r,n);case"ascii":return tn(this,r,n);case"latin1":case"binary":return on(this,r,n);case"base64":return nn(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}f.prototype._isBuffer=!0;function U(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}f.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 n=0;n<r;n+=2)U(this,n,n+1);return this};f.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 n=0;n<r;n+=4)U(this,n,n+3),U(this,n+1,n+2);return this};f.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 n=0;n<r;n+=8)U(this,n,n+7),U(this,n+1,n+6),U(this,n+2,n+5),U(this,n+3,n+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):qr.apply(this,arguments)};f.prototype.equals=function(r){if(!A(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.compare=function(r,n,e,t,u){if(!A(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),u===void 0&&(u=this.length),n<0||e>r.length||t<0||u>this.length)throw new RangeError("out of range index");if(t>=u&&n>=e)return 0;if(t>=u)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,u>>>=0,this===r)return 0;for(var o=u-t,a=e-n,c=Math.min(o,a),s=this.slice(t,u),p=r.slice(n,e),h=0;h<c;++h)if(s[h]!==p[h]){o=s[h],a=p[h];break}return o<a?-1:a<o?1:0};function nr(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=f.from(r,e)),A(r))return r.length===0?-1:q(i,r,n,e,t);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):q(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function q(i,r,n,e,t){var u=1,o=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;u=2,o/=2,a/=2,n/=2}function c(x,v){return u===1?x[v]:x.readUInt16BE(v*u)}var s;if(t){var p=-1;for(s=n;s<o;s++)if(c(i,s)===c(r,p===-1?0:s-p)){if(p===-1&&(p=s),s-p+1===a)return p*u}else p!==-1&&(s-=s-p),p=-1}else for(n+a>o&&(n=o-a),s=n;s>=0;s--){for(var h=!0,m=0;m<a;m++)if(c(i,s+m)!==c(r,m)){h=!1;break}if(h)return s}return-1}f.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};f.prototype.indexOf=function(r,n,e){return nr(this,r,n,e,!0)};f.prototype.lastIndexOf=function(r,n,e){return nr(this,r,n,e,!1)};function Zr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var u=r.length;if(u%2!==0)throw new TypeError("Invalid hex string");e>u/2&&(e=u/2);for(var o=0;o<e;++o){var a=parseInt(r.substr(o*2,2),16);if(isNaN(a))return o;i[n+o]=a}return o}function Kr(i,r,n,e){return C(P(r,i.length-n),i,n,e)}function ir(i,r,n,e){return C(pn(r),i,n,e)}function $r(i,r,n,e){return ir(i,r,n,e)}function jr(i,r,n,e){return C(fr(r),i,n,e)}function rn(i,r,n,e){return C(ln(r,i.length-n),i,n,e)}f.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var u=this.length-n;if((e===void 0||e>u)&&(e=u),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var o=!1;;)switch(t){case"hex":return Zr(this,r,n,e);case"utf8":case"utf-8":return Kr(this,r,n,e);case"ascii":return ir(this,r,n,e);case"latin1":case"binary":return $r(this,r,n,e);case"base64":return jr(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rn(this,r,n,e);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),o=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nn(i,r,n){return r===0&&n===i.length?X(i):X(i.slice(r,n))}function er(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var u=i[t],o=null,a=u>239?4:u>223?3:u>191?2:1;if(t+a<=n){var c,s,p,h;switch(a){case 1:u<128&&(o=u);break;case 2:c=i[t+1],(c&192)===128&&(h=(u&31)<<6|c&63,h>127&&(o=h));break;case 3:c=i[t+1],s=i[t+2],(c&192)===128&&(s&192)===128&&(h=(u&15)<<12|(c&63)<<6|s&63,h>2047&&(h<55296||h>57343)&&(o=h));break;case 4:c=i[t+1],s=i[t+2],p=i[t+3],(c&192)===128&&(s&192)===128&&(p&192)===128&&(h=(u&15)<<18|(c&63)<<12|(s&63)<<6|p&63,h>65535&&h<1114112&&(o=h))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|o&1023),e.push(o),t+=a}return en(e)}var Z=4096;function en(i){var r=i.length;if(r<=Z)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=Z));return n}function tn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function on(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function un(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",u=r;u<n;++u)t+=sn(i[u]);return t}function fn(i,r,n){for(var e=i.slice(r,n),t="",u=0;u<e.length;u+=2)t+=String.fromCharCode(e[u]+e[u+1]*256);return t}f.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(f.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=f.prototype;else{var u=n-r;t=new f(u,void 0);for(var o=0;o<u;++o)t[o]=this[o+r]}return t};function l(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||l(r,n,this.length);for(var t=this[r],u=1,o=0;++o<n&&(u*=256);)t+=this[r+o]*u;return t};f.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||l(r,n,this.length);for(var t=this[r+--n],u=1;n>0&&(u*=256);)t+=this[r+--n]*u;return t};f.prototype.readUInt8=function(r,n){return n||l(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,n){return n||l(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,n){return n||l(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,n){return n||l(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,n){return n||l(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||l(r,n,this.length);for(var t=this[r],u=1,o=0;++o<n&&(u*=256);)t+=this[r+o]*u;return u*=128,t>=u&&(t-=Math.pow(2,8*n)),t};f.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||l(r,n,this.length);for(var t=n,u=1,o=this[r+--t];t>0&&(u*=256);)o+=this[r+--t]*u;return u*=128,o>=u&&(o-=Math.pow(2,8*n)),o};f.prototype.readInt8=function(r,n){return n||l(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,n){n||l(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};f.prototype.readInt16BE=function(r,n){n||l(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};f.prototype.readInt32LE=function(r,n){return n||l(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,n){return n||l(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,n){return n||l(r,4,this.length),N(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,n){return n||l(r,4,this.length),N(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,n){return n||l(r,8,this.length),N(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,n){return n||l(r,8,this.length),N(this,r,!1,52,8)};function w(i,r,n,e,t,u){if(!A(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<u)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var u=Math.pow(2,8*e)-1;w(this,r,n,e,u,0)}var o=1,a=0;for(this[n]=r&255;++a<e&&(o*=256);)this[n+a]=r/o&255;return n+e};f.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var u=Math.pow(2,8*e)-1;w(this,r,n,e,u,0)}var o=e-1,a=1;for(this[n+o]=r&255;--o>=0&&(a*=256);)this[n+o]=r/a&255;return n+e};f.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function D(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,u=Math.min(i.length-n,2);t<u;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}f.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};f.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};function M(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,u=Math.min(i.length-n,4);t<u;++t)i[n+t]=r>>>(e?t:3-t)*8&255}f.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):M(this,r,n,!0),n+4};f.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):M(this,r,n,!1),n+4};f.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var u=Math.pow(2,8*e-1);w(this,r,n,e,u-1,-u)}var o=0,a=1,c=0;for(this[n]=r&255;++o<e&&(a*=256);)r<0&&c===0&&this[n+o-1]!==0&&(c=1),this[n+o]=(r/a>>0)-c&255;return n+e};f.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var u=Math.pow(2,8*e-1);w(this,r,n,e,u-1,-u)}var o=e-1,a=1,c=0;for(this[n+o]=r&255;--o>=0&&(a*=256);)r<0&&c===0&&this[n+o+1]!==0&&(c=1),this[n+o]=(r/a>>0)-c&255;return n+e};f.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};f.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};f.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};f.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):M(this,r,n,!0),n+4};f.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):M(this,r,n,!1),n+4};function tr(i,r,n,e,t,u){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function or(i,r,n,e,t){return t||tr(i,r,n,4,34028234663852886e22,-34028234663852886e22),cr(i,r,n,e,23,4),n+4}f.prototype.writeFloatLE=function(r,n,e){return or(this,r,n,!0,e)};f.prototype.writeFloatBE=function(r,n,e){return or(this,r,n,!1,e)};function ur(i,r,n,e,t){return t||tr(i,r,n,8,17976931348623157e292,-17976931348623157e292),cr(i,r,n,e,52,8),n+8}f.prototype.writeDoubleLE=function(r,n,e){return ur(this,r,n,!0,e)};f.prototype.writeDoubleBE=function(r,n,e){return ur(this,r,n,!1,e)};f.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var u=t-e,o;if(this===r&&e<n&&n<t)for(o=u-1;o>=0;--o)r[o+n]=this[o+e];else if(u<1e3||!f.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)r[o+n]=this[o+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+u),n);return u};f.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var u=r.charCodeAt(0);u<256&&(r=u)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var o;if(typeof r=="number")for(o=n;o<e;++o)this[o]=r;else{var a=A(r)?r:P(new f(r,t).toString()),c=a.length;for(o=0;o<e-n;++o)this[o+n]=a[o%c]}return this};var an=/[^+\/0-9A-Za-z-_]/g;function cn(i){if(i=hn(i).replace(an,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function hn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function sn(i){return i<16?"0"+i.toString(16):i.toString(16)}function P(i,r){r=r||1/0;for(var n,e=i.length,t=null,u=[],o=0;o<e;++o){if(n=i.charCodeAt(o),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(o+1===e){(r-=3)>-1&&u.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&u.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&u.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;u.push(n)}else if(n<2048){if((r-=2)<0)break;u.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;u.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;u.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return u}function pn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function ln(i,r){for(var n,e,t,u=[],o=0;o<i.length&&!((r-=2)<0);++o)n=i.charCodeAt(o),e=n>>8,t=n%256,u.push(t),u.push(e);return u}function fr(i){return Or(cn(i))}function C(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function wn(i){return i!==i}function xn(i){return i!=null&&(!!i._isBuffer||ar(i)||En(i))}function ar(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function En(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&ar(i.slice(0,0))}function N(i,r,n,e,t){var u,o,a=t*8-e-1,c=(1<<a)-1,s=c>>1,p=-7,h=n?t-1:0,m=n?-1:1,x=i[r+h];for(h+=m,u=x&(1<<-p)-1,x>>=-p,p+=a;p>0;u=u*256+i[r+h],h+=m,p-=8);for(o=u&(1<<-p)-1,u>>=-p,p+=e;p>0;o=o*256+i[r+h],h+=m,p-=8);if(u===0)u=1-s;else{if(u===c)return o?NaN:(x?-1:1)*(1/0);o=o+Math.pow(2,e),u=u-s}return(x?-1:1)*o*Math.pow(2,u-e)}function cr(i,r,n,e,t,u){var o,a,c,s=u*8-t-1,p=(1<<s)-1,h=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:u-1,v=e?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,o=p):(o=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?r+=m/c:r+=m*Math.pow(2,1-h),r*c>=2&&(o++,c/=2),o+h>=p?(a=0,o=p):o+h>=1?(a=(r*c-1)*Math.pow(2,t),o=o+h):(a=r*Math.pow(2,h-1)*Math.pow(2,t),o=0));t>=8;i[n+x]=a&255,x+=v,a/=256,t-=8);for(o=o<<t|a,s+=t;s>0;i[n+x]=o&255,x+=v,o/=256,s-=8);i[n+x-v]|=lr*128}import hr,{encodeAddress as mn}from"algosdk";var sr=28,Un=i=>{let r=f.from(i,"base64");return pr(r,{priceCoin_locked:{type:"uint"},priceCoin_available:{type:"uint"},baseCoin_locked:{type:"uint"},baseCoin_available:{type:"uint"},companyId:{type:"uint"},WLFeeShare:{type:"uint"},WLCustomFee:{type:"uint"},slotMap:{type:"uint"}})};function pr(i,r){let n=new Map,e=0;for(let[t,u]of Object.entries(r)){if(e>=i.length)throw new Error("Array index out of bounds");let o;switch(u.type){case"address":o=mn(i.slice(e,e+32)),e+=32;break;case"bytes":o=i.slice(e,e+u.size),o=hr.decodeUint64(o,"mixed"),e+=u.size;break;case"uint":o=hr.decodeUint64(i.slice(e,e+8),"mixed"),e+=8;break;case"string":o=yn(i.slice(e,e+u.size)),e+=u.size;break}n.set(t,o)}return Object.fromEntries(n)}function yn(i){return f.from(i).toString("utf-8")}var vn=i=>{let r=f.from(i,"base64"),n=[];for(let e=0;e<4;e++){let t=pr(r.subarray(sr*e,sr*(e+1)),{orderID:{type:"uint"},side:{type:"string",size:1},price:{type:"uint"},amount:{type:"uint"},type:{type:"string",size:1},directSettle:{type:"string",size:1},storageSlot:{type:"bytes",size:1}});n.push(t)}return n};export{yn as decodeString,Un as getAccounInfoFormLocalStorage,vn as printUnpackedLocalData,pr as unpackData};
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
+ */
@@ -0,0 +1,11 @@
1
+ function V(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var T=V,R=z;typeof globalThis.setTimeout=="function"&&(T=setTimeout);typeof globalThis.clearTimeout=="function"&&(R=clearTimeout);function K(e){if(T===setTimeout)return setTimeout(e,0);if((T===V||!T)&&setTimeout)return T=setTimeout,setTimeout(e,0);try{return T(e,0)}catch{try{return T.call(null,e,0)}catch{return T.call(this,e,0)}}}function wr(e){if(R===clearTimeout)return clearTimeout(e);if((R===z||!R)&&clearTimeout)return R=clearTimeout,clearTimeout(e);try{return R(e)}catch{try{return R.call(null,e)}catch{return R.call(this,e)}}}var A=[],v=!1,I,P=-1;function xr(){!v||!I||(v=!1,I.length?A=I.concat(A):P=-1,A.length&&b())}function b(){if(!v){var e=K(xr);v=!0;for(var r=A.length;r;){for(I=A,A=[];++P<r;)I&&I[P].run();P=-1,r=A.length}I=null,v=!1,wr(e)}}function mr(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];A.push(new G(e,r)),A.length===1&&!v&&K(b)}function G(e,r){this.fun=e,this.array=r}G.prototype.run=function(){this.fun.apply(null,this.array)};var Er="browser",gr="browser",dr=!0,Ar={},yr=[],Tr="",Rr={},Ir={},_r={};function _(){}var Ur=_,Br=_,Sr=_,vr=_,Pr=_,Cr=_,Yr=_;function Mr(e){throw new Error("process.binding is not supported")}function Dr(){return"/"}function kr(e){throw new Error("process.chdir is not supported")}function Nr(){return 0}var S=globalThis.performance||{},Fr=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function Lr(e){var r=Fr.call(S)*.001,n=Math.floor(r),i=Math.floor(r%1*1e9);return e&&(n=n-e[0],i=i-e[1],i<0&&(n--,i+=1e9)),[n,i]}var Xr=new Date;function Wr(){var e=new Date,r=e-Xr;return r/1e3}var L={nextTick:mr,title:Er,browser:dr,env:Ar,argv:yr,version:Tr,versions:Rr,on:Ur,addListener:Br,once:Sr,off:vr,removeListener:Pr,removeAllListeners:Cr,emit:Yr,binding:Mr,cwd:Dr,chdir:kr,umask:Nr,hrtime:Lr,platform:gr,release:Ir,config:_r,uptime:Wr},H={};Object.keys(H).forEach(e=>{let r=e.split("."),n=L;for(let i=0;i<r.length;i++){let t=r[i];i===r.length-1?n[t]=H[e]:n=n[t]||(n[t]={})}});var g=[],m=[],qr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=e.length;r<n;++r)g[r]=e[r],m[e.charCodeAt(r)]=r;m[45]=62,m[95]=63}function Or(e){W||$();var r,n,i,t,o,u,a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[a-2]==="="?2:e[a-1]==="="?1:0,u=new qr(a*3/4-o),i=o>0?a-4:a;var h=0;for(r=0,n=0;r<i;r+=4,n+=3)t=m[e.charCodeAt(r)]<<18|m[e.charCodeAt(r+1)]<<12|m[e.charCodeAt(r+2)]<<6|m[e.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return o===2?(t=m[e.charCodeAt(r)]<<2|m[e.charCodeAt(r+1)]>>4,u[h++]=t&255):o===1&&(t=m[e.charCodeAt(r)]<<10|m[e.charCodeAt(r+1)]<<4|m[e.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Hr(e){return g[e>>18&63]+g[e>>12&63]+g[e>>6&63]+g[e&63]}function Vr(e,r,n){for(var i,t=[],o=r;o<n;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],t.push(Hr(i));return t.join("")}function J(e){W||$();for(var r,n=e.length,i=n%3,t="",o=[],u=16383,a=0,h=n-i;a<h;a+=u)o.push(Vr(e,a,a+u>h?h:a+u));return i===1?(r=e[n-1],t+=g[r>>2],t+=g[r<<4&63],t+="=="):i===2&&(r=(e[n-2]<<8)+e[n-1],t+=g[r>>10],t+=g[r>>4&63],t+=g[r<<2&63],t+="="),o.push(t),o.join("")}f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(e,r){if(C()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=f.prototype):(e===null&&(e=new f(r)),e.length=r),e}function f(e,r,n){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(e,r,n);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return q(this,e)}return j(this,e,r,n)}f.poolSize=8192;f._augment=function(e){return e.__proto__=f.prototype,e};function j(e,r,n,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?br(e,r,n,i):typeof r=="string"?Kr(e,r,n):Gr(e,r)}f.from=function(e,r,n){return j(null,e,r,n)};f.kMaxLength=C();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&f[Symbol.species]);function rr(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function zr(e,r,n,i){return rr(r),r<=0?y(e,r):n!==void 0?typeof i=="string"?y(e,r).fill(n,i):y(e,r).fill(n):y(e,r)}f.alloc=function(e,r,n){return zr(null,e,r,n)};function q(e,r){if(rr(r),e=y(e,r<0?0:O(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)e[n]=0;return e}f.allocUnsafe=function(e){return q(null,e)};f.allocUnsafeSlow=function(e){return q(null,e)};function Kr(e,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=nr(r,n)|0;e=y(e,i);var t=e.write(r,n);return t!==i&&(e=e.slice(0,t)),e}function X(e,r){var n=r.length<0?0:O(r.length)|0;e=y(e,n);for(var i=0;i<n;i+=1)e[i]=r[i]&255;return e}function br(e,r,n,i){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return n===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,i),f.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=f.prototype):e=X(e,r),e}function Gr(e,r){if(d(r)){var n=O(r.length)|0;return e=y(e,n),e.length===0||r.copy(e,0,0,n),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||wn(r.length)?y(e,0):X(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return X(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function O(e){if(e>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return e|0}f.isBuffer=xn;function d(e){return!!(e!=null&&e._isBuffer)}f.compare=function(r,n){if(!d(r)||!d(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var i=r.length,t=n.length,o=0,u=Math.min(i,t);o<u;++o)if(r[o]!==n[o]){i=r[o],t=n[o];break}return i<t?-1:t<i?1:0};f.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}};f.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var i;if(n===void 0)for(n=0,i=0;i<r.length;++i)n+=r[i].length;var t=f.allocUnsafe(n),o=0;for(i=0;i<r.length;++i){var u=r[i];if(!d(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,o),o+=u.length}return t};function nr(e,r){if(d(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return ar(e).length;default:if(i)return Y(e).length;r=(""+r).toLowerCase(),i=!0}}f.byteLength=nr;function Jr(e,r,n){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return un(this,r,n);case"utf8":case"utf-8":return tr(this,r,n);case"ascii":return tn(this,r,n);case"latin1":case"binary":return on(this,r,n);case"base64":return nn(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fn(this,r,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}f.prototype._isBuffer=!0;function U(e,r,n){var i=e[r];e[r]=e[n],e[n]=i}f.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 n=0;n<r;n+=2)U(this,n,n+1);return this};f.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 n=0;n<r;n+=4)U(this,n,n+3),U(this,n+1,n+2);return this};f.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 n=0;n<r;n+=8)U(this,n,n+7),U(this,n+1,n+6),U(this,n+2,n+5),U(this,n+3,n+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?tr(this,0,r):Jr.apply(this,arguments)};f.prototype.equals=function(r){if(!d(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.compare=function(r,n,i,t,o){if(!d(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),i===void 0&&(i=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),n<0||i>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&n>=i)return 0;if(t>=o)return-1;if(n>=i)return 1;if(n>>>=0,i>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var u=o-t,a=i-n,h=Math.min(u,a),s=this.slice(t,o),l=r.slice(n,i),c=0;c<h;++c)if(s[c]!==l[c]){u=s[c],a=l[c];break}return u<a?-1:a<u?1:0};function er(e,r,n,i,t){if(e.length===0)return-1;if(typeof n=="string"?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(t)return-1;n=e.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=f.from(r,i)),d(r))return r.length===0?-1:Q(e,r,n,i,t);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):Q(e,[r],n,i,t);throw new TypeError("val must be string, number or Buffer")}function Q(e,r,n,i,t){var o=1,u=e.length,a=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,a/=2,n/=2}function h(x,B){return o===1?x[B]:x.readUInt16BE(B*o)}var s;if(t){var l=-1;for(s=n;s<u;s++)if(h(e,s)===h(r,l===-1?0:s-l)){if(l===-1&&(l=s),s-l+1===a)return l*o}else l!==-1&&(s-=s-l),l=-1}else for(n+a>u&&(n=u-a),s=n;s>=0;s--){for(var c=!0,E=0;E<a;E++)if(h(e,s+E)!==h(r,E)){c=!1;break}if(c)return s}return-1}f.prototype.includes=function(r,n,i){return this.indexOf(r,n,i)!==-1};f.prototype.indexOf=function(r,n,i){return er(this,r,n,i,!0)};f.prototype.lastIndexOf=function(r,n,i){return er(this,r,n,i,!1)};function Qr(e,r,n,i){n=Number(n)||0;var t=e.length-n;i?(i=Number(i),i>t&&(i=t)):i=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var u=0;u<i;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;e[n+u]=a}return u}function Zr(e,r,n,i){return k(Y(r,e.length-n),e,n,i)}function ir(e,r,n,i){return k(ln(r),e,n,i)}function $r(e,r,n,i){return ir(e,r,n,i)}function jr(e,r,n,i){return k(ar(r),e,n,i)}function rn(e,r,n,i){return k(pn(r,e.length-n),e,n,i)}f.prototype.write=function(r,n,i,t){if(n===void 0)t="utf8",i=this.length,n=0;else if(i===void 0&&typeof n=="string")t=n,i=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(i)?(i=i|0,t===void 0&&(t="utf8")):(t=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Qr(this,r,n,i);case"utf8":case"utf-8":return Zr(this,r,n,i);case"ascii":return ir(this,r,n,i);case"latin1":case"binary":return $r(this,r,n,i);case"base64":return jr(this,r,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rn(this,r,n,i);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nn(e,r,n){return r===0&&n===e.length?J(e):J(e.slice(r,n))}function tr(e,r,n){n=Math.min(e.length,n);for(var i=[],t=r;t<n;){var o=e[t],u=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=n){var h,s,l,c;switch(a){case 1:o<128&&(u=o);break;case 2:h=e[t+1],(h&192)===128&&(c=(o&31)<<6|h&63,c>127&&(u=c));break;case 3:h=e[t+1],s=e[t+2],(h&192)===128&&(s&192)===128&&(c=(o&15)<<12|(h&63)<<6|s&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=e[t+1],s=e[t+2],l=e[t+3],(h&192)===128&&(s&192)===128&&(l&192)===128&&(c=(o&15)<<18|(h&63)<<12|(s&63)<<6|l&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),t+=a}return en(i)}var Z=4096;function en(e){var r=e.length;if(r<=Z)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<r;)n+=String.fromCharCode.apply(String,e.slice(i,i+=Z));return n}function tn(e,r,n){var i="";n=Math.min(e.length,n);for(var t=r;t<n;++t)i+=String.fromCharCode(e[t]&127);return i}function on(e,r,n){var i="";n=Math.min(e.length,n);for(var t=r;t<n;++t)i+=String.fromCharCode(e[t]);return i}function un(e,r,n){var i=e.length;(!r||r<0)&&(r=0),(!n||n<0||n>i)&&(n=i);for(var t="",o=r;o<n;++o)t+=sn(e[o]);return t}function fn(e,r,n){for(var i=e.slice(r,n),t="",o=0;o<i.length;o+=2)t+=String.fromCharCode(i[o]+i[o+1]*256);return t}f.prototype.slice=function(r,n){var i=this.length;r=~~r,n=n===void 0?i:~~n,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),n<0?(n+=i,n<0&&(n=0)):n>i&&(n=i),n<r&&(n=r);var t;if(f.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=f.prototype;else{var o=n-r;t=new f(o,void 0);for(var u=0;u<o;++u)t[u]=this[u+r]}return t};function p(e,r,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,n,i){r=r|0,n=n|0,i||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return t};f.prototype.readUIntBE=function(r,n,i){r=r|0,n=n|0,i||p(r,n,this.length);for(var t=this[r+--n],o=1;n>0&&(o*=256);)t+=this[r+--n]*o;return t};f.prototype.readUInt8=function(r,n){return n||p(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,n){return n||p(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,n){return n||p(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,n){return n||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,n){return n||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,n,i){r=r|0,n=n|0,i||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*n)),t};f.prototype.readIntBE=function(r,n,i){r=r|0,n=n|0,i||p(r,n,this.length);for(var t=n,o=1,u=this[r+--t];t>0&&(o*=256);)u+=this[r+--t]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*n)),u};f.prototype.readInt8=function(r,n){return n||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,n){n||p(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};f.prototype.readInt16BE=function(r,n){n||p(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};f.prototype.readInt32LE=function(r,n){return n||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,n){return n||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,n){return n||p(r,4,this.length),N(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,n){return n||p(r,4,this.length),N(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,n){return n||p(r,8,this.length),N(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,n){return n||p(r,8,this.length),N(this,r,!1,52,8)};function w(e,r,n,i,t,o){if(!d(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,n,i,t){if(r=+r,n=n|0,i=i|0,!t){var o=Math.pow(2,8*i)-1;w(this,r,n,i,o,0)}var u=1,a=0;for(this[n]=r&255;++a<i&&(u*=256);)this[n+a]=r/u&255;return n+i};f.prototype.writeUIntBE=function(r,n,i,t){if(r=+r,n=n|0,i=i|0,!t){var o=Math.pow(2,8*i)-1;w(this,r,n,i,o,0)}var u=i-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+i};f.prototype.writeUInt8=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function M(e,r,n,i){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(e.length-n,2);t<o;++t)e[n+t]=(r&255<<8*(i?t:1-t))>>>(i?t:1-t)*8}f.prototype.writeUInt16LE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};f.prototype.writeUInt16BE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};function D(e,r,n,i){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(e.length-n,4);t<o;++t)e[n+t]=r>>>(i?t:3-t)*8&255}f.prototype.writeUInt32LE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):D(this,r,n,!0),n+4};f.prototype.writeUInt32BE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):D(this,r,n,!1),n+4};f.prototype.writeIntLE=function(r,n,i,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*i-1);w(this,r,n,i,o-1,-o)}var u=0,a=1,h=0;for(this[n]=r&255;++u<i&&(a*=256);)r<0&&h===0&&this[n+u-1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+i};f.prototype.writeIntBE=function(r,n,i,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*i-1);w(this,r,n,i,o-1,-o)}var u=i-1,a=1,h=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[n+u+1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+i};f.prototype.writeInt8=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};f.prototype.writeInt16LE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};f.prototype.writeInt16BE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};f.prototype.writeInt32LE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):D(this,r,n,!0),n+4};f.prototype.writeInt32BE=function(r,n,i){return r=+r,n=n|0,i||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):D(this,r,n,!1),n+4};function or(e,r,n,i,t,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ur(e,r,n,i,t){return t||or(e,r,n,4,34028234663852886e22,-34028234663852886e22),cr(e,r,n,i,23,4),n+4}f.prototype.writeFloatLE=function(r,n,i){return ur(this,r,n,!0,i)};f.prototype.writeFloatBE=function(r,n,i){return ur(this,r,n,!1,i)};function fr(e,r,n,i,t){return t||or(e,r,n,8,17976931348623157e292,-17976931348623157e292),cr(e,r,n,i,52,8),n+8}f.prototype.writeDoubleLE=function(r,n,i){return fr(this,r,n,!0,i)};f.prototype.writeDoubleBE=function(r,n,i){return fr(this,r,n,!1,i)};f.prototype.copy=function(r,n,i,t){if(i||(i=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<i&&(t=i),t===i||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-i&&(t=r.length-n+i);var o=t-i,u;if(this===r&&i<n&&n<t)for(u=o-1;u>=0;--u)r[u+n]=this[u+i];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+n]=this[u+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),n);return o};f.prototype.fill=function(r,n,i,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,i=this.length):typeof i=="string"&&(t=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<i)throw new RangeError("Out of range index");if(i<=n)return this;n=n>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<i;++u)this[u]=r;else{var a=d(r)?r:Y(new f(r,t).toString()),h=a.length;for(u=0;u<i-n;++u)this[u+n]=a[u%h]}return this};var an=/[^+\/0-9A-Za-z-_]/g;function hn(e){if(e=cn(e).replace(an,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function cn(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function sn(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,r){r=r||1/0;for(var n,i=e.length,t=null,o=[],u=0;u<i;++u){if(n=e.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&o.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;o.push(n)}else if(n<2048){if((r-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function ln(e){for(var r=[],n=0;n<e.length;++n)r.push(e.charCodeAt(n)&255);return r}function pn(e,r){for(var n,i,t,o=[],u=0;u<e.length&&!((r-=2)<0);++u)n=e.charCodeAt(u),i=n>>8,t=n%256,o.push(t),o.push(i);return o}function ar(e){return Or(hn(e))}function k(e,r,n,i){for(var t=0;t<i&&!(t+n>=r.length||t>=e.length);++t)r[t+n]=e[t];return t}function wn(e){return e!==e}function xn(e){return e!=null&&(!!e._isBuffer||hr(e)||mn(e))}function hr(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function mn(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&hr(e.slice(0,0))}function N(e,r,n,i,t){var o,u,a=t*8-i-1,h=(1<<a)-1,s=h>>1,l=-7,c=n?t-1:0,E=n?-1:1,x=e[r+c];for(c+=E,o=x&(1<<-l)-1,x>>=-l,l+=a;l>0;o=o*256+e[r+c],c+=E,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+e[r+c],c+=E,l-=8);if(o===0)o=1-s;else{if(o===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-s}return(x?-1:1)*u*Math.pow(2,o-i)}function cr(e,r,n,i,t,o){var u,a,h,s=o*8-t-1,l=(1<<s)-1,c=l>>1,E=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,B=i?1:-1,pr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=E/h:r+=E*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;e[n+x]=a&255,x+=B,a/=256,t-=8);for(u=u<<t|a,s+=t;s>0;e[n+x]=u&255,x+=B,u/=256,s-=8);e[n+x-B]|=pr*128}var Rn=e=>{let r=new Date(e),n=r.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),i=r.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return n+" "+i},In=(e,r)=>String(e).toLowerCase()===String(r).toLowerCase();function _n(e,r){return e=Math.ceil(e),r=Math.floor(r),Math.floor(Math.random()*(r-e+1))+e}function Un(e){let r=[],n=e.split(".");for(let i=0;i<n.length-1;i++)r.push(n.slice(i).join("."));return r}function Bn(e){let r=e.headers&&F({Authorization:e.headers.Authorization?.substring(0,200),"CloudFront-Viewer-Country":e.headers["CloudFront-Viewer-Country"],Host:e.headers.Host,origin:e.headers.origin,Referer:e.headers.Referer,"User-Agent":e.headers["User-Agent"],"wl-domain":e.headers["wl-domain"],"X-API-Key":sr(e.headers["X-API-Key"]),"X-Forwarded-For":e.headers["X-Forwarded-For"],"X-Forwarded-Port":e.headers["X-Forwarded-Port"],"X-Forwarded-Proto":e.headers["X-Forwarded-Proto"],"X-Trading-Key":e.headers["X-Trading-Key"],"X-Wallet-Address":e.headers["X-Wallet-Address"],"X-Wallet-Token":e.headers["X-Wallet-Token"],accessToken:sr(e.headers.accessToken),companyId:e.headers.companyId,seasonId:e.headers.seasonId}),n=e.requestContext&&F({identity:e.requestContext.identity&&F({userAgent:e.requestContext.identity.userAgent,sourceIp:e.requestContext.identity.sourceIp}),domainName:e.requestContext.domainName});return F({manage:e.manage,path:e.path,httpMethod:e.httpMethod,headers:r,requestContext:n})}function sr(e){if(!e?.length)return e;let r=Math.round(e.length/3),n=r,i=e.length-r;return e.substring(0,n)+"*".repeat(r)+e.substring(i)}function lr(e,r){return Array.isArray(e)?e.map(n=>lr(n,r)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).filter(([n])=>n!==r).map(([n,i])=>[n,lr(i,r)])):e}function F(e){return Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0))}export{Bn as cutEvent,In as equalIgnoreCase,Un as getDomains,_n as getRandomInt,Rn as listDateFormat,sr as maskingString,lr as removeField};
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
+ */
@@ -0,0 +1,11 @@
1
+ function z(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=z,_=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function O(i){if(R===setTimeout)return setTimeout(i,0);if((R===z||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch{try{return R.call(null,i,0)}catch{return R.call(this,i,0)}}}function lr(i){if(_===clearTimeout)return clearTimeout(i);if((_===J||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch{try{return _.call(null,i)}catch{return _.call(this,i)}}}var y=[],S=!1,I,Y=-1;function pr(){!S||!I||(S=!1,I.length?y=I.concat(y):Y=-1,y.length&&Q())}function Q(){if(!S){var i=O(pr);S=!0;for(var r=y.length;r;){for(I=y,y=[];++Y<r;)I&&I[Y].run();Y=-1,r=y.length}I=null,S=!1,lr(i)}}function sr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];y.push(new X(i,r)),y.length===1&&!S&&O(Q)}function X(i,r){this.fun=i,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function v(){}var _r=v,Ir=v,vr=v,Ur=v,Br=v,dr=v,Sr=v;function Yr(i){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Mr(i){throw new Error("process.chdir is not supported")}function Dr(){return 0}var d=globalThis.performance||{},Cr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function kr(i){var r=Cr.call(d)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Nr=new Date;function Lr(){var i=new Date,r=i-Nr;return r/1e3}var L={nextTick:sr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:_r,addListener:Ir,once:vr,off:Ur,removeListener:Br,removeAllListeners:dr,emit:Sr,binding:Yr,cwd:Pr,chdir:Mr,umask:Dr,hrtime:kr,platform:xr,release:Tr,config:Rr,uptime:Lr},V={};Object.keys(V).forEach(i=>{let r=i.split("."),n=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=V[i]:n=n[t]||(n[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(i){W||$();var r,n,e,t,f,u,h=i.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=i[h-2]==="="?2:i[h-1]==="="?1:0,u=new Fr(h*3/4-f),e=f>0?h-4:h;var a=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=t&255;return f===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,u[a++]=t&255):f===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,u[a++]=t>>8&255,u[a++]=t&255),u}function Gr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Hr(i,r,n){for(var e,t=[],f=r;f<n;f+=3)e=(i[f]<<16)+(i[f+1]<<8)+i[f+2],t.push(Gr(e));return t.join("")}function q(i){W||$();for(var r,n=i.length,e=n%3,t="",f=[],u=16383,h=0,a=n-e;h<a;h+=u)f.push(Hr(i,h,h+u>a?a:h+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=o.prototype):(i===null&&(i=new o(r)),i.length=r),i}function o(i,r,n){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,i)}return b(this,i,r,n)}o.poolSize=8192;o._augment=function(i){return i.__proto__=o.prototype,i};function b(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(i,r,n,e):typeof r=="string"?zr(i,r,n):Or(i,r)}o.from=function(i,r,n){return b(null,i,r,n)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Vr(i,r,n,e){return j(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}o.alloc=function(i,r,n){return Vr(null,i,r,n)};function G(i,r){if(j(r),i=T(i,r<0?0:H(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}o.allocUnsafe=function(i){return G(null,i)};o.allocUnsafeSlow=function(i){return G(null,i)};function zr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:H(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Jr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),o.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=o.prototype):i=F(i,r),i}function Or(i,r){if(g(r)){var n=H(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ln(r.length)?T(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(i){if(i>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return i|0}o.isBuffer=pn;function g(i){return!!(i!=null&&i._isBuffer)}o.compare=function(r,n){if(!g(r)||!g(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==n[f]){e=r[f],t=n[f];break}return e<t?-1:t<e?1:0};o.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}};o.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=o.allocUnsafe(n),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(i,r){if(g(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return M(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return or(i).length;default:if(e)return M(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return en(this,r,n);case"utf8":case"utf-8":return er(this,r,n);case"ascii":return rn(this,r,n);case"latin1":case"binary":return nn(this,r,n);case"base64":return br(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}o.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 n=0;n<r;n+=2)U(this,n,n+1);return this};o.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 n=0;n<r;n+=4)U(this,n,n+3),U(this,n+1,n+2);return this};o.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 n=0;n<r;n+=8)U(this,n,n+7),U(this,n+1,n+6),U(this,n+2,n+5),U(this,n+3,n+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,n,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),n<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&n>=e)return 0;if(t>=f)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,h=e-n,a=Math.min(u,h),l=this.slice(t,f),p=r.slice(n,e),c=0;c<a;++c)if(l[c]!==p[c]){u=l[c],h=p[c];break}return u<h?-1:h<u?1:0};function nr(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(i,r,n,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):Z(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(i,r,n,e,t){var f=1,u=i.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;f=2,u/=2,h/=2,n/=2}function a(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=n;l<u;l++)if(a(i,l)===a(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===h)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(n+h>u&&(n=u-h),l=n;l>=0;l--){for(var c=!0,m=0;m<h;m++)if(a(i,l+m)!==a(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};o.prototype.indexOf=function(r,n,e){return nr(this,r,n,e,!0)};o.prototype.lastIndexOf=function(r,n,e){return nr(this,r,n,e,!1)};function Xr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var h=parseInt(r.substr(u*2,2),16);if(isNaN(h))return u;i[n+u]=h}return u}function qr(i,r,n,e){return k(M(r,i.length-n),i,n,e)}function ir(i,r,n,e){return k(an(r),i,n,e)}function Zr(i,r,n,e){return ir(i,r,n,e)}function Kr(i,r,n,e){return k(or(r),i,n,e)}function $r(i,r,n,e){return k(cn(r,i.length-n),i,n,e)}o.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-n;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,n,e);case"utf8":case"utf-8":return qr(this,r,n,e);case"ascii":return ir(this,r,n,e);case"latin1":case"binary":return Zr(this,r,n,e);case"base64":return Kr(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(i,r,n){return r===0&&n===i.length?q(i):q(i.slice(r,n))}function er(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var f=i[t],u=null,h=f>239?4:f>223?3:f>191?2:1;if(t+h<=n){var a,l,p,c;switch(h){case 1:f<128&&(u=f);break;case 2:a=i[t+1],(a&192)===128&&(c=(f&31)<<6|a&63,c>127&&(u=c));break;case 3:a=i[t+1],l=i[t+2],(a&192)===128&&(l&192)===128&&(c=(f&15)<<12|(a&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:a=i[t+1],l=i[t+2],p=i[t+3],(a&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(a&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=h}return jr(e)}var K=4096;function jr(i){var r=i.length;if(r<=K)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=K));return n}function rn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function nn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function en(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",f=r;f<n;++f)t+=hn(i[f]);return t}function tn(i,r,n){for(var e=i.slice(r,n),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=o.prototype;else{var f=n-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r+--n],f=1;n>0&&(f*=256);)t+=this[r+--n]*f;return t};o.prototype.readUInt8=function(r,n){return n||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,n){return n||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,n){return n||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,n){return n||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,n){return n||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*n)),t};o.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=n,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*n)),u};o.prototype.readInt8=function(r,n){return n||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,n){n||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,n){n||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,n){return n||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,n){return n||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,n){return n||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,n){return n||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,n){return n||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,n){return n||s(r,8,this.length),N(this,r,!1,52,8)};function w(i,r,n,e,t,f){if(!g(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=1,h=0;for(this[n]=r&255;++h<e&&(u*=256);)this[n+h]=r/u&255;return n+e};o.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=e-1,h=1;for(this[n+u]=r&255;--u>=0&&(h*=256);)this[n+u]=r/h&255;return n+e};o.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function D(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(i.length-n,2);t<f;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};o.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};function C(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(i.length-n,4);t<f;++t)i[n+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):C(this,r,n,!0),n+4};o.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};o.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=0,h=1,a=0;for(this[n]=r&255;++u<e&&(h*=256);)r<0&&a===0&&this[n+u-1]!==0&&(a=1),this[n+u]=(r/h>>0)-a&255;return n+e};o.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=e-1,h=1,a=0;for(this[n+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[n+u+1]!==0&&(a=1),this[n+u]=(r/h>>0)-a&255;return n+e};o.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};o.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};o.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};o.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):C(this,r,n,!0),n+4};o.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};function tr(i,r,n,e,t,f){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function fr(i,r,n,e,t){return t||tr(i,r,n,4,34028234663852886e22,-34028234663852886e22),ar(i,r,n,e,23,4),n+4}o.prototype.writeFloatLE=function(r,n,e){return fr(this,r,n,!0,e)};o.prototype.writeFloatBE=function(r,n,e){return fr(this,r,n,!1,e)};function ur(i,r,n,e,t){return t||tr(i,r,n,8,17976931348623157e292,-17976931348623157e292),ar(i,r,n,e,52,8),n+8}o.prototype.writeDoubleLE=function(r,n,e){return ur(this,r,n,!0,e)};o.prototype.writeDoubleBE=function(r,n,e){return ur(this,r,n,!1,e)};o.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var f=t-e,u;if(this===r&&e<n&&n<t)for(u=f-1;u>=0;--u)r[u+n]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),n);return f};o.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var h=g(r)?r:M(new o(r,t).toString()),a=h.length;for(u=0;u<e-n;++u)this[u+n]=h[u%a]}return this};var fn=/[^+\/0-9A-Za-z-_]/g;function un(i){if(i=on(i).replace(fn,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function on(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function hn(i){return i<16?"0"+i.toString(16):i.toString(16)}function M(i,r){r=r||1/0;for(var n,e=i.length,t=null,f=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&f.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;f.push(n)}else if(n<2048){if((r-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function an(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function cn(i,r){for(var n,e,t,f=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,f.push(t),f.push(e);return f}function or(i){return Wr(un(i))}function k(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function ln(i){return i!==i}function pn(i){return i!=null&&(!!i._isBuffer||hr(i)||sn(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function sn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function N(i,r,n,e,t){var f,u,h=t*8-e-1,a=(1<<h)-1,l=a>>1,p=-7,c=n?t-1:0,m=n?-1:1,x=i[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=h;p>0;f=f*256+i[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+i[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function ar(i,r,n,e,t,f){var u,h,a,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(u++,a/=2),u+c>=p?(h=0,u=p):u+c>=1?(h=(r*a-1)*Math.pow(2,t),u=u+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=h&255,x+=B,h/=256,t-=8);for(u=u<<t|h,l+=t;l>0;i[n+x]=u&255,x+=B,u/=256,l-=8);i[n+x-B]|=cr*128}var yn=()=>1;export{yn as getGlobalPointSystemId};
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
+ */
@@ -0,0 +1,11 @@
1
+ function q(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var R=q,_=X;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function Z(i){if(R===setTimeout)return setTimeout(i,0);if((R===q||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch{try{return R.call(null,i,0)}catch{return R.call(this,i,0)}}}function mr(i){if(_===clearTimeout)return clearTimeout(i);if((_===X||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch{try{return _.call(null,i)}catch{return _.call(this,i)}}}var T=[],B=!1,d,b=-1;function Er(){!B||!d||(B=!1,d.length?T=d.concat(T):b=-1,T.length&&z())}function z(){if(!B){var i=Z(Er);B=!0;for(var r=T.length;r;){for(d=T,T=[];++b<r;)d&&d[b].run();b=-1,r=T.length}d=null,B=!1,mr(i)}}function Ar(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];T.push(new J(i,r)),T.length===1&&!B&&Z(z)}function J(i,r){this.fun=i,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var Tr="browser",yr="browser",Rr=!0,_r={},dr=[],Ur="",Ir={},vr={},Sr={};function U(){}var Br=U,br=U,Pr=U,Nr=U,Mr=U,Dr=U,Yr=U;function Lr(i){throw new Error("process.binding is not supported")}function Cr(){return"/"}function kr(i){throw new Error("process.chdir is not supported")}function Fr(){return 0}var S=globalThis.performance||{},Or=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function Hr(i){var r=Or.call(S)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Gr=new Date;function Qr(){var i=new Date,r=i-Gr;return r/1e3}var P={nextTick:Ar,title:Tr,browser:Rr,env:_r,argv:dr,version:Ur,versions:Ir,on:Br,addListener:br,once:Pr,off:Nr,removeListener:Mr,removeAllListeners:Dr,emit:Yr,binding:Lr,cwd:Cr,chdir:kr,umask:Fr,hrtime:Hr,platform:yr,release:vr,config:Sr,uptime:Qr},W={};Object.keys(W).forEach(i=>{let r=i.split("."),n=P;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=W[i]:n=n[t]||(n[t]={})}});var E=[],g=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,O=!1;function rr(){O=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)E[r]=i[r],g[i.charCodeAt(r)]=r;g[45]=62,g[95]=63}function Wr(i){O||rr();var r,n,e,t,o,u,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=i[a-2]==="="?2:i[a-1]==="="?1:0,u=new Vr(a*3/4-o),e=o>0?a-4:a;var c=0;for(r=0,n=0;r<e;r+=4,n+=3)t=g[i.charCodeAt(r)]<<18|g[i.charCodeAt(r+1)]<<12|g[i.charCodeAt(r+2)]<<6|g[i.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=t&255;return o===2?(t=g[i.charCodeAt(r)]<<2|g[i.charCodeAt(r+1)]>>4,u[c++]=t&255):o===1&&(t=g[i.charCodeAt(r)]<<10|g[i.charCodeAt(r+1)]<<4|g[i.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=t&255),u}function qr(i){return E[i>>18&63]+E[i>>12&63]+E[i>>6&63]+E[i&63]}function Xr(i,r,n){for(var e,t=[],o=r;o<n;o+=3)e=(i[o]<<16)+(i[o+1]<<8)+i[o+2],t.push(qr(e));return t.join("")}function $(i){O||rr();for(var r,n=i.length,e=n%3,t="",o=[],u=16383,a=0,c=n-e;a<c;a+=u)o.push(Xr(i,a,a+u>c?c:a+u));return e===1?(r=i[n-1],t+=E[r>>2],t+=E[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=E[r>>10],t+=E[r>>4&63],t+=E[r<<2&63],t+="="),o.push(t),o.join("")}f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function N(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(i,r){if(N()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=f.prototype):(i===null&&(i=new f(r)),i.length=r),i}function f(i,r,n){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,i)}return nr(this,i,r,n)}f.poolSize=8192;f._augment=function(i){return i.__proto__=f.prototype,i};function nr(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(i,r,n,e):typeof r=="string"?zr(i,r,n):$r(i,r)}f.from=function(i,r,n){return nr(null,i,r,n)};f.kMaxLength=N();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&f[Symbol.species]);function ir(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Zr(i,r,n,e){return ir(r),r<=0?y(i,r):n!==void 0?typeof e=="string"?y(i,r).fill(n,e):y(i,r).fill(n):y(i,r)}f.alloc=function(i,r,n){return Zr(null,i,r,n)};function H(i,r){if(ir(r),i=y(i,r<0?0:G(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}f.allocUnsafe=function(i){return H(null,i)};f.allocUnsafeSlow=function(i){return H(null,i)};function zr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=er(r,n)|0;i=y(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:G(r.length)|0;i=y(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Jr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),f.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=f.prototype):i=F(i,r),i}function $r(i,r){if(A(r)){var n=G(r.length)|0;return i=y(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||mn(r.length)?y(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(i){if(i>=N())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+N().toString(16)+" bytes");return i|0}f.isBuffer=En;function A(i){return!!(i!=null&&i._isBuffer)}f.compare=function(r,n){if(!A(r)||!A(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,o=0,u=Math.min(e,t);o<u;++o)if(r[o]!==n[o]){e=r[o],t=n[o];break}return e<t?-1:t<e?1:0};f.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}};f.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=f.allocUnsafe(n),o=0;for(e=0;e<r.length;++e){var u=r[e];if(!A(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,o),o+=u.length}return t};function er(i,r){if(A(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return M(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return hr(i).length;default:if(e)return M(i).length;r=(""+r).toLowerCase(),e=!0}}f.byteLength=er;function Kr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return cn(this,r,n);case"utf8":case"utf-8":return ur(this,r,n);case"ascii":return fn(this,r,n);case"latin1":case"binary":return an(this,r,n);case"base64":return on(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}f.prototype._isBuffer=!0;function I(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}f.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 n=0;n<r;n+=2)I(this,n,n+1);return this};f.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 n=0;n<r;n+=4)I(this,n,n+3),I(this,n+1,n+2);return this};f.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 n=0;n<r;n+=8)I(this,n,n+7),I(this,n+1,n+6),I(this,n+2,n+5),I(this,n+3,n+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ur(this,0,r):Kr.apply(this,arguments)};f.prototype.equals=function(r){if(!A(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.compare=function(r,n,e,t,o){if(!A(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),n<0||e>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&n>=e)return 0;if(t>=o)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var u=o-t,a=e-n,c=Math.min(u,a),s=this.slice(t,o),l=r.slice(n,e),h=0;h<c;++h)if(s[h]!==l[h]){u=s[h],a=l[h];break}return u<a?-1:a<u?1:0};function tr(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=f.from(r,e)),A(r))return r.length===0?-1:K(i,r,n,e,t);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):K(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function K(i,r,n,e,t){var o=1,u=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;o=2,u/=2,a/=2,n/=2}function c(w,v){return o===1?w[v]:w.readUInt16BE(v*o)}var s;if(t){var l=-1;for(s=n;s<u;s++)if(c(i,s)===c(r,l===-1?0:s-l)){if(l===-1&&(l=s),s-l+1===a)return l*o}else l!==-1&&(s-=s-l),l=-1}else for(n+a>u&&(n=u-a),s=n;s>=0;s--){for(var h=!0,m=0;m<a;m++)if(c(i,s+m)!==c(r,m)){h=!1;break}if(h)return s}return-1}f.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};f.prototype.indexOf=function(r,n,e){return tr(this,r,n,e,!0)};f.prototype.lastIndexOf=function(r,n,e){return tr(this,r,n,e,!1)};function jr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;i[n+u]=a}return u}function rn(i,r,n,e){return L(M(r,i.length-n),i,n,e)}function or(i,r,n,e){return L(wn(r),i,n,e)}function nn(i,r,n,e){return or(i,r,n,e)}function en(i,r,n,e){return L(hr(r),i,n,e)}function tn(i,r,n,e){return L(gn(r,i.length-n),i,n,e)}f.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((e===void 0||e>o)&&(e=o),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return jr(this,r,n,e);case"utf8":case"utf-8":return rn(this,r,n,e);case"ascii":return or(this,r,n,e);case"latin1":case"binary":return nn(this,r,n,e);case"base64":return en(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function on(i,r,n){return r===0&&n===i.length?$(i):$(i.slice(r,n))}function ur(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var o=i[t],u=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=n){var c,s,l,h;switch(a){case 1:o<128&&(u=o);break;case 2:c=i[t+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(u=h));break;case 3:c=i[t+1],s=i[t+2],(c&192)===128&&(s&192)===128&&(h=(o&15)<<12|(c&63)<<6|s&63,h>2047&&(h<55296||h>57343)&&(u=h));break;case 4:c=i[t+1],s=i[t+2],l=i[t+3],(c&192)===128&&(s&192)===128&&(l&192)===128&&(h=(o&15)<<18|(c&63)<<12|(s&63)<<6|l&63,h>65535&&h<1114112&&(u=h))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return un(e)}var j=4096;function un(i){var r=i.length;if(r<=j)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=j));return n}function fn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function an(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function cn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",o=r;o<n;++o)t+=xn(i[o]);return t}function hn(i,r,n){for(var e=i.slice(r,n),t="",o=0;o<e.length;o+=2)t+=String.fromCharCode(e[o]+e[o+1]*256);return t}f.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(f.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=f.prototype;else{var o=n-r;t=new f(o,void 0);for(var u=0;u<o;++u)t[u]=this[u+r]}return t};function p(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return t};f.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r+--n],o=1;n>0&&(o*=256);)t+=this[r+--n]*o;return t};f.prototype.readUInt8=function(r,n){return n||p(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,n){return n||p(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,n){return n||p(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,n){return n||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,n){return n||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*n)),t};f.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=n,o=1,u=this[r+--t];t>0&&(o*=256);)u+=this[r+--t]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*n)),u};f.prototype.readInt8=function(r,n){return n||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,n){n||p(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};f.prototype.readInt16BE=function(r,n){n||p(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};f.prototype.readInt32LE=function(r,n){return n||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,n){return n||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,n){return n||p(r,4,this.length),C(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,n){return n||p(r,4,this.length),C(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,n){return n||p(r,8,this.length),C(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,n){return n||p(r,8,this.length),C(this,r,!1,52,8)};function x(i,r,n,e,t,o){if(!A(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;x(this,r,n,e,o,0)}var u=1,a=0;for(this[n]=r&255;++a<e&&(u*=256);)this[n+a]=r/u&255;return n+e};f.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;x(this,r,n,e,o,0)}var u=e-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+e};f.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function D(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(i.length-n,2);t<o;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}f.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};f.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};function Y(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(i.length-n,4);t<o;++t)i[n+t]=r>>>(e?t:3-t)*8&255}f.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):Y(this,r,n,!0),n+4};f.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):Y(this,r,n,!1),n+4};f.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);x(this,r,n,e,o-1,-o)}var u=0,a=1,c=0;for(this[n]=r&255;++u<e&&(a*=256);)r<0&&c===0&&this[n+u-1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+e};f.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);x(this,r,n,e,o-1,-o)}var u=e-1,a=1,c=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&c===0&&this[n+u+1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+e};f.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};f.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};f.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};f.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):Y(this,r,n,!0),n+4};f.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):Y(this,r,n,!1),n+4};function fr(i,r,n,e,t,o){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ar(i,r,n,e,t){return t||fr(i,r,n,4,34028234663852886e22,-34028234663852886e22),lr(i,r,n,e,23,4),n+4}f.prototype.writeFloatLE=function(r,n,e){return ar(this,r,n,!0,e)};f.prototype.writeFloatBE=function(r,n,e){return ar(this,r,n,!1,e)};function cr(i,r,n,e,t){return t||fr(i,r,n,8,17976931348623157e292,-17976931348623157e292),lr(i,r,n,e,52,8),n+8}f.prototype.writeDoubleLE=function(r,n,e){return cr(this,r,n,!0,e)};f.prototype.writeDoubleBE=function(r,n,e){return cr(this,r,n,!1,e)};f.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var o=t-e,u;if(this===r&&e<n&&n<t)for(u=o-1;u>=0;--u)r[u+n]=this[u+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+o),n);return o};f.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var a=A(r)?r:M(new f(r,t).toString()),c=a.length;for(u=0;u<e-n;++u)this[u+n]=a[u%c]}return this};var sn=/[^+\/0-9A-Za-z-_]/g;function ln(i){if(i=pn(i).replace(sn,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function pn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function xn(i){return i<16?"0"+i.toString(16):i.toString(16)}function M(i,r){r=r||1/0;for(var n,e=i.length,t=null,o=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&o.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&o.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;o.push(n)}else if(n<2048){if((r-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function wn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function gn(i,r){for(var n,e,t,o=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,o.push(t),o.push(e);return o}function hr(i){return Wr(ln(i))}function L(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function mn(i){return i!==i}function En(i){return i!=null&&(!!i._isBuffer||sr(i)||An(i))}function sr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function An(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&sr(i.slice(0,0))}function C(i,r,n,e,t){var o,u,a=t*8-e-1,c=(1<<a)-1,s=c>>1,l=-7,h=n?t-1:0,m=n?-1:1,w=i[r+h];for(h+=m,o=w&(1<<-l)-1,w>>=-l,l+=a;l>0;o=o*256+i[r+h],h+=m,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=e;l>0;u=u*256+i[r+h],h+=m,l-=8);if(o===0)o=1-s;else{if(o===c)return u?NaN:(w?-1:1)*(1/0);u=u+Math.pow(2,e),o=o-s}return(w?-1:1)*u*Math.pow(2,o-e)}function lr(i,r,n,e,t,o){var u,a,c,s=o*8-t-1,l=(1<<s)-1,h=l>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=e?0:o-1,v=e?1:-1,gr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+h>=1?r+=m/c:r+=m*Math.pow(2,1-h),r*c>=2&&(u++,c/=2),u+h>=l?(a=0,u=l):u+h>=1?(a=(r*c-1)*Math.pow(2,t),u=u+h):(a=r*Math.pow(2,h-1)*Math.pow(2,t),u=0));t>=8;i[n+w]=a&255,w+=v,a/=256,t-=8);for(u=u<<t|a,s+=t;s>0;i[n+w]=u&255,w+=v,u/=256,s-=8);i[n+w-v]|=gr*128}import Q from"bignumber.js";Q.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function pr(i,r){return k(i,r,"-")}function xr(i,r){return k(i,r,"*")}function wr(i,r){return k(i,r,"/")}function V(i,r){return!!k(i,r,">")}function k(i,r,n){switch(i=new Q(String(i)),r=new Q(String(r)),n.toLowerCase()){case"-":return i.minus(r).toString();case"+":return i.plus(r).toString();case"*":case"x":return i.multipliedBy(r).toString();case"\xF7":case"/":return i.dividedBy(r).toString();case">=":return i.isGreaterThanOrEqualTo(r);case">":return i.isGreaterThan(r);case"<=":return i.isLessThanOrEqualTo(r);case"<":return i.isLessThan(r);case"==":return i.isEqualTo(r);case"mod":return i.modulo(r);default:break}}var Pn=(i,r)=>V(r,0)&&V(i,0)?xr(wr(pr(i,r),r),100):"0";export{Pn as changes24H};
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
+ */