@wormhole-foundation/wormhole-connect 2.0.0 → 2.1.0-beta.0-development
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.
- package/README.md +1 -0
- package/dist/assets/{ccip-B8McgJws.js → ccip-B5XelJyO.js} +1 -1
- package/dist/assets/{evm-B2eiT45I.js → evm-90nXZZVS.js} +3 -3
- package/dist/assets/{index.es-BO6bR5S4.js → index.es-Ed25jZ6s.js} +1 -1
- package/dist/assets/sui-DbbCSZ5V.js +1 -0
- package/dist/main.js +75 -75
- package/dist/src/config/constants.d.ts.map +1 -1
- package/dist/src/config/devnet/chains.d.ts.map +1 -1
- package/dist/src/config/devnet/index.d.ts.map +1 -1
- package/dist/src/config/devnet/rpcs.d.ts +0 -6
- package/dist/src/config/devnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/mainnet/chains.d.ts.map +1 -1
- package/dist/src/config/mainnet/index.d.ts.map +1 -1
- package/dist/src/config/mainnet/rpcs.d.ts +0 -6
- package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/chains.d.ts.map +1 -1
- package/dist/src/config/testnet/index.d.ts.map +1 -1
- package/dist/src/config/testnet/rpcs.d.ts +0 -6
- package/dist/src/config/testnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/config/tokens.d.ts +4 -0
- package/dist/src/config/tokens.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +2 -9
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/contexts/TokensContext.d.ts +1 -0
- package/dist/src/contexts/TokensContext.d.ts.map +1 -1
- package/dist/src/icons/ChainIcons.d.ts.map +1 -1
- package/dist/src/icons/Chains/UNI.d.ts +4 -0
- package/dist/src/icons/Chains/UNI.d.ts.map +1 -0
- package/dist/src/icons/TokenIcons.d.ts.map +1 -1
- package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/DEVNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/types.d.ts +0 -4
- package/dist/src/sdklegacy/types.d.ts.map +1 -1
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -1
- package/lib/{aptos-b8R7xC2M.js → aptos--edUC0Jm.js} +1 -1
- package/lib/{aptos-Ma7G2qxg.mjs → aptos-BrgNOgGM.mjs} +2 -2
- package/lib/{aptos-CH5PkH0s.js → aptos-CGjKms8W.js} +2 -2
- package/lib/{aptos-DQLx8hgI.mjs → aptos-dXuHBY5i.mjs} +5 -5
- package/lib/{base64-BoCuDrAB.js → base64-BbtWjSSq.js} +1 -1
- package/lib/{base64-mN6OGBib.mjs → base64-Cx-uEAcH.mjs} +1 -1
- package/lib/{ccip-B9dsdqqe.js → ccip-BRw4HAHQ.js} +1 -1
- package/lib/{ccip-D9a8gGDP.mjs → ccip-BiTI0Vsw.mjs} +1 -1
- package/lib/{chunk-OR6GFWLG-D0VxCcX2.js → chunk-OR6GFWLG-S-Fr6JAP.js} +1 -1
- package/lib/{chunk-OR6GFWLG-DVAlj5GC.mjs → chunk-OR6GFWLG-r6sLFcMR.mjs} +3 -3
- package/lib/{events-BiLMWAJd.js → events-BIriznPM.js} +1 -1
- package/lib/{events-exed8Lkm.mjs → events-CpW8AkTD.mjs} +1 -1
- package/lib/{evm-DOSrblQ4.js → evm-BSyj6JzA.js} +11 -11
- package/lib/{evm-Bn4_N0e_.mjs → evm-CxlQ91gJ.mjs} +5 -5
- package/lib/{evm-DbuXa17H.mjs → evm-Cyvodxhp.mjs} +388 -323
- package/lib/{evm-D5JyNa99.js → evm-DYaM3YMG.js} +1 -1
- package/lib/{index-CjC_JXyt.mjs → index--NM0JjnQ.mjs} +1 -1
- package/lib/{index-DNQTwT9U.mjs → index-Amhia1ZS.mjs} +2 -2
- package/lib/{index-DudwgIzb.js → index-B0dvPq6m.js} +1 -1
- package/lib/{index-D-8Ng1L-.mjs → index-B2EArRT7.mjs} +1 -1
- package/lib/{index-CoYZ1p1j.js → index-BBfGNpdz.js} +101 -101
- package/lib/{index-DzFW4H-c.mjs → index-BEZxctGp.mjs} +1 -1
- package/lib/{index-D6uakBm-.mjs → index-BJMqYpY6.mjs} +2 -2
- package/lib/{index-BEjIjDI_.mjs → index-BMcGCzso.mjs} +2 -2
- package/lib/{index-B4hte2VB.mjs → index-BND6j-zd.mjs} +1 -1
- package/lib/{index-BL3U9o8r.js → index-BQ9AZknw.js} +1 -1
- package/lib/{index-B14q08ea.js → index-BXyAX-bb.js} +1 -1
- package/lib/{index-D08eoAwY.mjs → index-B_oqyOcL.mjs} +1 -1
- package/lib/{index-BWwLFE0K.mjs → index-Bhz1Rs3C.mjs} +3 -3
- package/lib/{index-BQmtmaUN.mjs → index-BnV0tUca.mjs} +3 -3
- package/lib/{index-CztHxO-n.mjs → index-C-Dl1g5N.mjs} +2 -2
- package/lib/{index-B5Deg2Mr.mjs → index-CC6Tw8Ue.mjs} +4 -4
- package/lib/{index-Ba2rdKMd.js → index-CCzyci2v.js} +1 -1
- package/lib/{index-BaF9FXkh.js → index-CHBZ4cXy.js} +1 -1
- package/lib/{index-Bt41X2O-.js → index-CVYH-ljt.js} +1 -1
- package/lib/{index-_f9fa-SF.mjs → index-CXN2TSeM.mjs} +2 -2
- package/lib/{index-B7xiGLlo.js → index-Cajic-Zj.js} +1 -1
- package/lib/{index-zkkhgyCt.js → index-ChdEfYe-.js} +1 -1
- package/lib/{index-DKvD1ciD.mjs → index-ChzcO2lh.mjs} +5 -5
- package/lib/{index-t_N-kr6F.js → index-CjdAAhpi.js} +1 -1
- package/lib/{index-CTdUTRp6.mjs → index-CttRUMXZ.mjs} +6922 -6947
- package/lib/{index-BEg_FhHj.js → index-DBFaWeUh.js} +1 -1
- package/lib/{index-BsRDGZ_9.js → index-DCxu_9fC.js} +1 -1
- package/lib/{index-yHv6yF_6.mjs → index-DFp-75l7.mjs} +2 -2
- package/lib/{index-CT8zJiLG.mjs → index-DM6ABGI6.mjs} +2 -2
- package/lib/{index-DuaKRUyC.js → index-DOOjj9wv.js} +1 -1
- package/lib/{index-CeiDJddc.js → index-DSooDhqr.js} +1 -1
- package/lib/{index-BdbY6Nvl.js → index-DkXzI9E6.js} +1 -1
- package/lib/{index-ByaJFPk7.mjs → index-Dt2sCuyA.mjs} +2 -2
- package/lib/{index-dmXJ0lij.js → index-DzwZyiM9.js} +1 -1
- package/lib/{index-BtBZ1mGN.js → index-OgMy4QSY.js} +1 -1
- package/lib/{index-BVa8vX0X.mjs → index-PQxGZteo.mjs} +2 -2
- package/lib/{index-CTywhroc.js → index-eY3JxOiX.js} +1 -1
- package/lib/{index-CyZSCH1P.mjs → index-mdH3MkQ5.mjs} +1 -1
- package/lib/{index-D5i-Hwy3.js → index-nFX-Pkvm.js} +1 -1
- package/lib/{index-CMcnZ-nu.js → index-zxhCTPTL.js} +1 -1
- package/lib/{index.es-BU6v666-.mjs → index.es-C2Qro_0A.mjs} +6 -6
- package/lib/{index.es-HUYc3ygi.js → index.es-DU7kQxBj.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{signer-B5bRCRbp.mjs → signer-Bxzj_sfg.mjs} +1 -1
- package/lib/{signer-_8JGUZ18.js → signer-Oenym_zt.js} +1 -1
- package/lib/solana-BsoOVBn3.js +1 -0
- package/lib/{solana-Vkj_NP_7.js → solana-Bwr_Oe17.js} +1 -1
- package/lib/{solana-C5maMKhK.mjs → solana-CvLCZYlJ.mjs} +4 -4
- package/lib/{solana-C8ERuccx.mjs → solana-D7_c2sjy.mjs} +5 -5
- package/lib/{solanaEmbed.esm-CeLkcZUT.mjs → solanaEmbed.esm-C5KdLEHG.mjs} +2 -2
- package/lib/{solanaEmbed.esm-GokLVSoz.js → solanaEmbed.esm-CrRRGcT6.js} +1 -1
- package/lib/src/config/constants.d.ts.map +1 -1
- package/lib/src/config/devnet/chains.d.ts.map +1 -1
- package/lib/src/config/devnet/index.d.ts.map +1 -1
- package/lib/src/config/devnet/rpcs.d.ts +0 -6
- package/lib/src/config/devnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/index.d.ts.map +1 -1
- package/lib/src/config/mainnet/chains.d.ts.map +1 -1
- package/lib/src/config/mainnet/index.d.ts.map +1 -1
- package/lib/src/config/mainnet/rpcs.d.ts +0 -6
- package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/chains.d.ts.map +1 -1
- package/lib/src/config/testnet/index.d.ts.map +1 -1
- package/lib/src/config/testnet/rpcs.d.ts +0 -6
- package/lib/src/config/testnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/config/tokens.d.ts +4 -0
- package/lib/src/config/tokens.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +2 -9
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/contexts/TokensContext.d.ts +1 -0
- package/lib/src/contexts/TokensContext.d.ts.map +1 -1
- package/lib/src/icons/ChainIcons.d.ts.map +1 -1
- package/lib/src/icons/Chains/UNI.d.ts +4 -0
- package/lib/src/icons/Chains/UNI.d.ts.map +1 -0
- package/lib/src/icons/TokenIcons.d.ts.map +1 -1
- package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/DEVNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/types.d.ts +0 -4
- package/lib/src/sdklegacy/types.d.ts.map +1 -1
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -1
- package/lib/{sui-CXLpQ4w9.mjs → sui-BQq3s7Q3.mjs} +5 -5
- package/lib/{sui-BgpwzAcZ.mjs → sui-C7ivLHLu.mjs} +323 -319
- package/lib/{sui-DwGUL_nC.js → sui-CDzPbVuH.js} +2 -2
- package/lib/sui-CbH-5eUE.js +1 -0
- package/lib/{utf8-Dg51R0Wb.mjs → utf8-CDOzcEr-.mjs} +1 -1
- package/lib/{utf8-BBrW0GUg.js → utf8-Dez257K6.js} +1 -1
- package/package.json +20 -20
- package/dist/assets/sui-C-nd2a3Y.js +0 -1
- package/lib/solana-CFT736gU.js +0 -1
- package/lib/sui-CFB02A_e.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ue=require("./index-CoYZ1p1j.js");function Bt(e,r){for(var n=0;n<r.length;n++){const i=r[n];if(typeof i!="string"&&!Array.isArray(i)){for(const h in i)if(h!=="default"&&!(h in e)){const o=Object.getOwnPropertyDescriptor(i,h);o&&Object.defineProperty(e,h,o.get?o:{enumerable:!0,get:()=>i[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Qe=Ue.requireHash();const _t=Ue.getDefaultExportFromCjs(Qe),xt=Bt({__proto__:null,default:_t},[Qe]);var dt={},Le={},F={},Et={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(a,f){var s=a>>>16&65535,c=a&65535,v=f>>>16&65535,d=f&65535;return c*d+(s*d+c*v<<16>>>0)|0}e.mul=Math.imul||r;function n(a,f){return a+f|0}e.add=n;function i(a,f){return a-f|0}e.sub=i;function h(a,f){return a<<f|a>>>32-f}e.rotl=h;function o(a,f){return a<<32-f|a>>>f}e.rotr=o;function b(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}e.isInteger=Number.isInteger||b,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(a){return e.isInteger(a)&&a>=-e.MAX_SAFE_INTEGER&&a<=e.MAX_SAFE_INTEGER}})(Et);Object.defineProperty(F,"__esModule",{value:!0});var bt=Et;function Pt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}F.readInt16BE=Pt;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}F.readUint16BE=Rt;function jt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}F.readInt16LE=jt;function It(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}F.readUint16LE=It;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}F.writeUint16BE=wt;F.writeInt16BE=wt;function vt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}F.writeUint16LE=vt;F.writeInt16LE=vt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}F.readInt32BE=qe;function Ge(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}F.readUint32BE=Ge;function We(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}F.readInt32LE=We;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}F.readUint32LE=Ve;function Me(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}F.writeUint32BE=Me;F.writeInt32BE=Me;function Fe(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}F.writeUint32LE=Fe;F.writeInt32LE=Fe;function Ht(e,r){r===void 0&&(r=0);var n=qe(e,r),i=qe(e,r+4);return n*4294967296+i-(i>>31)*4294967296}F.readInt64BE=Ht;function Kt(e,r){r===void 0&&(r=0);var n=Ge(e,r),i=Ge(e,r+4);return n*4294967296+i}F.readUint64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=We(e,r),i=We(e,r+4);return i*4294967296+n-(n>>31)*4294967296}F.readInt64LE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ve(e,r),i=Ve(e,r+4);return i*4294967296+n}F.readUint64LE=Yt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Me(e/4294967296>>>0,r,n),Me(e>>>0,r,n+4),r}F.writeUint64BE=yt;F.writeInt64BE=yt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Fe(e>>>0,r,n),Fe(e/4294967296>>>0,r,n+4),r}F.writeUint64LE=gt;F.writeInt64LE=gt;function qt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,h=1,o=e/8+n-1;o>=n;o--)i+=r[o]*h,h*=256;return i}F.readUintBE=qt;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,h=1,o=n;o<n+e/8;o++)i+=r[o]*h,h*=256;return i}F.readUintLE=Gt;function Wt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var h=1,o=e/8+i-1;o>=i;o--)n[o]=r/h&255,h*=256;return n}F.writeUintBE=Wt;function Vt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var h=1,o=i;o<i+e/8;o++)n[o]=r/h&255,h*=256;return n}F.writeUintLE=Vt;function $t(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}F.readFloat32BE=$t;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}F.readFloat32LE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}F.readFloat64BE=Jt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}F.readFloat64LE=Zt;function Qt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e),r}F.writeFloat32BE=Qt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e,!0),r}F.writeFloat32LE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e),r}F.writeFloat64BE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e,!0),r}F.writeFloat64LE=tr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function rr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=rr;Object.defineProperty(Le,"__esModule",{value:!0});var _e=F,$e=de,nr=20;function ir(e,r,n){for(var i=1634760805,h=857760878,o=2036477234,b=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],f=n[7]<<24|n[6]<<16|n[5]<<8|n[4],s=n[11]<<24|n[10]<<16|n[9]<<8|n[8],c=n[15]<<24|n[14]<<16|n[13]<<8|n[12],v=n[19]<<24|n[18]<<16|n[17]<<8|n[16],d=n[23]<<24|n[22]<<16|n[21]<<8|n[20],_=n[27]<<24|n[26]<<16|n[25]<<8|n[24],w=n[31]<<24|n[30]<<16|n[29]<<8|n[28],m=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],R=r[15]<<24|r[14]<<16|r[13]<<8|r[12],T=i,l=h,E=o,D=b,t=a,u=f,y=s,S=c,U=v,L=d,x=_,B=w,N=m,M=p,g=O,A=R,W=0;W<nr;W+=2)T=T+t|0,N^=T,N=N>>>16|N<<16,U=U+N|0,t^=U,t=t>>>20|t<<12,l=l+u|0,M^=l,M=M>>>16|M<<16,L=L+M|0,u^=L,u=u>>>20|u<<12,E=E+y|0,g^=E,g=g>>>16|g<<16,x=x+g|0,y^=x,y=y>>>20|y<<12,D=D+S|0,A^=D,A=A>>>16|A<<16,B=B+A|0,S^=B,S=S>>>20|S<<12,E=E+y|0,g^=E,g=g>>>24|g<<8,x=x+g|0,y^=x,y=y>>>25|y<<7,D=D+S|0,A^=D,A=A>>>24|A<<8,B=B+A|0,S^=B,S=S>>>25|S<<7,l=l+u|0,M^=l,M=M>>>24|M<<8,L=L+M|0,u^=L,u=u>>>25|u<<7,T=T+t|0,N^=T,N=N>>>24|N<<8,U=U+N|0,t^=U,t=t>>>25|t<<7,T=T+u|0,A^=T,A=A>>>16|A<<16,x=x+A|0,u^=x,u=u>>>20|u<<12,l=l+y|0,N^=l,N=N>>>16|N<<16,B=B+N|0,y^=B,y=y>>>20|y<<12,E=E+S|0,M^=E,M=M>>>16|M<<16,U=U+M|0,S^=U,S=S>>>20|S<<12,D=D+t|0,g^=D,g=g>>>16|g<<16,L=L+g|0,t^=L,t=t>>>20|t<<12,E=E+S|0,M^=E,M=M>>>24|M<<8,U=U+M|0,S^=U,S=S>>>25|S<<7,D=D+t|0,g^=D,g=g>>>24|g<<8,L=L+g|0,t^=L,t=t>>>25|t<<7,l=l+y|0,N^=l,N=N>>>24|N<<8,B=B+N|0,y^=B,y=y>>>25|y<<7,T=T+u|0,A^=T,A=A>>>24|A<<8,x=x+A|0,u^=x,u=u>>>25|u<<7;_e.writeUint32LE(T+i|0,e,0),_e.writeUint32LE(l+h|0,e,4),_e.writeUint32LE(E+o|0,e,8),_e.writeUint32LE(D+b|0,e,12),_e.writeUint32LE(t+a|0,e,16),_e.writeUint32LE(u+f|0,e,20),_e.writeUint32LE(y+s|0,e,24),_e.writeUint32LE(S+c|0,e,28),_e.writeUint32LE(U+v|0,e,32),_e.writeUint32LE(L+d|0,e,36),_e.writeUint32LE(x+_|0,e,40),_e.writeUint32LE(B+w|0,e,44),_e.writeUint32LE(N+m|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(g+O|0,e,56),_e.writeUint32LE(A+R|0,e,60)}function St(e,r,n,i,h){if(h===void 0&&(h=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,b;if(h===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),b=o.length-r.length,o.set(r,b)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=r,b=h}for(var a=new Uint8Array(64),f=0;f<n.length;f+=64){ir(a,o,e);for(var s=f;s<f+64&&s<n.length;s++)i[s]=n[s]^a[s-f];ar(o,0,b)}return $e.wipe(a),h===0&&$e.wipe(o),i}Le.streamXOR=St;function ur(e,r,n,i){return i===void 0&&(i=0),$e.wipe(n),St(e,r,n,n,i)}Le.stream=ur;function ar(e,r,n){for(var i=1;n--;)i=i+(e[r]&255)|0,e[r]=i&255,i>>>=8,r++;if(i>0)throw new Error("ChaCha: counter overflow")}var pt={},be={};Object.defineProperty(be,"__esModule",{value:!0});function fr(e,r,n){return~(e-1)&r|e-1&n}be.select=fr;function hr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=hr;function Ct(e,r){if(e.length!==r.length)return 0;for(var n=0,i=0;i<e.length;i++)n|=e[i]^r[i];return 1&n-1>>>8}be.compare=Ct;function or(e,r){return e.length===0||r.length===0?!1:Ct(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var i=function(){function b(a){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var f=a[0]|a[1]<<8;this._r[0]=f&8191;var s=a[2]|a[3]<<8;this._r[1]=(f>>>13|s<<3)&8191;var c=a[4]|a[5]<<8;this._r[2]=(s>>>10|c<<6)&7939;var v=a[6]|a[7]<<8;this._r[3]=(c>>>7|v<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(v>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var _=a[10]|a[11]<<8;this._r[6]=(d>>>14|_<<2)&8191;var w=a[12]|a[13]<<8;this._r[7]=(_>>>11|w<<5)&8065;var m=a[14]|a[15]<<8;this._r[8]=(w>>>8|m<<8)&8191,this._r[9]=m>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return b.prototype._blocks=function(a,f,s){for(var c=this._fin?0:2048,v=this._h[0],d=this._h[1],_=this._h[2],w=this._h[3],m=this._h[4],p=this._h[5],O=this._h[6],R=this._h[7],T=this._h[8],l=this._h[9],E=this._r[0],D=this._r[1],t=this._r[2],u=this._r[3],y=this._r[4],S=this._r[5],U=this._r[6],L=this._r[7],x=this._r[8],B=this._r[9];s>=16;){var N=a[f+0]|a[f+1]<<8;v+=N&8191;var M=a[f+2]|a[f+3]<<8;d+=(N>>>13|M<<3)&8191;var g=a[f+4]|a[f+5]<<8;_+=(M>>>10|g<<6)&8191;var A=a[f+6]|a[f+7]<<8;w+=(g>>>7|A<<9)&8191;var W=a[f+8]|a[f+9]<<8;m+=(A>>>4|W<<12)&8191,p+=W>>>1&8191;var J=a[f+10]|a[f+11]<<8;O+=(W>>>14|J<<2)&8191;var X=a[f+12]|a[f+13]<<8;R+=(J>>>11|X<<5)&8191;var $=a[f+14]|a[f+15]<<8;T+=(X>>>8|$<<8)&8191,l+=$>>>5|c;var C=0,P=C;P+=v*E,P+=d*(5*B),P+=_*(5*x),P+=w*(5*L),P+=m*(5*U),C=P>>>13,P&=8191,P+=p*(5*S),P+=O*(5*y),P+=R*(5*u),P+=T*(5*t),P+=l*(5*D),C+=P>>>13,P&=8191;var j=C;j+=v*D,j+=d*E,j+=_*(5*B),j+=w*(5*x),j+=m*(5*L),C=j>>>13,j&=8191,j+=p*(5*U),j+=O*(5*S),j+=R*(5*y),j+=T*(5*u),j+=l*(5*t),C+=j>>>13,j&=8191;var I=C;I+=v*t,I+=d*D,I+=_*E,I+=w*(5*B),I+=m*(5*x),C=I>>>13,I&=8191,I+=p*(5*L),I+=O*(5*U),I+=R*(5*S),I+=T*(5*y),I+=l*(5*u),C+=I>>>13,I&=8191;var H=C;H+=v*u,H+=d*t,H+=_*D,H+=w*E,H+=m*(5*B),C=H>>>13,H&=8191,H+=p*(5*x),H+=O*(5*L),H+=R*(5*U),H+=T*(5*S),H+=l*(5*y),C+=H>>>13,H&=8191;var K=C;K+=v*y,K+=d*u,K+=_*t,K+=w*D,K+=m*E,C=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*x),K+=R*(5*L),K+=T*(5*U),K+=l*(5*S),C+=K>>>13,K&=8191;var z=C;z+=v*S,z+=d*y,z+=_*u,z+=w*t,z+=m*D,C=z>>>13,z&=8191,z+=p*E,z+=O*(5*B),z+=R*(5*x),z+=T*(5*L),z+=l*(5*U),C+=z>>>13,z&=8191;var Y=C;Y+=v*U,Y+=d*S,Y+=_*y,Y+=w*u,Y+=m*t,C=Y>>>13,Y&=8191,Y+=p*D,Y+=O*E,Y+=R*(5*B),Y+=T*(5*x),Y+=l*(5*L),C+=Y>>>13,Y&=8191;var q=C;q+=v*L,q+=d*U,q+=_*S,q+=w*y,q+=m*u,C=q>>>13,q&=8191,q+=p*t,q+=O*D,q+=R*E,q+=T*(5*B),q+=l*(5*x),C+=q>>>13,q&=8191;var G=C;G+=v*x,G+=d*L,G+=_*U,G+=w*S,G+=m*y,C=G>>>13,G&=8191,G+=p*u,G+=O*t,G+=R*D,G+=T*E,G+=l*(5*B),C+=G>>>13,G&=8191;var V=C;V+=v*B,V+=d*x,V+=_*L,V+=w*U,V+=m*S,C=V>>>13,V&=8191,V+=p*y,V+=O*u,V+=R*t,V+=T*D,V+=l*E,C+=V>>>13,V&=8191,C=(C<<2)+C|0,C=C+P|0,P=C&8191,C=C>>>13,j+=C,v=P,d=j,_=I,w=H,m=K,p=z,O=Y,R=q,T=G,l=V,f+=16,s-=16}this._h[0]=v,this._h[1]=d,this._h[2]=_,this._h[3]=w,this._h[4]=m,this._h[5]=p,this._h[6]=O,this._h[7]=R,this._h[8]=T,this._h[9]=l},b.prototype.finish=function(a,f){f===void 0&&(f=0);var s=new Uint16Array(10),c,v,d,_;if(this._leftover){for(_=this._leftover,this._buffer[_++]=1;_<16;_++)this._buffer[_]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(c=this._h[1]>>>13,this._h[1]&=8191,_=2;_<10;_++)this._h[_]+=c,c=this._h[_]>>>13,this._h[_]&=8191;for(this._h[0]+=c*5,c=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=c,c=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=c,s[0]=this._h[0]+5,c=s[0]>>>13,s[0]&=8191,_=1;_<10;_++)s[_]=this._h[_]+c,c=s[_]>>>13,s[_]&=8191;for(s[9]-=8192,v=(c^1)-1,_=0;_<10;_++)s[_]&=v;for(v=~v,_=0;_<10;_++)this._h[_]=this._h[_]&v|s[_];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,_=1;_<8;_++)d=(this._h[_]+this._pad[_]|0)+(d>>>16)|0,this._h[_]=d&65535;return a[f+0]=this._h[0]>>>0,a[f+1]=this._h[0]>>>8,a[f+2]=this._h[1]>>>0,a[f+3]=this._h[1]>>>8,a[f+4]=this._h[2]>>>0,a[f+5]=this._h[2]>>>8,a[f+6]=this._h[3]>>>0,a[f+7]=this._h[3]>>>8,a[f+8]=this._h[4]>>>0,a[f+9]=this._h[4]>>>8,a[f+10]=this._h[5]>>>0,a[f+11]=this._h[5]>>>8,a[f+12]=this._h[6]>>>0,a[f+13]=this._h[6]>>>8,a[f+14]=this._h[7]>>>0,a[f+15]=this._h[7]>>>8,this._finished=!0,this},b.prototype.update=function(a){var f=0,s=a.length,c;if(this._leftover){c=16-this._leftover,c>s&&(c=s);for(var v=0;v<c;v++)this._buffer[this._leftover+v]=a[f+v];if(s-=c,f+=c,this._leftover+=c,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(s>=16&&(c=s-s%16,this._blocks(a,f,c),f+=c,s-=c),s){for(var v=0;v<s;v++)this._buffer[this._leftover+v]=a[f+v];this._leftover+=s}return this},b.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},b.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},b}();e.Poly1305=i;function h(b,a){var f=new i(b);f.update(a);var s=f.digest();return f.clean(),s}e.oneTimeAuth=h;function o(b,a){return b.length!==e.DIGEST_LENGTH||a.length!==e.DIGEST_LENGTH?!1:r.equal(b,a)}e.equal=o})(pt);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Le,n=pt,i=de,h=F,o=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var b=new Uint8Array(16),a=function(){function f(s){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,s.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(s)}return f.prototype.seal=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=c.length+this.tagLength,p;if(d){if(d.length!==m)throw new Error("ChaCha20Poly1305: incorrect destination length");p=d}else p=new Uint8Array(m);return r.streamXOR(this._key,_,c,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),w,p.subarray(0,p.length-this.tagLength),v),i.wipe(_),p},f.prototype.open=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(c.length<this.tagLength)return null;var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=new Uint8Array(this.tagLength);if(this._authenticate(m,w,c.subarray(0,c.length-this.tagLength),v),!o.equal(m,c.subarray(c.length-this.tagLength,c.length)))return null;var p=c.length-this.tagLength,O;if(d){if(d.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=d}else O=new Uint8Array(p);return r.streamXOR(this._key,_,c.subarray(0,c.length-this.tagLength),O,4),i.wipe(_),O},f.prototype.clean=function(){return i.wipe(this._key),this},f.prototype._authenticate=function(s,c,v,d){var _=new n.Poly1305(c);d&&(_.update(d),d.length%16>0&&_.update(b.subarray(d.length%16))),_.update(v),v.length%16>0&&_.update(b.subarray(v.length%16));var w=new Uint8Array(8);d&&h.writeUint64LE(d.length,w),_.update(w),h.writeUint64LE(v.length,w),_.update(w);for(var m=_.digest(),p=0;p<m.length;p++)s[p]=m[p];_.clean(),i.wipe(m),i.wipe(w)},f}();e.ChaCha20Poly1305=a})(dt);var mt={},Oe={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function sr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=sr;Object.defineProperty(Oe,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(i).clean():i.set(n);for(var h=0;h<i.length;h++)i[h]^=54;this._inner.update(i);for(var h=0;h<i.length;h++)i[h]^=106;this._outer.update(i),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(i)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Oe.HMAC=Ut;function cr(e,r,n){var i=new Ut(e,r);i.update(n);var h=i.digest();return i.clean(),h}Oe.hmac=cr;Oe.equal=lr.equal;Object.defineProperty(mt,"__esModule",{value:!0});var rt=Oe,nt=de,_r=function(){function e(r,n,i,h){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=h;var o=rt.hmac(this._hash,i,n);this._hmac=new rt.HMAC(r,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(r){for(var n=new Uint8Array(r),i=0;i<n.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[i]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),dr=mt.HKDF=_r,et={},Be={},xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.BrowserRandomSource=void 0;const it=65536;class Er{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=it)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,it)));return n}}xe.BrowserRandomSource=Er;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.NodeRandomSource=void 0;const br=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ue.commonjsRequire<"u"){const r=Ue.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let h=0;h<i.length;h++)i[h]=n[h];return(0,br.wipe)(n),i}}Pe.NodeRandomSource=wr;Object.defineProperty(Be,"__esModule",{value:!0});Be.SystemRandomSource=void 0;const vr=xe,yr=Pe;class gr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new vr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new yr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Be.SystemRandomSource=gr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=Be,n=F,i=de;e.defaultRandomSource=new r.SystemRandomSource;function h(s,c=e.defaultRandomSource){return c.randomBytes(s)}e.randomBytes=h;function o(s=e.defaultRandomSource){const c=h(4,s),v=(0,n.readUint32LE)(c);return(0,i.wipe)(c),v}e.randomUint32=o;const b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(s,c=b,v=e.defaultRandomSource){if(c.length<2)throw new Error("randomString charset is too short");if(c.length>256)throw new Error("randomString charset is too long");let d="";const _=c.length,w=256-256%_;for(;s>0;){const m=h(Math.ceil(s*256/w),v);for(let p=0;p<m.length&&s>0;p++){const O=m[p];O<w&&(d+=c.charAt(O%_),s--)}(0,i.wipe)(m)}return d}e.randomString=a;function f(s,c=b,v=e.defaultRandomSource){const d=Math.ceil(s/(Math.log(c.length)/Math.LN2));return a(d,c,v)}e.randomStringForEntropy=f})(et);var At={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=F,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var i=function(){function a(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},a.prototype.update=function(f,s){if(s===void 0&&(s=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var c=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&s>0;)this._buffer[this._bufferLength++]=f[c++],s--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(c=o(this._temp,this._state,f,c,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=f[c++],s--;return this},a.prototype.finish=function(f){if(!this._finished){var s=this._bytesHashed,c=this._bufferLength,v=s/536870912|0,d=s<<3,_=s%64<56?64:128;this._buffer[c]=128;for(var w=c+1;w<_-8;w++)this._buffer[w]=0;r.writeUint32BE(v,this._buffer,_-8),r.writeUint32BE(d,this._buffer,_-4),o(this._temp,this._state,this._buffer,0,_),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)r.writeUint32BE(this._state[w],f,w*4);return this},a.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(f){n.wipe(f.state),f.buffer&&n.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},a}();e.SHA256=i;var h=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(a,f,s,c,v){for(;v>=64;){for(var d=f[0],_=f[1],w=f[2],m=f[3],p=f[4],O=f[5],R=f[6],T=f[7],l=0;l<16;l++){var E=c+l*4;a[l]=r.readUint32BE(s,E)}for(var l=16;l<64;l++){var D=a[l-2],t=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10;D=a[l-15];var u=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3;a[l]=(t+a[l-7]|0)+(u+a[l-16]|0)}for(var l=0;l<64;l++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&R)|0)+(T+(h[l]+a[l]|0)|0)|0,u=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&_^d&w^_&w)|0;T=R,R=O,O=p,p=m+t|0,m=w,w=_,_=d,d=t+u|0}f[0]+=d,f[1]+=_,f[2]+=w,f[3]+=m,f[4]+=p,f[5]+=O,f[6]+=R,f[7]+=T,c+=64,v-=64}return c}function b(a){var f=new i;f.update(a);var s=f.digest();return f.clean(),s}e.hash=b})(At);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function i(l){const E=new Float64Array(16);if(l)for(let D=0;D<l.length;D++)E[D]=l[D];return E}const h=new Uint8Array(32);h[0]=9;const o=i([56129,1]);function b(l){let E=1;for(let D=0;D<16;D++){let t=l[D]+E+65535;E=Math.floor(t/65536),l[D]=t-E*65536}l[0]+=E-1+37*(E-1)}function a(l,E,D){const t=~(D-1);for(let u=0;u<16;u++){const y=t&(l[u]^E[u]);l[u]^=y,E[u]^=y}}function f(l,E){const D=i(),t=i();for(let u=0;u<16;u++)t[u]=E[u];b(t),b(t),b(t);for(let u=0;u<2;u++){D[0]=t[0]-65517;for(let S=1;S<15;S++)D[S]=t[S]-65535-(D[S-1]>>16&1),D[S-1]&=65535;D[15]=t[15]-32767-(D[14]>>16&1);const y=D[15]>>16&1;D[14]&=65535,a(t,D,1-y)}for(let u=0;u<16;u++)l[2*u]=t[u]&255,l[2*u+1]=t[u]>>8}function s(l,E){for(let D=0;D<16;D++)l[D]=E[2*D]+(E[2*D+1]<<8);l[15]&=32767}function c(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]+D[t]}function v(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]-D[t]}function d(l,E,D){let t,u,y=0,S=0,U=0,L=0,x=0,B=0,N=0,M=0,g=0,A=0,W=0,J=0,X=0,$=0,C=0,P=0,j=0,I=0,H=0,K=0,z=0,Y=0,q=0,G=0,V=0,we=0,ge=0,pe=0,Ne=0,Ie=0,tt=0,Q=D[0],k=D[1],ee=D[2],te=D[3],re=D[4],ne=D[5],ie=D[6],ue=D[7],ae=D[8],fe=D[9],he=D[10],oe=D[11],se=D[12],le=D[13],De=D[14],ce=D[15];t=E[0],y+=t*Q,S+=t*k,U+=t*ee,L+=t*te,x+=t*re,B+=t*ne,N+=t*ie,M+=t*ue,g+=t*ae,A+=t*fe,W+=t*he,J+=t*oe,X+=t*se,$+=t*le,C+=t*De,P+=t*ce,t=E[1],S+=t*Q,U+=t*k,L+=t*ee,x+=t*te,B+=t*re,N+=t*ne,M+=t*ie,g+=t*ue,A+=t*ae,W+=t*fe,J+=t*he,X+=t*oe,$+=t*se,C+=t*le,P+=t*De,j+=t*ce,t=E[2],U+=t*Q,L+=t*k,x+=t*ee,B+=t*te,N+=t*re,M+=t*ne,g+=t*ie,A+=t*ue,W+=t*ae,J+=t*fe,X+=t*he,$+=t*oe,C+=t*se,P+=t*le,j+=t*De,I+=t*ce,t=E[3],L+=t*Q,x+=t*k,B+=t*ee,N+=t*te,M+=t*re,g+=t*ne,A+=t*ie,W+=t*ue,J+=t*ae,X+=t*fe,$+=t*he,C+=t*oe,P+=t*se,j+=t*le,I+=t*De,H+=t*ce,t=E[4],x+=t*Q,B+=t*k,N+=t*ee,M+=t*te,g+=t*re,A+=t*ne,W+=t*ie,J+=t*ue,X+=t*ae,$+=t*fe,C+=t*he,P+=t*oe,j+=t*se,I+=t*le,H+=t*De,K+=t*ce,t=E[5],B+=t*Q,N+=t*k,M+=t*ee,g+=t*te,A+=t*re,W+=t*ne,J+=t*ie,X+=t*ue,$+=t*ae,C+=t*fe,P+=t*he,j+=t*oe,I+=t*se,H+=t*le,K+=t*De,z+=t*ce,t=E[6],N+=t*Q,M+=t*k,g+=t*ee,A+=t*te,W+=t*re,J+=t*ne,X+=t*ie,$+=t*ue,C+=t*ae,P+=t*fe,j+=t*he,I+=t*oe,H+=t*se,K+=t*le,z+=t*De,Y+=t*ce,t=E[7],M+=t*Q,g+=t*k,A+=t*ee,W+=t*te,J+=t*re,X+=t*ne,$+=t*ie,C+=t*ue,P+=t*ae,j+=t*fe,I+=t*he,H+=t*oe,K+=t*se,z+=t*le,Y+=t*De,q+=t*ce,t=E[8],g+=t*Q,A+=t*k,W+=t*ee,J+=t*te,X+=t*re,$+=t*ne,C+=t*ie,P+=t*ue,j+=t*ae,I+=t*fe,H+=t*he,K+=t*oe,z+=t*se,Y+=t*le,q+=t*De,G+=t*ce,t=E[9],A+=t*Q,W+=t*k,J+=t*ee,X+=t*te,$+=t*re,C+=t*ne,P+=t*ie,j+=t*ue,I+=t*ae,H+=t*fe,K+=t*he,z+=t*oe,Y+=t*se,q+=t*le,G+=t*De,V+=t*ce,t=E[10],W+=t*Q,J+=t*k,X+=t*ee,$+=t*te,C+=t*re,P+=t*ne,j+=t*ie,I+=t*ue,H+=t*ae,K+=t*fe,z+=t*he,Y+=t*oe,q+=t*se,G+=t*le,V+=t*De,we+=t*ce,t=E[11],J+=t*Q,X+=t*k,$+=t*ee,C+=t*te,P+=t*re,j+=t*ne,I+=t*ie,H+=t*ue,K+=t*ae,z+=t*fe,Y+=t*he,q+=t*oe,G+=t*se,V+=t*le,we+=t*De,ge+=t*ce,t=E[12],X+=t*Q,$+=t*k,C+=t*ee,P+=t*te,j+=t*re,I+=t*ne,H+=t*ie,K+=t*ue,z+=t*ae,Y+=t*fe,q+=t*he,G+=t*oe,V+=t*se,we+=t*le,ge+=t*De,pe+=t*ce,t=E[13],$+=t*Q,C+=t*k,P+=t*ee,j+=t*te,I+=t*re,H+=t*ne,K+=t*ie,z+=t*ue,Y+=t*ae,q+=t*fe,G+=t*he,V+=t*oe,we+=t*se,ge+=t*le,pe+=t*De,Ne+=t*ce,t=E[14],C+=t*Q,P+=t*k,j+=t*ee,I+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ue,q+=t*ae,G+=t*fe,V+=t*he,we+=t*oe,ge+=t*se,pe+=t*le,Ne+=t*De,Ie+=t*ce,t=E[15],P+=t*Q,j+=t*k,I+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ue,G+=t*ae,V+=t*fe,we+=t*he,ge+=t*oe,pe+=t*se,Ne+=t*le,Ie+=t*De,tt+=t*ce,y+=38*j,S+=38*I,U+=38*H,L+=38*K,x+=38*z,B+=38*Y,N+=38*q,M+=38*G,g+=38*V,A+=38*we,W+=38*ge,J+=38*pe,X+=38*Ne,$+=38*Ie,C+=38*tt,u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),l[0]=y,l[1]=S,l[2]=U,l[3]=L,l[4]=x,l[5]=B,l[6]=N,l[7]=M,l[8]=g,l[9]=A,l[10]=W,l[11]=J,l[12]=X,l[13]=$,l[14]=C,l[15]=P}function _(l,E){d(l,E,E)}function w(l,E){const D=i();for(let t=0;t<16;t++)D[t]=E[t];for(let t=253;t>=0;t--)_(D,D),t!==2&&t!==4&&d(D,D,E);for(let t=0;t<16;t++)l[t]=D[t]}function m(l,E){const D=new Uint8Array(32),t=new Float64Array(80),u=i(),y=i(),S=i(),U=i(),L=i(),x=i();for(let g=0;g<31;g++)D[g]=l[g];D[31]=l[31]&127|64,D[0]&=248,s(t,E);for(let g=0;g<16;g++)y[g]=t[g];u[0]=U[0]=1;for(let g=254;g>=0;--g){const A=D[g>>>3]>>>(g&7)&1;a(u,y,A),a(S,U,A),c(L,u,S),v(u,u,S),c(S,y,U),v(y,y,U),_(U,L),_(x,u),d(u,S,u),d(S,y,L),c(L,u,S),v(u,u,S),_(y,u),v(S,U,x),d(u,S,o),c(u,u,U),d(S,S,u),d(u,U,x),d(U,y,t),_(y,L),a(u,y,A),a(S,U,A)}for(let g=0;g<16;g++)t[g+16]=u[g],t[g+32]=S[g],t[g+48]=y[g],t[g+64]=U[g];const B=t.subarray(32),N=t.subarray(16);w(B,B),d(N,N,B);const M=new Uint8Array(32);return f(M,N),M}e.scalarMult=m;function p(l){return m(l,h)}e.scalarMultBase=p;function O(l){if(l.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const E=new Uint8Array(l);return{publicKey:p(E),secretKey:E}}e.generateKeyPairFromSeed=O;function R(l){const E=(0,r.randomBytes)(32,l),D=O(E);return(0,n.wipe)(E),D}e.generateKeyPair=R;function T(l,E,D=!1){if(l.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(E.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=m(l,E);if(D){let u=0;for(let y=0;y<t.length;y++)u|=t[y];if(u===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=T})(Ot);function Sr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var h=0;h<e.length;h++){var o=e.charAt(h),b=o.charCodeAt(0);if(n[b]!==255)throw new TypeError(o+" is ambiguous");n[b]=h}var a=e.length,f=e.charAt(0),s=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function v(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var m=0,p=0,O=0,R=w.length;O!==R&&w[O]===0;)O++,m++;for(var T=(R-O)*c+1>>>0,l=new Uint8Array(T);O!==R;){for(var E=w[O],D=0,t=T-1;(E!==0||D<p)&&t!==-1;t--,D++)E+=256*l[t]>>>0,l[t]=E%a>>>0,E=E/a>>>0;if(E!==0)throw new Error("Non-zero carry");p=D,O++}for(var u=T-p;u!==T&&l[u]===0;)u++;for(var y=f.repeat(m);u<T;++u)y+=e.charAt(l[u]);return y}function d(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var m=0;if(w[m]!==" "){for(var p=0,O=0;w[m]===f;)p++,m++;for(var R=(w.length-m)*s+1>>>0,T=new Uint8Array(R);w[m];){var l=n[w.charCodeAt(m)];if(l===255)return;for(var E=0,D=R-1;(l!==0||E<O)&&D!==-1;D--,E++)l+=a*T[D]>>>0,T[D]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");O=E,m++}if(w[m]!==" "){for(var t=R-O;t!==R&&T[t]===0;)t++;for(var u=new Uint8Array(p+(R-t)),y=p;t!==R;)u[y++]=T[t++];return u}}}function _(w){var m=d(w);if(m)return m;throw new Error(`Non-${r} character`)}return{encode:v,decodeUnsafe:d,decode:_}}var pr=Sr,Cr=pr;const mr=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Ar=e=>new TextDecoder().decode(e);class Or{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Tr{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Tt(this,r)}}class Nr{constructor(r){this.decoders=r}or(r){return Tt(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Tt=(e,r)=>new Nr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,i,h){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=h,this.encoder=new Or(r,n,i),this.decoder=new Tr(r,n,h)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const Re=({name:e,prefix:r,encode:n,decode:i})=>new Mr(e,r,n,i),Te=({prefix:e,name:r,alphabet:n})=>{const{encode:i,decode:h}=Cr(n,r);return Re({prefix:e,name:r,encode:i,decode:o=>mr(h(o))})},Fr=(e,r,n,i)=>{const h={};for(let c=0;c<r.length;++c)h[r[c]]=c;let o=e.length;for(;e[o-1]==="=";)--o;const b=new Uint8Array(o*n/8|0);let a=0,f=0,s=0;for(let c=0;c<o;++c){const v=h[e[c]];if(v===void 0)throw new SyntaxError(`Non-${i} character`);f=f<<n|v,a+=n,a>=8&&(a-=8,b[s++]=255&f>>a)}if(a>=n||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return b},Lr=(e,r,n)=>{const i=r[r.length-1]==="=",h=(1<<n)-1;let o="",b=0,a=0;for(let f=0;f<e.length;++f)for(a=a<<8|e[f],b+=8;b>n;)b-=n,o+=r[h&a>>b];if(b&&(o+=r[h&a<<n-b]),i)for(;o.length*n&7;)o+="=";return o},Z=({name:e,prefix:r,bitsPerChar:n,alphabet:i})=>Re({prefix:r,name:e,encode(h){return Lr(h,i,n)},decode(h){return Fr(h,i,n,e)}}),Br=Re({prefix:"\0",name:"identity",encode:e=>Ar(e),decode:e=>Ur(e)}),xr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Pr=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Pr},Symbol.toStringTag,{value:"Module"})),jr=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Ir=Object.freeze(Object.defineProperty({__proto__:null,base8:jr},Symbol.toStringTag,{value:"Module"})),Hr=Te({prefix:"9",name:"base10",alphabet:"0123456789"}),Kr=Object.freeze(Object.defineProperty({__proto__:null,base10:Hr},Symbol.toStringTag,{value:"Module"})),zr=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yr=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),qr=Object.freeze(Object.defineProperty({__proto__:null,base16:zr,base16upper:Yr},Symbol.toStringTag,{value:"Module"})),Gr=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Wr=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vr=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$r=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Xr=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Jr=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qr=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kr=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),en=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Xr,base32hexpad:Zr,base32hexpadupper:Qr,base32hexupper:Jr,base32pad:Vr,base32padupper:$r,base32upper:Wr,base32z:kr},Symbol.toStringTag,{value:"Module"})),tn=Te({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rn=Te({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),nn=Object.freeze(Object.defineProperty({__proto__:null,base36:tn,base36upper:rn},Symbol.toStringTag,{value:"Module"})),un=Te({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=Te({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),fn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:an},Symbol.toStringTag,{value:"Module"})),hn=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sn=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:hn,base64pad:on,base64url:sn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Nt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),cn=Nt.reduce((e,r,n)=>(e[n]=r,e),[]),_n=Nt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function dn(e){return e.reduce((r,n)=>(r+=cn[n],r),"")}function En(e){const r=[];for(const n of e){const i=_n[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const bn=Re({prefix:"🚀",name:"base256emoji",encode:dn,decode:En}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:bn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
|
|
1
|
+
"use strict";const Ue=require("./index-BBfGNpdz.js");function Bt(e,r){for(var n=0;n<r.length;n++){const i=r[n];if(typeof i!="string"&&!Array.isArray(i)){for(const h in i)if(h!=="default"&&!(h in e)){const o=Object.getOwnPropertyDescriptor(i,h);o&&Object.defineProperty(e,h,o.get?o:{enumerable:!0,get:()=>i[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Qe=Ue.requireHash();const _t=Ue.getDefaultExportFromCjs(Qe),xt=Bt({__proto__:null,default:_t},[Qe]);var dt={},Le={},F={},Et={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(a,f){var s=a>>>16&65535,c=a&65535,v=f>>>16&65535,d=f&65535;return c*d+(s*d+c*v<<16>>>0)|0}e.mul=Math.imul||r;function n(a,f){return a+f|0}e.add=n;function i(a,f){return a-f|0}e.sub=i;function h(a,f){return a<<f|a>>>32-f}e.rotl=h;function o(a,f){return a<<32-f|a>>>f}e.rotr=o;function b(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}e.isInteger=Number.isInteger||b,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(a){return e.isInteger(a)&&a>=-e.MAX_SAFE_INTEGER&&a<=e.MAX_SAFE_INTEGER}})(Et);Object.defineProperty(F,"__esModule",{value:!0});var bt=Et;function Pt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}F.readInt16BE=Pt;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}F.readUint16BE=Rt;function jt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}F.readInt16LE=jt;function It(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}F.readUint16LE=It;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}F.writeUint16BE=wt;F.writeInt16BE=wt;function vt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}F.writeUint16LE=vt;F.writeInt16LE=vt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}F.readInt32BE=qe;function Ge(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}F.readUint32BE=Ge;function We(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}F.readInt32LE=We;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}F.readUint32LE=Ve;function Me(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}F.writeUint32BE=Me;F.writeInt32BE=Me;function Fe(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}F.writeUint32LE=Fe;F.writeInt32LE=Fe;function Ht(e,r){r===void 0&&(r=0);var n=qe(e,r),i=qe(e,r+4);return n*4294967296+i-(i>>31)*4294967296}F.readInt64BE=Ht;function Kt(e,r){r===void 0&&(r=0);var n=Ge(e,r),i=Ge(e,r+4);return n*4294967296+i}F.readUint64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=We(e,r),i=We(e,r+4);return i*4294967296+n-(n>>31)*4294967296}F.readInt64LE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ve(e,r),i=Ve(e,r+4);return i*4294967296+n}F.readUint64LE=Yt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Me(e/4294967296>>>0,r,n),Me(e>>>0,r,n+4),r}F.writeUint64BE=yt;F.writeInt64BE=yt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Fe(e>>>0,r,n),Fe(e/4294967296>>>0,r,n+4),r}F.writeUint64LE=gt;F.writeInt64LE=gt;function qt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,h=1,o=e/8+n-1;o>=n;o--)i+=r[o]*h,h*=256;return i}F.readUintBE=qt;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,h=1,o=n;o<n+e/8;o++)i+=r[o]*h,h*=256;return i}F.readUintLE=Gt;function Wt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var h=1,o=e/8+i-1;o>=i;o--)n[o]=r/h&255,h*=256;return n}F.writeUintBE=Wt;function Vt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var h=1,o=i;o<i+e/8;o++)n[o]=r/h&255,h*=256;return n}F.writeUintLE=Vt;function $t(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}F.readFloat32BE=$t;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}F.readFloat32LE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}F.readFloat64BE=Jt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}F.readFloat64LE=Zt;function Qt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e),r}F.writeFloat32BE=Qt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e,!0),r}F.writeFloat32LE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e),r}F.writeFloat64BE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e,!0),r}F.writeFloat64LE=tr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function rr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=rr;Object.defineProperty(Le,"__esModule",{value:!0});var _e=F,$e=de,nr=20;function ir(e,r,n){for(var i=1634760805,h=857760878,o=2036477234,b=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],f=n[7]<<24|n[6]<<16|n[5]<<8|n[4],s=n[11]<<24|n[10]<<16|n[9]<<8|n[8],c=n[15]<<24|n[14]<<16|n[13]<<8|n[12],v=n[19]<<24|n[18]<<16|n[17]<<8|n[16],d=n[23]<<24|n[22]<<16|n[21]<<8|n[20],_=n[27]<<24|n[26]<<16|n[25]<<8|n[24],w=n[31]<<24|n[30]<<16|n[29]<<8|n[28],m=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],R=r[15]<<24|r[14]<<16|r[13]<<8|r[12],T=i,l=h,E=o,D=b,t=a,u=f,y=s,S=c,U=v,L=d,x=_,B=w,N=m,M=p,g=O,A=R,W=0;W<nr;W+=2)T=T+t|0,N^=T,N=N>>>16|N<<16,U=U+N|0,t^=U,t=t>>>20|t<<12,l=l+u|0,M^=l,M=M>>>16|M<<16,L=L+M|0,u^=L,u=u>>>20|u<<12,E=E+y|0,g^=E,g=g>>>16|g<<16,x=x+g|0,y^=x,y=y>>>20|y<<12,D=D+S|0,A^=D,A=A>>>16|A<<16,B=B+A|0,S^=B,S=S>>>20|S<<12,E=E+y|0,g^=E,g=g>>>24|g<<8,x=x+g|0,y^=x,y=y>>>25|y<<7,D=D+S|0,A^=D,A=A>>>24|A<<8,B=B+A|0,S^=B,S=S>>>25|S<<7,l=l+u|0,M^=l,M=M>>>24|M<<8,L=L+M|0,u^=L,u=u>>>25|u<<7,T=T+t|0,N^=T,N=N>>>24|N<<8,U=U+N|0,t^=U,t=t>>>25|t<<7,T=T+u|0,A^=T,A=A>>>16|A<<16,x=x+A|0,u^=x,u=u>>>20|u<<12,l=l+y|0,N^=l,N=N>>>16|N<<16,B=B+N|0,y^=B,y=y>>>20|y<<12,E=E+S|0,M^=E,M=M>>>16|M<<16,U=U+M|0,S^=U,S=S>>>20|S<<12,D=D+t|0,g^=D,g=g>>>16|g<<16,L=L+g|0,t^=L,t=t>>>20|t<<12,E=E+S|0,M^=E,M=M>>>24|M<<8,U=U+M|0,S^=U,S=S>>>25|S<<7,D=D+t|0,g^=D,g=g>>>24|g<<8,L=L+g|0,t^=L,t=t>>>25|t<<7,l=l+y|0,N^=l,N=N>>>24|N<<8,B=B+N|0,y^=B,y=y>>>25|y<<7,T=T+u|0,A^=T,A=A>>>24|A<<8,x=x+A|0,u^=x,u=u>>>25|u<<7;_e.writeUint32LE(T+i|0,e,0),_e.writeUint32LE(l+h|0,e,4),_e.writeUint32LE(E+o|0,e,8),_e.writeUint32LE(D+b|0,e,12),_e.writeUint32LE(t+a|0,e,16),_e.writeUint32LE(u+f|0,e,20),_e.writeUint32LE(y+s|0,e,24),_e.writeUint32LE(S+c|0,e,28),_e.writeUint32LE(U+v|0,e,32),_e.writeUint32LE(L+d|0,e,36),_e.writeUint32LE(x+_|0,e,40),_e.writeUint32LE(B+w|0,e,44),_e.writeUint32LE(N+m|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(g+O|0,e,56),_e.writeUint32LE(A+R|0,e,60)}function St(e,r,n,i,h){if(h===void 0&&(h=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,b;if(h===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),b=o.length-r.length,o.set(r,b)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=r,b=h}for(var a=new Uint8Array(64),f=0;f<n.length;f+=64){ir(a,o,e);for(var s=f;s<f+64&&s<n.length;s++)i[s]=n[s]^a[s-f];ar(o,0,b)}return $e.wipe(a),h===0&&$e.wipe(o),i}Le.streamXOR=St;function ur(e,r,n,i){return i===void 0&&(i=0),$e.wipe(n),St(e,r,n,n,i)}Le.stream=ur;function ar(e,r,n){for(var i=1;n--;)i=i+(e[r]&255)|0,e[r]=i&255,i>>>=8,r++;if(i>0)throw new Error("ChaCha: counter overflow")}var pt={},be={};Object.defineProperty(be,"__esModule",{value:!0});function fr(e,r,n){return~(e-1)&r|e-1&n}be.select=fr;function hr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=hr;function Ct(e,r){if(e.length!==r.length)return 0;for(var n=0,i=0;i<e.length;i++)n|=e[i]^r[i];return 1&n-1>>>8}be.compare=Ct;function or(e,r){return e.length===0||r.length===0?!1:Ct(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var i=function(){function b(a){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var f=a[0]|a[1]<<8;this._r[0]=f&8191;var s=a[2]|a[3]<<8;this._r[1]=(f>>>13|s<<3)&8191;var c=a[4]|a[5]<<8;this._r[2]=(s>>>10|c<<6)&7939;var v=a[6]|a[7]<<8;this._r[3]=(c>>>7|v<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(v>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var _=a[10]|a[11]<<8;this._r[6]=(d>>>14|_<<2)&8191;var w=a[12]|a[13]<<8;this._r[7]=(_>>>11|w<<5)&8065;var m=a[14]|a[15]<<8;this._r[8]=(w>>>8|m<<8)&8191,this._r[9]=m>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return b.prototype._blocks=function(a,f,s){for(var c=this._fin?0:2048,v=this._h[0],d=this._h[1],_=this._h[2],w=this._h[3],m=this._h[4],p=this._h[5],O=this._h[6],R=this._h[7],T=this._h[8],l=this._h[9],E=this._r[0],D=this._r[1],t=this._r[2],u=this._r[3],y=this._r[4],S=this._r[5],U=this._r[6],L=this._r[7],x=this._r[8],B=this._r[9];s>=16;){var N=a[f+0]|a[f+1]<<8;v+=N&8191;var M=a[f+2]|a[f+3]<<8;d+=(N>>>13|M<<3)&8191;var g=a[f+4]|a[f+5]<<8;_+=(M>>>10|g<<6)&8191;var A=a[f+6]|a[f+7]<<8;w+=(g>>>7|A<<9)&8191;var W=a[f+8]|a[f+9]<<8;m+=(A>>>4|W<<12)&8191,p+=W>>>1&8191;var J=a[f+10]|a[f+11]<<8;O+=(W>>>14|J<<2)&8191;var X=a[f+12]|a[f+13]<<8;R+=(J>>>11|X<<5)&8191;var $=a[f+14]|a[f+15]<<8;T+=(X>>>8|$<<8)&8191,l+=$>>>5|c;var C=0,P=C;P+=v*E,P+=d*(5*B),P+=_*(5*x),P+=w*(5*L),P+=m*(5*U),C=P>>>13,P&=8191,P+=p*(5*S),P+=O*(5*y),P+=R*(5*u),P+=T*(5*t),P+=l*(5*D),C+=P>>>13,P&=8191;var j=C;j+=v*D,j+=d*E,j+=_*(5*B),j+=w*(5*x),j+=m*(5*L),C=j>>>13,j&=8191,j+=p*(5*U),j+=O*(5*S),j+=R*(5*y),j+=T*(5*u),j+=l*(5*t),C+=j>>>13,j&=8191;var I=C;I+=v*t,I+=d*D,I+=_*E,I+=w*(5*B),I+=m*(5*x),C=I>>>13,I&=8191,I+=p*(5*L),I+=O*(5*U),I+=R*(5*S),I+=T*(5*y),I+=l*(5*u),C+=I>>>13,I&=8191;var H=C;H+=v*u,H+=d*t,H+=_*D,H+=w*E,H+=m*(5*B),C=H>>>13,H&=8191,H+=p*(5*x),H+=O*(5*L),H+=R*(5*U),H+=T*(5*S),H+=l*(5*y),C+=H>>>13,H&=8191;var K=C;K+=v*y,K+=d*u,K+=_*t,K+=w*D,K+=m*E,C=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*x),K+=R*(5*L),K+=T*(5*U),K+=l*(5*S),C+=K>>>13,K&=8191;var z=C;z+=v*S,z+=d*y,z+=_*u,z+=w*t,z+=m*D,C=z>>>13,z&=8191,z+=p*E,z+=O*(5*B),z+=R*(5*x),z+=T*(5*L),z+=l*(5*U),C+=z>>>13,z&=8191;var Y=C;Y+=v*U,Y+=d*S,Y+=_*y,Y+=w*u,Y+=m*t,C=Y>>>13,Y&=8191,Y+=p*D,Y+=O*E,Y+=R*(5*B),Y+=T*(5*x),Y+=l*(5*L),C+=Y>>>13,Y&=8191;var q=C;q+=v*L,q+=d*U,q+=_*S,q+=w*y,q+=m*u,C=q>>>13,q&=8191,q+=p*t,q+=O*D,q+=R*E,q+=T*(5*B),q+=l*(5*x),C+=q>>>13,q&=8191;var G=C;G+=v*x,G+=d*L,G+=_*U,G+=w*S,G+=m*y,C=G>>>13,G&=8191,G+=p*u,G+=O*t,G+=R*D,G+=T*E,G+=l*(5*B),C+=G>>>13,G&=8191;var V=C;V+=v*B,V+=d*x,V+=_*L,V+=w*U,V+=m*S,C=V>>>13,V&=8191,V+=p*y,V+=O*u,V+=R*t,V+=T*D,V+=l*E,C+=V>>>13,V&=8191,C=(C<<2)+C|0,C=C+P|0,P=C&8191,C=C>>>13,j+=C,v=P,d=j,_=I,w=H,m=K,p=z,O=Y,R=q,T=G,l=V,f+=16,s-=16}this._h[0]=v,this._h[1]=d,this._h[2]=_,this._h[3]=w,this._h[4]=m,this._h[5]=p,this._h[6]=O,this._h[7]=R,this._h[8]=T,this._h[9]=l},b.prototype.finish=function(a,f){f===void 0&&(f=0);var s=new Uint16Array(10),c,v,d,_;if(this._leftover){for(_=this._leftover,this._buffer[_++]=1;_<16;_++)this._buffer[_]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(c=this._h[1]>>>13,this._h[1]&=8191,_=2;_<10;_++)this._h[_]+=c,c=this._h[_]>>>13,this._h[_]&=8191;for(this._h[0]+=c*5,c=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=c,c=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=c,s[0]=this._h[0]+5,c=s[0]>>>13,s[0]&=8191,_=1;_<10;_++)s[_]=this._h[_]+c,c=s[_]>>>13,s[_]&=8191;for(s[9]-=8192,v=(c^1)-1,_=0;_<10;_++)s[_]&=v;for(v=~v,_=0;_<10;_++)this._h[_]=this._h[_]&v|s[_];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,_=1;_<8;_++)d=(this._h[_]+this._pad[_]|0)+(d>>>16)|0,this._h[_]=d&65535;return a[f+0]=this._h[0]>>>0,a[f+1]=this._h[0]>>>8,a[f+2]=this._h[1]>>>0,a[f+3]=this._h[1]>>>8,a[f+4]=this._h[2]>>>0,a[f+5]=this._h[2]>>>8,a[f+6]=this._h[3]>>>0,a[f+7]=this._h[3]>>>8,a[f+8]=this._h[4]>>>0,a[f+9]=this._h[4]>>>8,a[f+10]=this._h[5]>>>0,a[f+11]=this._h[5]>>>8,a[f+12]=this._h[6]>>>0,a[f+13]=this._h[6]>>>8,a[f+14]=this._h[7]>>>0,a[f+15]=this._h[7]>>>8,this._finished=!0,this},b.prototype.update=function(a){var f=0,s=a.length,c;if(this._leftover){c=16-this._leftover,c>s&&(c=s);for(var v=0;v<c;v++)this._buffer[this._leftover+v]=a[f+v];if(s-=c,f+=c,this._leftover+=c,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(s>=16&&(c=s-s%16,this._blocks(a,f,c),f+=c,s-=c),s){for(var v=0;v<s;v++)this._buffer[this._leftover+v]=a[f+v];this._leftover+=s}return this},b.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},b.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},b}();e.Poly1305=i;function h(b,a){var f=new i(b);f.update(a);var s=f.digest();return f.clean(),s}e.oneTimeAuth=h;function o(b,a){return b.length!==e.DIGEST_LENGTH||a.length!==e.DIGEST_LENGTH?!1:r.equal(b,a)}e.equal=o})(pt);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Le,n=pt,i=de,h=F,o=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var b=new Uint8Array(16),a=function(){function f(s){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,s.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(s)}return f.prototype.seal=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=c.length+this.tagLength,p;if(d){if(d.length!==m)throw new Error("ChaCha20Poly1305: incorrect destination length");p=d}else p=new Uint8Array(m);return r.streamXOR(this._key,_,c,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),w,p.subarray(0,p.length-this.tagLength),v),i.wipe(_),p},f.prototype.open=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(c.length<this.tagLength)return null;var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=new Uint8Array(this.tagLength);if(this._authenticate(m,w,c.subarray(0,c.length-this.tagLength),v),!o.equal(m,c.subarray(c.length-this.tagLength,c.length)))return null;var p=c.length-this.tagLength,O;if(d){if(d.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=d}else O=new Uint8Array(p);return r.streamXOR(this._key,_,c.subarray(0,c.length-this.tagLength),O,4),i.wipe(_),O},f.prototype.clean=function(){return i.wipe(this._key),this},f.prototype._authenticate=function(s,c,v,d){var _=new n.Poly1305(c);d&&(_.update(d),d.length%16>0&&_.update(b.subarray(d.length%16))),_.update(v),v.length%16>0&&_.update(b.subarray(v.length%16));var w=new Uint8Array(8);d&&h.writeUint64LE(d.length,w),_.update(w),h.writeUint64LE(v.length,w),_.update(w);for(var m=_.digest(),p=0;p<m.length;p++)s[p]=m[p];_.clean(),i.wipe(m),i.wipe(w)},f}();e.ChaCha20Poly1305=a})(dt);var mt={},Oe={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function sr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=sr;Object.defineProperty(Oe,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(i).clean():i.set(n);for(var h=0;h<i.length;h++)i[h]^=54;this._inner.update(i);for(var h=0;h<i.length;h++)i[h]^=106;this._outer.update(i),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(i)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Oe.HMAC=Ut;function cr(e,r,n){var i=new Ut(e,r);i.update(n);var h=i.digest();return i.clean(),h}Oe.hmac=cr;Oe.equal=lr.equal;Object.defineProperty(mt,"__esModule",{value:!0});var rt=Oe,nt=de,_r=function(){function e(r,n,i,h){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=h;var o=rt.hmac(this._hash,i,n);this._hmac=new rt.HMAC(r,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(r){for(var n=new Uint8Array(r),i=0;i<n.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[i]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),dr=mt.HKDF=_r,et={},Be={},xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.BrowserRandomSource=void 0;const it=65536;class Er{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=it)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,it)));return n}}xe.BrowserRandomSource=Er;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.NodeRandomSource=void 0;const br=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ue.commonjsRequire<"u"){const r=Ue.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let h=0;h<i.length;h++)i[h]=n[h];return(0,br.wipe)(n),i}}Pe.NodeRandomSource=wr;Object.defineProperty(Be,"__esModule",{value:!0});Be.SystemRandomSource=void 0;const vr=xe,yr=Pe;class gr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new vr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new yr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Be.SystemRandomSource=gr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=Be,n=F,i=de;e.defaultRandomSource=new r.SystemRandomSource;function h(s,c=e.defaultRandomSource){return c.randomBytes(s)}e.randomBytes=h;function o(s=e.defaultRandomSource){const c=h(4,s),v=(0,n.readUint32LE)(c);return(0,i.wipe)(c),v}e.randomUint32=o;const b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(s,c=b,v=e.defaultRandomSource){if(c.length<2)throw new Error("randomString charset is too short");if(c.length>256)throw new Error("randomString charset is too long");let d="";const _=c.length,w=256-256%_;for(;s>0;){const m=h(Math.ceil(s*256/w),v);for(let p=0;p<m.length&&s>0;p++){const O=m[p];O<w&&(d+=c.charAt(O%_),s--)}(0,i.wipe)(m)}return d}e.randomString=a;function f(s,c=b,v=e.defaultRandomSource){const d=Math.ceil(s/(Math.log(c.length)/Math.LN2));return a(d,c,v)}e.randomStringForEntropy=f})(et);var At={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=F,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var i=function(){function a(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},a.prototype.update=function(f,s){if(s===void 0&&(s=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var c=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&s>0;)this._buffer[this._bufferLength++]=f[c++],s--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(c=o(this._temp,this._state,f,c,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=f[c++],s--;return this},a.prototype.finish=function(f){if(!this._finished){var s=this._bytesHashed,c=this._bufferLength,v=s/536870912|0,d=s<<3,_=s%64<56?64:128;this._buffer[c]=128;for(var w=c+1;w<_-8;w++)this._buffer[w]=0;r.writeUint32BE(v,this._buffer,_-8),r.writeUint32BE(d,this._buffer,_-4),o(this._temp,this._state,this._buffer,0,_),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)r.writeUint32BE(this._state[w],f,w*4);return this},a.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(f){n.wipe(f.state),f.buffer&&n.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},a}();e.SHA256=i;var h=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(a,f,s,c,v){for(;v>=64;){for(var d=f[0],_=f[1],w=f[2],m=f[3],p=f[4],O=f[5],R=f[6],T=f[7],l=0;l<16;l++){var E=c+l*4;a[l]=r.readUint32BE(s,E)}for(var l=16;l<64;l++){var D=a[l-2],t=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10;D=a[l-15];var u=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3;a[l]=(t+a[l-7]|0)+(u+a[l-16]|0)}for(var l=0;l<64;l++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&R)|0)+(T+(h[l]+a[l]|0)|0)|0,u=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&_^d&w^_&w)|0;T=R,R=O,O=p,p=m+t|0,m=w,w=_,_=d,d=t+u|0}f[0]+=d,f[1]+=_,f[2]+=w,f[3]+=m,f[4]+=p,f[5]+=O,f[6]+=R,f[7]+=T,c+=64,v-=64}return c}function b(a){var f=new i;f.update(a);var s=f.digest();return f.clean(),s}e.hash=b})(At);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function i(l){const E=new Float64Array(16);if(l)for(let D=0;D<l.length;D++)E[D]=l[D];return E}const h=new Uint8Array(32);h[0]=9;const o=i([56129,1]);function b(l){let E=1;for(let D=0;D<16;D++){let t=l[D]+E+65535;E=Math.floor(t/65536),l[D]=t-E*65536}l[0]+=E-1+37*(E-1)}function a(l,E,D){const t=~(D-1);for(let u=0;u<16;u++){const y=t&(l[u]^E[u]);l[u]^=y,E[u]^=y}}function f(l,E){const D=i(),t=i();for(let u=0;u<16;u++)t[u]=E[u];b(t),b(t),b(t);for(let u=0;u<2;u++){D[0]=t[0]-65517;for(let S=1;S<15;S++)D[S]=t[S]-65535-(D[S-1]>>16&1),D[S-1]&=65535;D[15]=t[15]-32767-(D[14]>>16&1);const y=D[15]>>16&1;D[14]&=65535,a(t,D,1-y)}for(let u=0;u<16;u++)l[2*u]=t[u]&255,l[2*u+1]=t[u]>>8}function s(l,E){for(let D=0;D<16;D++)l[D]=E[2*D]+(E[2*D+1]<<8);l[15]&=32767}function c(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]+D[t]}function v(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]-D[t]}function d(l,E,D){let t,u,y=0,S=0,U=0,L=0,x=0,B=0,N=0,M=0,g=0,A=0,W=0,J=0,X=0,$=0,C=0,P=0,j=0,I=0,H=0,K=0,z=0,Y=0,q=0,G=0,V=0,we=0,ge=0,pe=0,Ne=0,Ie=0,tt=0,Q=D[0],k=D[1],ee=D[2],te=D[3],re=D[4],ne=D[5],ie=D[6],ue=D[7],ae=D[8],fe=D[9],he=D[10],oe=D[11],se=D[12],le=D[13],De=D[14],ce=D[15];t=E[0],y+=t*Q,S+=t*k,U+=t*ee,L+=t*te,x+=t*re,B+=t*ne,N+=t*ie,M+=t*ue,g+=t*ae,A+=t*fe,W+=t*he,J+=t*oe,X+=t*se,$+=t*le,C+=t*De,P+=t*ce,t=E[1],S+=t*Q,U+=t*k,L+=t*ee,x+=t*te,B+=t*re,N+=t*ne,M+=t*ie,g+=t*ue,A+=t*ae,W+=t*fe,J+=t*he,X+=t*oe,$+=t*se,C+=t*le,P+=t*De,j+=t*ce,t=E[2],U+=t*Q,L+=t*k,x+=t*ee,B+=t*te,N+=t*re,M+=t*ne,g+=t*ie,A+=t*ue,W+=t*ae,J+=t*fe,X+=t*he,$+=t*oe,C+=t*se,P+=t*le,j+=t*De,I+=t*ce,t=E[3],L+=t*Q,x+=t*k,B+=t*ee,N+=t*te,M+=t*re,g+=t*ne,A+=t*ie,W+=t*ue,J+=t*ae,X+=t*fe,$+=t*he,C+=t*oe,P+=t*se,j+=t*le,I+=t*De,H+=t*ce,t=E[4],x+=t*Q,B+=t*k,N+=t*ee,M+=t*te,g+=t*re,A+=t*ne,W+=t*ie,J+=t*ue,X+=t*ae,$+=t*fe,C+=t*he,P+=t*oe,j+=t*se,I+=t*le,H+=t*De,K+=t*ce,t=E[5],B+=t*Q,N+=t*k,M+=t*ee,g+=t*te,A+=t*re,W+=t*ne,J+=t*ie,X+=t*ue,$+=t*ae,C+=t*fe,P+=t*he,j+=t*oe,I+=t*se,H+=t*le,K+=t*De,z+=t*ce,t=E[6],N+=t*Q,M+=t*k,g+=t*ee,A+=t*te,W+=t*re,J+=t*ne,X+=t*ie,$+=t*ue,C+=t*ae,P+=t*fe,j+=t*he,I+=t*oe,H+=t*se,K+=t*le,z+=t*De,Y+=t*ce,t=E[7],M+=t*Q,g+=t*k,A+=t*ee,W+=t*te,J+=t*re,X+=t*ne,$+=t*ie,C+=t*ue,P+=t*ae,j+=t*fe,I+=t*he,H+=t*oe,K+=t*se,z+=t*le,Y+=t*De,q+=t*ce,t=E[8],g+=t*Q,A+=t*k,W+=t*ee,J+=t*te,X+=t*re,$+=t*ne,C+=t*ie,P+=t*ue,j+=t*ae,I+=t*fe,H+=t*he,K+=t*oe,z+=t*se,Y+=t*le,q+=t*De,G+=t*ce,t=E[9],A+=t*Q,W+=t*k,J+=t*ee,X+=t*te,$+=t*re,C+=t*ne,P+=t*ie,j+=t*ue,I+=t*ae,H+=t*fe,K+=t*he,z+=t*oe,Y+=t*se,q+=t*le,G+=t*De,V+=t*ce,t=E[10],W+=t*Q,J+=t*k,X+=t*ee,$+=t*te,C+=t*re,P+=t*ne,j+=t*ie,I+=t*ue,H+=t*ae,K+=t*fe,z+=t*he,Y+=t*oe,q+=t*se,G+=t*le,V+=t*De,we+=t*ce,t=E[11],J+=t*Q,X+=t*k,$+=t*ee,C+=t*te,P+=t*re,j+=t*ne,I+=t*ie,H+=t*ue,K+=t*ae,z+=t*fe,Y+=t*he,q+=t*oe,G+=t*se,V+=t*le,we+=t*De,ge+=t*ce,t=E[12],X+=t*Q,$+=t*k,C+=t*ee,P+=t*te,j+=t*re,I+=t*ne,H+=t*ie,K+=t*ue,z+=t*ae,Y+=t*fe,q+=t*he,G+=t*oe,V+=t*se,we+=t*le,ge+=t*De,pe+=t*ce,t=E[13],$+=t*Q,C+=t*k,P+=t*ee,j+=t*te,I+=t*re,H+=t*ne,K+=t*ie,z+=t*ue,Y+=t*ae,q+=t*fe,G+=t*he,V+=t*oe,we+=t*se,ge+=t*le,pe+=t*De,Ne+=t*ce,t=E[14],C+=t*Q,P+=t*k,j+=t*ee,I+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ue,q+=t*ae,G+=t*fe,V+=t*he,we+=t*oe,ge+=t*se,pe+=t*le,Ne+=t*De,Ie+=t*ce,t=E[15],P+=t*Q,j+=t*k,I+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ue,G+=t*ae,V+=t*fe,we+=t*he,ge+=t*oe,pe+=t*se,Ne+=t*le,Ie+=t*De,tt+=t*ce,y+=38*j,S+=38*I,U+=38*H,L+=38*K,x+=38*z,B+=38*Y,N+=38*q,M+=38*G,g+=38*V,A+=38*we,W+=38*ge,J+=38*pe,X+=38*Ne,$+=38*Ie,C+=38*tt,u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),l[0]=y,l[1]=S,l[2]=U,l[3]=L,l[4]=x,l[5]=B,l[6]=N,l[7]=M,l[8]=g,l[9]=A,l[10]=W,l[11]=J,l[12]=X,l[13]=$,l[14]=C,l[15]=P}function _(l,E){d(l,E,E)}function w(l,E){const D=i();for(let t=0;t<16;t++)D[t]=E[t];for(let t=253;t>=0;t--)_(D,D),t!==2&&t!==4&&d(D,D,E);for(let t=0;t<16;t++)l[t]=D[t]}function m(l,E){const D=new Uint8Array(32),t=new Float64Array(80),u=i(),y=i(),S=i(),U=i(),L=i(),x=i();for(let g=0;g<31;g++)D[g]=l[g];D[31]=l[31]&127|64,D[0]&=248,s(t,E);for(let g=0;g<16;g++)y[g]=t[g];u[0]=U[0]=1;for(let g=254;g>=0;--g){const A=D[g>>>3]>>>(g&7)&1;a(u,y,A),a(S,U,A),c(L,u,S),v(u,u,S),c(S,y,U),v(y,y,U),_(U,L),_(x,u),d(u,S,u),d(S,y,L),c(L,u,S),v(u,u,S),_(y,u),v(S,U,x),d(u,S,o),c(u,u,U),d(S,S,u),d(u,U,x),d(U,y,t),_(y,L),a(u,y,A),a(S,U,A)}for(let g=0;g<16;g++)t[g+16]=u[g],t[g+32]=S[g],t[g+48]=y[g],t[g+64]=U[g];const B=t.subarray(32),N=t.subarray(16);w(B,B),d(N,N,B);const M=new Uint8Array(32);return f(M,N),M}e.scalarMult=m;function p(l){return m(l,h)}e.scalarMultBase=p;function O(l){if(l.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const E=new Uint8Array(l);return{publicKey:p(E),secretKey:E}}e.generateKeyPairFromSeed=O;function R(l){const E=(0,r.randomBytes)(32,l),D=O(E);return(0,n.wipe)(E),D}e.generateKeyPair=R;function T(l,E,D=!1){if(l.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(E.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=m(l,E);if(D){let u=0;for(let y=0;y<t.length;y++)u|=t[y];if(u===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=T})(Ot);function Sr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var h=0;h<e.length;h++){var o=e.charAt(h),b=o.charCodeAt(0);if(n[b]!==255)throw new TypeError(o+" is ambiguous");n[b]=h}var a=e.length,f=e.charAt(0),s=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function v(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var m=0,p=0,O=0,R=w.length;O!==R&&w[O]===0;)O++,m++;for(var T=(R-O)*c+1>>>0,l=new Uint8Array(T);O!==R;){for(var E=w[O],D=0,t=T-1;(E!==0||D<p)&&t!==-1;t--,D++)E+=256*l[t]>>>0,l[t]=E%a>>>0,E=E/a>>>0;if(E!==0)throw new Error("Non-zero carry");p=D,O++}for(var u=T-p;u!==T&&l[u]===0;)u++;for(var y=f.repeat(m);u<T;++u)y+=e.charAt(l[u]);return y}function d(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var m=0;if(w[m]!==" "){for(var p=0,O=0;w[m]===f;)p++,m++;for(var R=(w.length-m)*s+1>>>0,T=new Uint8Array(R);w[m];){var l=n[w.charCodeAt(m)];if(l===255)return;for(var E=0,D=R-1;(l!==0||E<O)&&D!==-1;D--,E++)l+=a*T[D]>>>0,T[D]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");O=E,m++}if(w[m]!==" "){for(var t=R-O;t!==R&&T[t]===0;)t++;for(var u=new Uint8Array(p+(R-t)),y=p;t!==R;)u[y++]=T[t++];return u}}}function _(w){var m=d(w);if(m)return m;throw new Error(`Non-${r} character`)}return{encode:v,decodeUnsafe:d,decode:_}}var pr=Sr,Cr=pr;const mr=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Ar=e=>new TextDecoder().decode(e);class Or{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Tr{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Tt(this,r)}}class Nr{constructor(r){this.decoders=r}or(r){return Tt(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Tt=(e,r)=>new Nr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,i,h){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=h,this.encoder=new Or(r,n,i),this.decoder=new Tr(r,n,h)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const Re=({name:e,prefix:r,encode:n,decode:i})=>new Mr(e,r,n,i),Te=({prefix:e,name:r,alphabet:n})=>{const{encode:i,decode:h}=Cr(n,r);return Re({prefix:e,name:r,encode:i,decode:o=>mr(h(o))})},Fr=(e,r,n,i)=>{const h={};for(let c=0;c<r.length;++c)h[r[c]]=c;let o=e.length;for(;e[o-1]==="=";)--o;const b=new Uint8Array(o*n/8|0);let a=0,f=0,s=0;for(let c=0;c<o;++c){const v=h[e[c]];if(v===void 0)throw new SyntaxError(`Non-${i} character`);f=f<<n|v,a+=n,a>=8&&(a-=8,b[s++]=255&f>>a)}if(a>=n||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return b},Lr=(e,r,n)=>{const i=r[r.length-1]==="=",h=(1<<n)-1;let o="",b=0,a=0;for(let f=0;f<e.length;++f)for(a=a<<8|e[f],b+=8;b>n;)b-=n,o+=r[h&a>>b];if(b&&(o+=r[h&a<<n-b]),i)for(;o.length*n&7;)o+="=";return o},Z=({name:e,prefix:r,bitsPerChar:n,alphabet:i})=>Re({prefix:r,name:e,encode(h){return Lr(h,i,n)},decode(h){return Fr(h,i,n,e)}}),Br=Re({prefix:"\0",name:"identity",encode:e=>Ar(e),decode:e=>Ur(e)}),xr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Pr=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Pr},Symbol.toStringTag,{value:"Module"})),jr=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Ir=Object.freeze(Object.defineProperty({__proto__:null,base8:jr},Symbol.toStringTag,{value:"Module"})),Hr=Te({prefix:"9",name:"base10",alphabet:"0123456789"}),Kr=Object.freeze(Object.defineProperty({__proto__:null,base10:Hr},Symbol.toStringTag,{value:"Module"})),zr=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yr=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),qr=Object.freeze(Object.defineProperty({__proto__:null,base16:zr,base16upper:Yr},Symbol.toStringTag,{value:"Module"})),Gr=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Wr=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vr=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$r=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Xr=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Jr=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qr=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kr=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),en=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Xr,base32hexpad:Zr,base32hexpadupper:Qr,base32hexupper:Jr,base32pad:Vr,base32padupper:$r,base32upper:Wr,base32z:kr},Symbol.toStringTag,{value:"Module"})),tn=Te({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rn=Te({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),nn=Object.freeze(Object.defineProperty({__proto__:null,base36:tn,base36upper:rn},Symbol.toStringTag,{value:"Module"})),un=Te({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=Te({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),fn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:an},Symbol.toStringTag,{value:"Module"})),hn=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sn=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:hn,base64pad:on,base64url:sn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Nt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),cn=Nt.reduce((e,r,n)=>(e[n]=r,e),[]),_n=Nt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function dn(e){return e.reduce((r,n)=>(r+=cn[n],r),"")}function En(e){const r=[];for(const n of e){const i=_n[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const bn=Re({prefix:"🚀",name:"base256emoji",encode:dn,decode:En}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:bn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Tr=Object.defineProperty;var vr=(e,t,r)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var F=(e,t,r)=>vr(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("./index-CoYZ1p1j.js"),ke=require("./sui-DwGUL_nC.js"),Er=require("./unsignedTransaction-DzSLsK-p.js");class xr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:o}=t,u=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function jr(e){return z(e)&&typeof e[Symbol.iterator]=="function"}function z(e){return typeof e=="object"&&e!=null}function V(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Ir(e){const{done:t,value:r}=e.next();return t?void 0:r}function Or(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:o,message:u=`Expected a value of type \`${a}\`${o?` with refinement \`${o}\``:""}, but received: \`${V(n)}\``}=e;return{value:n,type:a,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:u}}function*Nt(e,t,r,n){jr(e)||(e=[e]);for(const i of e){const s=Or(i,t,r,n);s&&(yield s)}}function*at(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),a&&t.type!=="type"&&z(t.schema)&&z(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let u="valid";for(const d of t.validator(e,o))d.explanation=r.message,u="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,o)){const m=at(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:a,message:r.message});for(const p of m)p[0]?(u=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(l=p[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):z(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(u!=="not_valid")for(const d of t.refiner(e,o))d.explanation=r.message,u="not_refined",yield[d,void 0];u==="valid"&&(yield[void 0,e])}class Y{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=u=>u,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=a,i?this.validator=(u,d)=>{const l=i(u,d);return Nt(l,d,this,u)}:this.validator=()=>[],s?this.refiner=(u,d)=>{const l=s(u,d);return Nt(l,d,this,u)}:this.refiner=()=>[]}assert(t,r){return Qe(t,this,r)}create(t,r){return Gt(t,this,r)}is(t){return N(t,this)}mask(t,r){return Ft(t,this,r)}validate(t,r={}){return xe(t,this,r)}}function Qe(e,t,r){const n=xe(e,t,{message:r});if(n[0])throw n[0]}function Gt(e,t,r){const n=xe(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Ft(e,t,r){const n=xe(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function N(e,t){return!xe(e,t)[0]}function xe(e,t,r={}){const n=at(e,t,r),i=Ir(n);return i[0]?[new xr(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function be(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?kr(n):h(n)}function P(e,t){return new Y({type:e,schema:null,validator:t})}function et(){return P("any",()=>!0)}function v(e){return new Y({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${V(t)}`}})}function Ar(){return P("bigint",e=>typeof e=="bigint")}function U(){return P("boolean",e=>typeof e=="boolean")}function Z(){return P("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${V(e)}`)}function b(e){const t=V(e),r=typeof e;return new Y({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${V(n)}`}})}function Lt(){return P("never",()=>!1)}function O(e){return new Y({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function de(){return P("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${V(e)}`)}function h(e){const t=e?Object.keys(e):[],r=Lt();return new Y({type:"object",schema:e||null,*entries(n){if(e&&z(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return z(n)||`Expected an object, but received: ${V(n)}`},coercer(n){return z(n)?{...n}:n}})}function w(e){return new Y({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function X(e,t){return new Y({type:"record",schema:null,*entries(r){if(z(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`}})}function f(){return P("string",e=>typeof e=="string"||`Expected a string, but received: ${V(e)}`)}function Kt(e){const t=Lt();return new Y({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${V(r)}`}})}function kr(e){const t=Object.keys(e);return new Y({type:"type",schema:e,*entries(r){if(z(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`},coercer(r){return z(r)?{...r}:r}})}function k(e){const t=e.map(r=>r.type).join(" | ");return new Y({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=at(r,s,n),[o]=a;if(o[0])for(const[u]of a)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${V(r)}`,...i]}})}function Wt(){return P("unknown",()=>!0)}const ot=k([h({AddressOwner:f()}),h({ObjectOwner:f()}),h({Shared:h({initial_shared_version:O(f())})}),b("Immutable")]);P("SuiJsonValue",()=>!0);const _r=k([h({u32:f()}),h({u64:f()}),h({f64:f()})]);h({attributes:X(f(),O(_r)),featureFlags:X(f(),U()),maxSupportedProtocolVersion:f(),minSupportedProtocolVersion:f(),protocolVersion:f()});k([f(),b("package")]);const ae=h({digest:f(),objectId:f(),version:k([de(),f(),Ar()])});h({owner:ot,reference:ae});h({objectId:f(),sequenceNumber:f()});h({payment:v(ae),owner:f(),price:f(),budget:f()});const Cr=be(ae,h({type:f(),owner:ot,previousTransaction:f()})),$r=X(f(),et()),Mr=X(f(),Wt()),Ur=h({type:f(),fields:$r,hasPublicTransfer:U()}),Br=h({disassembled:Mr}),Rr=k([be(Ur,h({dataType:b("moveObject")})),be(Br,h({dataType:b("package")}))]),Nr=h({type:f(),hasPublicTransfer:U(),version:f(),bcsBytes:f()}),Pr=h({id:f(),moduleMap:X(f(),f())}),Dr=k([be(Nr,h({dataType:b("moveObject")})),be(Pr,h({dataType:b("package")}))]);BigInt(1e9);const Jt=h({code:f(),error:w(f()),object_id:w(f()),parent_object_id:w(f()),version:w(f()),digest:w(f())}),zr=h({data:O(w(X(f(),f()))),error:O(w(Jt))}),Vr=k([zr,w(X(f(),f()))]),Ht=h({objectId:f(),version:f(),digest:f(),type:O(w(f())),content:O(w(Rr)),bcs:O(w(Dr)),owner:O(w(ot)),previousTransaction:O(w(f())),storageRebate:O(w(f())),display:O(w(Vr))});h({showType:O(w(U())),showContent:O(w(U())),showBcs:O(w(U())),showOwner:O(w(U())),showPreviousTransaction:O(w(U())),showStorageRebate:O(w(U())),showDisplay:O(w(U()))});k([b("Exists"),b("notExists"),b("Deleted")]);v(Cr);const Gr=h({data:O(w(Ht)),error:O(w(Jt))});function Fr(e){return e.data}function Lr(e){if(e.error&&"object_id"in e.error&&"version"in e.error&&"digest"in e.error){const t=e.error;return{objectId:t.object_id,version:t.version,digest:t.digest}}}function Pt(e){if("reference"in e)return e.reference;const t=Fr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Lr(e)}h({objectId:f(),atCheckpoint:w(de())});h({data:v(Gr),nextCursor:w(O(f())),hasNextPage:U()});k([h({details:Ht,status:b("VersionFound")}),h({details:f(),status:b("ObjectNotExists")}),h({details:ae,status:b("ObjectDeleted")}),h({details:Kt([f(),de()]),status:b("VersionNotFound")}),h({details:h({asked_version:de(),latest_version:de(),object_id:f()}),status:b("VersionTooHigh")})]);const Kr=k([f(),h({Object:f()})]);v(Kr);const Wr=h({address:f(),name:f()}),Jr=k([b("Private"),b("Public"),b("Friend")]),ct=h({abilities:v(f())}),Hr=h({constraints:ct,isPhantom:U()}),Xr=h({TypeParameter:de()}),Ke=Kt([h({module:f(),package:f(),function:f()}),f()]);h({rank3Days:v(Ke),rank7Days:v(Ke),rank30Days:v(Ke)});function Xt(e){if(!e)return!1;if(typeof e=="string"||N(e,Xr)||qt(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(N(t.Reference,he)||N(t.MutableReference,he)||N(t.Vector,he))}const he=P("SuiMoveNormalizedType",Xt);function qt(e){if(!e||typeof e!="object")return!1;const t=e;if(!t.Struct||typeof t.Struct!="object")return!1;const r=t.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>Xt(n)))}P("SuiMoveNormalizedStructType",qt);const qr=h({visibility:Jr,isEntry:U(),typeParameters:v(ct),parameters:v(he),return:v(he)}),Zr=h({name:f(),type:he}),Yr=h({abilities:ct,typeParameters:v(Hr),fields:v(Zr)}),Qr=h({fileFormatVersion:de(),address:f(),name:f(),friends:v(Wr),structs:X(f(),Yr),exposedFunctions:X(f(),qr)});X(f(),Qr);function tt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function Zt(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ut(e){if(typeof e=="object"&&"Struct"in e)return e;const t=Zt(e),r=tt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function en(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var a=e.length,o=e.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function l(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var y=0,S=0,E=0,A=p.length;E!==A&&p[E]===0;)E++,y++;for(var _=(A-E)*d+1>>>0,D=new Uint8Array(_);E!==A;){for(var q=p[E],ie=0,G=_-1;(q!==0||ie<S)&&G!==-1;G--,ie++)q+=256*D[G]>>>0,D[G]=q%a>>>0,q=q/a>>>0;if(q!==0)throw new Error("Non-zero carry");S=ie,E++}for(var Q=_-S;Q!==_&&D[Q]===0;)Q++;for(var Ae=o.repeat(y);Q<_;++Q)Ae+=e.charAt(D[Q]);return Ae}function g(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;for(var y=0,S=0,E=0;p[y]===o;)S++,y++;for(var A=(p.length-y)*u+1>>>0,_=new Uint8Array(A);p[y];){var D=t[p.charCodeAt(y)];if(D===255)return;for(var q=0,ie=A-1;(D!==0||q<E)&&ie!==-1;ie--,q++)D+=a*_[ie]>>>0,_[ie]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");E=q,y++}for(var G=A-E;G!==A&&_[G]===0;)G++;for(var Q=new Uint8Array(S+(A-G)),Ae=S;G!==A;)Q[Ae++]=_[G++];return Q}function m(p){var y=g(p);if(y)return y;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var tn=en;const rn=tn,nn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var sn=rn(nn);const Yt=K.getDefaultExportFromCjs(sn),je=e=>Yt.encode(e),dt=e=>Yt.decode(e);function oe(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const We=8192;function Ie(e){if(e.length<We)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=We){const n=e.slice(r,r+We);t+=String.fromCharCode(...n)}return btoa(t)}function Fe(e){var i;const t=e.startsWith("0x")?e.slice(2):e,n=((i=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Oe(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function ft(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function an(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class Qt{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=an(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function on(e,t){switch(t){case"base58":return je(e);case"base64":return Ie(e);case"hex":return Oe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function cn(e,t){switch(t){case"base58":return dt(e);case"base64":return oe(e);case"hex":return Fe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function er(e,t=["<",">"]){const[r,n]=t,i=[];let s="",a=0;for(let o=0;o<e.length;o++){const u=e[o];if(u===r&&a++,u===n&&a--,a===0&&u===","){i.push(s.trim()),s="";continue}s+=u}return i.push(s.trim()),i}class tr{constructor({size:t=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r||t,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return Je(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Je(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Je(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return ft(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return on(this.toBytes(),t)}}function Je(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var rr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},W=(e,t,r)=>(rr(e,t,"read from private field"),r?r.call(e):t.get(e)),Ne=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Pe=(e,t,r,n)=>(rr(e,t,"write to private field"),t.set(e,r),r),le,pe,Me,se;const nr=class{constructor(e){Ne(this,le,void 0),Ne(this,pe,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Pe(this,le,e.write),Pe(this,pe,e.serialize??((t,r)=>{const n=new tr({size:this.serializedSize(t)??void 0,...r});return W(this,le).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),W(this,le).call(this,e,t)}serialize(e,t){return this.validate(e),new un(this,W(this,pe).call(this,e,t))}parse(e){const t=new Qt(e);return this.read(t)}transform({name:e,input:t,output:r}){return new nr({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>W(this,le).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>W(this,pe).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let J=nr;le=new WeakMap;pe=new WeakMap;const ir=Symbol.for("@mysten/serialized-bcs");function lt(e){return!!e&&typeof e=="object"&&e[ir]===!0}class un{constructor(t,r){Ne(this,Me,void 0),Ne(this,se,void 0),Pe(this,Me,t),Pe(this,se,r)}get[ir](){return!0}toBytes(){return W(this,se)}toHex(){return Oe(W(this,se))}toBase64(){return Ie(W(this,se))}toBase58(){return je(W(this,se))}parse(){return W(this,Me).parse(W(this,se))}}Me=new WeakMap;se=new WeakMap;function De({size:e,...t}){return new J({...t,serializedSize:()=>e})}function He({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function Xe({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var s;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(s=r.validate)==null||s.call(r,i)}})}function dn({serialize:e,...t}){const r=new J({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function fn({toBytes:e,fromBytes:t,...r}){return new J({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let a=0;a<s.length;a++)i.write8(s[a])},serialize:n=>{const i=e(n),s=ft(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function ln(e){let t=null;function r(){return t||(t=e()),t}return new J({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const c={u8(e){return He({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return He({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return He({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Xe({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Xe({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Xe({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return De({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return dn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(ft(t)),...e})},bytes(e,t){return De({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{for(let i=0;i<e;i++)n.write8(r[i]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},string(e){return fn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new J({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.write(s,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return c.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>"Some"in t?t.Some:null})},vector(e,t){return new J({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new J({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new J({name:e,serializedSize:i=>{let s=0;for(const[a,o]of n){const u=o.serializedSize(i[a]);if(u==null)return null;s+=u}return s},read:i=>{const s={};for(const[a,o]of n)s[a]=o.read(i);return s},write:(i,s)=>{for(const[a,o]of n)o.write(i[a],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(e,t,r){const n=Object.entries(t);return new J({name:e,read:i=>{const s=i.readULEB(),[a,o]=n[s];return{[a]:(o==null?void 0:o.read(i))??!0}},write:(i,s)=>{const[a,o]=Object.entries(i)[0];for(let u=0;u<n.length;u++){const[d,l]=n[u];if(d===a){s.writeULEB(u),l==null||l.write(o,s);return}}},...r,validate:i=>{var o;if((o=r==null?void 0:r.validate)==null||o.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i);if(s.length!==1)throw new TypeError(`Expected object with one key, found ${s.length}`);const[a]=s;if(!Object.hasOwn(t,a))throw new TypeError(`Invalid enum variant ${a}`)}})},map(e,t){return c.vector(c.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(e,t){return(...r)=>t(...r).transform({name:`${t.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(e){return ln(e)}},hn=32,me=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof me){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(me.ADDRESS,e.addressLength,e.addressEncoding),this.registerVectorType(e.vectorType),e.types&&e.types.structs)for(let t of Object.keys(e.types.structs))this.registerStructType(t,e.types.structs[t]);if(e.types&&e.types.enums)for(let t of Object.keys(e.types.enums))this.registerEnumType(t,e.types.enums[t]);if(e.types&&e.types.aliases)for(let t of Object.keys(e.types.aliases))this.registerAlias(t,e.types.aliases[t]);e.withPrimitives!==!1&&gn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(e,t,r){if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).encode(this,t,r,i)}if(typeof e=="object"){const n=this.tempKey();return new me(this).registerStructType(n,e).ser(n,t,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
|
|
1
|
+
"use strict";var Tr=Object.defineProperty;var vr=(e,t,r)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var F=(e,t,r)=>vr(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("./index-BBfGNpdz.js"),ke=require("./sui-CDzPbVuH.js"),Er=require("./unsignedTransaction-DzSLsK-p.js");class xr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:o}=t,u=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function jr(e){return z(e)&&typeof e[Symbol.iterator]=="function"}function z(e){return typeof e=="object"&&e!=null}function V(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Ir(e){const{done:t,value:r}=e.next();return t?void 0:r}function Or(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:o,message:u=`Expected a value of type \`${a}\`${o?` with refinement \`${o}\``:""}, but received: \`${V(n)}\``}=e;return{value:n,type:a,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:u}}function*Nt(e,t,r,n){jr(e)||(e=[e]);for(const i of e){const s=Or(i,t,r,n);s&&(yield s)}}function*at(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),a&&t.type!=="type"&&z(t.schema)&&z(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let u="valid";for(const d of t.validator(e,o))d.explanation=r.message,u="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,o)){const m=at(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:a,message:r.message});for(const p of m)p[0]?(u=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(l=p[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):z(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(u!=="not_valid")for(const d of t.refiner(e,o))d.explanation=r.message,u="not_refined",yield[d,void 0];u==="valid"&&(yield[void 0,e])}class Y{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=u=>u,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=a,i?this.validator=(u,d)=>{const l=i(u,d);return Nt(l,d,this,u)}:this.validator=()=>[],s?this.refiner=(u,d)=>{const l=s(u,d);return Nt(l,d,this,u)}:this.refiner=()=>[]}assert(t,r){return Qe(t,this,r)}create(t,r){return Gt(t,this,r)}is(t){return N(t,this)}mask(t,r){return Ft(t,this,r)}validate(t,r={}){return xe(t,this,r)}}function Qe(e,t,r){const n=xe(e,t,{message:r});if(n[0])throw n[0]}function Gt(e,t,r){const n=xe(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Ft(e,t,r){const n=xe(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function N(e,t){return!xe(e,t)[0]}function xe(e,t,r={}){const n=at(e,t,r),i=Ir(n);return i[0]?[new xr(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function be(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?kr(n):h(n)}function P(e,t){return new Y({type:e,schema:null,validator:t})}function et(){return P("any",()=>!0)}function v(e){return new Y({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${V(t)}`}})}function Ar(){return P("bigint",e=>typeof e=="bigint")}function U(){return P("boolean",e=>typeof e=="boolean")}function Z(){return P("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${V(e)}`)}function b(e){const t=V(e),r=typeof e;return new Y({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${V(n)}`}})}function Lt(){return P("never",()=>!1)}function O(e){return new Y({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function de(){return P("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${V(e)}`)}function h(e){const t=e?Object.keys(e):[],r=Lt();return new Y({type:"object",schema:e||null,*entries(n){if(e&&z(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return z(n)||`Expected an object, but received: ${V(n)}`},coercer(n){return z(n)?{...n}:n}})}function w(e){return new Y({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function X(e,t){return new Y({type:"record",schema:null,*entries(r){if(z(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`}})}function f(){return P("string",e=>typeof e=="string"||`Expected a string, but received: ${V(e)}`)}function Kt(e){const t=Lt();return new Y({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${V(r)}`}})}function kr(e){const t=Object.keys(e);return new Y({type:"type",schema:e,*entries(r){if(z(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`},coercer(r){return z(r)?{...r}:r}})}function k(e){const t=e.map(r=>r.type).join(" | ");return new Y({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=at(r,s,n),[o]=a;if(o[0])for(const[u]of a)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${V(r)}`,...i]}})}function Wt(){return P("unknown",()=>!0)}const ot=k([h({AddressOwner:f()}),h({ObjectOwner:f()}),h({Shared:h({initial_shared_version:O(f())})}),b("Immutable")]);P("SuiJsonValue",()=>!0);const _r=k([h({u32:f()}),h({u64:f()}),h({f64:f()})]);h({attributes:X(f(),O(_r)),featureFlags:X(f(),U()),maxSupportedProtocolVersion:f(),minSupportedProtocolVersion:f(),protocolVersion:f()});k([f(),b("package")]);const ae=h({digest:f(),objectId:f(),version:k([de(),f(),Ar()])});h({owner:ot,reference:ae});h({objectId:f(),sequenceNumber:f()});h({payment:v(ae),owner:f(),price:f(),budget:f()});const Cr=be(ae,h({type:f(),owner:ot,previousTransaction:f()})),$r=X(f(),et()),Mr=X(f(),Wt()),Ur=h({type:f(),fields:$r,hasPublicTransfer:U()}),Br=h({disassembled:Mr}),Rr=k([be(Ur,h({dataType:b("moveObject")})),be(Br,h({dataType:b("package")}))]),Nr=h({type:f(),hasPublicTransfer:U(),version:f(),bcsBytes:f()}),Pr=h({id:f(),moduleMap:X(f(),f())}),Dr=k([be(Nr,h({dataType:b("moveObject")})),be(Pr,h({dataType:b("package")}))]);BigInt(1e9);const Jt=h({code:f(),error:w(f()),object_id:w(f()),parent_object_id:w(f()),version:w(f()),digest:w(f())}),zr=h({data:O(w(X(f(),f()))),error:O(w(Jt))}),Vr=k([zr,w(X(f(),f()))]),Ht=h({objectId:f(),version:f(),digest:f(),type:O(w(f())),content:O(w(Rr)),bcs:O(w(Dr)),owner:O(w(ot)),previousTransaction:O(w(f())),storageRebate:O(w(f())),display:O(w(Vr))});h({showType:O(w(U())),showContent:O(w(U())),showBcs:O(w(U())),showOwner:O(w(U())),showPreviousTransaction:O(w(U())),showStorageRebate:O(w(U())),showDisplay:O(w(U()))});k([b("Exists"),b("notExists"),b("Deleted")]);v(Cr);const Gr=h({data:O(w(Ht)),error:O(w(Jt))});function Fr(e){return e.data}function Lr(e){if(e.error&&"object_id"in e.error&&"version"in e.error&&"digest"in e.error){const t=e.error;return{objectId:t.object_id,version:t.version,digest:t.digest}}}function Pt(e){if("reference"in e)return e.reference;const t=Fr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Lr(e)}h({objectId:f(),atCheckpoint:w(de())});h({data:v(Gr),nextCursor:w(O(f())),hasNextPage:U()});k([h({details:Ht,status:b("VersionFound")}),h({details:f(),status:b("ObjectNotExists")}),h({details:ae,status:b("ObjectDeleted")}),h({details:Kt([f(),de()]),status:b("VersionNotFound")}),h({details:h({asked_version:de(),latest_version:de(),object_id:f()}),status:b("VersionTooHigh")})]);const Kr=k([f(),h({Object:f()})]);v(Kr);const Wr=h({address:f(),name:f()}),Jr=k([b("Private"),b("Public"),b("Friend")]),ct=h({abilities:v(f())}),Hr=h({constraints:ct,isPhantom:U()}),Xr=h({TypeParameter:de()}),Ke=Kt([h({module:f(),package:f(),function:f()}),f()]);h({rank3Days:v(Ke),rank7Days:v(Ke),rank30Days:v(Ke)});function Xt(e){if(!e)return!1;if(typeof e=="string"||N(e,Xr)||qt(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(N(t.Reference,he)||N(t.MutableReference,he)||N(t.Vector,he))}const he=P("SuiMoveNormalizedType",Xt);function qt(e){if(!e||typeof e!="object")return!1;const t=e;if(!t.Struct||typeof t.Struct!="object")return!1;const r=t.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>Xt(n)))}P("SuiMoveNormalizedStructType",qt);const qr=h({visibility:Jr,isEntry:U(),typeParameters:v(ct),parameters:v(he),return:v(he)}),Zr=h({name:f(),type:he}),Yr=h({abilities:ct,typeParameters:v(Hr),fields:v(Zr)}),Qr=h({fileFormatVersion:de(),address:f(),name:f(),friends:v(Wr),structs:X(f(),Yr),exposedFunctions:X(f(),qr)});X(f(),Qr);function tt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function Zt(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ut(e){if(typeof e=="object"&&"Struct"in e)return e;const t=Zt(e),r=tt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function en(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var a=e.length,o=e.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function l(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var y=0,S=0,E=0,A=p.length;E!==A&&p[E]===0;)E++,y++;for(var _=(A-E)*d+1>>>0,D=new Uint8Array(_);E!==A;){for(var q=p[E],ie=0,G=_-1;(q!==0||ie<S)&&G!==-1;G--,ie++)q+=256*D[G]>>>0,D[G]=q%a>>>0,q=q/a>>>0;if(q!==0)throw new Error("Non-zero carry");S=ie,E++}for(var Q=_-S;Q!==_&&D[Q]===0;)Q++;for(var Ae=o.repeat(y);Q<_;++Q)Ae+=e.charAt(D[Q]);return Ae}function g(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;for(var y=0,S=0,E=0;p[y]===o;)S++,y++;for(var A=(p.length-y)*u+1>>>0,_=new Uint8Array(A);p[y];){var D=t[p.charCodeAt(y)];if(D===255)return;for(var q=0,ie=A-1;(D!==0||q<E)&&ie!==-1;ie--,q++)D+=a*_[ie]>>>0,_[ie]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");E=q,y++}for(var G=A-E;G!==A&&_[G]===0;)G++;for(var Q=new Uint8Array(S+(A-G)),Ae=S;G!==A;)Q[Ae++]=_[G++];return Q}function m(p){var y=g(p);if(y)return y;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var tn=en;const rn=tn,nn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var sn=rn(nn);const Yt=K.getDefaultExportFromCjs(sn),je=e=>Yt.encode(e),dt=e=>Yt.decode(e);function oe(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const We=8192;function Ie(e){if(e.length<We)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=We){const n=e.slice(r,r+We);t+=String.fromCharCode(...n)}return btoa(t)}function Fe(e){var i;const t=e.startsWith("0x")?e.slice(2):e,n=((i=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Oe(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function ft(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function an(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class Qt{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=an(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function on(e,t){switch(t){case"base58":return je(e);case"base64":return Ie(e);case"hex":return Oe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function cn(e,t){switch(t){case"base58":return dt(e);case"base64":return oe(e);case"hex":return Fe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function er(e,t=["<",">"]){const[r,n]=t,i=[];let s="",a=0;for(let o=0;o<e.length;o++){const u=e[o];if(u===r&&a++,u===n&&a--,a===0&&u===","){i.push(s.trim()),s="";continue}s+=u}return i.push(s.trim()),i}class tr{constructor({size:t=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r||t,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return Je(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Je(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Je(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return ft(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return on(this.toBytes(),t)}}function Je(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var rr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},W=(e,t,r)=>(rr(e,t,"read from private field"),r?r.call(e):t.get(e)),Ne=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Pe=(e,t,r,n)=>(rr(e,t,"write to private field"),t.set(e,r),r),le,pe,Me,se;const nr=class{constructor(e){Ne(this,le,void 0),Ne(this,pe,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Pe(this,le,e.write),Pe(this,pe,e.serialize??((t,r)=>{const n=new tr({size:this.serializedSize(t)??void 0,...r});return W(this,le).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),W(this,le).call(this,e,t)}serialize(e,t){return this.validate(e),new un(this,W(this,pe).call(this,e,t))}parse(e){const t=new Qt(e);return this.read(t)}transform({name:e,input:t,output:r}){return new nr({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>W(this,le).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>W(this,pe).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let J=nr;le=new WeakMap;pe=new WeakMap;const ir=Symbol.for("@mysten/serialized-bcs");function lt(e){return!!e&&typeof e=="object"&&e[ir]===!0}class un{constructor(t,r){Ne(this,Me,void 0),Ne(this,se,void 0),Pe(this,Me,t),Pe(this,se,r)}get[ir](){return!0}toBytes(){return W(this,se)}toHex(){return Oe(W(this,se))}toBase64(){return Ie(W(this,se))}toBase58(){return je(W(this,se))}parse(){return W(this,Me).parse(W(this,se))}}Me=new WeakMap;se=new WeakMap;function De({size:e,...t}){return new J({...t,serializedSize:()=>e})}function He({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function Xe({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var s;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(s=r.validate)==null||s.call(r,i)}})}function dn({serialize:e,...t}){const r=new J({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function fn({toBytes:e,fromBytes:t,...r}){return new J({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let a=0;a<s.length;a++)i.write8(s[a])},serialize:n=>{const i=e(n),s=ft(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function ln(e){let t=null;function r(){return t||(t=e()),t}return new J({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const c={u8(e){return He({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return He({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return He({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Xe({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Xe({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Xe({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return De({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return dn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(ft(t)),...e})},bytes(e,t){return De({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{for(let i=0;i<e;i++)n.write8(r[i]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},string(e){return fn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new J({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.write(s,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return c.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>"Some"in t?t.Some:null})},vector(e,t){return new J({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new J({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new J({name:e,serializedSize:i=>{let s=0;for(const[a,o]of n){const u=o.serializedSize(i[a]);if(u==null)return null;s+=u}return s},read:i=>{const s={};for(const[a,o]of n)s[a]=o.read(i);return s},write:(i,s)=>{for(const[a,o]of n)o.write(i[a],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(e,t,r){const n=Object.entries(t);return new J({name:e,read:i=>{const s=i.readULEB(),[a,o]=n[s];return{[a]:(o==null?void 0:o.read(i))??!0}},write:(i,s)=>{const[a,o]=Object.entries(i)[0];for(let u=0;u<n.length;u++){const[d,l]=n[u];if(d===a){s.writeULEB(u),l==null||l.write(o,s);return}}},...r,validate:i=>{var o;if((o=r==null?void 0:r.validate)==null||o.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i);if(s.length!==1)throw new TypeError(`Expected object with one key, found ${s.length}`);const[a]=s;if(!Object.hasOwn(t,a))throw new TypeError(`Invalid enum variant ${a}`)}})},map(e,t){return c.vector(c.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(e,t){return(...r)=>t(...r).transform({name:`${t.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(e){return ln(e)}},hn=32,me=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof me){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(me.ADDRESS,e.addressLength,e.addressEncoding),this.registerVectorType(e.vectorType),e.types&&e.types.structs)for(let t of Object.keys(e.types.structs))this.registerStructType(t,e.types.structs[t]);if(e.types&&e.types.enums)for(let t of Object.keys(e.types.enums))this.registerEnumType(t,e.types.enums[t]);if(e.types&&e.types.aliases)for(let t of Object.keys(e.types.aliases))this.registerAlias(t,e.types.aliases[t]);e.withPrimitives!==!1&&gn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(e,t,r){if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).encode(this,t,r,i)}if(typeof e=="object"){const n=this.tempKey();return new me(this).registerStructType(n,e).ser(n,t,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
|
|
2
2
|
${JSON.stringify(e)}`)}de(e,t,r){if(typeof t=="string")if(r)t=cn(t,r);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).decode(this,t,i)}if(typeof e=="object"){const n=new me(this),i=this.tempKey();return n.registerStructType(i,e).de(i,t,r)}throw new Error(`Incorrect type passed into the '.de()' function.
|
|
3
3
|
${JSON.stringify(e)}`)}hasType(e){return this.types.has(e)}registerAlias(e,t){return this.types.set(e,t),this}registerType(e,t,r,n=()=>!0){const{name:i,params:s}=this.parseTypeName(e);return this.types.set(i,{encode(a,o,u,d){const l=s.reduce((g,m,p)=>Object.assign(g,{[m]:d[p]}),{});return this._encodeRaw.call(a,new tr(u),o,d,l)},decode(a,o,u){const d=s.reduce((l,g,m)=>Object.assign(l,{[g]:u[m]}),{});return this._decodeRaw.call(a,new Qt(o),u,d)},_encodeRaw(a,o,u,d){if(n(o))return t.call(this,a,o,u,d);throw new Error(`Validation failed for type ${i}, data: ${o}`)},_decodeRaw(a,o,u){return r.call(this,a,o,u)}}),this}registerBcsType(e,t){return this.registerType(e,(r,n,i)=>{const s=i.map(a=>new J({name:String(a),write:(o,u)=>{const{name:d,params:l}=this.parseTypeName(a),g=this.getTypeInterface(d),m=l.reduce((p,y,S)=>Object.assign(p,{[y]:i[S]}),{});return g._encodeRaw.call(this,u,o,l,m)},read:()=>{throw new Error("Not implemented")}}));return t(...s).write(n,r),r},(r,n)=>{const i=n.map(s=>new J({name:String(s),write:(a,o)=>{throw new Error("Not implemented")},read:a=>{const{name:o,params:u}=this.parseTypeName(s),d=this.getTypeInterface(o),l=u.reduce((g,m,p)=>Object.assign(g,{[m]:n[p]}),{});return d._decodeRaw.call(this,a,u,l)}}));return t(...i).read(r)}),this}registerAddressType(e,t,r="hex"){switch(r){case"base64":return this.registerType(e,function(i,s){return oe(s).reduce((a,o)=>a.write8(o),i)},function(i){return Ie(i.readBytes(t))});case"hex":return this.registerType(e,function(i,s){return Fe(s).reduce((a,o)=>a.write8(o),i)},function(i){return Oe(i.readBytes(t))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(e){let{name:t,params:r}=this.parseTypeName(e);if(r.length>1)throw new Error("Vector can have only one type parameter; got "+t);return this.registerType(e,function(i,s,a,o){return i.writeVec(s,(u,d)=>{let l=a[0];if(!l)throw new Error(`Incorrect number of type parameters passed a to vector '${e}'`);let{name:g,params:m}=this.parseTypeName(l);if(this.hasType(g))return this.getTypeInterface(g)._encodeRaw.call(this,u,d,m,o);if(!(g in o))throw new Error(`Unable to find a matching type definition for ${g} in vector; make sure you passed a generic`);let{name:p,params:y}=this.parseTypeName(o[g]);return this.getTypeInterface(p)._encodeRaw.call(this,u,d,y,o)})},function(i,s,a){return i.readVec(o=>{let u=s[0];if(!u)throw new Error(`Incorrect number of type parameters passed to a vector '${e}'`);let{name:d,params:l}=this.parseTypeName(u);if(this.hasType(d))return this.getTypeInterface(d)._decodeRaw.call(this,o,l,a);if(!(d in a))throw new Error(`Unable to find a matching type definition for ${d} in vector; make sure you passed a generic`);let{name:g,params:m}=this.parseTypeName(a[d]);return this.getTypeInterface(g)._decodeRaw.call(this,o,m,a)})})}registerStructType(e,t){for(let a in t){let o=this.tempKey(),u=t[a];!Array.isArray(u)&&typeof u!="string"&&(t[a]=o,this.registerStructType(o,u))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(o,u,d,l){if(!u||u.constructor!==Object)throw new Error(`Expected ${i} to be an Object, got: ${u}`);if(d.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${d.length}`);for(let g of n){if(!(g in u))throw new Error(`Struct ${i} requires field ${g}:${r[g]}`);const{name:m,params:p}=this.parseTypeName(r[g]);if(!s.includes(m))this.getTypeInterface(m)._encodeRaw.call(this,o,u[g],p,l);else{const y=s.indexOf(m);let{name:S,params:E}=this.parseTypeName(d[y]);if(this.hasType(S)){this.getTypeInterface(S)._encodeRaw.call(this,o,u[g],E,l);continue}if(!(S in l))throw new Error(`Unable to find a matching type definition for ${S} in ${i}; make sure you passed a generic`);let{name:A,params:_}=this.parseTypeName(l[S]);this.getTypeInterface(A)._encodeRaw.call(this,o,u[g],_,l)}}return o},function(o,u,d){if(u.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${u.length}`);let l={};for(let g of n){const{name:m,params:p}=this.parseTypeName(r[g]);if(!s.includes(m))l[g]=this.getTypeInterface(m)._decodeRaw.call(this,o,p,d);else{const y=s.indexOf(m);let{name:S,params:E}=this.parseTypeName(u[y]);if(this.hasType(S)){l[g]=this.getTypeInterface(S)._decodeRaw.call(this,o,E,d);continue}if(!(S in d))throw new Error(`Unable to find a matching type definition for ${S} in ${i}; make sure you passed a generic`);let{name:A,params:_}=this.parseTypeName(d[S]);l[g]=this.getTypeInterface(A)._decodeRaw.call(this,o,_,d)}}return l})}registerEnumType(e,t){for(let a in t){let o=this.tempKey(),u=t[a];u!==null&&!Array.isArray(u)&&typeof u!="string"&&(t[a]=o,this.registerStructType(o,u))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(o,u,d,l){if(!u)throw new Error(`Unable to write enum "${i}", missing data.
|
|
4
4
|
Received: "${u}"`);if(typeof u!="object")throw new Error(`Incorrect data passed into enum "${i}", expected object with properties: "${n.join(" | ")}".
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cD as Dc, V as x, co as oo, aA as Fc, X as ao, c3 as C, ac as Lc, ag as qc } from "./index-
|
|
1
|
+
import { cD as Dc, V as x, co as oo, aA as Fc, X as ao, c3 as C, ac as Lc, ag as qc } from "./index-CttRUMXZ.mjs";
|
|
2
2
|
import { d as Uc } from "./dijkstra-BZM-8g-B.mjs";
|
|
3
|
-
import { e as Ae, s as co } from "./events-
|
|
4
|
-
import { c as E, b as Oe, s as $r, x as lo, r as Mr, H as Bc, a as uo } from "./index-
|
|
5
|
-
import { r as zc, a as ot, g as at, i as be, b as kr, I as ht, f as pe, t as ne, c as ei, z as _i, d as Kc, C as jc, e as In, h as Vc, j as Wc, k as Li, p as Hc, _ as Jc, E as te, y as ce, l as qi, A as Gc, m as Yc, n as xn, o as Qc, s as Xc, T as ho, q as Ui, u as Bi, v as $e, w as et } from "./index-
|
|
6
|
-
import { t as ti, k as fo, c as Zc, s as po, a as fe, b as go, L as el, d as Dt, m as tl, e as ri, g as rl, j as Pn } from "./utf8-
|
|
3
|
+
import { e as Ae, s as co } from "./events-CpW8AkTD.mjs";
|
|
4
|
+
import { c as E, b as Oe, s as $r, x as lo, r as Mr, H as Bc, a as uo } from "./index-BND6j-zd.mjs";
|
|
5
|
+
import { r as zc, a as ot, g as at, i as be, b as kr, I as ht, f as pe, t as ne, c as ei, z as _i, d as Kc, C as jc, e as In, h as Vc, j as Wc, k as Li, p as Hc, _ as Jc, E as te, y as ce, l as qi, A as Gc, m as Yc, n as xn, o as Qc, s as Xc, T as ho, q as Ui, u as Bi, v as $e, w as et } from "./index-BMcGCzso.mjs";
|
|
6
|
+
import { t as ti, k as fo, c as Zc, s as po, a as fe, b as go, L as el, d as Dt, m as tl, e as ri, g as rl, j as Pn } from "./utf8-CDOzcEr-.mjs";
|
|
7
7
|
const il = `Ethereum Signed Message:
|
|
8
8
|
`;
|
|
9
9
|
function mo(r) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BBfGNpdz.js");class o extends Error{constructor(r){super(r)}}class s extends o{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}}const n=e.struct([e.u32("mintAuthorityOption"),e.publicKey("mintAuthority"),e.u64("supply"),e.u8("decimals"),e.bool("isInitialized"),e.u32("freezeAuthorityOption"),e.publicKey("freezeAuthority")]);n.span;async function c(t,r,u=!1,i=e.TOKEN_PROGRAM_ID,O=e.ASSOCIATED_TOKEN_PROGRAM_ID){if(!u&&!e.PublicKey.isOnCurve(r.toBuffer()))throw new s;const[A]=await e.PublicKey.findProgramAddress([r.toBuffer(),i.toBuffer(),t.toBuffer()],O);return A}exports.ASSOCIATED_TOKEN_PROGRAM_ID=e.ASSOCIATED_TOKEN_PROGRAM_ID;exports.TOKEN_2022_PROGRAM_ID=e.TOKEN_2022_PROGRAM_ID;exports.TOKEN_PROGRAM_ID=e.TOKEN_PROGRAM_ID;exports.MintLayout=n;exports.TokenError=o;exports.TokenOwnerOffCurveError=s;exports.getAssociatedTokenAddress=c;
|