most-box 0.3.7 → 0.3.8
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 -1
- package/out/about/index.html +6 -5
- package/out/admin/index.html +0 -0
- package/out/app/index.html +0 -0
- package/out/assets/AccountMenu-C3wvcWtn.js +1 -0
- package/out/assets/{AppShell-CKP_dglR.js → AppShell-BN1uaxn1.js} +1 -1
- package/out/assets/{AppTop-C03PsDr_.js → AppTop-iPNi3cv5.js} +1 -1
- package/out/assets/{CopyButton-ClwBN6Iy.js → CopyButton-BfQ-TOoR.js} +1 -1
- package/out/assets/{MarketingHeader-ChTIIzXG.js → MarketingHeader-Bh6LcQOj.js} +1 -1
- package/out/assets/{MarketingLayout-hkPAtieL.js → MarketingLayout-9X-D6xx4.js} +1 -1
- package/out/assets/{MilkdownEditor-X9MUH_0q.js → MilkdownEditor-4FuwE6Td.js} +1 -1
- package/out/assets/{OpenSidebarButton-CXBAjjCE.js → OpenSidebarButton-09yeNDLa.js} +1 -1
- package/out/assets/arrow-right-DcTPIyLV.js +1 -0
- package/out/assets/{arrow-up-down-DvLSz6Ma.js → arrow-up-down-gcWLrYup.js} +1 -1
- package/out/assets/{channelApi-C5eHetoJ.js → channelApi-DA2GY-k4.js} +1 -1
- package/out/assets/{chatNoteDraft-DTy6In5R.js → chatNoteDraft-D6FEmSXK.js} +1 -1
- package/out/assets/{circle-alert-DXVkx8p8.js → circle-alert-Dg9cBJgj.js} +1 -1
- package/out/assets/{copy-OwXDsstV.js → copy-BofKiKH_.js} +1 -1
- package/out/assets/{download-Cy2BlfKM.js → download-nQ9X-v0q.js} +1 -1
- package/out/assets/{downloadValidation-Dd43i9_9.js → downloadValidation-C0PecvKC.js} +1 -1
- package/out/assets/{external-link-D_AQSgxW.js → external-link-LcGMVTLE.js} +1 -1
- package/out/assets/{file-text-zvTER2mN.js → file-text-f1ij7Al1.js} +1 -1
- package/out/assets/{fingerprint-pattern-BT73ASEB.js → fingerprint-pattern-Z6NfIcxC.js} +1 -1
- package/out/assets/{folder-6pYYnS2-.js → folder-DGTODlX0.js} +1 -1
- package/out/assets/{folder-open-DOJ4bB58.js → folder-open-BKTeAP5z.js} +1 -1
- package/out/assets/{gamepad-2-BYqNgCQr.js → gamepad-2-q3ssU_CE.js} +1 -1
- package/out/assets/{hard-drive-DL1KJHmG.js → hard-drive-CMNAmPI5.js} +1 -1
- package/out/assets/{index-DJzLHA0V.js → index-CCU5Z4K-.js} +7 -6
- package/out/assets/{index.lazy-BQ_Dyw5C.js → index.lazy-1YPf8Ys8.js} +1 -1
- package/out/assets/{index.lazy-b811JgFg.js → index.lazy-7EjTGodD.js} +1 -1
- package/out/assets/{index.lazy-CT5TGyGl.js → index.lazy-B2-v2OGR.js} +1 -1
- package/out/assets/{index.lazy-CnpeKB4C.js → index.lazy-BBsa7aDt.js} +1 -1
- package/out/assets/{index.lazy-DYhpVW5B.js → index.lazy-BJh0zxMI.js} +1 -1
- package/out/assets/{index.lazy-C8luNCxY.js → index.lazy-BMh0Oy3C.js} +1 -1
- package/out/assets/{index.lazy-Cy249kq1.js → index.lazy-Bi5tHgok.js} +1 -1
- package/out/assets/{index.lazy-DA98XQ0Q.js → index.lazy-CbtY_wql.js} +1 -1
- package/out/assets/{index.lazy-psYKmxdW.js → index.lazy-CsgZmOLX.js} +1 -1
- package/out/assets/{index.lazy-Cgrv1NmQ.js → index.lazy-D9zm7DgW.js} +1 -1
- package/out/assets/{index.lazy-B8ud1tpC.js → index.lazy-DH1bcYry.js} +1 -1
- package/out/assets/{index.lazy-BEDWJZPP.js → index.lazy-DQA4yE6c.js} +1 -1
- package/out/assets/{index.lazy-CTLlLPjy.js → index.lazy-DhhSG0Me.js} +1 -1
- package/out/assets/{index.lazy-C0L9TDqK.js → index.lazy-Dl8LX4dH.js} +1 -1
- package/out/assets/{index.lazy-CwAN1t6l.js → index.lazy-Q-Lr-abQ.js} +2 -2
- package/out/assets/{loader-C4pED_QP.js → loader-DAMqAKH7.js} +1 -1
- package/out/assets/{lock-yG7M7GkB.js → lock-Cigqt_VP.js} +1 -1
- package/out/assets/{message-square-CfApq8Ou.js → message-square-0kQmuMcd.js} +1 -1
- package/out/assets/{mp-cEQteKUC.js → mp-CFhRibX9.js} +1 -1
- package/out/assets/{music-Br2x8TKX.js → music-U7NZcQ6S.js} +1 -1
- package/out/assets/{notebook-pen-Bcd3MrtD.js → notebook-pen-CMRWy6ni.js} +1 -1
- package/out/assets/play-B6IGTGxm.js +1 -0
- package/out/assets/{refresh-cw-CfkUlTK9.js → refresh-cw-Bxmcm8cn.js} +1 -1
- package/out/assets/{save-CfYzXcxH.js → save-CQyJvrmI.js} +1 -1
- package/out/assets/{saveLocalFile-DTgdBgO9.js → saveLocalFile-DkrpR5WS.js} +1 -1
- package/out/assets/search-CURHlVZZ.js +1 -0
- package/out/assets/{send-Bie9hgHI.js → send-yxXCy-t8.js} +1 -1
- package/out/assets/{shield-check-2-h_eEXp.js → shield-check-Cq1PKT30.js} +1 -1
- package/out/assets/{smartphone-CrsocYJo.js → smartphone-D9j5h2Pg.js} +1 -1
- package/out/assets/{trash-2-B9gno5q6.js → trash-2-DQI0V0Rl.js} +1 -1
- package/out/assets/{triangle-alert-BhNtjKm2.js → triangle-alert-D8P4Ikwc.js} +1 -1
- package/out/assets/{upload-BmufnMFu.js → upload-PpzkqJnf.js} +1 -1
- package/out/assets/{useAppStore-DNhyhD20.js → useAppStore-Pjif7nCR.js} +1 -1
- package/out/assets/{useChannelMessages-BrqZa2SG.js → useChannelMessages-Ea1I0HsF.js} +1 -1
- package/out/assets/{useGameRoom-B3wvUICl.js → useGameRoom-CqeouPP_.js} +1 -1
- package/out/assets/{wallet-D6HZocla.js → wallet-Ts6jdQzi.js} +1 -1
- package/out/assets/{wifi-CILQyKk0.js → wifi-B1v_i_dr.js} +1 -1
- package/out/chat/index.html +0 -0
- package/out/chat/join/demo/index.html +0 -0
- package/out/chat/join/index.html +0 -0
- package/out/download/index.html +6 -5
- package/out/game/gandengyan/index.html +0 -0
- package/out/game/index.html +0 -0
- package/out/game/zhajinhua/index.html +0 -0
- package/out/index.html +6 -5
- package/out/note/index.html +0 -0
- package/out/ping/index.html +6 -5
- package/out/profile/index.html +0 -0
- package/out/web3/index.html +0 -0
- package/package.json +1 -1
- package/out/assets/AccountMenu-D_rcXDZr.js +0 -1
- package/out/assets/arrow-right-BsHzC0ZL.js +0 -1
- package/out/assets/play-DSHtNcOe.js +0 -1
- package/out/assets/search-DLBOUfny.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{a as e,i as t,n,o as r,r as i,t as a}from"./jsx-runtime-Bt-cYkS5.js";import{n as o,o as s,r as c,s as l}from"./useNavigate-DWlBD_-b.js";var u=i((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),d=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()}));function f(e){return e[e.length-1]}function p(e){return typeof e==`function`}function m(e,t){return p(e)?e(t):e}var h=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;function _(e){for(let t in e)if(h.call(e,t))return!0;return!1}var v=()=>Object.create(null),y=(e,t)=>b(e,t,v);function b(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=w(e)&&w(i);if(!a&&!(S(e)&&S(i)))return i;let o=a?e:x(e);if(!o)return i;let s=a?i:x(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:h.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=b(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function x(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!g.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!g.call(e,t))return!1;r.push(t)}return r}function S(e){if(!C(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!C(n)||!n.hasOwnProperty(`isPrototypeOf`))}function C(e){return Object.prototype.toString.call(e)===`[object Object]`}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!T(e[r],t[r],n))return!1;return!0}if(S(e)&&S(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!T(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!T(e[o],t[o],n)))return!1;return i===a}return!1}function E(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function D(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function O(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function k(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function A(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return k(t)}var j=[`http:`,`https:`,`mailto:`,`tel:`];function M(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var N={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},P=/[&><\u2028\u2029]/g;function F(e){return e.replace(P,e=>N[e])}function I(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=A(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=A(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function L(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function R(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function z(){throw Error(`Invariant failed`)}function B(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var V=4,H=5;function ee(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function U(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ee(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function W(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=U(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=te(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=te(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ne(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ne(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=ne(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=te(n.fullPath??n.from);e.kind=H,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=te(n.fullPath??n.from);e.kind=V,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)W(e,t,r,s,i,a,o)}function G(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function K(e){if(e.pathless)for(let t of e.pathless)K(t);if(e.static)for(let t of e.static.values())K(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())K(t);if(e.dynamic?.length){e.dynamic.sort(G);for(let t of e.dynamic)K(t)}if(e.optional?.length){e.optional.sort(G);for(let t of e.optional)K(t)}if(e.wildcard?.length){e.wildcard.sort(G);for(let t of e.wildcard)K(t)}}function te(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function ne(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function re(e,t){let n=te(`/`),r=new Uint16Array(6);for(let t of e)W(!1,r,t,1,n,0);K(n),t.masksTree=n,t.flatCache=B(1e3)}function ie(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=le(e,t.masksTree);return t.flatCache.set(e,r),r}function ae(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=te(`/`),W(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),le(r,o,n)}function oe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=le(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=de(a.route)),t.matchCache.set(r,a),a}function se(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ce(e,t=!1,n){let r=te(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return W(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&z(),a[e.id]=e,s!==0&&e.path){let t=se(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),K(r),{processedTree:{segmentTree:r,singleCache:B(1e3),matchCache:B(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function le(e,t,n=!1){let r=e.split(`/`),i=pe(e,r,t,n);if(!i)return null;let[a]=ue(e,r,i);return{route:i.node.route,rawParams:a}}function ue(e,t,n){let r=fe(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===V)break;if(u.kind===H){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function de(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function fe(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function pe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!f(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!_e(l,n))continue;if(i.parse){if(!ge(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==V&&_e(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===V||i.kind===2)&&_e(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(ge(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&he(p,o))return n;_e(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+me(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+me(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+me(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+me(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function me(e,t){return 2**(e-t-1)}function he(e,t){return e===2**(t-1)-1}function ge(e,t,n){let r,i;try{[r,i]=ue(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function _e(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===V)>(e.node.kind===V)||t.node.kind===V==(e.node.kind===V)&&t.depth>e.depth))):!0}function ve(e){return ye(e.filter(e=>e!==void 0).join(`/`))}function ye(e){return e.replace(/\/{2,}/g,`/`)}function be(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function xe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Se(e){return xe(be(e))}function Ce(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function we(e,t,n){return Ce(e,n)===Ce(t,n)}function Te({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&f(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(f(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=ye(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Ee(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function De(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>ke(e,n)).join(`/`):ke(r,n):r}function Oe({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=U(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=De(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=De(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=De(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function ke(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ae(e){return e?.isNotFound===!0}var je=`__root__`;function Me(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ne(e){return e instanceof Response&&!!e.options}function Pe(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return Me(e)}var Fe=`Error preloading route! ☝️`,Ie=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=je:this.parentRoute||z();let r=n?je:t?.path;r&&r!==`/`&&(r=be(r));let i=t?.id||r,a=n?je:ve([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=ve([`/`,a]));let o=a===`__root__`?`/`:ve([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=xe(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Me({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Le=class extends Ie{constructor(e){super(e)}},q=r(n(),1),Re=a();function ze({children:e,fallback:t=null}){return Be()?(0,Re.jsx)(q.Fragment,{children:e}):(0,Re.jsx)(q.Fragment,{children:t})}function Be(){return q.useSyncExternalStore(Ve,()=>!0,()=>!1)}function Ve(){return()=>{}}var He=q.createContext(void 0),Ue=q.createContext(void 0),We=i((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ge=i(((e,t)=>{t.exports=We()})),Ke=i((e=>{var t=n(),r=Ge();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),qe=i(((e,t)=>{t.exports=Ke()}))();function Je(e,t){return e===t}function Ye(e,t,n=Je){let r=(0,q.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,q.useCallback)(()=>e?.get(),[e]);return(0,qe.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Xe={get(){},subscribe(){return{unsubscribe(){}}}};function Ze(e,t){let n=q.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=b(n.current,i):i}}function Qe(e){let t=c(),n=q.useContext(e.from?Ue:He),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Ze(e,t),a=Ye(r??Xe,e=>e?i(e):Xe);if(a!==Xe)return a;(e.shouldThrow??!0)&&z()}function $e(e){return Qe({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}var et=d();function tt(e,t){let n=c(),r=s(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,preloadIntentProximity:p,hashScrollIntoView:h,replace:g,startTransition:_,resetScroll:v,viewTransition:y,children:b,target:x,disabled:S,style:C,className:w,onClick:E,onBlur:D,onFocus:O,onMouseEnter:k,onMouseLeave:A,onTouchStart:j,ignoreBlocker:N,params:P,search:F,hash:I,state:L,mask:R,reloadDocument:z,unsafeRelative:B,from:V,_fromLocation:H,...ee}=e,U=Be(),W=q.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),G=Ye(n.stores.location,e=>e,(e,t)=>e.href===t.href),K=q.useMemo(()=>{let e={_fromLocation:G,...W};return n.buildLocation(e)},[n,G,W]),te=K.maskedLocation?K.maskedLocation.publicHref:K.publicHref,ne=K.maskedLocation?K.maskedLocation.external:K.external,re=q.useMemo(()=>ut(te,ne,n.history,S),[S,ne,te,n.history]),ie=q.useMemo(()=>{if(re?.external)return M(re.href,n.protocolAllowlist)?void 0:re.href;if(!dt(u)&&!(typeof u!=`string`||u.indexOf(`:`)===-1))try{return new URL(u),M(u,n.protocolAllowlist)?void 0:u}catch{}},[u,re,n.protocolAllowlist]),ae=q.useMemo(()=>{if(ie)return!1;if(o?.exact){if(!we(G.pathname,K.pathname,n.basepath))return!1}else{let e=Ce(G.pathname,n.basepath),t=Ce(K.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!T(G.search,K.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?U&&G.hash===K.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,G,ie,U,K.hash,K.pathname,K.search,n.basepath]),oe=ae?m(i,{})??rt:nt,se=ae?nt:m(a,{})??nt,ce=[w,oe.className,se.className].filter(Boolean).join(` `),le=(C||oe.style||se.style)&&{...C,...oe.style,...se.style},[ue,de]=q.useState(!1),fe=q.useRef(!1),pe=e.reloadDocument||ie?!1:d??n.options.defaultPreload,me=f??n.options.defaultPreloadDelay??0,he=q.useCallback(()=>{n.preloadRoute({...W,_builtLocation:K}).catch(e=>{console.warn(e),console.warn(Fe)})},[n,W,K]);l(r,q.useCallback(e=>{e?.isIntersecting&&he()},[he]),ct,{disabled:!!S||pe!==`viewport`}),q.useEffect(()=>{fe.current||!S&&pe===`render`&&(he(),fe.current=!0)},[S,he,pe]);let ge=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!pt(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,et.flushSync)(()=>{de(!0)});let t=n.subscribe(`onResolved`,()=>{t(),de(!1)});n.navigate({...W,replace:g,resetScroll:v,hashScrollIntoView:h,startTransition:_,viewTransition:y,ignoreBlocker:N})}};if(ie)return{...ee,ref:r,href:ie,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...E&&{onClick:E},...D&&{onBlur:D},...O&&{onFocus:O},...k&&{onMouseEnter:k},...A&&{onMouseLeave:A},...j&&{onTouchStart:j}};let _e=e=>{if(S||pe!==`intent`)return;if(!me){he();return}let t=e.currentTarget;if(st.has(t))return;let n=setTimeout(()=>{st.delete(t),he()},me);st.set(t,n)},ve=e=>{S||pe!==`intent`||he()},ye=e=>{if(S||!pe||!me)return;let t=e.currentTarget,n=st.get(t);n&&(clearTimeout(n),st.delete(t))};return{...ee,...oe,...se,href:re?.href,ref:r,onClick:lt([E,ge]),onBlur:lt([D,ye]),onFocus:lt([O,_e]),onMouseEnter:lt([k,_e]),onMouseLeave:lt([A,ye]),onTouchStart:lt([j,ve]),disabled:!!S,target:x,...le&&{style:le},...ce&&{className:ce},...S&&it,...ae&&at,...U&&ue&&ot}}var nt={},rt={className:`active`},it={role:`link`,"aria-disabled":!0},at={"data-status":`active`,"aria-current":`page`},ot={"data-transitioning":`transitioning`},st=new WeakMap,ct={rootMargin:`100px`},lt=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ut(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function dt(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ft=q.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=tt(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return q.createElement(`a`,t,o)}return q.createElement(n,a,o)});function pt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mt(e){return Qe({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ht(e){let{select:t,...n}=e;return Qe({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function gt(e){return Qe({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function _t(e){return Qe({...e,select:t=>e.select?e.select(t.context):t.context})}var vt=class extends Ie{constructor(e){super(e),this.useMatch=e=>Qe({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>_t({...e,from:this.id}),this.useSearch=e=>gt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>$e({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ht({...e,from:this.id}),this.useLoaderData=e=>mt({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,Re.jsx)(ft,{ref:t,from:this.fullPath,...e}))}};function yt(e){return new vt(e)}var bt=class extends Le{constructor(e){super(e),this.useMatch=e=>Qe({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>_t({...e,from:this.id}),this.useSearch=e=>gt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>$e({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ht({...e,from:this.id}),this.useLoaderData=e=>mt({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,Re.jsx)(ft,{ref:t,from:this.fullPath,...e}))}};function xt(e){return new bt(e)}function St(e){return new Ct(e,{silent:!0}).createRoute}var Ct=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=yt(e);return t.isRoot=!1,t},this.silent=t?.silent}},wt=class{constructor(e){this.useMatch=e=>Qe({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>_t({...e,from:this.options.id}),this.useSearch=e=>gt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>$e({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>ht({...e,from:this.options.id}),this.useLoaderData=e=>mt({...e,from:this.options.id}),this.useNavigate=()=>o({from:c().routesById[this.options.id].fullPath}),this.options=e}};function Tt(e){return typeof e==`object`?new wt(e):t=>new wt({id:e,...t})}var Et=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Dt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ot=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),kt=e=>{let t=Ot(e);return t.charAt(0).toUpperCase()+t.slice(1)},At={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},jt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Mt=(0,q.createContext)({}),Nt=()=>(0,q.useContext)(Mt),Pt=(0,q.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Nt()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,q.createElement)(`svg`,{ref:c,...At,width:t??l??At.width,height:t??l??At.height,stroke:e??f,strokeWidth:m,className:Et(`lucide`,p,i),...!a&&!jt(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,q.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ft=(e,t)=>{let n=(0,q.forwardRef)(({className:n,...r},i)=>(0,q.createElement)(Pt,{ref:i,iconNode:t,className:Et(`lucide-${Dt(kt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=kt(e),n},It=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Lt=(e=>e?It(e):It),Rt=e=>e;function zt(e,t=Rt){let n=q.useSyncExternalStore(e.subscribe,q.useCallback(()=>t(e.getState()),[e,t]),q.useCallback(()=>t(e.getInitialState()),[e,t]));return q.useDebugValue(n),n}var Bt=e=>{let t=Lt(e),n=e=>zt(t,e);return Object.assign(n,t),n},Vt=(e=>e?Bt(e):Bt);function Ht(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function Ut(e,...t){if(!(e instanceof Uint8Array))throw Error(`Expected Uint8Array`);if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Wt(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);Ht(e.outputLen),Ht(e.blockLen)}function Gt(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Kt(e,t){Ut(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var qt=e=>e instanceof Uint8Array,Jt=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Yt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Xt=(e,t)=>e<<32-t|e>>>t;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw Error(`Non little-endian hardware is not supported`);var Zt=async()=>{};async function Qt(e,t,n){let r=Date.now();for(let i=0;i<e;i++){n(i);let e=Date.now()-r;e>=0&&e<t||(await Zt(),r+=e)}}function $t(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function en(e){if(typeof e==`string`&&(e=$t(e)),!qt(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}var tn=class{clone(){return this._cloneInto()}},nn={}.toString;function rn(e,t){if(t!==void 0&&nn.call(t)!==`[object Object]`)throw Error(`Options should be object or undefined`);return Object.assign(e,t)}function an(e){let t=t=>e().update(en(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var on=class extends tn{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Wt(e);let n=en(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Gt(this),this.iHash.update(e),this}digestInto(e){Gt(this),Ut(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},sn=(e,t,n)=>new on(e,t).update(n).digest();sn.create=(e,t)=>new on(e,t);function cn(e,t,n,r){Wt(e);let{c:i,dkLen:a,asyncTick:o}=rn({dkLen:32,asyncTick:10},r);if(Ht(i),Ht(a),Ht(o),i<1)throw Error(`PBKDF2: iterations (c) should be >= 1`);let s=en(t),c=en(n),l=new Uint8Array(a),u=sn.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function ln(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),i.fill(0),n}function un(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=cn(e,t,n,r),l,u=new Uint8Array(4),d=Yt(u),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){let n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(l=c._cloneInto(l)).update(u).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(l).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return ln(s,c,o,l,f)}function dn(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var fn=class extends tn{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Yt(this.buffer)}update(e){Gt(this);let{view:t,buffer:n,blockLen:r}=this;e=en(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Yt(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Gt(this),Kt(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;dn(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Yt(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},pn=(e,t,n)=>e&t^~e&n,mn=(e,t,n)=>e&t^e&n^t&n,hn=new Uint32Array([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]),gn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_n=new Uint32Array(64),vn=class extends fn{constructor(){super(64,32,8,!1),this.A=gn[0]|0,this.B=gn[1]|0,this.C=gn[2]|0,this.D=gn[3]|0,this.E=gn[4]|0,this.F=gn[5]|0,this.G=gn[6]|0,this.H=gn[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)_n[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=_n[e-15],n=_n[e-2],r=Xt(t,7)^Xt(t,18)^t>>>3;_n[e]=(Xt(n,17)^Xt(n,19)^n>>>10)+_n[e-7]+r+_n[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Xt(o,6)^Xt(o,11)^Xt(o,25),u=l+t+pn(o,s,c)+hn[e]+_n[e]|0,d=(Xt(n,2)^Xt(n,13)^Xt(n,22))+mn(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){_n.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},yn=an(()=>new vn),bn=BigInt(2**32-1),xn=BigInt(32);function Sn(e,t=!1){return t?{h:Number(e&bn),l:Number(e>>xn&bn)}:{h:Number(e>>xn&bn)|0,l:Number(e&bn)|0}}function Cn(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:a,l:o}=Sn(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}var wn=(e,t)=>BigInt(e>>>0)<<xn|BigInt(t>>>0),Tn=(e,t,n)=>e>>>n,En=(e,t,n)=>e<<32-n|t>>>n,Dn=(e,t,n)=>e>>>n|t<<32-n,On=(e,t,n)=>e<<32-n|t>>>n,kn=(e,t,n)=>e<<64-n|t>>>n-32,An=(e,t,n)=>e>>>n-32|t<<64-n,jn=(e,t)=>t,Mn=(e,t)=>e,Nn=(e,t,n)=>e<<n|t>>>32-n,Pn=(e,t,n)=>t<<n|e>>>32-n,Fn=(e,t,n)=>t<<n-32|e>>>64-n,In=(e,t,n)=>e<<n-32|t>>>64-n;function Ln(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var J={fromBig:Sn,split:Cn,toBig:wn,shrSH:Tn,shrSL:En,rotrSH:Dn,rotrSL:On,rotrBH:kn,rotrBL:An,rotr32H:jn,rotr32L:Mn,rotlSH:Nn,rotlSL:Pn,rotlBH:Fn,rotlBL:In,add:Ln,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},[Rn,zn]=J.split(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Bn=new Uint32Array(80),Vn=new Uint32Array(80),Hn=class extends fn{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)Bn[n]=e.getUint32(t),Vn[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=Bn[e-15]|0,n=Vn[e-15]|0,r=J.rotrSH(t,n,1)^J.rotrSH(t,n,8)^J.shrSH(t,n,7),i=J.rotrSL(t,n,1)^J.rotrSL(t,n,8)^J.shrSL(t,n,7),a=Bn[e-2]|0,o=Vn[e-2]|0,s=J.rotrSH(a,o,19)^J.rotrBH(a,o,61)^J.shrSH(a,o,6),c=J.rotrSL(a,o,19)^J.rotrBL(a,o,61)^J.shrSL(a,o,6),l=J.add4L(i,c,Vn[e-7],Vn[e-16]);Bn[e]=J.add4H(l,r,s,Bn[e-7],Bn[e-16])|0,Vn[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=J.rotrSH(u,d,14)^J.rotrSH(u,d,18)^J.rotrBH(u,d,41),v=J.rotrSL(u,d,14)^J.rotrSL(u,d,18)^J.rotrBL(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=J.add5L(_,v,b,zn[e],Vn[e]),S=J.add5H(x,g,t,y,Rn[e],Bn[e]),C=x|0,w=J.rotrSH(n,r,28)^J.rotrBH(n,r,34)^J.rotrBH(n,r,39),T=J.rotrSL(n,r,28)^J.rotrBL(n,r,34)^J.rotrBL(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=J.add(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let O=J.add3L(C,T,D);n=J.add3H(O,S,w,E),r=O|0}({h:n,l:r}=J.add(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=J.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=J.add(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=J.add(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=J.add(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=J.add(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=J.add(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=J.add(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){Bn.fill(0),Vn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Un=an(()=>new Hn),Wn=`6.17.0`;function Gn(e,t,n){let r=t.split(`|`).map(e=>e.trim());for(let n=0;n<r.length;n++)switch(t){case`any`:return;case`bigint`:case`boolean`:case`number`:case`string`:if(typeof e===t)return}let i=Error(`invalid value for type ${t}`);throw i.code=`INVALID_ARGUMENT`,i.argument=`value.${n}`,i.value=e,i}async function Kn(e){let t=Object.keys(e);return(await Promise.all(t.map(t=>Promise.resolve(e[t])))).reduce((e,n,r)=>(e[t[r]]=n,e),{})}function qn(e,t,n){for(let r in t){let i=t[r],a=n?n[r]:null;a&&Gn(i,a,r),Object.defineProperty(e,r,{enumerable:!0,value:i,writable:!1})}}function Jn(e,t){if(e==null)return`null`;if(t??=new Set,typeof e==`object`){if(t.has(e))return`[Circular]`;t.add(e)}if(Array.isArray(e))return`[ `+e.map(e=>Jn(e,t)).join(`, `)+` ]`;if(e instanceof Uint8Array){let t=`0123456789abcdef`,n=`0x`;for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[e[r]&15];return n}if(typeof e==`object`&&typeof e.toJSON==`function`)return Jn(e.toJSON(),t);switch(typeof e){case`boolean`:case`number`:case`symbol`:return e.toString();case`bigint`:return BigInt(e).toString();case`string`:return JSON.stringify(e);case`object`:{let n=Object.keys(e);return n.sort(),`{ `+n.map(n=>`${Jn(n,t)}: ${Jn(e[n],t)}`).join(`, `)+` }`}}return`[ COULD NOT SERIALIZE ]`}function Yn(e,t,n){let r=e;{let r=[];if(n){if(`message`in n||`code`in n||`name`in n)throw Error(`value will overwrite populated values: ${Jn(n)}`);for(let e in n){if(e===`shortMessage`)continue;let t=n[e];r.push(e+`=`+Jn(t))}}r.push(`code=${t}`),r.push(`version=${Wn}`),r.length&&(e+=` (`+r.join(`, `)+`)`)}let i;switch(t){case`INVALID_ARGUMENT`:i=TypeError(e);break;case`NUMERIC_FAULT`:case`BUFFER_OVERRUN`:i=RangeError(e);break;default:i=Error(e)}return qn(i,{code:t}),n&&Object.assign(i,n),i.shortMessage??qn(i,{shortMessage:r}),i}function Y(e,t,n,r){if(!e)throw Yn(t,n,r)}function X(e,t,n,r){Y(e,t,`INVALID_ARGUMENT`,{argument:n,value:r})}var Xn=[`NFD`,`NFC`,`NFKD`,`NFKC`].reduce((e,t)=>{try{if(`test`.normalize(t)!==`test`)throw Error(`bad`);if(t===`NFD`&&`é`.normalize(`NFD`)!==`é`)throw Error(`broken`);e.push(t)}catch{}return e},[]);function Zn(e){Y(Xn.indexOf(e)>=0,`platform missing String.prototype.normalize`,`UNSUPPORTED_OPERATION`,{operation:`String.prototype.normalize`,info:{form:e}})}function Qn(e,t,n){if(n??=``,e!==t){let e=n,t=`new`;n&&(e+=`.`,t+=` `+n),Y(!1,`private constructor; use ${e}from* methods`,`UNSUPPORTED_OPERATION`,{operation:t})}}function $n(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if(typeof e==`string`&&e.length%2==0&&e.match(/^0x[0-9a-f]*$/i)){let t=new Uint8Array((e.length-2)/2),n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}X(!1,`invalid BytesLike value`,t||`value`,e)}function Z(e,t){return $n(e,t,!1)}function er(e,t){return $n(e,t,!0)}function tr(e,t){return!(typeof e!=`string`||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t==`number`&&e.length!==2+2*t||t===!0&&e.length%2!=0)}function nr(e){return tr(e,!0)||e instanceof Uint8Array}var rr=`0123456789abcdef`;function Q(e){let t=Z(e),n=`0x`;for(let e=0;e<t.length;e++){let r=t[e];n+=rr[(r&240)>>4]+rr[r&15]}return n}function ir(e){return`0x`+e.map(e=>Q(e).substring(2)).join(``)}function ar(e){return tr(e,!0)?(e.length-2)/2:Z(e).length}function or(e,t,n){let r=Z(e);return n!=null&&n>r.length&&Y(!1,`cannot slice beyond data bounds`,`BUFFER_OVERRUN`,{buffer:r,length:r.length,offset:n}),Q(r.slice(t??0,n??r.length))}function sr(e,t,n){let r=Z(e);Y(t>=r.length,`padding exceeds data length`,`BUFFER_OVERRUN`,{buffer:new Uint8Array(r),length:t,offset:t+1});let i=new Uint8Array(t);return i.fill(0),n?i.set(r,t-r.length):i.set(r,0),Q(i)}function cr(e,t){return sr(e,t,!0)}var lr=BigInt(0),ur=BigInt(1),dr=9007199254740991;function fr(e,t){let n=mr(e,`value`),r=BigInt(vr(t,`width`)),i=ur<<r-ur;if(n<lr){n=-n,Y(n<=i,`too low`,`NUMERIC_FAULT`,{operation:`toTwos`,fault:`overflow`,value:e});let t=(ur<<r)-ur;return(~n&t)+ur}else Y(n<i,`too high`,`NUMERIC_FAULT`,{operation:`toTwos`,fault:`overflow`,value:e});return n}function pr(e,t){return hr(e,`value`)&(ur<<BigInt(vr(t,`bits`)))-ur}function mr(e,t){switch(typeof e){case`bigint`:return e;case`number`:return X(Number.isInteger(e),`underflow`,t||`value`,e),X(e>=-9007199254740991&&e<=dr,`overflow`,t||`value`,e),BigInt(e);case`string`:try{if(e===``)throw Error(`empty string`);return e[0]===`-`&&e[1]!==`-`?-BigInt(e.substring(1)):BigInt(e)}catch(n){X(!1,`invalid BigNumberish string: ${n.message}`,t||`value`,e)}}X(!1,`invalid BigNumberish value`,t||`value`,e)}function hr(e,t){let n=mr(e,t);return Y(n>=lr,`unsigned value cannot be negative`,`NUMERIC_FAULT`,{fault:`overflow`,operation:`getUint`,value:e}),n}var gr=`0123456789abcdef`;function _r(e){if(e instanceof Uint8Array){let t=`0x0`;for(let n of e)t+=gr[n>>4],t+=gr[n&15];return BigInt(t)}return mr(e)}function vr(e,t){switch(typeof e){case`bigint`:return X(e>=-9007199254740991&&e<=dr,`overflow`,t||`value`,e),Number(e);case`number`:return X(Number.isInteger(e),`underflow`,t||`value`,e),X(e>=-9007199254740991&&e<=dr,`overflow`,t||`value`,e),e;case`string`:try{if(e===``)throw Error(`empty string`);return vr(BigInt(e),t)}catch(n){X(!1,`invalid numeric string: ${n.message}`,t||`value`,e)}}X(!1,`invalid numeric value`,t||`value`,e)}function yr(e,t){let n=hr(e,`value`),r=n.toString(16);if(t==null)r.length%2&&(r=`0`+r);else{let i=vr(t,`width`);if(i===0&&n===lr)return`0x`;for(Y(i*2>=r.length,`value exceeds width (${i} bytes)`,`NUMERIC_FAULT`,{operation:`toBeHex`,fault:`overflow`,value:e});r.length<i*2;)r=`0`+r}return`0x`+r}function br(e,t){let n=hr(e,`value`);if(n===lr){let e=t==null?0:vr(t,`width`);return new Uint8Array(e)}let r=n.toString(16);if(r.length%2&&(r=`0`+r),t!=null){let n=vr(t,`width`);for(;r.length<n*2;)r=`00`+r;Y(n*2===r.length,`value exceeds width (${n} bytes)`,`NUMERIC_FAULT`,{operation:`toBeArray`,fault:`overflow`,value:e})}let i=new Uint8Array(r.length/2);for(let e=0;e<i.length;e++){let t=e*2;i[e]=parseInt(r.substring(t,t+2),16)}return i}function xr(e){let t=Q(nr(e)?e:br(e)).substring(2);for(;t.startsWith(`0`);)t=t.substring(1);return t===``&&(t=`0`),`0x`+t}var Sr=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,Cr=null;function wr(e){if(Cr==null){Cr={};for(let e=0;e<58;e++)Cr[Sr[e]]=BigInt(e)}let t=Cr[e];return X(t!=null,`invalid base58 value`,`letter`,e),t}var Tr=BigInt(0),Er=BigInt(58);function Dr(e){let t=Z(e),n=_r(t),r=``;for(;n;)r=Sr[Number(n%Er)]+r,n/=Er;for(let e=0;e<t.length&&!t[e];e++)r=Sr[0]+r;return r}function Or(e){let t=Tr;for(let n=0;n<e.length;n++)t*=Er,t+=wr(e[n]);return t}function kr(e){e=atob(e);let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return Z(t)}function Ar(e){let t=Z(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function jr(e){let t=e.toString(16);for(;t.length<2;)t=`0`+t;return`0x`+t}function Mr(e,t,n){let r=0;for(let i=0;i<n;i++)r=r*256+e[t+i];return r}function Nr(e,t,n,r){let i=[];for(;n<t+1+r;){let a=Pr(e,n);i.push(a.result),n+=a.consumed,Y(n<=t+1+r,`child data too short`,`BUFFER_OVERRUN`,{buffer:e,length:r,offset:t})}return{consumed:1+r,result:i}}function Pr(e,t){Y(e.length!==0,`data too short`,`BUFFER_OVERRUN`,{buffer:e,length:0,offset:1});let n=t=>{Y(t<=e.length,`data short segment too short`,`BUFFER_OVERRUN`,{buffer:e,length:e.length,offset:t})};if(e[t]>=248){let r=e[t]-247;n(t+1+r);let i=Mr(e,t+1,r);return n(t+1+r+i),Nr(e,t,t+1+r,r+i)}else if(e[t]>=192){let r=e[t]-192;return n(t+1+r),Nr(e,t,t+1,r)}else if(e[t]>=184){let r=e[t]-183;n(t+1+r);let i=Mr(e,t+1,r);n(t+1+r+i);let a=Q(e.slice(t+1+r,t+1+r+i));return{consumed:1+r+i,result:a}}else if(e[t]>=128){let r=e[t]-128;n(t+1+r);let i=Q(e.slice(t+1,t+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:jr(e[t])}}function Fr(e){let t=Z(e,`data`),n=Pr(t,0);return X(n.consumed===t.length,`unexpected junk after rlp payload`,`data`,e),n.result}function Ir(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function Lr(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(Lr(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=Ir(t.length);return n.unshift(247+n.length),n.concat(t)}let t=Array.prototype.slice.call(Z(e,`object`));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=Ir(t.length);return n.unshift(183+n.length),n.concat(t)}var Rr=`0123456789abcdef`;function zr(e){let t=`0x`;for(let n of Lr(e))t+=Rr[n>>4],t+=Rr[n&15];return t}function Br(e,t,n,r,i){X(!1,`invalid codepoint at offset ${t}; ${e}`,`bytes`,n)}function Vr(e,t,n,r,i){if(e===`BAD_PREFIX`||e===`UNEXPECTED_CONTINUE`){let e=0;for(let r=t+1;r<n.length&&n[r]>>6==2;r++)e++;return e}return e===`OVERRUN`?n.length-t-1:0}function Hr(e,t,n,r,i){return e===`OVERLONG`?(X(typeof i==`number`,`invalid bad code point for replacement`,`badCodepoint`,i),r.push(i),0):(r.push(65533),Vr(e,t,n,r,i))}Object.freeze({error:Br,ignore:Vr,replace:Hr});function Ur(e,t){X(typeof e==`string`,`invalid string value`,`str`,e),t!=null&&(Zn(t),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(r&63|128);else if((r&64512)==55296){t++;let i=e.charCodeAt(t);X(t<e.length&&(i&64512)==56320,`invalid surrogate pair`,`str`,e);let a=65536+((r&1023)<<10)+(i&1023);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(a&63|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(r&63|128)}return new Uint8Array(n)}function Wr(e){let t=Z(e,`randomBytes`);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Q(t);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join(`-`)}function Gr(){if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)}var Kr=Gr(),qr=Kr.crypto||Kr.msCrypto;function Jr(e){switch(e){case`sha256`:return yn.create();case`sha512`:return Un.create()}X(!1,`invalid hashing algorithm name`,`algorithm`,e)}function Yr(e,t){let n={sha256:yn,sha512:Un}[e];return X(n!=null,`invalid hmac algorithm`,`algorithm`,e),sn.create(n,t)}function Xr(e,t,n,r,i){let a={sha256:yn,sha512:Un}[i];return X(a!=null,`invalid pbkdf2 algorithm`,`algorithm`,i),un(a,e,t,{c:n,dkLen:r})}function Zr(e){Y(qr!=null,`platform does not support secure random numbers`,`UNSUPPORTED_OPERATION`,{operation:`randomBytes`}),X(Number.isInteger(e)&&e>0&&e<=1024,`invalid length`,`length`,e);let t=new Uint8Array(e);return qr.getRandomValues(t),t}var Qr=!1,$r=function(e,t,n){return Yr(e,t).update(n).digest()},ei=$r;function ti(e,t,n){let r=Z(t,`key`),i=Z(n,`data`);return Q(ei(e,r,i))}ti._=$r,ti.lock=function(){Qr=!0},ti.register=function(e){if(Qr)throw Error(`computeHmac is locked`);ei=e},Object.freeze(ti);var[ni,ri,ii]=[[],[],[]],ai=BigInt(0),oi=BigInt(1),si=BigInt(2),ci=BigInt(7),li=BigInt(256),ui=BigInt(113);for(let e=0,t=oi,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],ni.push(2*(5*r+n)),ri.push((e+1)*(e+2)/2%64);let i=ai;for(let e=0;e<7;e++)t=(t<<oi^(t>>ci)*ui)%li,t&si&&(i^=oi<<(oi<<BigInt(e))-oi);ii.push(i)}var[di,fi]=Cn(ii,!0),pi=(e,t,n)=>n>32?Fn(e,t,n):Nn(e,t,n),mi=(e,t,n)=>n>32?In(e,t,n):Pn(e,t,n);function hi(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=pi(a,o,1)^n[r],c=mi(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=ri[n],a=pi(t,i,r),o=mi(t,i,r),s=ni[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=di[r],e[1]^=fi[r]}n.fill(0)}var gi=class e extends tn{constructor(e,t,n,r=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ht(n),0>=this.blockLen||this.blockLen>=200)throw Error(`Sha3 supports only keccak-f1600 function`);this.state=new Uint8Array(200),this.state32=Jt(this.state)}keccak(){hi(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Gt(this);let{blockLen:t,state:n}=this;e=en(e);let r=e.length;for(let i=0;i<r;){let a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Gt(this,!1),Ut(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return Ht(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Kt(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},_i=((e,t,n)=>an(()=>new gi(t,e,n)))(1,136,256/8),vi=!1,yi=function(e){return _i(e)},bi=yi;function xi(e){let t=Z(e,`data`);return Q(bi(t))}xi._=yi,xi.lock=function(){vi=!0},xi.register=function(e){if(vi)throw TypeError(`keccak256 is locked`);bi=e},Object.freeze(xi);var Si=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Ci=Uint8Array.from({length:16},(e,t)=>t),wi=Ci.map(e=>(9*e+5)%16),Ti=[Ci],Ei=[wi];for(let e=0;e<4;e++)for(let t of[Ti,Ei])t.push(t[e].map(e=>Si[e]));var Di=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),Oi=Ti.map((e,t)=>e.map(e=>Di[t][e])),ki=Ei.map((e,t)=>e.map(e=>Di[t][e])),Ai=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),ji=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Mi=(e,t)=>e<<t|e>>>32-t;function Ni(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}var Pi=new Uint32Array(16),Fi=class extends fn{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:r,h4:i}=this;return[e,t,n,r,i]}set(e,t,n,r,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=r|0,this.h4=i|0}process(e,t){for(let n=0;n<16;n++,t+=4)Pi[n]=e.getUint32(t,!0);let n=this.h0|0,r=n,i=this.h1|0,a=i,o=this.h2|0,s=o,c=this.h3|0,l=c,u=this.h4|0,d=u;for(let e=0;e<5;e++){let t=4-e,f=Ai[e],p=ji[e],m=Ti[e],h=Ei[e],g=Oi[e],_=ki[e];for(let t=0;t<16;t++){let r=Mi(n+Ni(e,i,o,c)+Pi[m[t]]+f,g[t])+u|0;n=u,u=c,c=Mi(o,10)|0,o=i,i=r}for(let e=0;e<16;e++){let n=Mi(r+Ni(t,a,s,l)+Pi[h[e]]+p,_[e])+d|0;r=d,d=l,l=Mi(s,10)|0,s=a,a=n}}this.set(this.h1+o+l|0,this.h2+c+d|0,this.h3+u+r|0,this.h4+n+a|0,this.h0+i+s|0)}roundClean(){Pi.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},Ii=an(()=>new Fi),Li=!1,Ri=function(e){return Ii(e)},zi=Ri;function Bi(e){let t=Z(e,`data`);return Q(zi(t))}Bi._=Ri,Bi.lock=function(){Li=!0},Bi.register=function(e){if(Li)throw TypeError(`ripemd160 is locked`);zi=e},Object.freeze(Bi);var Vi=!1,Hi=function(e,t,n,r,i){return Xr(e,t,n,r,i)},Ui=Hi;function Wi(e,t,n,r,i){let a=Z(e,`password`),o=Z(t,`salt`);return Q(Ui(a,o,n,r,i))}Wi._=Hi,Wi.lock=function(){Vi=!0},Wi.register=function(e){if(Vi)throw Error(`pbkdf2 is locked`);Ui=e},Object.freeze(Wi);var Gi=!1,Ki=function(e){return new Uint8Array(Zr(e))},qi=Ki;function Ji(e){return qi(e)}Ji._=Ki,Ji.lock=function(){Gi=!0},Ji.register=function(e){if(Gi)throw Error(`randomBytes is locked`);qi=e},Object.freeze(Ji);var Yi=(e,t)=>e<<t|e>>>32-t;function Xi(e,t,n,r,i,a){let o=e[t++]^n[r++],s=e[t++]^n[r++],c=e[t++]^n[r++],l=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],p=e[t++]^n[r++],m=e[t++]^n[r++],h=e[t++]^n[r++],g=e[t++]^n[r++],_=e[t++]^n[r++],v=e[t++]^n[r++],y=e[t++]^n[r++],b=e[t++]^n[r++],x=e[t++]^n[r++],S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I=b,L=x;for(let e=0;e<8;e+=2)E^=Yi(S+P|0,7),A^=Yi(E+S|0,9),P^=Yi(A+E|0,13),S^=Yi(P+A|0,18),j^=Yi(D+C|0,7),F^=Yi(j+D|0,9),C^=Yi(F+j|0,13),D^=Yi(C+F|0,18),I^=Yi(M+O|0,7),w^=Yi(I+M|0,9),O^=Yi(w+I|0,13),M^=Yi(O+w|0,18),T^=Yi(L+N|0,7),k^=Yi(T+L|0,9),N^=Yi(k+T|0,13),L^=Yi(N+k|0,18),C^=Yi(S+T|0,7),w^=Yi(C+S|0,9),T^=Yi(w+C|0,13),S^=Yi(T+w|0,18),O^=Yi(D+E|0,7),k^=Yi(O+D|0,9),E^=Yi(k+O|0,13),D^=Yi(E+k|0,18),N^=Yi(M+j|0,7),A^=Yi(N+M|0,9),j^=Yi(A+N|0,13),M^=Yi(j+A|0,18),P^=Yi(L+I|0,7),F^=Yi(P+L|0,9),I^=Yi(F+P|0,13),L^=Yi(I+F|0,18);i[a++]=o+S|0,i[a++]=s+C|0,i[a++]=c+w|0,i[a++]=l+T|0,i[a++]=u+E|0,i[a++]=d+D|0,i[a++]=f+O|0,i[a++]=p+k|0,i[a++]=m+A|0,i[a++]=h+j|0,i[a++]=g+M|0,i[a++]=_+N|0,i[a++]=v+P|0,i[a++]=y+F|0,i[a++]=b+I|0,i[a++]=x+L|0}function Zi(e,t,n,r,i){let a=r+0,o=r+16*i;for(let r=0;r<16;r++)n[o+r]=e[t+(2*i-1)*16+r];for(let r=0;r<i;r++,a+=16,t+=16)Xi(n,o,e,t,n,a),r>0&&(o+=16),Xi(n,a,e,t+=16,n,o)}function Qi(e,t,n){let{N:r,r:i,p:a,dkLen:o,asyncTick:s,maxmem:c,onProgress:l}=rn({dkLen:32,asyncTick:10,maxmem:1024**3+1024},n);if(Ht(r),Ht(i),Ht(a),Ht(o),Ht(s),Ht(c),l!==void 0&&typeof l!=`function`)throw Error(`progressCb should be function`);let u=128*i,d=u/4;if(r<=1||r&r-1||r>=2**(u/8)||r>2**32)throw Error(`Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32`);if(a<0||a>(2**32-1)*32/u)throw Error(`Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)`);if(o<0||o>(2**32-1)*32)throw Error(`Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32`);let f=u*(r+a);if(f>c)throw Error(`Scrypt: parameters too large, ${f} (128 * r * (N + p)) > ${c} (maxmem)`);let p=un(yn,e,t,{c:1,dkLen:u*a}),m=Jt(p),h=Jt(new Uint8Array(u*r)),g=Jt(new Uint8Array(u)),_=()=>{};if(l){let e=2*r*a,t=Math.max(Math.floor(e/1e4),1),n=0;_=()=>{n++,l&&(!(n%t)||n===e)&&l(n/e)}}return{N:r,r:i,p:a,dkLen:o,blockSize32:d,V:h,B32:m,B:p,tmp:g,blockMixCb:_,asyncTick:s}}function $i(e,t,n,r,i){let a=un(yn,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),i.fill(0),a}function ea(e,t,n){let{N:r,r:i,p:a,dkLen:o,blockSize32:s,V:c,B32:l,B:u,tmp:d,blockMixCb:f}=Qi(e,t,n);for(let e=0;e<a;e++){let t=s*e;for(let e=0;e<s;e++)c[e]=l[t+e];for(let e=0,t=0;e<r-1;e++)Zi(c,t,c,t+=s,i),f();Zi(c,(r-1)*s,l,t,i),f();for(let e=0;e<r;e++){let e=l[t+s-16]%r;for(let n=0;n<s;n++)d[n]=l[t+n]^c[e*s+n];Zi(d,0,l,t,i),f()}}return $i(e,o,u,c,d)}async function ta(e,t,n){let{N:r,r:i,p:a,dkLen:o,blockSize32:s,V:c,B32:l,B:u,tmp:d,blockMixCb:f,asyncTick:p}=Qi(e,t,n);for(let e=0;e<a;e++){let t=s*e;for(let e=0;e<s;e++)c[e]=l[t+e];let n=0;await Qt(r-1,p,()=>{Zi(c,n,c,n+=s,i),f()}),Zi(c,(r-1)*s,l,t,i),f(),await Qt(r,p,()=>{let e=l[t+s-16]%r;for(let n=0;n<s;n++)d[n]=l[t+n]^c[e*s+n];Zi(d,0,l,t,i),f()})}return $i(e,o,u,c,d)}var na=!1,ra=!1,ia=async function(e,t,n,r,i,a,o){return await ta(e,t,{N:n,r,p:i,dkLen:a,onProgress:o})},aa=function(e,t,n,r,i,a){return ea(e,t,{N:n,r,p:i,dkLen:a})},oa=ia,sa=aa;async function ca(e,t,n,r,i,a,o){let s=Z(e,`passwd`),c=Z(t,`salt`);return Q(await oa(s,c,n,r,i,a,o))}ca._=ia,ca.lock=function(){ra=!0},ca.register=function(e){if(ra)throw Error(`scrypt is locked`);oa=e},Object.freeze(ca);function la(e,t,n,r,i,a){let o=Z(e,`passwd`),s=Z(t,`salt`);return Q(sa(o,s,n,r,i,a))}la._=aa,la.lock=function(){na=!0},la.register=function(e){if(na)throw Error(`scryptSync is locked`);sa=e},Object.freeze(la);var ua=function(e){return Jr(`sha256`).update(e).digest()},da=function(e){return Jr(`sha512`).update(e).digest()},fa=ua,pa=da,ma=!1,ha=!1;function ga(e){let t=Z(e,`data`);return Q(fa(t))}ga._=ua,ga.lock=function(){ma=!0},ga.register=function(e){if(ma)throw Error(`sha256 is locked`);fa=e},Object.freeze(ga);function _a(e){let t=Z(e,`data`);return Q(pa(t))}_a._=da,_a.lock=function(){ha=!0},_a.register=function(e){if(ha)throw Error(`sha512 is locked`);pa=e},Object.freeze(ga);function va(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function ya(e,...t){if(!(e instanceof Uint8Array))throw Error(`Expected Uint8Array`);if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function ba(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);va(e.outputLen),va(e.blockLen)}function xa(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Sa(e,t){ya(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var Ca=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0,wa=e=>e instanceof Uint8Array,Ta=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ea=(e,t)=>e<<32-t|e>>>t;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw Error(`Non little-endian hardware is not supported`);function Da(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Oa(e){if(typeof e==`string`&&(e=Da(e)),!wa(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function ka(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!wa(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}var Aa=class{clone(){return this._cloneInto()}};({}).toString;function ja(e){let t=t=>e().update(Oa(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Ma(e=32){if(Ca&&typeof Ca.getRandomValues==`function`)return Ca.getRandomValues(new Uint8Array(e));throw Error(`crypto.getRandomValues must be defined`)}function Na(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var Pa=class extends Aa{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ta(this.buffer)}update(e){xa(this);let{view:t,buffer:n,blockLen:r}=this;e=Oa(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Ta(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){xa(this),Sa(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Na(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Ta(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},Fa=(e,t,n)=>e&t^~e&n,Ia=(e,t,n)=>e&t^e&n^t&n,La=new Uint32Array([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]),Ra=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),za=new Uint32Array(64),Ba=class extends Pa{constructor(){super(64,32,8,!1),this.A=Ra[0]|0,this.B=Ra[1]|0,this.C=Ra[2]|0,this.D=Ra[3]|0,this.E=Ra[4]|0,this.F=Ra[5]|0,this.G=Ra[6]|0,this.H=Ra[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)za[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=za[e-15],n=za[e-2],r=Ea(t,7)^Ea(t,18)^t>>>3;za[e]=(Ea(n,17)^Ea(n,19)^n>>>10)+za[e-7]+r+za[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Ea(o,6)^Ea(o,11)^Ea(o,25),u=l+t+Fa(o,s,c)+La[e]+za[e]|0,d=(Ea(n,2)^Ea(n,13)^Ea(n,22))+Ia(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){za.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Va=ja(()=>new Ba),Ha=t({bitGet:()=>co,bitLen:()=>so,bitMask:()=>uo,bitSet:()=>lo,bytesToHex:()=>Ja,bytesToNumberBE:()=>Qa,bytesToNumberLE:()=>$a,concatBytes:()=>io,createHmacDrbg:()=>mo,ensureBytes:()=>ro,equalBytes:()=>ao,hexToBytes:()=>Za,hexToNumber:()=>Xa,numberToBytesBE:()=>eo,numberToBytesLE:()=>to,numberToHexUnpadded:()=>Ya,numberToVarBytesBE:()=>no,utf8ToBytes:()=>oo,validateObject:()=>go}),Ua=BigInt(0),Wa=BigInt(1),Ga=BigInt(2),Ka=e=>e instanceof Uint8Array,qa=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Ja(e){if(!Ka(e))throw Error(`Uint8Array expected`);let t=``;for(let n=0;n<e.length;n++)t+=qa[e[n]];return t}function Ya(e){let t=e.toString(16);return t.length&1?`0${t}`:t}function Xa(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return BigInt(e===``?`0`:`0x${e}`)}function Za(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);let t=e.length;if(t%2)throw Error(`padded hex string expected, got unpadded hex of length `+t);let n=new Uint8Array(t/2);for(let t=0;t<n.length;t++){let r=t*2,i=e.slice(r,r+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw Error(`Invalid byte sequence`);n[t]=a}return n}function Qa(e){return Xa(Ja(e))}function $a(e){if(!Ka(e))throw Error(`Uint8Array expected`);return Xa(Ja(Uint8Array.from(e).reverse()))}function eo(e,t){return Za(e.toString(16).padStart(t*2,`0`))}function to(e,t){return eo(e,t).reverse()}function no(e){return Za(Ya(e))}function ro(e,t,n){let r;if(typeof t==`string`)try{r=Za(t)}catch(n){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else if(Ka(t))r=Uint8Array.from(t);else throw Error(`${e} must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(`${e} expected ${n} bytes, got ${i}`);return r}function io(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!Ka(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}function ao(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oo(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function so(e){let t;for(t=0;e>Ua;e>>=Wa,t+=1);return t}function co(e,t){return e>>BigInt(t)&Wa}var lo=(e,t,n)=>e|(n?Wa:Ua)<<BigInt(t),uo=e=>(Ga<<BigInt(e-1))-Wa,fo=e=>new Uint8Array(e),po=e=>Uint8Array.from(e);function mo(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=fo(e),i=fo(e),a=0,o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),c=(e=fo())=>{i=s(po([0]),e),r=s(),e.length!==0&&(i=s(po([1]),e),r=s())},l=()=>{if(a++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){r=s();let t=r.slice();n.push(t),e+=r.length}return io(...n)};return(e,t)=>{o(),c(e);let n;for(;!(n=t(l()));)c();return o(),n}}var ho={bigint:e=>typeof e==`bigint`,function:e=>typeof e==`function`,boolean:e=>typeof e==`boolean`,string:e=>typeof e==`string`,stringOrUint8Array:e=>typeof e==`string`||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e==`function`&&Number.isSafeInteger(e.outputLen)};function go(e,t,n={}){let r=(t,n,r)=>{let i=ho[n];if(typeof i!=`function`)throw Error(`Invalid validator "${n}", expected function`);let a=e[t];if(!(r&&a===void 0)&&!i(a,e))throw Error(`Invalid param ${String(t)}=${a} (${typeof a}), expected ${n}`)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e}var _o=BigInt(0),vo=BigInt(1),yo=BigInt(2),bo=BigInt(3),xo=BigInt(4),So=BigInt(5),Co=BigInt(8),wo=BigInt(16);function To(e,t){let n=e%t;return n>=_o?n:t+n}function Eo(e,t,n){if(n<=_o||t<_o)throw Error(`Expected power/modulo > 0`);if(n===vo)return _o;let r=vo;for(;t>_o;)t&vo&&(r=r*e%n),e=e*e%n,t>>=vo;return r}function Do(e,t,n){let r=e;for(;t-->_o;)r*=r,r%=n;return r}function Oo(e,t){if(e===_o||t<=_o)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=To(e,t),r=t,i=_o,a=vo,o=vo,s=_o;for(;n!==_o;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==vo)throw Error(`invert: does not exist`);return To(i,t)}function ko(e){let t=(e-vo)/yo,n,r,i;for(n=e-vo,r=0;n%yo===_o;n/=yo,r++);for(i=yo;i<e&&Eo(i,t,e)!==e-vo;i++);if(r===1){let t=(e+vo)/xo;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}let a=(n+vo)/yo;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw Error(`Cannot find square root`);let s=r,c=e.pow(e.mul(e.ONE,i),n),l=e.pow(o,a),u=e.pow(o,n);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(u);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);let n=e.pow(c,vo<<BigInt(s-t-1));c=e.sqr(n),l=e.mul(l,n),u=e.mul(u,c),s=t}return l}}function Ao(e){if(e%xo===bo){let t=(e+vo)/xo;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}if(e%Co===So){let t=(e-So)/Co;return function(e,n){let r=e.mul(n,yo),i=e.pow(r,t),a=e.mul(n,i),o=e.mul(e.mul(a,yo),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),n))throw Error(`Cannot find square root`);return s}}return e%wo,ko(e)}var jo=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function Mo(e){return go(e,jo.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`}))}function No(e,t,n){if(n<_o)throw Error(`Expected power > 0`);if(n===_o)return e.ONE;if(n===vo)return t;let r=e.ONE,i=t;for(;n>_o;)n&vo&&(r=e.mul(r,i)),i=e.sqr(i),n>>=vo;return r}function Po(e,t){let n=Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function Fo(e,t){let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Io(e,t,n=!1,r={}){if(e<=_o)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:a}=Fo(e,t);if(a>2048)throw Error(`Field lengths over 2048 bytes are not supported`);let o=Ao(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:a,MASK:uo(i),ZERO:_o,ONE:vo,create:t=>To(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return _o<=t&&t<e},is0:e=>e===_o,isOdd:e=>(e&vo)===vo,neg:t=>To(-t,e),eql:(e,t)=>e===t,sqr:t=>To(t*t,e),add:(t,n)=>To(t+n,e),sub:(t,n)=>To(t-n,e),mul:(t,n)=>To(t*n,e),pow:(e,t)=>No(s,e,t),div:(t,n)=>To(t*Oo(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Oo(t,e),sqrt:r.sqrt||(e=>o(s,e)),invertBatch:e=>Po(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?to(e,a):eo(e,a),fromBytes:e=>{if(e.length!==a)throw Error(`Fp.fromBytes: expected ${a}, got ${e.length}`);return n?$a(e):Qa(e)}});return Object.freeze(s)}function Lo(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function Ro(e){let t=Lo(e);return t+Math.ceil(t/2)}function zo(e,t,n=!1){let r=e.length,i=Lo(t),a=Ro(t);if(r<16||r<a||r>1024)throw Error(`expected ${a}-1024 bytes of input, got ${r}`);let o=To(n?Qa(e):$a(e),t-vo)+vo;return n?to(o,i):eo(o,i)}var Bo=BigInt(0),Vo=BigInt(1);function Ho(e,t){let n=(e,t)=>{let n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>Bo;)n&Vo&&(r=r.add(i)),i=i.double(),n>>=Vo;return r},precomputeWindow(e,t){let{windows:n,windowSize:i}=r(t),a=[],o=e,s=o;for(let e=0;e<n;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(t,i,a){let{windows:o,windowSize:s}=r(t),c=e.ZERO,l=e.BASE,u=BigInt(2**t-1),d=2**t,f=BigInt(t);for(let e=0;e<o;e++){let t=e*s,r=Number(a&u);a>>=f,r>s&&(r-=d,a+=Vo);let o=t,p=t+Math.abs(r)-1,m=e%2!=0,h=r<0;r===0?l=l.add(n(m,i[o])):c=c.add(n(h,i[p]))}return{p:c,f:l}},wNAFCached(e,t,n,r){let i=e._WINDOW_SIZE||1,a=t.get(e);return a||(a=this.precomputeWindow(e,i),i!==1&&t.set(e,r(a))),this.wNAF(i,a,n)}}}function Uo(e){return Mo(e.Fp),go(e,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...Fo(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function Wo(e){let t=Uo(e);go(t,{a:`field`,b:`field`},{allowedPrivateKeyLengths:`array`,wrapPrivateKey:`boolean`,isTorsionFree:`function`,clearCofactor:`function`,allowInfinityPoint:`boolean`,fromBytes:`function`,toBytes:`function`});let{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw Error(`Endomorphism can only be defined for Koblitz curves that have a=0`);if(typeof n!=`object`||typeof n.beta!=`bigint`||typeof n.splitScalar!=`function`)throw Error(`Expected endomorphism with beta: bigint and splitScalar: function`)}return Object.freeze({...t})}var{bytesToNumberBE:Go,hexToBytes:Ko}=Ha,qo={Err:class extends Error{constructor(e=``){super(e)}},_parseInt(e){let{Err:t}=qo;if(e.length<2||e[0]!==2)throw new t(`Invalid signature integer tag`);let n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t(`Invalid signature integer: wrong length`);if(r[0]&128)throw new t(`Invalid signature integer: negative`);if(r[0]===0&&!(r[1]&128))throw new t(`Invalid signature integer: unnecessary leading zero`);return{d:Go(r),l:e.subarray(n+2)}},toSig(e){let{Err:t}=qo,n=typeof e==`string`?Ko(e):e;if(!(n instanceof Uint8Array))throw Error(`ui8a expected`);let r=n.length;if(r<2||n[0]!=48)throw new t(`Invalid signature tag`);if(n[1]!==r-2)throw new t(`Invalid signature: incorrect length`);let{d:i,l:a}=qo._parseInt(n.subarray(2)),{d:o,l:s}=qo._parseInt(a);if(s.length)throw new t(`Invalid signature: left bytes after parsing`);return{r:i,s:o}},hexFromSig(e){let t=e=>Number.parseInt(e[0],16)&8?`00`+e:e,n=e=>{let t=e.toString(16);return t.length&1?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),a=r.length/2,o=i.length/2,s=n(a),c=n(o);return`30${n(o+a+4)}02${c}${i}02${s}${r}`}},Jo=BigInt(0),Yo=BigInt(1),Xo=BigInt(3);function Zo(e){let t=Wo(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{let i=t.toAffine();return io(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){let{a:r,b:i}=t,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw Error(`bad generator point: equation left != right`);function o(e){return typeof e==`bigint`&&Jo<e&&e<t.n}function s(e){if(!o(e))throw Error(`Expected valid bigint: 0 < bigint < curve.n`)}function c(e){let{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:a}=t;if(n&&typeof e!=`bigint`){if(e instanceof Uint8Array&&(e=Ja(e)),typeof e!=`string`||!n.includes(e.length))throw Error(`Invalid key`);e=e.padStart(r*2,`0`)}let o;try{o=typeof e==`bigint`?e:Qa(ro(`private key`,e,r))}catch{throw Error(`private key must be ${r} bytes, hex or bigint, not ${typeof e}`)}return i&&(o=To(o,a)),s(o),o}let l=new Map;function u(e){if(!(e instanceof d))throw Error(`ProjectivePoint expected`)}class d{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,e==null||!n.isValid(e))throw Error(`x required`);if(t==null||!n.isValid(t))throw Error(`y required`);if(r==null||!n.isValid(r))throw Error(`z required`)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error(`invalid affine point`);if(e instanceof d)throw Error(`projective point not allowed`);let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)}static fromHex(e){let t=d.fromAffine(i(ro(`pointHex`,e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw Error(`bad point: ZERO`)}let{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw Error(`bad point: x or y not FE`);let i=n.sqr(r),o=a(e);if(!n.eql(i,o))throw Error(`bad point: equation left != right`);if(!this.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error(`Field doesn't support isOdd`)}equals(e){u(e);let{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,c=n.eql(n.mul(t,s),n.mul(a,i)),l=n.eql(n.mul(r,s),n.mul(o,i));return c&&l}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:r}=t,i=n.mul(r,Xo),{px:a,py:o,pz:s}=this,c=n.ZERO,l=n.ZERO,u=n.ZERO,f=n.mul(a,a),p=n.mul(o,o),m=n.mul(s,s),h=n.mul(a,o);return h=n.add(h,h),u=n.mul(a,s),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,m),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(h,c),u=n.mul(i,u),m=n.mul(e,m),h=n.sub(f,m),h=n.mul(e,h),h=n.add(h,u),u=n.add(f,f),f=n.add(u,f),f=n.add(f,m),f=n.mul(f,h),l=n.add(l,f),m=n.mul(o,s),m=n.add(m,m),f=n.mul(m,h),c=n.sub(c,f),u=n.mul(m,p),u=n.add(u,u),u=n.add(u,u),new d(c,l,u)}add(e){u(e);let{px:r,py:i,pz:a}=this,{px:o,py:s,pz:c}=e,l=n.ZERO,f=n.ZERO,p=n.ZERO,m=t.a,h=n.mul(t.b,Xo),g=n.mul(r,o),_=n.mul(i,s),v=n.mul(a,c),y=n.add(r,i),b=n.add(o,s);y=n.mul(y,b),b=n.add(g,_),y=n.sub(y,b),b=n.add(r,a);let x=n.add(o,c);return b=n.mul(b,x),x=n.add(g,v),b=n.sub(b,x),x=n.add(i,a),l=n.add(s,c),x=n.mul(x,l),l=n.add(_,v),x=n.sub(x,l),p=n.mul(m,b),l=n.mul(h,v),p=n.add(l,p),l=n.sub(_,p),p=n.add(_,p),f=n.mul(l,p),_=n.add(g,g),_=n.add(_,g),v=n.mul(m,v),b=n.mul(h,b),_=n.add(_,v),v=n.sub(g,v),v=n.mul(m,v),b=n.add(b,v),g=n.mul(_,b),f=n.add(f,g),g=n.mul(x,b),l=n.mul(y,l),l=n.sub(l,g),g=n.mul(y,_),p=n.mul(x,p),p=n.add(p,g),new d(l,f,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,l,e,e=>{let t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)})}multiplyUnsafe(e){let r=d.ZERO;if(e===Jo)return r;if(s(e),e===Yo)return this;let{endo:i}=t;if(!i)return p.unsafeLadder(this,e);let{k1neg:a,k1:o,k2neg:c,k2:l}=i.splitScalar(e),u=r,f=r,m=this;for(;o>Jo||l>Jo;)o&Yo&&(u=u.add(m)),l&Yo&&(f=f.add(m)),m=m.double(),o>>=Yo,l>>=Yo;return a&&(u=u.negate()),c&&(f=f.negate()),f=new d(n.mul(f.px,i.beta),f.py,f.pz),u.add(f)}multiply(e){s(e);let r=e,i,a,{endo:o}=t;if(o){let{k1neg:e,k1:t,k2neg:s,k2:c}=o.splitScalar(r),{p:l,f:u}=this.wNAF(t),{p:f,f:m}=this.wNAF(c);l=p.constTimeNegate(e,l),f=p.constTimeNegate(s,f),f=new d(n.mul(f.px,o.beta),f.py,f.pz),i=l.add(f),a=u.add(m)}else{let{p:e,f:t}=this.wNAF(r);i=e,a=t}return d.normalizeZ([i,a])[0]}multiplyAndAddUnsafe(e,t,n){let r=d.BASE,i=(e,t)=>t===Jo||t===Yo||!e.equals(r)?e.multiplyUnsafe(t):e.multiply(t),a=i(this,t).add(i(e,n));return a.is0()?void 0:a}toAffine(e){let{px:t,py:r,pz:i}=this,a=this.is0();e??=a?n.ONE:n.inv(i);let o=n.mul(t,e),s=n.mul(r,e),c=n.mul(i,e);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw Error(`invZ was invalid`);return{x:o,y:s}}isTorsionFree(){let{h:e,isTorsionFree:n}=t;if(e===Yo)return!0;if(n)return n(d,this);throw Error(`isTorsionFree() has not been declared for the elliptic curve`)}clearCofactor(){let{h:e,clearCofactor:n}=t;return e===Yo?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return Ja(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);let f=t.nBitLength,p=Ho(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function Qo(e){let t=Uo(e);return go(t,{hash:`hash`,hmac:`function`,randomBytes:`function`},{bits2int:`function`,bits2int_modN:`function`,lowS:`boolean`}),Object.freeze({lowS:!0,...t})}function $o(e){let t=Qo(e),{Fp:n,n:r}=t,i=n.BYTES+1,a=2*n.BYTES+1;function o(e){return Jo<e&&e<n.ORDER}function s(e){return To(e,r)}function c(e){return Oo(e,r)}let{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Zo({...t,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x),o=io;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),a):o(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){let t=e.length,r=e[0],s=e.subarray(1);if(t===i&&(r===2||r===3)){let e=Qa(s);if(!o(e))throw Error(`Point is not on curve`);let t=d(e),i=n.sqrt(t),a=(i&Yo)===Yo;return(r&1)==1!==a&&(i=n.neg(i)),{x:e,y:i}}else if(t===a&&r===4)return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))};else throw Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}}),p=e=>Ja(eo(e,t.nByteLength));function m(e){return e>r>>Yo}function h(e){return m(e)?s(-e):e}let g=(e,t,n)=>Qa(e.slice(t,n));class _{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){let n=t.nByteLength;return e=ro(`compactSignature`,e,n*2),new _(g(e,0,n),g(e,n,2*n))}static fromDER(e){let{r:t,s:n}=qo.toSig(ro(`DER`,e));return new _(t,n)}assertValidity(){if(!f(this.r))throw Error(`r must be 0 < r < CURVE.n`);if(!f(this.s))throw Error(`s must be 0 < s < CURVE.n`)}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){let{r,s:i,recovery:a}=this,o=C(ro(`msgHash`,e));if(a==null||![0,1,2,3].includes(a))throw Error(`recovery id invalid`);let u=a===2||a===3?r+t.n:r;if(u>=n.ORDER)throw Error(`recovery id 2 or 3 invalid`);let d=a&1?`03`:`02`,f=l.fromHex(d+p(u)),m=c(u),h=s(-o*m),g=s(i*m),_=l.BASE.multiplyAndAddUnsafe(f,h,g);if(!_)throw Error(`point at infinify`);return _.assertValidity(),_}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Za(this.toDERHex())}toDERHex(){return qo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Za(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}let v={isValidPrivateKey(e){try{return u(e),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let e=Ro(t.n);return zo(t.randomBytes(e),t.n)},precompute(e=8,t=l.BASE){return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function y(e,t=!0){return l.fromPrivateKey(e).toRawBytes(t)}function b(e){let t=e instanceof Uint8Array,n=typeof e==`string`,r=(t||n)&&e.length;return t?r===i||r===a:n?r===2*i||r===2*a:e instanceof l}function x(e,t,n=!0){if(b(e))throw Error(`first arg must be private key`);if(!b(t))throw Error(`second arg must be public key`);return l.fromHex(t).multiply(u(e)).toRawBytes(n)}let S=t.bits2int||function(e){let n=Qa(e),r=e.length*8-t.nBitLength;return r>0?n>>BigInt(r):n},C=t.bits2int_modN||function(e){return s(S(e))},w=uo(t.nBitLength);function T(e){if(typeof e!=`bigint`)throw Error(`bigint expected`);if(!(Jo<=e&&e<w))throw Error(`bigint expected < 2^${t.nBitLength}`);return eo(e,t.nByteLength)}function E(e,r,i=D){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{hash:a,randomBytes:o}=t,{lowS:d,prehash:p,extraEntropy:g}=i;d??=!0,e=ro(`msgHash`,e),p&&(e=ro(`prehashed msgHash`,a(e)));let v=C(e),y=u(r),b=[T(y),T(v)];if(g!=null){let e=g===!0?o(n.BYTES):g;b.push(ro(`extraEntropy`,e))}let x=io(...b),w=v;function E(e){let t=S(e);if(!f(t))return;let n=c(t),r=l.BASE.multiply(t).toAffine(),i=s(r.x);if(i===Jo)return;let a=s(n*s(w+i*y));if(a===Jo)return;let o=(r.x===i?0:2)|Number(r.y&Yo),u=a;return d&&m(a)&&(u=h(a),o^=1),new _(i,u,o)}return{seed:x,k2sig:E}}let D={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};function k(e,n,r=D){let{seed:i,k2sig:a}=E(e,n,r),o=t;return mo(o.hash.outputLen,o.nByteLength,o.hmac)(i,a)}l.BASE._setWindowSize(8);function A(e,n,r,i=O){let a=e;if(n=ro(`msgHash`,n),r=ro(`publicKey`,r),`strict`in i)throw Error(`options.strict was renamed to lowS`);let{lowS:o,prehash:u}=i,d,f;try{if(typeof a==`string`||a instanceof Uint8Array)try{d=_.fromDER(a)}catch(e){if(!(e instanceof qo.Err))throw e;d=_.fromCompact(a)}else if(typeof a==`object`&&typeof a.r==`bigint`&&typeof a.s==`bigint`){let{r:e,s:t}=a;d=new _(e,t)}else throw Error(`PARSE`);f=l.fromHex(r)}catch(e){if(e.message===`PARSE`)throw Error(`signature must be Signature instance, Uint8Array or hex string`);return!1}if(o&&d.hasHighS())return!1;u&&(n=t.hash(n));let{r:p,s:m}=d,h=C(n),g=c(m),v=s(h*g),y=s(p*g),b=l.BASE.multiplyAndAddUnsafe(f,v,y)?.toAffine();return b?s(b.x)===p:!1}return{CURVE:t,getPublicKey:y,getSharedSecret:x,sign:k,verify:A,ProjectivePoint:l,Signature:_,utils:v}}var es=class extends Aa{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ba(e);let n=Oa(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return xa(this),this.iHash.update(e),this}digestInto(e){xa(this),ya(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ts=(e,t,n)=>new es(e,t).update(n).digest();ts.create=(e,t)=>new es(e,t);function ns(e){return{hash:e,hmac:(t,...n)=>ts(e,t,ka(...n)),randomBytes:Ma}}function rs(e,t){let n=t=>$o({...e,...ns(t)});return Object.freeze({...n(t),create:n})}var is=BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`),as=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),os=BigInt(1),ss=BigInt(2),cs=(e,t)=>(e+t/ss)/t;function ls(e){let t=is,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Do(Do(Do(u,n,t)*u%t,n,t)*u%t,ss,t)*l%t,f=Do(d,i,t)*d%t,p=Do(f,a,t)*f%t,m=Do(p,s,t)*p%t,h=Do(Do(Do(Do(Do(Do(m,c,t)*m%t,s,t)*p%t,n,t)*u%t,o,t)*f%t,r,t)*l%t,ss,t);if(!us.eql(us.sqr(h),e))throw Error(`Cannot find square root`);return h}var us=Io(is,void 0,void 0,{sqrt:ls}),ds=rs({a:BigInt(0),b:BigInt(7),Fp:us,n:as,Gx:BigInt(`55066263022277343669578718895168534326250603453777594175500187360389116729240`),Gy:BigInt(`32670510020758816978083085130507043184471273380659243275938904335757337482424`),h:BigInt(1),lowS:!0,endo:{beta:BigInt(`0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`),splitScalar:e=>{let t=as,n=BigInt(`0x3086d221a7d46bcde86c90e49284eb15`),r=-os*BigInt(`0xe4437ed6010e88286f547fa90abfe4c3`),i=BigInt(`0x114ca50f7a8e2f3f657c1108d9d44cfd8`),a=n,o=BigInt(`0x100000000000000000000000000000000`),s=cs(a*e,t),c=cs(-r*e,t),l=To(e-s*n-c*i,t),u=To(-s*r-c*a,t),d=l>o,f=u>o;if(d&&(l=t-l),f&&(u=t-u),l>o||u>o)throw Error(`splitScalar: Endomorphism failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},Va);ds.ProjectivePoint;var fs=`0x0000000000000000000000000000000000000000000000000000000000000000`,ps=`Ethereum Signed Message:
|
|
2
2
|
`,ms=BigInt(0),hs=BigInt(1),gs=BigInt(2),_s=BigInt(27),vs=BigInt(28),ys=BigInt(35),bs=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),xs=bs/gs,Ss=Symbol.for(`nodejs.util.inspect.custom`),Cs={};function ws(e){return cr(br(e),32)}var Ts=class e{#e;#t;#n;#r;get r(){return this.#e}set r(e){X(ar(e)===32,`invalid r`,`value`,e),this.#e=Q(e)}get s(){return X(parseInt(this.#t.substring(0,3))<8,`non-canonical s; use ._s`,`s`,this.#t),this.#t}set s(e){X(ar(e)===32,`invalid s`,`value`,e),this.#t=Q(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=xs}get v(){return this.#n}set v(e){let t=vr(e,`value`);X(t===27||t===28,`invalid v`,`v`,e),this.#n=t}get networkV(){return this.#r}get legacyChainId(){let t=this.networkV;return t==null?null:e.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=Z(this.s);return this.yParity&&(e[0]|=128),Q(e)}get compactSerialized(){return ir([this.r,this.yParityAndS])}get serialized(){return ir([this.r,this.s,this.yParity?`0x1c`:`0x1b`])}constructor(e,t,n,r){Qn(e,Cs,`Signature`),this.#e=t,this.#t=n,this.#n=r,this.#r=null}getCanonical(){if(this.isValid())return this;let t=bs-BigInt(this._s),n=55-this.v,r=new e(Cs,this.r,ws(t),n);return this.networkV&&(r.#r=this.networkV),r}clone(){let t=new e(Cs,this.r,this._s,this.v);return this.networkV&&(t.#r=this.networkV),t}toJSON(){let e=this.networkV;return{_type:`signature`,networkV:e==null?null:e.toString(),r:this.r,s:this._s,v:this.v}}[Ss](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){let t=mr(e,`v`);return t==_s||t==vs?ms:(X(t>=ys,`invalid EIP-155 v`,`v`,e),(t-ys)/gs)}static getChainIdV(e,t){return mr(e)*gs+BigInt(35+t-27)}static getNormalizedV(e){let t=mr(e);return t===ms||t===_s?27:t===hs||t===vs?28:(X(t>=ys,`invalid v`,`v`,e),t&hs?27:28)}static from(t){function n(e,n){X(e,n,`signature`,t)}if(t==null)return new e(Cs,fs,fs,27);if(typeof t==`string`){let r=Z(t,`signature`);if(r.length===64){let t=Q(r.slice(0,32)),n=r.slice(32,64),i=n[0]&128?28:27;return n[0]&=127,new e(Cs,t,Q(n),i)}if(r.length===65)return new e(Cs,Q(r.slice(0,32)),Q(r.slice(32,64)),e.getNormalizedV(r[64]));n(!1,`invalid raw signature length`)}if(t instanceof e)return t.clone();let r=t.r;n(r!=null,`missing r`);let i=ws(r),a=(function(e,t){if(e!=null)return ws(e);if(t!=null){n(tr(t,32),`invalid yParityAndS`);let e=Z(t);return e[0]&=127,Q(e)}n(!1,`missing s`)})(t.s,t.yParityAndS),{networkV:o,v:s}=(function(t,r,i){if(t!=null){let n=mr(t);return{networkV:n>=ys?n:void 0,v:e.getNormalizedV(n)}}if(r!=null)return n(tr(r,32),`invalid yParityAndS`),{v:Z(r)[0]&128?28:27};if(i!=null){switch(vr(i,`sig.yParity`)){case 0:return{v:27};case 1:return{v:28}}n(!1,`invalid yParity`)}n(!1,`missing v`)})(t.v,t.yParityAndS,t.yParity),c=new e(Cs,i,a,s);return o&&(c.#r=o),n(t.yParity==null||vr(t.yParity,`sig.yParity`)===c.yParity,`yParity mismatch`),n(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,`yParityAndS mismatch`),c}},Es=class e{#e;constructor(e){X(ar(e)===32,`invalid private key`,`privateKey`,`[REDACTED]`),this.#e=Q(e)}get privateKey(){return this.#e}get publicKey(){return e.computePublicKey(this.#e)}get compressedPublicKey(){return e.computePublicKey(this.#e,!0)}sign(e){X(ar(e)===32,`invalid digest length`,`digest`,e);let t=ds.sign(er(e),er(this.#e),{lowS:!0});return Ts.from({r:yr(t.r,32),s:yr(t.s,32),v:t.recovery?28:27})}computeSharedSecret(t){let n=e.computePublicKey(t);return Q(ds.getSharedSecret(er(this.#e),Z(n),!1))}static computePublicKey(e,t){let n=Z(e,`key`);if(n.length===32)return Q(ds.getPublicKey(n,!!t));if(n.length===64){let e=new Uint8Array(65);e[0]=4,e.set(n,1),n=e}return Q(ds.ProjectivePoint.fromHex(n).toRawBytes(t))}static recoverPublicKey(e,t){X(ar(e)===32,`invalid digest length`,`digest`,e);let n=Ts.from(t),r=ds.Signature.fromCompact(er(ir([n.r,n.s])));r=r.addRecoveryBit(n.yParity);let i=r.recoverPublicKey(er(e));return X(i!=null,`invalid signature for digest`,`signature`,t),`0x`+i.toHex(!1)}static addPoints(t,n,r){let i=ds.ProjectivePoint.fromHex(e.computePublicKey(t).substring(2)),a=ds.ProjectivePoint.fromHex(e.computePublicKey(n).substring(2));return`0x`+i.add(a).toHex(!!r)}},Ds=BigInt(0),Os=BigInt(36);function ks(e){e=e.toLowerCase();let t=e.substring(2).split(``),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);let r=Z(xi(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(r[e>>1]&15)>=8&&(t[e+1]=t[e+1].toUpperCase());return`0x`+t.join(``)}var As={};for(let e=0;e<10;e++)As[String(e)]=String(e);for(let e=0;e<26;e++)As[String.fromCharCode(65+e)]=String(10+e);var js=15;function Ms(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>As[e]).join(``);for(;t.length>=js;){let e=t.substring(0,js);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n=`0`+n;return n}var Ns=(function(){let e={};for(let t=0;t<36;t++){let n=`0123456789abcdefghijklmnopqrstuvwxyz`[t];e[n]=BigInt(t)}return e})();function Ps(e){e=e.toLowerCase();let t=Ds;for(let n=0;n<e.length;n++)t=t*Os+Ns[e[n]];return t}function Fs(e){if(X(typeof e==`string`,`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith(`0x`)||(e=`0x`+e);let t=ks(e);return X(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,`bad address checksum`,`address`,e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){X(e.substring(2,4)===Ms(e),`bad icap checksum`,`address`,e);let t=Ps(e.substring(4)).toString(16);for(;t.length<40;)t=`0`+t;return ks(`0x`+t)}X(!1,`invalid address`,`address`,e)}function Is(e){return e&&typeof e.getAddress==`function`}async function Ls(e,t){let n=await t;return(n==null||n===`0x0000000000000000000000000000000000000000`)&&(Y(typeof e!=`string`,`unconfigured name`,`UNCONFIGURED_NAME`,{value:e}),X(!1,`invalid AddressLike value; did not resolve to a value address`,`target`,e)),Fs(n)}function Rs(e,t){if(typeof e==`string`)return e.match(/^0x[0-9a-f]{40}$/i)?Fs(e):(Y(t!=null,`ENS resolution requires a provider`,`UNSUPPORTED_OPERATION`,{operation:`resolveName`}),Ls(e,t.resolveName(e)));if(Is(e))return Ls(e,e.getAddress());if(e&&typeof e.then==`function`)return Ls(e,e);X(!1,`unsupported addressable value`,`target`,e)}function zs(e,t){return{address:Fs(e),storageKeys:t.map((e,t)=>(X(tr(e,32),`invalid slot`,`storageKeys[${t}]`,e),e.toLowerCase()))}}function Bs(e){if(Array.isArray(e))return e.map((t,n)=>Array.isArray(t)?(X(t.length===2,`invalid slot set`,`value[${n}]`,t),zs(t[0],t[1])):(X(typeof t==`object`&&!!t,`invalid address-slot set`,`value`,e),zs(t.address,t.storageKeys)));X(typeof e==`object`&&!!e,`invalid access list`,`value`,e);let t=Object.keys(e).map(t=>{let n=e[t].reduce((e,t)=>(e[t]=!0,e),{});return zs(t,Object.keys(n).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function Vs(e){let t;return t=typeof e==`string`?Es.computePublicKey(e,!1):e.publicKey,Fs(xi(`0x`+t.substring(4)).substring(26))}function Hs(e,t){return Vs(Es.recoverPublicKey(e,t))}var Us=`0x0000000000000000000000000000000000000000`;function Ws(e){return{address:Fs(e.address),nonce:mr(e.nonce==null?0:e.nonce),chainId:mr(e.chainId==null?0:e.chainId),signature:Ts.from(e.signature)}}var Gs=BigInt(0),Ks=BigInt(2),qs=BigInt(27),Js=BigInt(28),Ys=BigInt(35),Xs=BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),Zs=Symbol.for(`nodejs.util.inspect.custom`),Qs=4096*32,$s=128;function ec(e){return{blobToKzgCommitment:t=>{if(`computeBlobProof`in e){if(`blobToKzgCommitment`in e&&typeof e.blobToKzgCommitment==`function`)return Z(e.blobToKzgCommitment(Q(t)))}else if(`blobToKzgCommitment`in e&&typeof e.blobToKzgCommitment==`function`)return Z(e.blobToKzgCommitment(t));if(`blobToKZGCommitment`in e&&typeof e.blobToKZGCommitment==`function`)return Z(e.blobToKZGCommitment(Q(t)));X(!1,`unsupported KZG library`,`kzg`,e)},computeBlobKzgProof:(t,n)=>{if(`computeBlobProof`in e&&typeof e.computeBlobProof==`function`)return Z(e.computeBlobProof(Q(t),Q(n)));if(`computeBlobKzgProof`in e&&typeof e.computeBlobKzgProof==`function`)return e.computeBlobKzgProof(t,n);if(`computeBlobKZGProof`in e&&typeof e.computeBlobKZGProof==`function`)return Z(e.computeBlobKZGProof(Q(t),Q(n)));X(!1,`unsupported KZG library`,`kzg`,e)}}}function tc(e,t){let n=e.toString(16);for(;n.length<2;)n=`0`+n;return n+=ga(t).substring(4),`0x`+n}function nc(e){return e===`0x`?null:Fs(e)}function rc(e,t){try{return Bs(e)}catch(n){X(!1,n.message,t,e)}}function ic(e,t){try{if(!Array.isArray(e))throw Error(`authorizationList: invalid array`);let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(!Array.isArray(r))throw Error(`authorization[${n}]: invalid array`);if(r.length!==6)throw Error(`authorization[${n}]: wrong length`);if(!r[1])throw Error(`authorization[${n}]: null address`);t.push({address:nc(r[1]),nonce:oc(r[2],`nonce`),chainId:oc(r[0],`chainId`),signature:Ts.from({yParity:ac(r[3],`yParity`),r:cr(r[4],32),s:cr(r[5],32)})})}return t}catch(n){X(!1,n.message,t,e)}}function ac(e,t){return e===`0x`?0:vr(e,t)}function oc(e,t){if(e===`0x`)return Gs;let n=mr(e,t);return X(n<=Xs,`value exceeds uint size`,t,n),n}function $(e,t){let n=mr(e,`value`),r=br(n);return X(r.length<=32,`value too large`,`tx.${t}`,n),r}function sc(e){return Bs(e).map(e=>[e.address,e.storageKeys])}function cc(e){return e.map(e=>[$(e.chainId,`chainId`),e.address,$(e.nonce,`nonce`),$(e.signature.yParity,`yParity`),br(e.signature.r),br(e.signature._s)])}function lc(e,t){X(Array.isArray(e),`invalid ${t}`,`value`,e);for(let t=0;t<e.length;t++)X(tr(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function uc(e){let t=Fr(e);X(Array.isArray(t)&&(t.length===9||t.length===6),`invalid field count for legacy transaction`,`data`,e);let n={type:0,nonce:ac(t[0],`nonce`),gasPrice:oc(t[1],`gasPrice`),gasLimit:oc(t[2],`gasLimit`),to:nc(t[3]),value:oc(t[4],`value`),data:Q(t[5]),chainId:Gs};if(t.length===6)return n;let r=oc(t[6],`v`),i=oc(t[7],`r`),a=oc(t[8],`s`);if(i===Gs&&a===Gs)n.chainId=r;else{let e=(r-Ys)/Ks;e<Gs&&(e=Gs),n.chainId=e,X(e!==Gs||r===qs||r===Js,`non-canonical legacy v`,`v`,t[6]),n.signature=Ts.from({r:cr(t[7],32),s:cr(t[8],32),v:r})}return n}function dc(e,t){let n=[$(e.nonce,`nonce`),$(e.gasPrice||0,`gasPrice`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data],r=Gs;if(e.chainId!=Gs)r=mr(e.chainId,`tx.chainId`),X(!t||t.networkV==null||t.legacyChainId===r,`tx.chainId/sig.v mismatch`,`sig`,t);else if(e.signature){let t=e.signature.legacyChainId;t!=null&&(r=t)}if(!t)return r!==Gs&&(n.push(br(r)),n.push(`0x`),n.push(`0x`)),zr(n);let i=BigInt(27+t.yParity);return r===Gs?BigInt(t.v)!==i&&X(!1,`tx.chainId/sig.v mismatch`,`sig`,t):i=Ts.getChainIdV(r,t.v),n.push(br(i)),n.push(br(t.r)),n.push(br(t._s)),zr(n)}function fc(e,t){let n;try{if(n=ac(t[0],`yParity`),n!==0&&n!==1)throw Error(`bad yParity`)}catch{X(!1,`invalid yParity`,`yParity`,t[0])}let r=cr(t[1],32),i=cr(t[2],32);e.signature=Ts.from({r,s:i,yParity:n})}function pc(e){let t=Fr(Z(e).slice(1));X(Array.isArray(t)&&(t.length===9||t.length===12),`invalid field count for transaction type: 2`,`data`,Q(e));let n={type:2,chainId:oc(t[0],`chainId`),nonce:ac(t[1],`nonce`),maxPriorityFeePerGas:oc(t[2],`maxPriorityFeePerGas`),maxFeePerGas:oc(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:oc(t[4],`gasLimit`),to:nc(t[5]),value:oc(t[6],`value`),data:Q(t[7]),accessList:rc(t[8],`accessList`)};return t.length===9||fc(n,t.slice(9)),n}function mc(e,t){let n=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.maxPriorityFeePerGas||0,`maxPriorityFeePerGas`),$(e.maxFeePerGas||0,`maxFeePerGas`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data,sc(e.accessList||[])];return t&&(n.push($(t.yParity,`yParity`)),n.push(br(t.r)),n.push(br(t.s))),ir([`0x02`,zr(n)])}function hc(e){let t=Fr(Z(e).slice(1));X(Array.isArray(t)&&(t.length===8||t.length===11),`invalid field count for transaction type: 1`,`data`,Q(e));let n={type:1,chainId:oc(t[0],`chainId`),nonce:ac(t[1],`nonce`),gasPrice:oc(t[2],`gasPrice`),gasLimit:oc(t[3],`gasLimit`),to:nc(t[4]),value:oc(t[5],`value`),data:Q(t[6]),accessList:rc(t[7],`accessList`)};return t.length===8||fc(n,t.slice(8)),n}function gc(e,t){let n=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.gasPrice||0,`gasPrice`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data,sc(e.accessList||[])];return t&&(n.push($(t.yParity,`recoveryParam`)),n.push(br(t.r)),n.push(br(t.s))),ir([`0x01`,zr(n)])}function _c(e){let t=Fr(Z(e).slice(1)),n=`3`,r=null,i=null;if(t.length===4&&Array.isArray(t[0])){n=`3 (network format)`;let e=t[1],r=t[2],a=t[3];X(Array.isArray(e),`invalid network format: blobs not an array`,`fields[1]`,e),X(Array.isArray(r),`invalid network format: commitments not an array`,`fields[2]`,r),X(Array.isArray(a),`invalid network format: proofs not an array`,`fields[3]`,a),X(e.length===r.length,`invalid network format: blobs/commitments length mismatch`,`fields`,t),X(e.length===a.length,`invalid network format: blobs/proofs length mismatch`,`fields`,t),i=[];for(let n=0;n<t[1].length;n++)i.push({data:e[n],commitment:r[n],proof:a[n]});t=t[0]}else if(t.length===5&&Array.isArray(t[0])){n=`3 (EIP-7594 network format)`,r=vr(t[1]);let e=t[2],a=t[3],o=t[4];X(r===1,`unsupported EIP-7594 network format version: ${r}`,`fields[1]`,r),X(Array.isArray(e),`invalid EIP-7594 network format: blobs not an array`,`fields[2]`,e),X(Array.isArray(a),`invalid EIP-7594 network format: commitments not an array`,`fields[3]`,a),X(Array.isArray(o),`invalid EIP-7594 network format: proofs not an array`,`fields[4]`,o),X(e.length===a.length,`invalid network format: blobs/commitments length mismatch`,`fields`,t),X(e.length*$s===o.length,`invalid network format: blobs/proofs length mismatch`,`fields`,t),i=[];for(let t=0;t<e.length;t++){let n=[];for(let e=0;e<$s;e++)n.push(o[t*$s+e]);i.push({data:e[t],commitment:a[t],proof:ir(n)})}t=t[0]}X(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,`data`,Q(e));let a={type:3,chainId:oc(t[0],`chainId`),nonce:ac(t[1],`nonce`),maxPriorityFeePerGas:oc(t[2],`maxPriorityFeePerGas`),maxFeePerGas:oc(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:oc(t[4],`gasLimit`),to:nc(t[5]),value:oc(t[6],`value`),data:Q(t[7]),accessList:rc(t[8],`accessList`),maxFeePerBlobGas:oc(t[9],`maxFeePerBlobGas`),blobVersionedHashes:t[10],blobWrapperVersion:r};i&&(a.blobs=i),X(a.to!=null,`invalid address for transaction type: ${n}`,`data`,e),X(Array.isArray(a.blobVersionedHashes),`invalid blobVersionedHashes: must be an array`,`data`,e);for(let t=0;t<a.blobVersionedHashes.length;t++)X(tr(a.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,`data`,e);return t.length===11||fc(a,t.slice(11)),a}function vc(e,t,n){let r=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.maxPriorityFeePerGas||0,`maxPriorityFeePerGas`),$(e.maxFeePerGas||0,`maxFeePerGas`),$(e.gasLimit,`gasLimit`),e.to||`0x0000000000000000000000000000000000000000`,$(e.value,`value`),e.data,sc(e.accessList||[]),$(e.maxFeePerBlobGas||0,`maxFeePerBlobGas`),lc(e.blobVersionedHashes||[],`blobVersionedHashes`)];if(t&&(r.push($(t.yParity,`yParity`)),r.push(br(t.r)),r.push(br(t.s)),n)){if(e.blobWrapperVersion!=null){let t=br(e.blobWrapperVersion),i=[];for(let{proof:e}of n){let t=Z(e),n=t.length/$s;for(let e=0;e<t.length;e+=n)i.push(t.subarray(e,e+n))}return ir([`0x03`,zr([r,t,n.map(e=>e.data),n.map(e=>e.commitment),i])])}return ir([`0x03`,zr([r,n.map(e=>e.data),n.map(e=>e.commitment),n.map(e=>e.proof)])])}return ir([`0x03`,zr(r)])}function yc(e){let t=Fr(Z(e).slice(1));X(Array.isArray(t)&&(t.length===10||t.length===13),`invalid field count for transaction type: 4`,`data`,Q(e));let n={type:4,chainId:oc(t[0],`chainId`),nonce:ac(t[1],`nonce`),maxPriorityFeePerGas:oc(t[2],`maxPriorityFeePerGas`),maxFeePerGas:oc(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:oc(t[4],`gasLimit`),to:nc(t[5]),value:oc(t[6],`value`),data:Q(t[7]),accessList:rc(t[8],`accessList`),authorizationList:ic(t[9],`authorizationList`)};return t.length===10||fc(n,t.slice(10)),n}function bc(e,t){let n=[$(e.chainId,`chainId`),$(e.nonce,`nonce`),$(e.maxPriorityFeePerGas||0,`maxPriorityFeePerGas`),$(e.maxFeePerGas||0,`maxFeePerGas`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data,sc(e.accessList||[]),cc(e.authorizationList||[])];return t&&(n.push($(t.yParity,`yParity`)),n.push(br(t.r)),n.push(br(t.s))),ir([`0x04`,zr(n)])}var xc=class e{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case`legacy`:this.#e=0;break;case 1:case`berlin`:case`eip-2930`:this.#e=1;break;case 2:case`london`:case`eip-1559`:this.#e=2;break;case 3:case`cancun`:case`eip-4844`:this.#e=3;break;case 4:case`pectra`:case`eip-7702`:this.#e=4;break;default:X(!1,`unsupported transaction type`,`type`,e)}}get typeName(){switch(this.type){case 0:return`legacy`;case 1:return`eip-2930`;case 2:return`eip-1559`;case 3:return`eip-4844`;case 4:return`eip-7702`}return null}get to(){let e=this.#t;return e==null&&this.type===3?Us:e}set to(e){this.#t=e==null?null:Fs(e)}get nonce(){return this.#r}set nonce(e){this.#r=vr(e,`value`)}get gasLimit(){return this.#i}set gasLimit(e){this.#i=mr(e)}get gasPrice(){let e=this.#a;return e==null&&(this.type===0||this.type===1)?Gs:e}set gasPrice(e){this.#a=e==null?null:mr(e,`gasPrice`)}get maxPriorityFeePerGas(){return this.#o??(this.type===2||this.type===3?Gs:null)}set maxPriorityFeePerGas(e){this.#o=e==null?null:mr(e,`maxPriorityFeePerGas`)}get maxFeePerGas(){return this.#s??(this.type===2||this.type===3?Gs:null)}set maxFeePerGas(e){this.#s=e==null?null:mr(e,`maxFeePerGas`)}get data(){return this.#n}set data(e){this.#n=Q(e)}get value(){return this.#c}set value(e){this.#c=mr(e,`value`)}get chainId(){return this.#l}set chainId(e){this.#l=mr(e)}get signature(){return this.#u||null}set signature(e){this.#u=e==null?null:Ts.from(e)}isValid(){let e=this.signature;if(e&&!e.isValid())return!1;let t=this.authorizationList;if(t){for(let e of t)if(!e.signature.isValid())return!1}return!0}get accessList(){return(this.#d||null)??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#d=e==null?null:Bs(e)}get authorizationList(){let e=this.#g||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#g=e==null?null:e.map(e=>Ws(e))}get maxFeePerBlobGas(){let e=this.#f;return e==null&&this.type===3?Gs:e}set maxFeePerBlobGas(e){this.#f=e==null?null:mr(e,`maxFeePerBlobGas`)}get blobVersionedHashes(){let e=this.#p;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){X(Array.isArray(e),`blobVersionedHashes must be an Array`,`value`,e),e=e.slice();for(let t=0;t<e.length;t++)X(tr(e[t],32),`invalid blobVersionedHash`,`value[${t}]`,e[t])}this.#p=e}get blobs(){return this.#h==null?null:this.#h.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#h=null;return}let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(nr(i)){Y(this.#m,`adding a raw blob requires a KZG library`,`UNSUPPORTED_OPERATION`,{operation:`set blobs()`});let e=Z(i);if(X(e.length<=Qs,`blob is too large`,`blobs[${r}]`,i),e.length!==Qs){let t=new Uint8Array(Qs);t.set(e),e=t}let a=this.#m.blobToKzgCommitment(e),o=Q(this.#m.computeBlobKzgProof(e,a));t.push({data:Q(e),commitment:Q(a),proof:o}),n.push(tc(1,a))}else{let e=Q(i.data),r=Q(i.commitment),a=Q(i.proof);t.push({data:e,commitment:r,proof:a}),n.push(tc(1,r))}}this.#h=t,this.#p=n}get kzg(){return this.#m}set kzg(e){e==null?this.#m=null:this.#m=ec(e)}get blobWrapperVersion(){return this.#_}set blobWrapperVersion(e){this.#_=e}constructor(){this.#e=null,this.#t=null,this.#r=0,this.#i=Gs,this.#a=null,this.#o=null,this.#s=null,this.#n=`0x`,this.#c=Gs,this.#l=Gs,this.#u=null,this.#d=null,this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null,this.#_=null}get hash(){return this.signature==null?null:xi(this.#v(!0,!1))}get unsignedHash(){return xi(this.unsignedSerialized)}get from(){return this.signature==null?null:Hs(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:Es.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#v(e,t){Y(!e||this.signature!=null,`cannot serialize unsigned transaction; maybe you meant .unsignedSerialized`,`UNSUPPORTED_OPERATION`,{operation:`.serialized`});let n=e?this.signature:null;switch(this.inferType()){case 0:return dc(this,n);case 1:return gc(this,n);case 2:return mc(this,n);case 3:return vc(this,n,t?this.blobs:null);case 4:return bc(this,n)}Y(!1,`unsupported transaction type`,`UNSUPPORTED_OPERATION`,{operation:`.serialized`})}get serialized(){return this.#v(!0,!0)}get unsignedSerialized(){return this.#v(!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,r=this.#f!=null||this.#p;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Y(this.maxFeePerGas>=this.maxPriorityFeePerGas,`priorityFee cannot be more than maxFee`,`BAD_DATA`,{value:this}),Y(!t||this.type!==0&&this.type!==1,`transaction type cannot have maxFeePerGas or maxPriorityFeePerGas`,`BAD_DATA`,{value:this}),Y(this.type!==0||!n,`legacy transaction cannot have accessList`,`BAD_DATA`,{value:this});let i=[];return this.type==null?this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):r&&this.to?i.push(3):(i.push(0),i.push(1),i.push(2),i.push(3)):i.push(this.type),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return e.from(this)}toJSON(){let e=e=>e==null?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[Zs](){return this.toString()}toString(){let e=[],t=t=>{let n=this[t];typeof n==`string`&&(n=JSON.stringify(n)),e.push(`${t}: ${n}`)};this.type&&t(`type`),t(`to`),t(`data`),t(`nonce`),t(`gasLimit`),t(`value`),this.chainId!=null&&t(`chainId`),this.signature&&(t(`from`),e.push(`signature: ${this.signature.toString()}`));let n=this.authorizationList;if(n){let t=[];for(let e of n){let n=[];n.push(`address: ${JSON.stringify(e.address)}`),e.nonce!=null&&n.push(`nonce: ${e.nonce}`),e.chainId!=null&&n.push(`chainId: ${e.chainId}`),e.signature&&n.push(`signature: ${e.signature.toString()}`),t.push(`Authorization { ${n.join(`, `)} }`)}e.push(`authorizations: [ ${t.join(`, `)} ]`)}return`Transaction { ${e.join(`, `)} }`}static from(t){if(t==null)return new e;if(typeof t==`string`){let n=Z(t);if(n[0]>=127)return e.from(uc(n));switch(n[0]){case 1:return e.from(hc(n));case 2:return e.from(pc(n));case 3:return e.from(_c(n));case 4:return e.from(yc(n))}Y(!1,`unsupported transaction type`,`UNSUPPORTED_OPERATION`,{operation:`from`})}let n=new e;return t.type!=null&&(n.type=t.type),t.to!=null&&(n.to=t.to),t.nonce!=null&&(n.nonce=t.nonce),t.gasLimit!=null&&(n.gasLimit=t.gasLimit),t.gasPrice!=null&&(n.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(n.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(n.data=t.data),t.value!=null&&(n.value=t.value),t.chainId!=null&&(n.chainId=t.chainId),t.signature!=null&&(n.signature=Ts.from(t.signature)),t.accessList!=null&&(n.accessList=t.accessList),t.authorizationList!=null&&(n.authorizationList=t.authorizationList),t.blobVersionedHashes!=null&&(n.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(n.kzg=t.kzg),t.blobWrapperVersion!=null&&(n.blobWrapperVersion=t.blobWrapperVersion),t.blobs!=null&&(n.blobs=t.blobs),t.hash!=null&&(X(n.isSigned(),`unsigned transaction cannot define '.hash'`,`tx`,t),X(n.hash===t.hash,`hash mismatch`,`tx`,t)),t.from!=null&&(X(n.isSigned(),`unsigned transaction cannot define '.from'`,`tx`,t),X(n.from.toLowerCase()===(t.from||``).toLowerCase(),`from mismatch`,`tx`,t)),n}};function Sc(e){return X(typeof e.address==`string`,`invalid address for hashAuthorization`,`auth.address`,e),xi(ir([`0x05`,zr([e.chainId==null?`0x`:br(e.chainId),Fs(e.address),e.nonce==null?`0x`:br(e.nonce)])]))}function Cc(e){return xi(Ur(e))}function wc(e){return typeof e==`string`&&(e=Ur(e)),xi(ir([Ur(ps),Ur(String(e.length)),e]))}var Tc=new Uint8Array(32);Tc.fill(0);var Ec=BigInt(-1),Dc=BigInt(0),Oc=BigInt(1),kc=BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`);function Ac(e){let t=Z(e),n=t.length%32;return n?ir([t,Tc.slice(n)]):Q(t)}var jc=yr(Oc,32),Mc=yr(Dc,32),Nc={name:`string`,version:`string`,chainId:`uint256`,verifyingContract:`address`,salt:`bytes32`},Pc=[`name`,`version`,`chainId`,`verifyingContract`,`salt`];function Fc(e){return function(t){return X(typeof t==`string`,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}var Ic={name:Fc(`name`),version:Fc(`version`),chainId:function(e){let t=mr(e,`domain.chainId`);return X(t>=0,`invalid chain ID`,`domain.chainId`,e),Number.isSafeInteger(t)?Number(t):xr(t)},verifyingContract:function(e){try{return Fs(e).toLowerCase()}catch{}X(!1,`invalid domain value "verifyingContract"`,`domain.verifyingContract`,e)},salt:function(e){let t=Z(e,`domain.salt`);return X(t.length===32,`invalid domain value "salt"`,`domain.salt`,e),Q(t)}};function Lc(e){{let t=e.match(/^(u?)int(\d+)$/);if(t){let n=t[1]===``,r=parseInt(t[2]);X(r%8==0&&r!==0&&r<=256&&t[2]===String(r),`invalid numeric width`,`type`,e);let i=pr(kc,n?r-1:r),a=n?(i+Oc)*Ec:Dc;return function(t){let r=mr(t,`value`);return X(r>=a&&r<=i,`value out-of-bounds for ${e}`,`value`,r),yr(n?fr(r,256):r,32)}}}{let t=e.match(/^bytes(\d+)$/);if(t){let n=parseInt(t[1]);return X(n!==0&&n<=32&&t[1]===String(n),`invalid bytes width`,`type`,e),function(t){return X(Z(t).length===n,`invalid length for ${e}`,`value`,t),Ac(t)}}}switch(e){case`address`:return function(e){return cr(Fs(e),32)};case`bool`:return function(e){return e?jc:Mc};case`bytes`:return function(e){return xi(e)};case`string`:return function(e){return Cc(e)}}return null}function Rc(e,t){return`${e}(${t.map(({name:e,type:t})=>t+` `+e).join(`,`)})`}function zc(e){let t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}var Bc=class e{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#n;constructor(e){this.#t=new Map,this.#n=new Map;let t=new Map,n=new Map,r=new Map,i={};Object.keys(e).forEach(a=>{i[a]=e[a].map(({name:t,type:n})=>{let{base:r,index:i}=zc(n);return r===`int`&&!e.int&&(r=`int256`),r===`uint`&&!e.uint&&(r=`uint256`),{name:t,type:r+(i||``)}}),t.set(a,new Set),n.set(a,[]),r.set(a,new Set)}),this.#e=JSON.stringify(i);for(let r in i){let a=new Set;for(let o of i[r]){X(!a.has(o.name),`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,`types`,e),a.add(o.name);let i=zc(o.type).base;X(i!==r,`circular type reference to ${JSON.stringify(i)}`,`types`,e),!Lc(i)&&(X(n.has(i),`unknown type ${JSON.stringify(i)}`,`types`,e),n.get(i).push(r),t.get(r).add(i))}}let a=Array.from(n.keys()).filter(e=>n.get(e).length===0);X(a.length!==0,`missing primary type`,`types`,e),X(a.length===1,`ambiguous primary types or unused types: ${a.map(e=>JSON.stringify(e)).join(`, `)}`,`types`,e),qn(this,{primaryType:a[0]});function o(i,a){X(!a.has(i),`circular type reference to ${JSON.stringify(i)}`,`types`,e),a.add(i);for(let e of t.get(i))if(n.has(e)){o(e,a);for(let t of a)r.get(t).add(e)}a.delete(i)}o(this.primaryType,new Set);for(let[e,t]of r){let n=Array.from(t);n.sort(),this.#t.set(e,Rc(e,i[e])+n.map(e=>Rc(e,i[e])).join(``))}}getEncoder(e){let t=this.#n.get(e);return t||(t=this.#r(e),this.#n.set(e,t)),t}#r(e){{let t=Lc(e);if(t)return t}let t=zc(e).array;if(t){let e=t.prefix,n=this.getEncoder(e);return r=>{X(t.count===-1||t.count===r.length,`array length mismatch; expected length ${t.count}`,`value`,r);let i=r.map(n);return this.#t.has(e)&&(i=i.map(xi)),xi(ir(i))}}let n=this.types[e];if(n){let t=Cc(this.#t.get(e));return e=>{let r=n.map(({name:t,type:n})=>{let r=this.getEncoder(n)(e[t]);return this.#t.has(n)?xi(r):r});return r.unshift(t),ir(r)}}X(!1,`unknown type: ${e}`,`type`,e)}encodeType(e){let t=this.#t.get(e);return X(t,`unknown type: ${JSON.stringify(e)}`,`name`,e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return xi(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Lc(e))return n(e,t);let r=zc(e).array;if(r)return X(r.count===-1||r.count===t.length,`array length mismatch; expected length ${r.count}`,`value`,t),t.map(e=>this._visit(r.prefix,e,n));let i=this.types[e];if(i)return i.reduce((e,{name:r,type:i})=>(e[r]=this._visit(i,t[r],n),e),{});X(!1,`unknown type: ${e}`,`type`,e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(t){return new e(t)}static getPrimaryType(t){return e.from(t).primaryType}static hashStruct(t,n,r){return e.from(n).hashStruct(t,r)}static hashDomain(t){let n=[];for(let e in t){if(t[e]==null)continue;let r=Nc[e];X(r,`invalid typed-data domain key: ${JSON.stringify(e)}`,`domain`,t),n.push({name:e,type:r})}return n.sort((e,t)=>Pc.indexOf(e.name)-Pc.indexOf(t.name)),e.hashStruct(`EIP712Domain`,{EIP712Domain:n},t)}static encode(t,n,r){return ir([`0x1901`,e.hashDomain(t),e.from(n).hash(r)])}static hash(t,n,r){return xi(e.encode(t,n,r))}static async resolveNames(t,n,r,i){t=Object.assign({},t);for(let e in t)t[e]??delete t[e];let a={};t.verifyingContract&&!tr(t.verifyingContract,20)&&(a[t.verifyingContract]=`0x`);let o=e.from(n);o.visit(r,(e,t)=>(e===`address`&&!tr(t,20)&&(a[t]=`0x`),t));for(let e in a)a[e]=await i(e);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,(e,t)=>e===`address`&&a[t]?a[t]:t),{domain:t,value:r}}static getPayload(t,n,r){e.hashDomain(t);let i={},a=[];Pc.forEach(e=>{let n=t[e];n!=null&&(i[e]=Ic[e](n),a.push({name:e,type:Nc[e]}))});let o=e.from(n);n=o.types;let s=Object.assign({},n);return X(s.EIP712Domain==null,`types must not contain EIP712Domain type`,`types.EIP712Domain`,n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return Q(Z(t));if(e.match(/^u?int/))return mr(t).toString();switch(e){case`address`:return t.toLowerCase();case`bool`:return!!t;case`string`:return X(typeof t==`string`,`invalid string`,`value`,t),t}X(!1,`unsupported type`,`type`,e)})}}};function Vc(e){let t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=Q(e.data));let n=`chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value`.split(/,/);for(let r of n)!(r in e)||e[r]==null||(t[r]=mr(e[r],`request.${r}`));let r=`type,nonce`.split(/,/);for(let n of r)!(n in e)||e[n]==null||(t[n]=vr(e[n],`request.${n}`));return e.accessList&&(t.accessList=Bs(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),`blockTag`in e&&(t.blockTag=e.blockTag),`enableCcipRead`in e&&(t.enableCcipRead=!!e.enableCcipRead),`customData`in e&&(t.customData=e.customData),`blobVersionedHashes`in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),`kzg`in e&&(t.kzg=e.kzg),`blobWrapperVersion`in e&&(t.blobWrapperVersion=e.blobWrapperVersion),`blobs`in e&&e.blobs&&(t.blobs=e.blobs.map(e=>nr(e)?Q(e):Object.assign({},e))),t}function Hc(e,t){if(e.provider)return e.provider;Y(!1,`missing provider`,`UNSUPPORTED_OPERATION`,{operation:t})}async function Uc(e,t){let n=Vc(t);if(n.to!=null&&(n.to=Rs(n.to,e)),n.from!=null){let t=n.from;n.from=Promise.all([e.getAddress(),Rs(t,e)]).then(([e,t])=>(X(e.toLowerCase()===t.toLowerCase(),`transaction from mismatch`,`tx.from`,t),e))}else n.from=e.getAddress();return await Kn(n)}var Wc=class{provider;constructor(e){qn(this,{provider:e||null})}async getNonce(e){return Hc(this,`getTransactionCount`).getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Uc(this,e)}async populateTransaction(e){let t=Hc(this,`populateTransaction`),n=await Uc(this,e);n.nonce??=await this.getNonce(`pending`),n.gasLimit??=await this.estimateGas(n);let r=await this.provider.getNetwork();n.chainId==null?n.chainId=r.chainId:X(mr(n.chainId)===r.chainId,`transaction chainId mismatch`,`tx.chainId`,e.chainId);let i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?X(!1,`eip-1559 transaction do not support gasPrice`,`tx`,e):(n.type===0||n.type===1)&&i&&X(!1,`pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas`,`tx`,e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){let e=await t.getFeeData();Y(e.gasPrice!=null,`network does not support gasPrice`,`UNSUPPORTED_OPERATION`,{operation:`getGasPrice`}),n.gasPrice??=e.gasPrice}else{let e=await t.getFeeData();if(n.type==null)if(e.maxFeePerGas!=null&&e.maxPriorityFeePerGas!=null)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,n.gasPrice!=null){let e=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=e,n.maxPriorityFeePerGas=e}else n.maxFeePerGas??=e.maxFeePerGas,n.maxPriorityFeePerGas??=e.maxPriorityFeePerGas;else e.gasPrice==null?Y(!1,`failed to get consistent fee data`,`UNSUPPORTED_OPERATION`,{operation:`signer.getFeeData`}):(Y(!i,`network does not support EIP-1559`,`UNSUPPORTED_OPERATION`,{operation:`populateTransaction`}),n.gasPrice??=e.gasPrice,n.type=0);else(n.type===2||n.type===3||n.type===4)&&(n.maxFeePerGas??=e.maxFeePerGas,n.maxPriorityFeePerGas??=e.maxPriorityFeePerGas)}return await Kn(n)}async populateAuthorization(e){let t=Object.assign({},e);return t.chainId??=(await Hc(this,`getNetwork`).getNetwork()).chainId,t.nonce??=await this.getNonce(),t}async estimateGas(e){return Hc(this,`estimateGas`).estimateGas(await this.populateCall(e))}async call(e){return Hc(this,`call`).call(await this.populateCall(e))}async resolveName(e){return await Hc(this,`resolveName`).resolveName(e)}async sendTransaction(e){let t=Hc(this,`sendTransaction`),n=await this.populateTransaction(e);delete n.from;let r=xc.from(n);return await t.broadcastTransaction(await this.signTransaction(r))}authorize(e){Y(!1,`authorization not implemented for this signer`,`UNSUPPORTED_OPERATION`,{operation:`authorize`})}},Gc=class e extends Wc{address;constructor(e,t){super(t),qn(this,{address:e})}async getAddress(){return this.address}connect(t){return new e(this.address,t)}#e(e,t){Y(!1,`VoidSigner cannot sign ${e}`,`UNSUPPORTED_OPERATION`,{operation:t})}async signTransaction(e){this.#e(`transactions`,`signTransaction`)}async signMessage(e){this.#e(`messages`,`signMessage`)}async signTypedData(e,t,n){this.#e(`typed-data`,`signTypedData`)}},Kc=" !#$%&'()*+,-./<=>?@[]^_`{|}~",qc=/^[a-z]*$/i;function Jc(e,t){let n=97;return e.reduce((e,r)=>(r===t?n++:r.match(qc)?e.push(String.fromCharCode(n)+r):(n=97,e.push(r)),e),[])}function Yc(e,t){for(let n=28;n>=0;n--)e=e.split(Kc[n]).join(t.substring(2*n,2*n+2));let n=[],r=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(e,t,r,i)=>{if(r)for(let e=parseInt(r);e>=0;e--)n.push(`;`);else n.push(t.toLowerCase());return``});if(r)throw Error(`leftovers: ${JSON.stringify(r)}`);return Jc(Jc(n,`;`),`:`)}function Xc(e){return X(e[0]===`0`,`unsupported auwl data`,`data`,e),Yc(e.substring(59),e.substring(1,59))}var Zc=class{locale;constructor(e){qn(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(` `)}},Qc=class extends Zc{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#n=null}get _data(){return this.#e}_decodeWords(){return Xc(this.#e)}#n;#r(){if(this.#n==null){let e=this._decodeWords();if(Cc(e.join(`
|
|
3
3
|
`)+`
|
|
4
|
-
`)!==this.#t)throw Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#n=e}return this.#n}getWord(e){let t=this.#r();return X(e>=0&&e<t.length,`invalid word index: ${e}`,`index`,e),t[e]}getWordIndex(e){return this.#r().indexOf(e)}},$c="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",el=`0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60`,tl=null,nl=class e extends Qc{constructor(){super(`en`,$c,el)}static wordlist(){return tl??=new e,tl}},rl=class e extends Wc{address;#e;constructor(e,t){super(t),X(e&&typeof e.sign==`function`,`invalid private key`,`privateKey`,`[ REDACTED ]`),this.#e=e;let n=Vs(this.signingKey.publicKey);qn(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new e(this.#e,t)}async signTransaction(e){e=Vc(e);let{to:t,from:n}=await Kn({to:e.to?Rs(e.to,this):void 0,from:e.from?Rs(e.from,this):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&(X(Fs(e.from)===this.address,`transaction from address mismatch`,`tx.from`,e.from),delete e.from);let r=xc.from(e);return r.signature=this.signingKey.sign(r.unsignedHash),r.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(wc(e)).serialized}authorizeSync(e){X(typeof e.address==`string`,`invalid address for authorizeSync`,`auth.address`,e);let t=this.signingKey.sign(Sc(e));return Object.assign({},{address:Fs(e.address),nonce:mr(e.nonce||0),chainId:mr(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await Rs(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,n){let r=await Bc.resolveNames(e,t,n,async e=>{Y(this.provider!=null,`cannot resolve ENS names without a provider`,`UNSUPPORTED_OPERATION`,{operation:`resolveName`,info:{name:e}});let t=await this.provider.resolveName(e);return Y(t!=null,`unconfigured ENS name`,`UNCONFIGURED_NAME`,{value:e}),t});return this.signingKey.sign(Bc.hash(r.domain,t,r.value)).serialized}};function il(e){return(1<<e)-1<<8-e&255}function al(e){return(1<<e)-1&255}function ol(e,t){Zn(`NFKD`),t??=nl.wordlist();let n=t.split(e);X(n.length%3==0&&n.length>=12&&n.length<=24,`invalid mnemonic length`,`mnemonic`,`[ REDACTED ]`);let r=new Uint8Array(Math.ceil(11*n.length/8)),i=0;for(let e=0;e<n.length;e++){let a=t.getWordIndex(n[e].normalize(`NFKD`));X(a>=0,`invalid mnemonic word at index ${e}`,`mnemonic`,`[ REDACTED ]`);for(let e=0;e<11;e++)a&1<<10-e&&(r[i>>3]|=1<<7-i%8),i++}let a=32*n.length/3,o=il(n.length/3);return X((Z(ga(r.slice(0,a/8)))[0]&o)===(r[r.length-1]&o),`invalid mnemonic checksum`,`mnemonic`,`[ REDACTED ]`),Q(r.slice(0,a/8))}function sl(e,t){X(e.length%4==0&&e.length>=16&&e.length<=32,`invalid entropy size`,`entropy`,`[ REDACTED ]`),t??=nl.wordlist();let n=[0],r=11;for(let t=0;t<e.length;t++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=e[t],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[t]>>8-r,n.push(e[t]&al(8-r)),r+=3);let i=e.length/4,a=parseInt(ga(e).substring(2,4),16)&il(i);return n[n.length-1]<<=i,n[n.length-1]|=a>>8-i,t.join(n.map(e=>t.getWord(e)))}var cl={},ll=class e{phrase;password;wordlist;entropy;constructor(e,t,n,r,i){r??=``,i??=nl.wordlist(),Qn(e,cl,`Mnemonic`),qn(this,{phrase:n,password:r,wordlist:i,entropy:t})}computeSeed(){let e=Ur(`mnemonic`+this.password,`NFKD`);return Wi(Ur(this.phrase,`NFKD`),e,2048,64,`sha512`)}static fromPhrase(t,n,r){let i=ol(t,r);return t=sl(Z(i),r),new e(cl,i,t,n,r)}static fromEntropy(t,n,r){let i=Z(t,`entropy`),a=sl(i,r);return new e(cl,Q(i),a,n,r)}static entropyToPhrase(e,t){return sl(Z(e,`entropy`),t)}static phraseToEntropy(e,t){return ol(e,t)}static isValidMnemonic(e,t){try{return ol(e,t),!0}catch{}return!1}},ul=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},dl=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},fl,pl,ml,hl={16:10,24:12,32:14},gl=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],_l=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],vl=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],yl=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],bl=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],xl=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Sl=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Cl=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],wl=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Tl=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],El=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Dl=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ol=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],kl=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Al=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function jl(e){let t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}var Ml=class e{get key(){return ul(this,fl,`f`).slice()}constructor(t){if(fl.set(this,void 0),pl.set(this,void 0),ml.set(this,void 0),!(this instanceof e))throw Error("AES must be instanitated with `new`");dl(this,fl,new Uint8Array(t),`f`);let n=hl[this.key.length];if(n==null)throw TypeError(`invalid key size (must be 16, 24 or 32 bytes)`);dl(this,ml,[],`f`),dl(this,pl,[],`f`);for(let e=0;e<=n;e++)ul(this,ml,`f`).push([0,0,0,0]),ul(this,pl,`f`).push([0,0,0,0]);let r=(n+1)*4,i=this.key.length/4,a=jl(this.key),o;for(let e=0;e<i;e++)o=e>>2,ul(this,ml,`f`)[o][e%4]=a[e],ul(this,pl,`f`)[n-o][e%4]=a[e];let s=0,c=i,l;for(;c<r;){if(l=a[i-1],a[0]^=_l[l>>16&255]<<24^_l[l>>8&255]<<16^_l[l&255]<<8^_l[l>>24&255]^gl[s]<<24,s+=1,i!=8)for(let e=1;e<i;e++)a[e]^=a[e-1];else{for(let e=1;e<i/2;e++)a[e]^=a[e-1];l=a[i/2-1],a[i/2]^=_l[l&255]^_l[l>>8&255]<<8^_l[l>>16&255]<<16^_l[l>>24&255]<<24;for(let e=i/2+1;e<i;e++)a[e]^=a[e-1]}let e=0,t,o;for(;e<i&&c<r;)t=c>>2,o=c%4,ul(this,ml,`f`)[t][o]=a[e],ul(this,pl,`f`)[n-t][o]=a[e++],c++}for(let e=1;e<n;e++)for(let t=0;t<4;t++)l=ul(this,pl,`f`)[e][t],ul(this,pl,`f`)[e][t]=Dl[l>>24&255]^Ol[l>>16&255]^kl[l>>8&255]^Al[l&255]}encrypt(e){if(e.length!=16)throw TypeError(`invalid plaintext size (must be 16 bytes)`);let t=ul(this,ml,`f`).length-1,n=[0,0,0,0],r=jl(e);for(let e=0;e<4;e++)r[e]^=ul(this,ml,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=yl[r[t]>>24&255]^bl[r[(t+1)%4]>>16&255]^xl[r[(t+2)%4]>>8&255]^Sl[r[(t+3)%4]&255]^ul(this,ml,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ul(this,ml,`f`)[t][e],i[4*e]=(_l[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(_l[r[(e+1)%4]>>16&255]^a>>16)&255,i[4*e+2]=(_l[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(_l[r[(e+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw TypeError(`invalid ciphertext size (must be 16 bytes)`);let t=ul(this,pl,`f`).length-1,n=[0,0,0,0],r=jl(e);for(let e=0;e<4;e++)r[e]^=ul(this,pl,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=Cl[r[t]>>24&255]^wl[r[(t+3)%4]>>16&255]^Tl[r[(t+2)%4]>>8&255]^El[r[(t+1)%4]&255]^ul(this,pl,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ul(this,pl,`f`)[t][e],i[4*e]=(vl[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(vl[r[(e+3)%4]>>16&255]^a>>16)&255,i[4*e+2]=(vl[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(vl[r[(e+1)%4]&255]^a)&255;return i}};fl=new WeakMap,pl=new WeakMap,ml=new WeakMap;var Nl=class{constructor(e,t,n){if(n&&!(this instanceof n))throw Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Ml(t)},name:{enumerable:!0,value:e}})}},Pl=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},Fl=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Il,Ll,Rl,zl=class e extends Nl{constructor(t,n){super(`CTR`,t,e),Il.set(this,void 0),Ll.set(this,void 0),Rl.set(this,void 0),Pl(this,Rl,new Uint8Array(16),`f`),Fl(this,Rl,`f`).fill(0),Pl(this,Il,Fl(this,Rl,`f`),`f`),Pl(this,Ll,16,`f`),n??=1,typeof n==`number`?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(Fl(this,Rl,`f`))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>2**53-1)throw TypeError(`invalid counter initial integer value`);for(let t=15;t>=0;--t)Fl(this,Rl,`f`)[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw TypeError(`invalid counter initial Uint8Array value length`);Fl(this,Rl,`f`).set(e)}increment(){for(let e=15;e>=0;e--)if(Fl(this,Rl,`f`)[e]===255)Fl(this,Rl,`f`)[e]=0;else{Fl(this,Rl,`f`)[e]++;break}}encrypt(e){var t,n;let r=new Uint8Array(e);for(let e=0;e<r.length;e++)Fl(this,Ll,`f`)===16&&(Pl(this,Il,this.aes.encrypt(Fl(this,Rl,`f`)),`f`),Pl(this,Ll,0,`f`),this.increment()),r[e]^=Fl(this,Il,`f`)[Pl(this,Ll,(n=Fl(this,Ll,`f`),t=n++,n),`f`),t];return r}decrypt(e){return this.encrypt(e)}};Il=new WeakMap,Ll=new WeakMap,Rl=new WeakMap;function Bl(e,t){for(e=String(e);e.length<t;)e=`0`+e;return e}function Vl(e){return typeof e==`string`?Ur(e,`NFKC`):er(e)}var Hl=`m/44'/60'/0'/0/0`;function Ul(e){let t=e.salt==null?Ji(32):Z(e.salt,`options.salt`),n=1<<17,r=8,i=1;return e.scrypt&&(e.scrypt.N&&(n=e.scrypt.N),e.scrypt.r&&(r=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),X(typeof n==`number`&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),`invalid scrypt N parameter`,`options.N`,n),X(typeof r==`number`&&r>0&&Number.isSafeInteger(r),`invalid scrypt r parameter`,`options.r`,r),X(typeof i==`number`&&i>0&&Number.isSafeInteger(i),`invalid scrypt p parameter`,`options.p`,i),{name:`scrypt`,dkLen:32,salt:t,N:n,r,p:i}}function Wl(e,t,n,r){let i=Z(n.privateKey,`privateKey`),a=r.iv==null?Ji(16):Z(r.iv,`options.iv`);X(a.length===16,`invalid options.iv length`,`options.iv`,r.iv);let o=r.uuid==null?Ji(16):Z(r.uuid,`options.uuid`);X(o.length===16,`invalid options.uuid length`,`options.uuid`,r.iv);let s=e.slice(0,16),c=e.slice(16,32),l=Z(new zl(s,a).encrypt(i)),u=xi(ir([c,l])),d={address:n.address.substring(2).toLowerCase(),id:Wr(o),version:3,Crypto:{cipher:`aes-128-ctr`,cipherparams:{iv:Q(a).substring(2)},ciphertext:Q(l).substring(2),kdf:`scrypt`,kdfparams:{salt:Q(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:u.substring(2)}};if(n.mnemonic){let t=r.client==null?`ethers/${Wn}`:r.client,i=n.mnemonic.path||Hl,a=n.mnemonic.locale||`en`,o=e.slice(32,64),s=Z(n.mnemonic.entropy,`account.mnemonic.entropy`),c=Ji(16),l=Z(new zl(o,c).encrypt(s)),u=new Date;d[`x-ethers`]={client:t,gethFilename:`UTC--`+(u.getUTCFullYear()+`-`+Bl(u.getUTCMonth()+1,2)+`-`+Bl(u.getUTCDate(),2)+`T`+Bl(u.getUTCHours(),2)+`-`+Bl(u.getUTCMinutes(),2)+`-`+Bl(u.getUTCSeconds(),2)+`.0Z`)+`--`+d.address,path:i,locale:a,mnemonicCounter:Q(c).substring(2),mnemonicCiphertext:Q(l).substring(2),version:`0.1`}}return JSON.stringify(d)}function Gl(e,t,n){n??={};let r=Vl(t),i=Ul(n);return Wl(Z(la(r,i.salt,i.N,i.r,i.p,64)),i,e,n)}async function Kl(e,t,n){n??={};let r=Vl(t),i=Ul(n);return Wl(Z(await ca(r,i.salt,i.N,i.r,i.p,64,n.progressCallback)),i,e,n)}var ql=`m/44'/60'/0'/0/0`,Jl=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Yl=2147483648,Xl=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),Zl=`0123456789abcdef`;function Ql(e,t){let n=``;for(;e;)n=Zl[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n=`0`+n;return`0x`+n}function $l(e){let t=Z(e);return Dr(ir([t,or(ga(ga(t)),0,4)]))}var eu={};function tu(e,t,n,r){let i=new Uint8Array(37);e&Yl?(Y(r!=null,`cannot derive child of neutered node`,`UNSUPPORTED_OPERATION`,{operation:`deriveChild`}),i.set(Z(r),1)):i.set(Z(n));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;let a=Z(ti(`sha512`,t,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function nu(e,t){let n=t.split(`/`);X(n.length>0,`invalid path`,`path`,t),n[0]===`m`&&(X(e.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,`path`,t),n.shift());let r=e;for(let e=0;e<n.length;e++){let t=n[e];if(t.match(/^[0-9]+'$/)){let n=parseInt(t.substring(0,t.length-1));X(n<Yl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(Yl+n)}else if(t.match(/^[0-9]+$/)){let n=parseInt(t);X(n<Yl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(n)}else X(!1,`invalid path component`,`path[${e}]`,t)}return r}var ru=class e extends rl{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Qn(e,eu,`HDNodeWallet`),qn(this,{publicKey:t.compressedPublicKey});let l=or(Bi(ga(this.publicKey)),0,4);qn(this,{parentFingerprint:n,fingerprint:l,chainCode:r,path:i,index:a,depth:o}),qn(this,{mnemonic:s})}connect(t){return new e(eu,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}#e(){let e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&t.wordlist.locale===`en`&&t.password===``&&(e.mnemonic={path:this.path,locale:`en`,entropy:t.entropy}),e}async encrypt(e,t){return await Kl(this.#e(),e,{progressCallback:t})}encryptSync(e){return Gl(this.#e(),e)}get extendedKey(){return Y(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),$l(ir([`0x0488ADE4`,Ql(this.depth,1),this.parentFingerprint,Ql(this.index,4),this.chainCode,ir([`0x00`,this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new iu(eu,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=vr(t,`index`);X(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Yl&&(r+=`'`));let{IR:i,IL:a}=tu(n,this.chainCode,this.publicKey,this.privateKey);return new e(eu,new Es(yr((_r(a)+BigInt(this.privateKey))%Xl,32)),this.fingerprint,Q(i),r,n,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return nu(this,e)}static#t(t,n){X(nr(t),`invalid seed`,`seed`,`[REDACTED]`);let r=Z(t,`seed`);X(r.length>=16&&r.length<=64,`invalid seed`,`seed`,`[REDACTED]`);let i=Z(ti(`sha512`,Jl,r));return new e(eu,new Es(Q(i.slice(0,32))),`0x00000000`,Q(i.slice(32)),`m`,0,0,n,null)}static fromExtendedKey(t){let n=br(Or(t));X(n.length===82||$l(n.slice(0,78))===t,`invalid extended key`,`extendedKey`,`[ REDACTED ]`);let r=n[4],i=Q(n.slice(5,9)),a=parseInt(Q(n.slice(9,13)).substring(2),16),o=Q(n.slice(13,45)),s=n.slice(45,78);switch(Q(n.slice(0,4))){case`0x0488b21e`:case`0x043587cf`:{let e=Q(s);return new iu(eu,Vs(e),e,i,o,null,a,r,null)}case`0x0488ade4`:case`0x04358394 `:if(s[0]!==0)break;return new e(eu,new Es(s.slice(1)),i,o,null,a,r,null,null)}X(!1,`invalid extended key prefix`,`extendedKey`,`[ REDACTED ]`)}static createRandom(t,n,r){t??=``,n??=ql,r??=nl.wordlist();let i=ll.fromEntropy(Ji(16),t,r);return e.#t(i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){return n||=ql,e.#t(t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,r,i){n??=``,r??=ql,i??=nl.wordlist();let a=ll.fromPhrase(t,n,i);return e.#t(a.computeSeed(),a).derivePath(r)}static fromSeed(t){return e.#t(t,null)}},iu=class e extends Gc{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Qn(e,eu,`HDNodeVoidWallet`),qn(this,{publicKey:n});let l=or(Bi(ga(n)),0,4);qn(this,{publicKey:n,fingerprint:l,parentFingerprint:r,chainCode:i,path:a,index:o,depth:s})}connect(t){return new e(eu,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return Y(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),$l(ir([`0x0488B21E`,Ql(this.depth,1),this.parentFingerprint,Ql(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){let n=vr(t,`index`);X(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Yl&&(r+=`'`));let{IR:i,IL:a}=tu(n,this.chainCode,this.publicKey,null),o=Es.addPoints(a,this.publicKey,!0);return new e(eu,Vs(o),o,this.fingerprint,Q(i),r,n,this.depth+1,this.provider)}derivePath(e){return nu(this,e)}},au=i(((e,t)=>{t.exports={}})),ou=i(((t,n)=>{(function(t){var n=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},r=function(){throw Error(`no PRNG`)},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=n(),s=n([1]),c=n([56129,1]),l=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=r&255}function h(e,t,n,r,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function g(e,t,n,r){return h(e,t,n,r,16)}function _(e,t,n,r){return h(e,t,n,r,32)}function v(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;b=b+i|0,x=x+a|0,S=S+o|0,C=C+s|0,w=w+c|0,T=T+l|0,E=E+u|0,D=D+d|0,O=O+f|0,k=k+p|0,A=A+m|0,j=j+h|0,M=M+g|0,N=N+_|0,P=P+v|0,F=F+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=w>>>0&255,e[17]=w>>>8&255,e[18]=w>>>16&255,e[19]=w>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=E>>>0&255,e[25]=E>>>8&255,e[26]=E>>>16&255,e[27]=E>>>24&255,e[28]=D>>>0&255,e[29]=D>>>8&255,e[30]=D>>>16&255,e[31]=D>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=k>>>0&255,e[37]=k>>>8&255,e[38]=k>>>16&255,e[39]=k>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=j>>>0&255,e[45]=j>>>8&255,e[46]=j>>>16&255,e[47]=j>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=F>>>0&255,e[61]=F>>>8&255,e[62]=F>>>16&255,e[63]=F>>>24&255}function y(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=F>>>0&255,e[13]=F>>>8&255,e[14]=F>>>16&255,e[15]=F>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=O>>>0&255,e[25]=O>>>8&255,e[26]=O>>>16&255,e[27]=O>>>24&255,e[28]=k>>>0&255,e[29]=k>>>8&255,e[30]=k>>>16&255,e[31]=k>>>24&255}function b(e,t,n,r){v(e,t,n,r)}function x(e,t,n,r){y(e,t,n,r)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function C(e,t,n,r,i,a,o){var s=new Uint8Array(16),c=new Uint8Array(64),l,u;for(u=0;u<16;u++)s[u]=0;for(u=0;u<8;u++)s[u]=a[u];for(;i>=64;){for(b(c,s,o,S),u=0;u<64;u++)e[t+u]=n[r+u]^c[u];for(l=1,u=8;u<16;u++)l=l+(s[u]&255)|0,s[u]=l&255,l>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(c,s,o,S),u=0;u<i;u++)e[t+u]=n[r+u]^c[u];return 0}function w(e,t,n,r,i){var a=new Uint8Array(16),o=new Uint8Array(64),s,c;for(c=0;c<16;c++)a[c]=0;for(c=0;c<8;c++)a[c]=r[c];for(;n>=64;){for(b(o,a,i,S),c=0;c<64;c++)e[t+c]=o[c];for(s=1,c=8;c<16;c++)s=s+(a[c]&255)|0,a[c]=s&255,s>>>=8;n-=64,t+=64}if(n>0)for(b(o,a,i,S),c=0;c<n;c++)e[t+c]=o[c];return 0}function T(e,t,n,r,i){var a=new Uint8Array(32);x(a,r,i,S);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=r[s+16];return w(e,t,n,o,a)}function E(e,t,n,r,i,a,o){var s=new Uint8Array(32);x(s,a,o,S);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=a[l+16];return C(e,t,n,r,i,c,s)}var D=function(e){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;var t=e[0]&255|(e[1]&255)<<8,n,r,i,a,o,s,c;this.r[0]=t&8191,n=e[2]&255|(e[3]&255)<<8,this.r[1]=(t>>>13|n<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(n>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,a=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,o=e[10]&255|(e[11]&255)<<8,this.r[6]=(a>>>14|o<<2)&8191,s=e[12]&255|(e[13]&255)<<8,this.r[7]=(o>>>11|s<<5)&8065,c=e[14]&255|(e[15]&255)<<8,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8};D.prototype.blocks=function(e,t,n){for(var r=this.fin?0:2048,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=this.h[0],w=this.h[1],T=this.h[2],E=this.h[3],D=this.h[4],O=this.h[5],k=this.h[6],A=this.h[7],j=this.h[8],M=this.h[9],N=this.r[0],P=this.r[1],F=this.r[2],I=this.r[3],L=this.r[4],R=this.r[5],z=this.r[6],B=this.r[7],V=this.r[8],H=this.r[9];n>=16;)i=e[t+0]&255|(e[t+1]&255)<<8,C+=i&8191,a=e[t+2]&255|(e[t+3]&255)<<8,w+=(i>>>13|a<<3)&8191,o=e[t+4]&255|(e[t+5]&255)<<8,T+=(a>>>10|o<<6)&8191,s=e[t+6]&255|(e[t+7]&255)<<8,E+=(o>>>7|s<<9)&8191,c=e[t+8]&255|(e[t+9]&255)<<8,D+=(s>>>4|c<<12)&8191,O+=c>>>1&8191,l=e[t+10]&255|(e[t+11]&255)<<8,k+=(c>>>14|l<<2)&8191,u=e[t+12]&255|(e[t+13]&255)<<8,A+=(l>>>11|u<<5)&8191,d=e[t+14]&255|(e[t+15]&255)<<8,j+=(u>>>8|d<<8)&8191,M+=d>>>5|r,f=0,p=f,p+=C*N,p+=5*H*w,p+=5*V*T,p+=5*B*E,p+=5*z*D,f=p>>>13,p&=8191,p+=5*R*O,p+=5*L*k,p+=5*I*A,p+=5*F*j,p+=5*P*M,f+=p>>>13,p&=8191,m=f,m+=C*P,m+=w*N,m+=5*H*T,m+=5*V*E,m+=5*B*D,f=m>>>13,m&=8191,m+=5*z*O,m+=5*R*k,m+=5*L*A,m+=5*I*j,m+=5*F*M,f+=m>>>13,m&=8191,h=f,h+=C*F,h+=w*P,h+=T*N,h+=5*H*E,h+=5*V*D,f=h>>>13,h&=8191,h+=5*B*O,h+=5*z*k,h+=5*R*A,h+=5*L*j,h+=5*I*M,f+=h>>>13,h&=8191,g=f,g+=C*I,g+=w*F,g+=T*P,g+=E*N,g+=5*H*D,f=g>>>13,g&=8191,g+=5*V*O,g+=5*B*k,g+=5*z*A,g+=5*R*j,g+=5*L*M,f+=g>>>13,g&=8191,_=f,_+=C*L,_+=w*I,_+=T*F,_+=E*P,_+=D*N,f=_>>>13,_&=8191,_+=5*H*O,_+=5*V*k,_+=5*B*A,_+=5*z*j,_+=5*R*M,f+=_>>>13,_&=8191,v=f,v+=C*R,v+=w*L,v+=T*I,v+=E*F,v+=D*P,f=v>>>13,v&=8191,v+=O*N,v+=5*H*k,v+=5*V*A,v+=5*B*j,v+=5*z*M,f+=v>>>13,v&=8191,y=f,y+=C*z,y+=w*R,y+=T*L,y+=E*I,y+=D*F,f=y>>>13,y&=8191,y+=O*P,y+=k*N,y+=5*H*A,y+=5*V*j,y+=5*B*M,f+=y>>>13,y&=8191,b=f,b+=C*B,b+=w*z,b+=T*R,b+=E*L,b+=D*I,f=b>>>13,b&=8191,b+=O*F,b+=k*P,b+=A*N,b+=5*H*j,b+=5*V*M,f+=b>>>13,b&=8191,x=f,x+=C*V,x+=w*B,x+=T*z,x+=E*R,x+=D*L,f=x>>>13,x&=8191,x+=O*I,x+=k*F,x+=A*P,x+=j*N,x+=5*H*M,f+=x>>>13,x&=8191,S=f,S+=C*H,S+=w*V,S+=T*B,S+=E*z,S+=D*R,f=S>>>13,S&=8191,S+=O*L,S+=k*I,S+=A*F,S+=j*P,S+=M*N,f+=S>>>13,S&=8191,f=(f<<2)+f|0,f=f+p|0,p=f&8191,f>>>=13,m+=f,C=p,w=m,T=h,E=g,D=_,O=v,k=y,A=b,j=x,M=S,t+=16,n-=16;this.h[0]=C,this.h[1]=w,this.h[2]=T,this.h[3]=E,this.h[4]=D,this.h[5]=O,this.h[6]=k,this.h[7]=A,this.h[8]=j,this.h[9]=M},D.prototype.finish=function(e,t){var n=new Uint16Array(10),r,i,a,o;if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,n[0]=this.h[0]+5,r=n[0]>>>13,n[0]&=8191,o=1;o<10;o++)n[o]=this.h[o]+r,r=n[o]>>>13,n[o]&=8191;for(n[9]-=8192,i=(r^1)-1,o=0;o<10;o++)n[o]&=i;for(i=~i,o=0;o<10;o++)this.h[o]=this.h[o]&i|n[o];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,a=this.h[0]+this.pad[0],this.h[0]=a&65535,o=1;o<8;o++)a=(this.h[o]+this.pad[o]|0)+(a>>>16)|0,this.h[o]=a&65535;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},D.prototype.update=function(e,t,n){var r,i;if(this.leftover){for(i=16-this.leftover,i>n&&(i=n),r=0;r<i;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};function O(e,t,n,r,i,a){var o=new D(a);return o.update(n,r,i),o.finish(e,t),0}function k(e,t,n,r,i,a){var o=new Uint8Array(16);return O(o,0,n,r,i,a),g(e,t,o,0)}function A(e,t,n,r,i){var a;if(n<32)return-1;for(E(e,0,t,0,n,r,i),O(e,16,e,32,n-32,e),a=0;a<16;a++)e[a]=0;return 0}function j(e,t,n,r,i){var a,o=new Uint8Array(32);if(n<32||(T(o,0,32,r,i),k(t,16,t,32,n-32,o)!==0))return-1;for(E(e,0,t,0,n,r,i),a=0;a<32;a++)e[a]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function N(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function P(e,t,n){for(var r,i=~(n-1),a=0;a<16;a++)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function F(e,t){var r,i,a,o=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(N(s),N(s),N(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,P(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=s[r]&255,e[2*r+1]=s[r]>>8}function I(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return F(n,e),F(r,t),_(n,0,r,0)}function L(e){var t=new Uint8Array(32);return F(t,e),t[0]&1}function R(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function z(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function V(e,t,n){var r,i,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=n[0],L=n[1],R=n[2],z=n[3],B=n[4],V=n[5],H=n[6],ee=n[7],U=n[8],W=n[9],G=n[10],K=n[11],te=n[12],ne=n[13],re=n[14],ie=n[15];r=t[0],a+=r*I,o+=r*L,s+=r*R,c+=r*z,l+=r*B,u+=r*V,d+=r*H,f+=r*ee,p+=r*U,m+=r*W,h+=r*G,g+=r*K,_+=r*te,v+=r*ne,y+=r*re,b+=r*ie,r=t[1],o+=r*I,s+=r*L,c+=r*R,l+=r*z,u+=r*B,d+=r*V,f+=r*H,p+=r*ee,m+=r*U,h+=r*W,g+=r*G,_+=r*K,v+=r*te,y+=r*ne,b+=r*re,x+=r*ie,r=t[2],s+=r*I,c+=r*L,l+=r*R,u+=r*z,d+=r*B,f+=r*V,p+=r*H,m+=r*ee,h+=r*U,g+=r*W,_+=r*G,v+=r*K,y+=r*te,b+=r*ne,x+=r*re,S+=r*ie,r=t[3],c+=r*I,l+=r*L,u+=r*R,d+=r*z,f+=r*B,p+=r*V,m+=r*H,h+=r*ee,g+=r*U,_+=r*W,v+=r*G,y+=r*K,b+=r*te,x+=r*ne,S+=r*re,C+=r*ie,r=t[4],l+=r*I,u+=r*L,d+=r*R,f+=r*z,p+=r*B,m+=r*V,h+=r*H,g+=r*ee,_+=r*U,v+=r*W,y+=r*G,b+=r*K,x+=r*te,S+=r*ne,C+=r*re,w+=r*ie,r=t[5],u+=r*I,d+=r*L,f+=r*R,p+=r*z,m+=r*B,h+=r*V,g+=r*H,_+=r*ee,v+=r*U,y+=r*W,b+=r*G,x+=r*K,S+=r*te,C+=r*ne,w+=r*re,T+=r*ie,r=t[6],d+=r*I,f+=r*L,p+=r*R,m+=r*z,h+=r*B,g+=r*V,_+=r*H,v+=r*ee,y+=r*U,b+=r*W,x+=r*G,S+=r*K,C+=r*te,w+=r*ne,T+=r*re,E+=r*ie,r=t[7],f+=r*I,p+=r*L,m+=r*R,h+=r*z,g+=r*B,_+=r*V,v+=r*H,y+=r*ee,b+=r*U,x+=r*W,S+=r*G,C+=r*K,w+=r*te,T+=r*ne,E+=r*re,D+=r*ie,r=t[8],p+=r*I,m+=r*L,h+=r*R,g+=r*z,_+=r*B,v+=r*V,y+=r*H,b+=r*ee,x+=r*U,S+=r*W,C+=r*G,w+=r*K,T+=r*te,E+=r*ne,D+=r*re,O+=r*ie,r=t[9],m+=r*I,h+=r*L,g+=r*R,_+=r*z,v+=r*B,y+=r*V,b+=r*H,x+=r*ee,S+=r*U,C+=r*W,w+=r*G,T+=r*K,E+=r*te,D+=r*ne,O+=r*re,k+=r*ie,r=t[10],h+=r*I,g+=r*L,_+=r*R,v+=r*z,y+=r*B,b+=r*V,x+=r*H,S+=r*ee,C+=r*U,w+=r*W,T+=r*G,E+=r*K,D+=r*te,O+=r*ne,k+=r*re,A+=r*ie,r=t[11],g+=r*I,_+=r*L,v+=r*R,y+=r*z,b+=r*B,x+=r*V,S+=r*H,C+=r*ee,w+=r*U,T+=r*W,E+=r*G,D+=r*K,O+=r*te,k+=r*ne,A+=r*re,j+=r*ie,r=t[12],_+=r*I,v+=r*L,y+=r*R,b+=r*z,x+=r*B,S+=r*V,C+=r*H,w+=r*ee,T+=r*U,E+=r*W,D+=r*G,O+=r*K,k+=r*te,A+=r*ne,j+=r*re,M+=r*ie,r=t[13],v+=r*I,y+=r*L,b+=r*R,x+=r*z,S+=r*B,C+=r*V,w+=r*H,T+=r*ee,E+=r*U,D+=r*W,O+=r*G,k+=r*K,A+=r*te,j+=r*ne,M+=r*re,N+=r*ie,r=t[14],y+=r*I,b+=r*L,x+=r*R,S+=r*z,C+=r*B,w+=r*V,T+=r*H,E+=r*ee,D+=r*U,O+=r*W,k+=r*G,A+=r*K,j+=r*te,M+=r*ne,N+=r*re,P+=r*ie,r=t[15],b+=r*I,x+=r*L,S+=r*R,C+=r*z,w+=r*B,T+=r*V,E+=r*H,D+=r*ee,O+=r*U,k+=r*W,A+=r*G,j+=r*K,M+=r*te,N+=r*ne,P+=r*re,F+=r*ie,a+=38*x,o+=38*S,s+=38*C,c+=38*w,l+=38*T,u+=38*E,d+=38*D,f+=38*O,p+=38*k,m+=38*A,h+=38*j,g+=38*M,_+=38*N,v+=38*P,y+=38*F,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=p,e[9]=m,e[10]=h,e[11]=g,e[12]=_,e[13]=v,e[14]=y,e[15]=b}function H(e,t){V(e,t,t)}function ee(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)H(r,r),i!==2&&i!==4&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function U(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=250;i>=0;i--)H(r,r),i!==1&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function W(e,t,r){var i=new Uint8Array(32),a=new Float64Array(80),o,s,l=n(),u=n(),d=n(),f=n(),p=n(),m=n();for(s=0;s<31;s++)i[s]=t[s];for(i[31]=t[31]&127|64,i[0]&=248,R(a,r),s=0;s<16;s++)u[s]=a[s],f[s]=l[s]=d[s]=0;for(l[0]=f[0]=1,s=254;s>=0;--s)o=i[s>>>3]>>>(s&7)&1,P(l,u,o),P(d,f,o),z(p,l,d),B(l,l,d),z(d,u,f),B(u,u,f),H(f,p),H(m,l),V(l,d,l),V(d,u,p),z(p,l,d),B(l,l,d),H(u,l),B(d,f,m),V(l,d,c),z(l,l,f),V(d,d,l),V(l,f,m),V(f,u,a),H(u,p),P(l,u,o),P(d,f,o);for(s=0;s<16;s++)a[s+16]=l[s],a[s+32]=d[s],a[s+48]=u[s],a[s+64]=f[s];var h=a.subarray(32),g=a.subarray(16);return ee(h,h),V(g,g,h),F(e,g),0}function G(e,t){return W(e,t,a)}function K(e,t){return r(t,32),G(e,t)}function te(e,t,n){var r=new Uint8Array(32);return W(r,n,t),x(e,i,r,S)}var ne=A,re=j;function ie(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),ne(e,t,n,r,o)}function ae(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),re(e,t,n,r,o)}var oe=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function se(e,t,n,r){for(var i=new Int32Array(16),a=new Int32Array(16),o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=e[0],N=e[1],P=e[2],F=e[3],I=e[4],L=e[5],R=e[6],z=e[7],B=t[0],V=t[1],H=t[2],ee=t[3],U=t[4],W=t[5],G=t[6],K=t[7],te=0;r>=128;){for(w=0;w<16;w++)T=8*w+te,i[w]=n[T+0]<<24|n[T+1]<<16|n[T+2]<<8|n[T+3],a[w]=n[T+4]<<24|n[T+5]<<16|n[T+6]<<8|n[T+7];for(w=0;w<80;w++)if(o=M,s=N,c=P,l=F,u=I,d=L,f=R,p=z,m=B,h=V,g=H,_=ee,v=U,y=W,b=G,x=K,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(I>>>14|U<<18)^(I>>>18|U<<14)^(U>>>9|I<<23),D=(U>>>14|I<<18)^(U>>>18|I<<14)^(I>>>9|U<<23),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=I&L^~I&R,D=U&W^~U&G,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=oe[w*2],D=oe[w*2+1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=i[w%16],D=a[w%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,S=A&65535|j<<16,C=O&65535|k<<16,E=S,D=C,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(M>>>28|B<<4)^(B>>>2|M<<30)^(B>>>7|M<<25),D=(B>>>28|M<<4)^(M>>>2|B<<30)^(M>>>7|B<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=M&N^M&P^N&P,D=B&V^B&H^V&H,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,p=A&65535|j<<16,x=O&65535|k<<16,E=l,D=_,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=S,D=C,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,l=A&65535|j<<16,_=O&65535|k<<16,N=o,P=s,F=c,I=l,L=u,R=d,z=f,M=p,V=m,H=h,ee=g,U=_,W=v,G=y,K=b,B=x,w%16==15)for(T=0;T<16;T++)E=i[T],D=a[T],O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=i[(T+9)%16],D=a[(T+9)%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+1)%16],C=a[(T+1)%16],E=(S>>>1|C<<31)^(S>>>8|C<<24)^S>>>7,D=(C>>>1|S<<31)^(C>>>8|S<<24)^(C>>>7|S<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+14)%16],C=a[(T+14)%16],E=(S>>>19|C<<13)^(C>>>29|S<<3)^S>>>6,D=(C>>>19|S<<13)^(S>>>29|C<<3)^(C>>>6|S<<26),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,i[T]=A&65535|j<<16,a[T]=O&65535|k<<16;E=M,D=B,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[0],D=t[0],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[0]=M=A&65535|j<<16,t[0]=B=O&65535|k<<16,E=N,D=V,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[1],D=t[1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[1]=N=A&65535|j<<16,t[1]=V=O&65535|k<<16,E=P,D=H,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[2],D=t[2],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[2]=P=A&65535|j<<16,t[2]=H=O&65535|k<<16,E=F,D=ee,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[3],D=t[3],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[3]=F=A&65535|j<<16,t[3]=ee=O&65535|k<<16,E=I,D=U,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[4],D=t[4],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[4]=I=A&65535|j<<16,t[4]=U=O&65535|k<<16,E=L,D=W,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[5],D=t[5],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[5]=L=A&65535|j<<16,t[5]=W=O&65535|k<<16,E=R,D=G,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[6],D=t[6],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[6]=R=A&65535|j<<16,t[6]=G=O&65535|k<<16,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[7],D=t[7],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[7]=z=A&65535|j<<16,t[7]=K=O&65535|k<<16,te+=128,r-=128}return r}function ce(e,t,n){var r=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),o,s=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,se(r,i,t,n),n%=128,o=0;o<n;o++)a[o]=t[s-n+o];for(a[n]=128,n=256-128*(n<112),a[n-9]=0,m(a,n-8,s/536870912|0,s<<3),se(r,i,a,n),o=0;o<8;o++)m(e,8*o,r[o],i[o]);return 0}function le(e,t){var r=n(),i=n(),a=n(),o=n(),s=n(),c=n(),l=n(),d=n(),f=n();B(r,e[1],e[0]),B(f,t[1],t[0]),V(r,r,f),z(i,e[0],e[1]),z(f,t[0],t[1]),V(i,i,f),V(a,e[3],t[3]),V(a,a,u),V(o,e[2],t[2]),z(o,o,o),B(s,i,r),B(c,o,a),z(l,o,a),z(d,i,r),V(e[0],s,c),V(e[1],d,l),V(e[2],l,c),V(e[3],s,d)}function ue(e,t,n){var r;for(r=0;r<4;r++)P(e[r],t[r],n)}function de(e,t){var r=n(),i=n(),a=n();ee(a,t[2]),V(r,t[0],a),V(i,t[1],a),F(e,i),e[31]^=L(r)<<7}function fe(e,t,n){var r,i;for(M(e[0],o),M(e[1],s),M(e[2],s),M(e[3],o),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,ue(e,t,r),le(t,e),le(e,e),ue(e,t,r)}function pe(e,t){var r=[n(),n(),n(),n()];M(r[0],d),M(r[1],f),M(r[2],s),V(r[3],d,f),fe(e,r,t)}function me(e,t,i){var a=new Uint8Array(64),o=[n(),n(),n(),n()],s;for(i||r(t,32),ce(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,pe(o,a),de(e,o),s=0;s<32;s++)t[s+32]=e[s];return 0}var he=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ge(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*he[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*he[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*he[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function _e(e){var t=new Float64Array(64),n;for(n=0;n<64;n++)t[n]=e[n];for(n=0;n<64;n++)e[n]=0;ge(e,t)}function ve(e,t,r,i){var a=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),c,l,u=new Float64Array(64),d=[n(),n(),n(),n()];ce(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=r+64;for(c=0;c<r;c++)e[64+c]=t[c];for(c=0;c<32;c++)e[32+c]=a[32+c];for(ce(s,e.subarray(32),r+32),_e(s),pe(d,s),de(e,d),c=32;c<64;c++)e[c]=i[c];for(ce(o,e,r+64),_e(o),c=0;c<64;c++)u[c]=0;for(c=0;c<32;c++)u[c]=s[c];for(c=0;c<32;c++)for(l=0;l<32;l++)u[c+l]+=o[c]*a[l];return ge(e.subarray(32),u),f}function ye(e,t){var r=n(),i=n(),a=n(),c=n(),u=n(),d=n(),f=n();return M(e[2],s),R(e[1],t),H(a,e[1]),V(c,a,l),B(a,a,e[2]),z(c,e[2],c),H(u,c),H(d,u),V(f,d,u),V(r,f,a),V(r,r,c),U(r,r),V(r,r,a),V(r,r,c),V(r,r,c),V(e[0],r,c),H(i,e[0]),V(i,i,c),I(i,a)&&V(e[0],e[0],p),H(i,e[0]),V(i,i,c),I(i,a)?-1:(L(e[0])===t[31]>>7&&B(e[0],o,e[0]),V(e[3],e[0],e[1]),0)}function be(e,t,r,i){var a,o=new Uint8Array(32),s=new Uint8Array(64),c=[n(),n(),n(),n()],l=[n(),n(),n(),n()];if(r<64||ye(l,i))return-1;for(a=0;a<r;a++)e[a]=t[a];for(a=0;a<32;a++)e[a+32]=i[a];if(ce(s,e,r),_e(s),fe(c,l,s),pe(l,t.subarray(32)),le(c,l),de(o,c),r-=64,_(t,0,o,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=t[a+64];return r}var xe=32,Se=24,Ce=32,we=16,Te=32,Ee=32,De=32,Oe=32,ke=32,Ae=Se,je=Ce,Me=we,Ne=64,Pe=32,Fe=64,Ie=32,Le=64;t.lowlevel={crypto_core_hsalsa20:x,crypto_stream_xor:E,crypto_stream:T,crypto_stream_salsa20_xor:C,crypto_stream_salsa20:w,crypto_onetimeauth:O,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:_,crypto_secretbox:A,crypto_secretbox_open:j,crypto_scalarmult:W,crypto_scalarmult_base:G,crypto_box_beforenm:te,crypto_box_afternm:ne,crypto_box:ie,crypto_box_open:ae,crypto_box_keypair:K,crypto_hash:ce,crypto_sign:ve,crypto_sign_keypair:me,crypto_sign_open:be,crypto_secretbox_KEYBYTES:xe,crypto_secretbox_NONCEBYTES:Se,crypto_secretbox_ZEROBYTES:Ce,crypto_secretbox_BOXZEROBYTES:we,crypto_scalarmult_BYTES:Te,crypto_scalarmult_SCALARBYTES:Ee,crypto_box_PUBLICKEYBYTES:De,crypto_box_SECRETKEYBYTES:Oe,crypto_box_BEFORENMBYTES:ke,crypto_box_NONCEBYTES:Ae,crypto_box_ZEROBYTES:je,crypto_box_BOXZEROBYTES:Me,crypto_sign_BYTES:Ne,crypto_sign_PUBLICKEYBYTES:Pe,crypto_sign_SECRETKEYBYTES:Fe,crypto_sign_SEEDBYTES:Ie,crypto_hash_BYTES:Le,gf:n,D:l,L:he,pack25519:F,unpack25519:R,M:V,A:z,S:H,Z:B,pow2523:U,add:le,set25519:M,modL:ge,scalarmult:fe,scalarbase:pe};function q(e,t){if(e.length!==xe)throw Error(`bad key size`);if(t.length!==Se)throw Error(`bad nonce size`)}function Re(e,t){if(e.length!==De)throw Error(`bad public key size`);if(t.length!==Oe)throw Error(`bad secret key size`)}function ze(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError(`unexpected type, use Uint8Array`)}function Be(e){for(var t=0;t<e.length;t++)e[t]=0}t.randomBytes=function(e){var t=new Uint8Array(e);return r(t,e),t},t.secretbox=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(Ce+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+Ce]=e[a];return A(i,r,r.length,t,n),i.subarray(we)},t.secretbox.open=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(we+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+we]=e[a];return r.length<32||j(i,r,r.length,t,n)!==0?null:i.subarray(Ce)},t.secretbox.keyLength=xe,t.secretbox.nonceLength=Se,t.secretbox.overheadLength=we,t.scalarMult=function(e,t){if(ze(e,t),e.length!==Ee)throw Error(`bad n size`);if(t.length!==Te)throw Error(`bad p size`);var n=new Uint8Array(Te);return W(n,e,t),n},t.scalarMult.base=function(e){if(ze(e),e.length!==Ee)throw Error(`bad n size`);var t=new Uint8Array(Te);return G(t,e),t},t.scalarMult.scalarLength=Ee,t.scalarMult.groupElementLength=Te,t.box=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox(e,n,a)},t.box.before=function(e,t){ze(e,t),Re(e,t);var n=new Uint8Array(ke);return te(n,e,t),n},t.box.after=t.secretbox,t.box.open=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox.open(e,n,a)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var e=new Uint8Array(De),t=new Uint8Array(Oe);return K(e,t),{publicKey:e,secretKey:t}},t.box.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Oe)throw Error(`bad secret key size`);var t=new Uint8Array(De);return G(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},t.box.publicKeyLength=De,t.box.secretKeyLength=Oe,t.box.sharedKeyLength=ke,t.box.nonceLength=Ae,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(e,t){if(ze(e,t),t.length!==Fe)throw Error(`bad secret key size`);var n=new Uint8Array(Ne+e.length);return ve(n,e,e.length,t),n},t.sign.open=function(e,t){if(ze(e,t),t.length!==Pe)throw Error(`bad public key size`);var n=new Uint8Array(e.length),r=be(n,e,e.length,t);if(r<0)return null;for(var i=new Uint8Array(r),a=0;a<i.length;a++)i[a]=n[a];return i},t.sign.detached=function(e,n){for(var r=t.sign(e,n),i=new Uint8Array(Ne),a=0;a<i.length;a++)i[a]=r[a];return i},t.sign.detached.verify=function(e,t,n){if(ze(e,t,n),t.length!==Ne)throw Error(`bad signature size`);if(n.length!==Pe)throw Error(`bad public key size`);var r=new Uint8Array(Ne+e.length),i=new Uint8Array(Ne+e.length),a;for(a=0;a<Ne;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+Ne]=e[a];return be(i,r,r.length,n)>=0},t.sign.keyPair=function(){var e=new Uint8Array(Pe),t=new Uint8Array(Fe);return me(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Fe)throw Error(`bad secret key size`);for(var t=new Uint8Array(Pe),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},t.sign.keyPair.fromSeed=function(e){if(ze(e),e.length!==Ie)throw Error(`bad seed size`);for(var t=new Uint8Array(Pe),n=new Uint8Array(Fe),r=0;r<32;r++)n[r]=e[r];return me(t,n,!0),{publicKey:t,secretKey:n}},t.sign.publicKeyLength=Pe,t.sign.secretKeyLength=Fe,t.sign.seedLength=Ie,t.sign.signatureLength=Ne,t.hash=function(e){ze(e);var t=new Uint8Array(Le);return ce(t,e,e.length),t},t.hash.hashLength=Le,t.verify=function(e,t){return ze(e,t),e.length===0||t.length===0||e.length!==t.length?!1:h(e,0,t,0,e.length)===0},t.setPRNG=function(e){r=e},(function(){var n=typeof self<`u`?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var r=65536;t.setPRNG(function(e,t){var i,a=new Uint8Array(t);for(i=0;i<t;i+=r)n.getRandomValues(a.subarray(i,i+Math.min(t-i,r)));for(i=0;i<t;i++)e[i]=a[i];Be(a)})}else e!==void 0&&(n=au(),n&&n.randomBytes&&t.setPRNG(function(e,t){var r,i=n.randomBytes(t);for(r=0;r<t;r++)e[r]=i[r];Be(i)}))})()})(n!==void 0&&n.exports?n.exports:self.nacl=self.nacl||{})})),su=r(ou(),1),cu=`/most.box/`,lu=5e4,uu=32,du=1,fu=8,pu=9+su.default.secretbox.nonceLength,mu=pu+su.default.secretbox.overheadLength,hu=new TextEncoder().encode(`MP-AE`);function gu(e,t){let n=Ur(cu+e),r=Z(ga(Z(Wi(Ur(t),n,lu,uu,`sha512`)))),i=ll.entropyToPhrase(r);return{username:e,address:ru.fromPhrase(i).address,danger:Q(r)}}function _u(e){return ll.entropyToPhrase(Z(e))}function vu(e){let t=su.default.box.keyPair.fromSecretKey(Z(e)),n=su.default.sign.keyPair.fromSeed(Z(e));return{public_key:Q(t.publicKey),private_key:Q(t.secretKey),ed_public_key:Q(n.publicKey)}}async function yu(e,t){let n=ru.fromPhrase(_u(e));return{address:n.address,signature:await n.signMessage(t)}}function bu(e,t){let n=new TextEncoder().encode(e),r=su.default.randomBytes(su.default.secretbox.nonceLength),i=Z(t).slice(0,su.default.secretbox.keyLength),a=su.default.secretbox(n,r,i);return[`mp://1`,Ar(r),Ar(a)].join(`.`)}function xu(e,t){let[n,r,i]=String(e||``).split(`.`);if(n!==`mp://1`||!r||!i)return``;let a=Z(t).slice(0,su.default.secretbox.keyLength),o=su.default.secretbox.open(kr(i),kr(r),a);return o?new TextDecoder().decode(o):``}function Su(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Cu(e){return Ar(e).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replaceAll(`=`,``)}function wu(e){let t=String(e||``).trim();if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return null;try{return kr(t.replaceAll(`-`,`+`).replaceAll(`_`,`/`).padEnd(Math.ceil(t.length/4)*4,`=`))}catch{return null}}function Tu(e){let t=new Uint8Array(fu);return new DataView(t.buffer).setBigUint64(0,BigInt(e),!1),t}function Eu(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return Number(t.getBigUint64(0,!1))}function Du(e){let t=wu(e);if(!t||t.length<mu||t[0]!==du)return null;let n=t.slice(1,9),r=t.slice(9,pu),i=t.slice(pu);return{version:t[0],timestampMs:Eu(n),nonce:r,encrypted:i}}function Ou(e,t,n){return su.default.hash(Su([hu,e,t,n])).slice(0,su.default.secretbox.keyLength)}function ku(e,{senderPrivateKey:t,recipientPublicKey:n}){let r=Z(t),i=su.default.box.keyPair.fromSecretKey(r).publicKey,a=Z(n),o=Ou(i,a,su.default.box.before(a,r)),s=su.default.randomBytes(su.default.secretbox.nonceLength),c=su.default.secretbox(new TextEncoder().encode(e),s,o);return Cu(Su([new Uint8Array([du]),Tu(Date.now()),s,c]))}function Au(e){let t=Du(e);return t?{version:t.version,timestampMs:t.timestampMs,nonce:Cu(t.nonce)}:null}function ju(e,{senderPublicKey:t,recipientPrivateKey:n}){let r=Du(e);if(!r)return``;try{let e=Z(n),i=su.default.box.keyPair.fromSecretKey(e).publicKey,a=Z(t),o=Ou(a,i,su.default.box.before(a,e)),s=su.default.secretbox.open(r.encrypted,r.nonce,o);return s?new TextDecoder().decode(s):``}catch{return``}}function Mu(e,t){let{address:n,danger:r}=gu(e,t);return{username:e,address:n,danger:r,displayName:`${e}#${n.slice(-4).toUpperCase()}`}}function Nu(){if(typeof localStorage>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function Pu(e){typeof localStorage>`u`||localStorage.setItem(`mostbox_identity`,JSON.stringify(e))}function Fu(){typeof localStorage>`u`||localStorage.removeItem(`mostbox_identity`)}function Iu(e){return`${e.username}#${e.address.slice(-4).toUpperCase()}`}function Lu(e){return e.displayName?e.displayName:Iu(e)}function Ru(e){if(!e||typeof e!=`object`)return null;let t=e;if(!t.username||!t.address||!t.danger)return null;let n=t.address,r=Lu(t),i=typeof t.avatar==`string`&&t.avatar.trim()||void 0,a=Number(t.profileUpdatedAt);return{username:t.username,address:n,danger:t.danger,displayName:r,logo:typeof t.logo==`string`?t.logo:void 0,logo_dark:typeof t.logo_dark==`string`?t.logo_dark:void 0,data:typeof t.data==`string`&&t.data.trim()||void 0,avatar:i,profileUpdatedAt:Number.isFinite(a)&&a>0?Math.floor(a):void 0,theme:t.theme===`sparkbit`?t.theme:void 0}}function zu(){return{loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``}}var Bu=Vt((e,t)=>({identity:null,wallet:void 0,firstPath:``,showLoginModal:!1,loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``,pendingCloudRestoreAddress:null,setFirstPath:t=>{e({firstPath:t||`/`})},initializeUser:()=>{let t=Ru(Nu());t||Fu(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:``})},closeLoginModal:()=>{e({showLoginModal:!1,...zu()})},setLoginUsername:t=>{e({loginUsername:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},setLoginPassword:t=>{e({loginPassword:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},togglePassword:()=>{e(e=>({showPassword:!e.showPassword}))},previewLoginIdentity:()=>{let{loginUsername:n,loginPassword:r}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;let i=Mu(n.trim(),r);return e({loginPreviewAddress:i.address,hasPreviewedAvatar:!0,loginError:``}),i},loginUser:()=>{let{loginUsername:n,loginPassword:r,hasPreviewedAvatar:i}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;if(!i)return e({loginError:`login.error.previewRequired`}),null;e({loginLoading:!0,loginError:``});try{let t=Mu(n.trim(),r);return Pu(t),e({identity:t,wallet:t,pendingCloudRestoreAddress:t.address,showLoginModal:!1,...zu()}),t}catch{return e({loginLoading:!1,loginError:`login.error.failed`}),null}},setUserIdentity:t=>{let n=Ru(t);n&&(Pu(n),e({identity:n,wallet:n}))},consumePendingCloudRestore:n=>{let r=t().pendingCloudRestoreAddress;return!r||r.toLowerCase()!==n.toLowerCase()?!1:(e({pendingCloudRestoreAddress:null}),!0)},logoutUser:()=>{Fu(),e({identity:null,wallet:void 0,pendingCloudRestoreAddress:null})}}));function Vu(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function Hu(e){if(e instanceof Uint8Array&&e.constructor.name===`Uint8Array`)return Wu(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return Wu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));throw Error(`Unknown type, must be binary type`)}function Uu(e){return e?.buffer instanceof ArrayBuffer}function Wu(e){return Uu(e)?e:e.slice()}function Gu(e,t,n){if(e.length>=255)throw TypeError(`Alphabet too long`);for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var a=0;a<e.length;a++){var o=e.charAt(a),s=o.charCodeAt(0);if(r[s]!==255)throw TypeError(o+` is ambiguous`);if(r[s]=a,n){var c=o.toLowerCase().charCodeAt(0),l=o.toUpperCase().charCodeAt(0);c!==s&&(r[c]=a),l!==s&&(r[l]=a)}}var u=e.length,d=e.charAt(0),f=Math.log(u)/Math.log(256),p=Math.log(256)/Math.log(u);function m(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError(`Expected Uint8Array`);if(t.length===0)return``;for(var n=0,r=0,i=0,a=t.length;i!==a&&t[i]===0;)i++,n++;for(var o=(a-i)*p+1>>>0,s=new Uint8Array(o);i!==a;){for(var c=t[i],l=0,f=o-1;(c!==0||l<r)&&f!==-1;f--,l++)c+=256*s[f]>>>0,s[f]=c%u>>>0,c=c/u>>>0;if(c!==0)throw Error(`Non-zero carry`);r=l,i++}for(var m=o-r;m!==o&&s[m]===0;)m++;for(var h=d.repeat(n);m<o;++m)h+=e.charAt(s[m]);return h}function h(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return new Uint8Array;var t=0;if(e[t]!==` `){for(var n=0,i=0;e[t]===d;)n++,t++;for(var a=(e.length-t)*f+1>>>0,o=new Uint8Array(a);e[t];){var s=r[e.charCodeAt(t)];if(s===255)return;for(var c=0,l=a-1;(s!==0||c<i)&&l!==-1;l--,c++)s+=u*o[l]>>>0,o[l]=s%256>>>0,s=s/256>>>0;if(s!==0)throw Error(`Non-zero carry`);i=c,t++}if(e[t]!==` `){for(var p=a-i;p!==a&&o[p]===0;)p++;for(var m=new Uint8Array(n+(a-p)),h=n;p!==a;)m[h++]=o[p++];return m}}}function g(e){var n=h(e);if(n)return n;throw Error(`Non-${t} character`)}return{encode:m,decodeUnsafe:h,decode:g}}var Ku=Gu,qu=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error(`Unknown type, must be binary type`)}},Ju=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw Error(`Invalid prefix character`);this.prefixCodePoint=r,this.baseDecode=n}decode(e){if(typeof e==`string`){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error(`Can only multibase decode strings`)}or(e){return Xu(this,e)}},Yu=class{decoders;constructor(e){this.decoders=e}or(e){return Xu(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Xu(e,t){return new Yu({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var Zu=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new qu(e,t,n),this.decoder=new Ju(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Qu({name:e,prefix:t,encode:n,decode:r}){return new Zu(e,t,n,r)}function $u({name:e,prefix:t,alphabet:n,caseInsensitive:r=!1}){let{encode:i,decode:a}=Ku(n,e,r);return Qu({prefix:t,name:e,encode:i,decode:e=>Hu(a(e))})}function ed(e,t,n,r){let i=e.length;for(;e[i-1]===`=`;)--i;let a=new Uint8Array(i*n/8|0),o=0,s=0,c=0;for(let l=0;l<i;++l){let i=t[e[l]];if(i===void 0)throw SyntaxError(`Non-${r} character`);s=s<<n|i,o+=n,o>=8&&(o-=8,a[c++]=255&s>>o)}if(o>=n||255&s<<8-o)throw SyntaxError(`Unexpected end of data`);return a}function td(e,t,n){let r=t[t.length-1]===`=`,i=(1<<n)-1,a=``,o=0,s=0;for(let r=0;r<e.length;++r)for(s=s<<8|e[r],o+=8;o>n;)o-=n,a+=t[i&s>>o];if(o!==0&&(a+=t[i&s<<n-o]),r)for(;a.length*n&7;)a+=`=`;return a}function nd(e,t){let n={};for(let r=0;r<e.length;++r)if(n[e[r]]=r,t){let t=e[r].toLowerCase(),i=e[r].toUpperCase();t!==e[r]&&(n[t]=r),i!==e[r]&&(n[i]=r)}return n}function rd({name:e,prefix:t,bitsPerChar:n,alphabet:r,caseInsensitive:i=!1}){let a=nd(r,i);return Qu({prefix:t,name:e,encode(e){return td(e,r,n)},decode(t){return ed(t,a,n,e)}})}var id=rd({prefix:`b`,name:`base32`,alphabet:`abcdefghijklmnopqrstuvwxyz234567`,bitsPerChar:5,caseInsensitive:!0});rd({prefix:`B`,name:`base32upper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`c`,name:`base32pad`,alphabet:`abcdefghijklmnopqrstuvwxyz234567=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`C`,name:`base32padupper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`v`,name:`base32hex`,alphabet:`0123456789abcdefghijklmnopqrstuv`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`V`,name:`base32hexupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`t`,name:`base32hexpad`,alphabet:`0123456789abcdefghijklmnopqrstuv=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`T`,name:`base32hexpadupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`h`,name:`base32z`,alphabet:`ybndrfg8ejkmcpqxot1uwisza345h769`,bitsPerChar:5});var ad=$u({prefix:`k`,name:`base36`,alphabet:`0123456789abcdefghijklmnopqrstuvwxyz`,caseInsensitive:!0});$u({prefix:`K`,name:`base36upper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`,caseInsensitive:!0});var od=$u({name:`base58btc`,prefix:`z`,alphabet:`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`});$u({name:`base58flickr`,prefix:`Z`,alphabet:`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`});var sd=dd,cd=128,ld=-128,ud=2**31;function dd(e,t,n){t||=[],n||=0;for(var r=n;e>=ud;)t[n++]=e&255|cd,e/=128;for(;e&ld;)t[n++]=e&255|cd,e>>>=7;return t[n]=e|0,dd.bytes=n-r+1,t}var fd=hd,pd=128,md=127;function hd(e,t){var n=0,t=t||0,r=0,i=t,a,o=e.length;do{if(i>=o)throw hd.bytes=0,RangeError(`Could not decode varint`);a=e[i++],n+=r<28?(a&md)<<r:(a&md)*2**r,r+=7}while(a>=pd);return hd.bytes=i-t,n}var gd=2**7,_d=2**14,vd=2**21,yd=2**28,bd=2**35,xd=2**42,Sd=2**49,Cd=2**56,wd=2**63,Td={encode:sd,decode:fd,encodingLength:function(e){return e<gd?1:e<_d?2:e<vd?3:e<yd?4:e<bd?5:e<xd?6:e<Sd?7:e<Cd?8:e<wd?9:10}};function Ed(e,t=0){return[Td.decode(e,t),Td.decode.bytes]}function Dd(e,t,n=0){return Td.encode(e,t,n),t}function Od(e){return Td.encodingLength(e)}function kd(e,t){let n=t.byteLength,r=Od(e),i=r+Od(n),a=new Uint8Array(i+n);return Dd(e,a,0),Dd(n,a,r),a.set(t,i),new Md(e,n,t,a)}function Ad(e){let t=Hu(e),[n,r]=Ed(t),[i,a]=Ed(t.subarray(r)),o=t.subarray(r+a);if(o.byteLength!==i)throw Error(`Incorrect length`);return new Md(n,i,o,t)}function jd(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&Vu(e.bytes,n.bytes)}}var Md=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=Wu(n),this.bytes=Wu(r)}};function Nd(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return Rd(n,Fd(e),t??od.encoder);default:return zd(n,Fd(e),t??id.encoder)}}var Pd=new WeakMap;function Fd(e){let t=Pd.get(e);if(t==null){let t=new Map;return Pd.set(e,t),t}return t}var Id=class e{code;version;multihash;bytes;"/";constructor(e,t,n,r){this.code=t,this.version=e,this.multihash=n,this.bytes=Wu(r),this[`/`]=this.bytes}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:n}=this;if(t!==Bd)throw Error(`Cannot convert a non dag-pb CID to CIDv0`);if(n.code!==Vd)throw Error(`Cannot convert non sha2-256 multihash CID to CIDv0`);return e.createV0(n)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:n}=this.multihash,r=kd(t,n);return e.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&jd(e.multihash,n.multihash)}toString(e){return Nd(this,e)}toJSON(){return{"/":Nd(this)}}link(){return this}[Symbol.toStringTag]=`CID`;[Symbol.for(`nodejs.util.inspect.custom`)](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let n=t;if(n instanceof e)return n;if(n[`/`]!=null&&n[`/`]===n.bytes||n.asCID===n){let{version:t,code:r,multihash:i,bytes:a}=n;return new e(t,r,i,a??Hd(t,r,i.bytes))}else if(n[Ud]===!0){let{version:t,multihash:r,code:i}=n,a=Ad(r);return e.create(t,i,a)}else return null}static create(t,n,r){if(typeof n!=`number`)throw Error(`String codecs are no longer supported`);if(!(r.bytes instanceof Uint8Array))throw Error(`Invalid digest`);switch(t){case 0:if(n!==Bd)throw Error(`Version 0 CID must use dag-pb (code: ${Bd}) block encoding`);return new e(t,n,r,r.bytes);case 1:return new e(t,n,r,Hd(t,n,r.bytes));default:throw Error(`Invalid version`)}}static createV0(t){return e.create(0,Bd,t)}static createV1(t,n){return e.create(1,t,n)}static decode(t){let[n,r]=e.decodeFirst(t);if(r.length!==0)throw Error(`Incorrect length`);return n}static decodeFirst(t){let n=e.inspectBytes(t),r=n.size-n.multihashSize,i=Hu(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw Error(`Incorrect length`);let a=i.subarray(n.multihashSize-n.digestSize),o=new Md(n.multihashCode,n.digestSize,a,i);return[n.version===0?e.createV0(o):e.createV1(n.codec,o),t.subarray(n.size)]}static inspectBytes(e){let t=0,n=()=>{let[n,r]=Ed(e.subarray(t));return t+=r,n},r=n(),i=Bd;if(r===18?(r=0,t=0):i=n(),r!==0&&r!==1)throw RangeError(`Invalid CID version ${r}`);let a=t,o=n(),s=n(),c=t+s,l=c-a;return{version:r,codec:i,multihashCode:o,digestSize:s,multihashSize:l,size:c}}static parse(t,n){let[r,i]=Ld(t,n),a=e.decode(i);if(a.version===0&&t[0]!==`Q`)throw Error(`Version 0 CID string must not include multibase prefix`);return Fd(a).set(r,t),a}};function Ld(e,t){switch(e[0]){case`Q`:{let n=t??od;return[od.prefix,n.decode(`${od.prefix}${e}`)]}case od.prefix:{let n=t??od;return[od.prefix,n.decode(e)]}case id.prefix:{let n=t??id;return[id.prefix,n.decode(e)]}case ad.prefix:{let n=t??ad;return[ad.prefix,n.decode(e)]}default:if(t==null)throw Error(`To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided`);return[e[0],t.decode(e)]}}function Rd(e,t,n){let{prefix:r}=n;if(r!==od.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let i=n.encode(e).slice(1);return t.set(r,i),i}else return i}function zd(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let i=n.encode(e);return t.set(r,i),i}else return i}var Bd=112,Vd=18;function Hd(e,t,n){let r=Od(e),i=r+Od(t),a=new Uint8Array(i+n.byteLength);return Dd(e,a,0),Dd(t,a,r),a.set(n,i),a}var Ud=Symbol.for(`@ipld/js-cid/CID`),Wd=20;function Gd({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new Kd(e,t,n,r,i)}var Kd=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??Wd,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?qd(n,this.code,t?.truncate):n.then(e=>qd(e,this.code,t?.truncate))}else throw Error(`Unknown type, must be binary type`)}};function qd(e,t,n){if(n!=null&&n!==e.byteLength){if(n>e.byteLength)throw Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,n)}return kd(t,e)}function Jd(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var Yd=Gd({name:`sha2-256`,code:18,encode:Jd(`SHA-256`)});Gd({name:`sha2-512`,code:19,encode:Jd(`SHA-512`)});function Xd(e=``){return String(e).replace(/\\/g,`/`).split(`/`).map(e=>e.trim()).filter(e=>e&&e!==`.`).filter(e=>e!==`..`).join(`/`)}function Zd(e){let t=Xd(e?.path||``),n=String(e?.name||``).trim();return t?`${t}/${n}`:n}var Qd={EMPTY:`empty`,SLASH:`slash`,BACKSLASH:`backslash`};function $d(e){let t=String(e||``).trim();return t?t.includes(`/`)?{valid:!1,errorCode:Qd.SLASH,error:`Name cannot contain /`}:t.includes(`\\`)?{valid:!1,errorCode:Qd.BACKSLASH,error:`Name cannot contain \\`}:{valid:!0,name:t}:{valid:!1,errorCode:Qd.EMPTY,error:`Name is required`}}async function ef(e=``){let t=new TextEncoder().encode(String(e)),n=await Yd.digest(t);return Id.create(1,85,n).toString()}function tf(e,t,n,r){let i=Xd(t),a=Xd(n),o=String(r||``).trim(),s=Xd(a?`${a}/${o}`:o),c=Date.now();return e.map(e=>{let t=Zd(e);if(t===i)return{...e,path:a,name:o,updated_at:c};if(t.startsWith(`${i}/`)){let n=Xd(`${s}/${t.slice(i.length+1)}`),r=n.lastIndexOf(`/`);return{...e,path:r===-1?``:n.slice(0,r),name:n.slice(r+1),updated_at:c}}return e})}var nf=class extends Error{name=`KyError`;get isKyError(){return!0}},rf=class extends nf{name=`HTTPError`;response;request;options;data;constructor(e,t,n){let r=`${e.status||e.status===0?e.status:``} ${e.statusText??``}`.trim(),i=r?`status code ${r}`:`an unknown error`;super(`Request failed with ${i}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=n}},af=class extends nf{name=`NetworkError`;request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},of=class extends Error{name=`NonError`;value;constructor(e){let t=`Non-error value was thrown`;try{typeof e==`string`?t=e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`&&(t=e.message)}catch{}super(t),this.value=e}},sf=class extends nf{name=`ForceRetryError`;customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new of(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:`Forced retry`,t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},cf=class extends Error{name=`SchemaValidationError`;issues;constructor(e){super(`Response schema validation failed`),this.issues=e}},lf=class extends nf{name=`TimeoutError`;request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},uf=(()=>{let e=!1,t=!1,n=typeof globalThis.ReadableStream==`function`,r=typeof globalThis.Request==`function`;if(n&&r)try{t=new globalThis.Request(`https://empty.invalid`,{body:new globalThis.ReadableStream,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`)}catch(e){if(e instanceof Error&&e.message===`unsupported BodyInit type`)return!1;throw e}return e&&!t})(),df=typeof globalThis.AbortController==`function`,ff=typeof globalThis.AbortSignal==`function`&&typeof globalThis.AbortSignal.any==`function`,pf=typeof globalThis.ReadableStream==`function`,mf=typeof globalThis.FormData==`function`,hf=[`get`,`post`,`put`,`patch`,`head`,`delete`],gf={json:`application/json`,text:`text/*`,formData:`multipart/form-data`,arrayBuffer:`*/*`,blob:`*/*`,bytes:`*/*`},_f=2147483647,vf=Symbol(`stop`),yf=class{options;constructor(e){this.options=e}},bf=e=>new yf(e),xf={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Sf={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Cf=new TextEncoder,wf=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=40,t+=Cf.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+=typeof r==`string`?Cf.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof e==`string`?Cf.encode(e).byteLength:e instanceof URLSearchParams?Cf.encode(e.toString()).byteLength:0},Tf=(e,t,n)=>{let r,i=0;return e.pipeThrough(new TransformStream({transform(e,a){if(a.enqueue(e),r){i+=r.byteLength;let e=t===0?0:i/t;e>=1&&(e=1-2**-52),n?.({percent:e,totalBytes:Math.max(t,i),transferredBytes:i},r)}r=e},flush(){r&&(i+=r.byteLength,n?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},r))}}))},Ef=(e,t)=>{if(!e.body)return e;let n={status:e.status,statusText:e.statusText,headers:e.headers};if(e.status===204)return new Response(null,n);let r=Math.max(0,Number(e.headers.get(`content-length`))||0);return new Response(Tf(e.body,r,t),n)},Df=(e,t,n)=>{if(!e.body)return e;let r=wf(n??e.body);return new Request(e,{duplex:`half`,body:Tf(e.body,r,t)})},Of=e=>typeof e==`object`&&!!e,kf=Symbol(`replaceOption`),Af=e=>Of(e)&&e[kf]===!0?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},jf=(...e)=>{for(let t of e)if((!Of(t)||Array.isArray(t))&&t!==void 0)throw TypeError("The `options` argument must be an object");return Vf({},...e)},Mf=(e={},t={})=>{let n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[e,t]of i.entries())r&&t===`undefined`||t===void 0?n.delete(e):n.set(e,t);return n},Nf=e=>{if(!Of(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Pf=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),n=e[zf];return n&&(t[zf]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:Nf(e)?{...e}:e},Ff=e=>Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0)),If=(e,t)=>Nf(e)&&Nf(t)?Ff({...e,...t}):Mf(e,t);function Lf(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Vf(e[n]??[],t[n]??[])}var Rf=(e={},t={})=>({init:Lf(e,t,`init`),beforeRequest:Lf(e,t,`beforeRequest`),beforeRetry:Lf(e,t,`beforeRetry`),beforeError:Lf(e,t,`beforeError`),afterResponse:Lf(e,t,`afterResponse`)}),zf=Symbol(`deletedParameters`),Bf=(e,t)=>{let n=new URLSearchParams,r=new Set;for(let i of[e,t])if(i!==void 0)if(i instanceof URLSearchParams){for(let[e,t]of i.entries())n.append(e,t),r.delete(e);let e=i[zf];if(e)for(let t of e)n.delete(t),r.add(t)}else if(Array.isArray(i))for(let e of i){if(!Array.isArray(e)||e.length!==2)throw TypeError(`Array search parameters must be provided in [[key, value], ...] format`);n.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(Of(i))for(let[e,t]of Object.entries(i))t===void 0?(n.delete(e),r.add(e)):(n.append(e,String(t)),r.delete(e));else{let e=new URLSearchParams(i);for(let[t,i]of e.entries())n.append(t,i),r.delete(t)}return r.size>0&&(n[zf]=r),n},Vf=(...e)=>{let t={},n={},r={},i,a=[];for(let o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(Of(o)){for(let[e,n]of Object.entries(o)){if(e===`signal`&&n instanceof globalThis.AbortSignal){a.push(n);continue}let r=Af(n),{isReplace:o}=r;if(n=r.value,e===`context`){if(n!=null&&(!Of(n)||Array.isArray(n)))throw TypeError("The `context` option must be an object");t={...t,context:n==null?{}:o?{...n}:{...t.context,...n}};continue}if(e===`searchParams`){i=n==null?void 0:o||i===void 0?n:Bf(i,n);continue}Of(n)&&!o&&e in t&&(n=Vf(t[e],n)),t={...t,[e]:n}}if(Of(o.hooks)){let{value:e,isReplace:n}=Af(o.hooks);r=Rf(n?{}:r,e),t.hooks=r}if(Of(o.headers)){let{value:e,isReplace:r}=Af(o.headers);n=r?Pf(e):If(n,e),t.headers=n}}return i!==void 0&&(t.searchParams=i),a.length>0&&(a.length===1?t.signal=a[0]:ff?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t},Hf=e=>hf.includes(e)?e.toUpperCase():e,Uf={limit:2,methods:[`get`,`put`,`head`,`delete`,`options`,`trace`],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Wf=(e={})=>{if(typeof e==`number`)return{...Uf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw Error(`retry.methods must be an array`);if(e.statusCodes&&!Array.isArray(e.statusCodes))throw Error(`retry.statusCodes must be an array`);let t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>e!==void 0));return{...Uf,...t}};async function Gf(e,t,n,r){return new Promise((i,a)=>{let o=setTimeout(()=>{n&&n.abort(),a(new lf(e))},r.timeout);r.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Kf(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener(`abort`,i,{once:!0}));function i(){clearTimeout(a),r(t.reason)}let a=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e)})}var qf=e=>{let t={};for(let n in e)Object.hasOwn(e,n)&&!(n in Sf)&&!(n in xf)&&(t[n]=e[n]);return t},Jf=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[zf]?.size:typeof e==`object`?Object.keys(e).length>0:typeof e==`string`?e.trim().length>0:!!e,Yf=Object.prototype.toString,Xf=e=>Yf.call(e)===`[object Error]`,Zf=new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Qf(e){if(!(e&&Xf(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Zf.has(t)}var $f=(e,t)=>e instanceof t||e?.name===t.name;function ep(e){return $f(e,rf)}function tp(e){return $f(e,af)}function np(e){return $f(e,lf)}var rp=10*1024*1024,ip="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",ap=Symbol(`timedOutResponseData`),op=e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder},sp="The `schema` argument must follow the Standard Schema specification",cp=e=>typeof e==`object`?{...e,...e.methods&&{methods:[...e.methods]},...e.statusCodes&&{statusCodes:[...e.statusCodes]},...e.afterStatusCodes&&{afterStatusCodes:[...e.afterStatusCodes]}}:e,lp=Object.prototype.toString,up=e=>e instanceof globalThis.Request||lp.call(e)===`[object Request]`,dp=e=>e instanceof globalThis.Response||lp.call(e)===`[object Response]`,fp=e=>Array.isArray(e)?e.map(e=>[...e]):Pf(e);function pp(e){let t={...e,json:Pf(e.json),context:Pf(e.context),headers:Pf(e.headers),searchParams:fp(e.searchParams)};return e.retry!==void 0&&(t.retry=cp(e.retry)),t}var mp=async(e,t)=>{if(typeof t!=`object`&&typeof t!=`function`||t===null)throw TypeError(sp);let n=t[`~standard`];if(typeof n!=`object`||!n||typeof n.validate!=`function`)throw TypeError(sp);let r=await n.validate(e);if(r.issues)throw new cf(r.issues);return r.value},hp=class e{static create(t,n){let r=n.hooks?.init??[],i=r.length>0?pp(n):n;for(let e of r)e(i);let a=new e(t,i),o=async()=>{if(typeof a.#i.timeout==`number`&&a.#i.timeout>2147483647)throw RangeError(`The \`timeout\` option cannot be greater than ${_f}`);if(typeof a.#i.totalTimeout==`number`&&a.#i.totalTimeout>2147483647)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${_f}`);await Promise.resolve();let e=await a.#w(),t=e??await a.#E(async()=>a.#k()),n=e!==void 0||a.#O();for(;;){if(t===void 0)return t;if(dp(t))try{t=await a.#T(t)}catch(e){if(!(e instanceof sf))throw e;let r=await a.#D(e,async()=>a.#k());if(r===void 0)return r;t=r,n=a.#O();continue}let e=t;if(!e.ok&&e.type!==`opaque`&&(typeof a.#i.throwHttpErrors==`function`?a.#i.throwHttpErrors(e.status):a.#i.throwHttpErrors)){let r=new rf(e,a.#P(e),a.#M()),i=r;if(r.data=await a.#h(e),n)throw i;let o=await a.#D(r,async()=>a.#k());if(o===void 0)return o;t=o,n=a.#O();continue}break}if(!dp(t))return t;if(a.#m(t),a.#i.onDownloadProgress){if(typeof a.#i.onDownloadProgress!=`function`)throw TypeError("The `onDownloadProgress` option must be a function");if(!pf)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();return a.#x(t),Ef(e,a.#i.onDownloadProgress)}return t},s=(async()=>{try{return await o()}catch(e){if(!(e instanceof Error)||a.#s.has(e))throw e;let t=e;for(let e of a.#i.hooks.beforeError){let n=await e({request:a.request,options:a.#M(),error:t,retryCount:a.#n});n instanceof Error&&(t=n)}throw t}finally{let e=a.#a;a.#b(e?.body??void 0),a.request!==e&&a.#b(a.request.body??void 0)}})();for(let[e,t]of Object.entries(gf))e===`bytes`&&typeof globalThis.Response?.prototype?.bytes!=`function`||(s[e]=async n=>{a.request.headers.set(`accept`,a.request.headers.get(`accept`)||t);let r=await s;if(e!==`json`)return r[e]();let o=await r.text();if(o===``)return n===void 0?JSON.parse(o):mp(void 0,n);let c=i.parseJson?await i.parseJson(o,{request:a.#P(r),response:r}):JSON.parse(o);return n===void 0?c:mp(c,n)});return s}static#e(e){return e&&typeof e==`object`&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)):e}request;#t;#n=0;#r;#i;#a;#o;#s=new WeakSet;#c;#l;#u=!1;#d=new WeakMap;constructor(t,n={}){if(this.#r=t,Object.hasOwn(n,`prefixUrl`))throw Error(ip);if(this.#i={...n,headers:Mf(this.#r.headers,n.headers),hooks:Rf({},n.hooks),method:Hf(n.method??this.#r.method??`GET`),prefix:String(n.prefix||``),retry:Wf(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,totalTimeout:n.totalTimeout??!1,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#r!=`string`&&!(this.#r instanceof URL||this.#r instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#r==`string`){if(this.#i.prefix){let e=this.#i.prefix.replace(/\/+$/,``),t=this.#r.replace(/^\/+/,``);this.#r=`${e}/${t}`}if(this.#i.baseUrl){let e;try{e=new URL(this.#r)}catch{}e||(this.#r=new URL(this.#r,new Request(this.#i.baseUrl).url))}}df&&ff&&(this.#o=this.#i.signal??this.#r.signal,this.#t=new globalThis.AbortController,this.#i.signal=this.#S()),uf&&(this.#i.duplex=`half`),this.#i.json!==void 0&&(this.#i.body=this.#i.stringifyJson?.(this.#i.json)??JSON.stringify(this.#i.json),this.#i.headers.set(`content-type`,this.#i.headers.get(`content-type`)??`application/json`));let r=n.headers&&new globalThis.Headers(n.headers).has(`content-type`);if(this.#r instanceof globalThis.Request&&(mf&&this.#i.body instanceof globalThis.FormData||this.#i.body instanceof URLSearchParams)&&!r&&this.#i.headers.delete(`content-type`),this.request=new globalThis.Request(this.#r,this.#i),Jf(this.#i.searchParams)){let t=new URL(this.request.url),n=this.#i.searchParams?.[zf];if(n)for(let e of n)t.searchParams.delete(e);if(typeof this.#i.searchParams==`string`){let e=this.#i.searchParams.replace(/^\?/,``);e!==``&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{let n=new URLSearchParams(e.#e(this.#i.searchParams));for(let[e,r]of n.entries())t.searchParams.append(e,r)}if(this.#i.searchParams&&typeof this.#i.searchParams==`object`&&!Array.isArray(this.#i.searchParams)&&!(this.#i.searchParams instanceof URLSearchParams))for(let[e,n]of Object.entries(this.#i.searchParams))n===void 0&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#i)}if(this.#i.onUploadProgress&&typeof this.#i.onUploadProgress!=`function`)throw TypeError("The `onUploadProgress` option must be a function");this.#l=typeof this.#i.totalTimeout==`number`?this.#j():void 0}#f(){let e=this.#i.retry.delay(this.#n+1),t=e;return this.#i.retry.jitter===!0?t=Math.random()*e:typeof this.#i.retry.jitter==`function`&&(t=this.#i.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e)),Math.min(this.#i.retry.backoffLimit,t)}async#p(e){if(this.#n>=this.#i.retry.limit)throw e;let t=e instanceof Error?e:new of(e);if(t instanceof sf)return t.customDelay??this.#f();if(!this.#i.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#i.retry.shouldRetry!==void 0){let n=await this.#i.retry.shouldRetry({error:t,retryCount:this.#n+1});if(n===!1)throw e;if(n===!0)return this.#f()}if(np(e)){if(!this.#i.retry.retryOnTimeout)throw e;return this.#f()}if(ep(e)){if(!this.#i.retry.statusCodes.includes(e.response.status))throw e;let t=e.response.headers.get(`Retry-After`)??e.response.headers.get(`RateLimit-Reset`)??e.response.headers.get(`X-RateLimit-Retry-After`)??e.response.headers.get(`X-RateLimit-Reset`)??e.response.headers.get(`X-Rate-Limit-Reset`);if(t&&this.#i.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t)*1e3;return Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse(`2024-01-01`)&&(e-=Date.now()),Number.isFinite(e)?(e=Math.max(0,e),Math.min(this.#i.retry.maxRetryAfter,e)):Math.min(this.#i.retry.maxRetryAfter,this.#f())}if(e.response.status===413)throw e;return this.#f()}if(!tp(e))throw e;return this.#f()}#m(e){let t=this.#P(e);return this.#i.parseJson&&(e.json=async()=>{let n=await e.text();return n===``?JSON.parse(n):this.#i.parseJson(n,{request:t,response:e})}),e}async#h(e){let t=await this.#v(e,this.#g());if(t===ap){this.#C();return}if(!t)return;if(!this.#_(e.headers.get(`content-type`)??``))return t;let n=await this.#y(t,e,this.#g(),this.#P(e));if(n===ap){this.#C();return}return n}#g(){let e=this.#i.timeout===!1?1e4:this.#i.timeout,t=this.#A();if(t===void 0)return e;if(t<=0)throw new lf(this.request);return Math.min(e,t)}#_(e){let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#v(e,t){let{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}let i=op(e.headers.get(`content-type`)??``),a=[],o=0,s=(async()=>{try{for(;;){let{done:e,value:t}=await r.read();if(e)break;if(o+=t.byteLength,o>rp){r.cancel().catch(()=>void 0);return}a.push(i.decode(t,{stream:!0}))}}catch{return}return a.push(i.decode()),a.join(``)})(),c=new Promise(e=>{let n=setTimeout(()=>{e(ap)},t);s.finally(()=>{clearTimeout(n)})}),l=await Promise.race([s,c]);return l===ap&&r.cancel().catch(()=>void 0),l}async#y(e,t,n,r){let i;try{return await Promise.race([Promise.resolve().then(()=>this.#i.parseJson?this.#i.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{i=setTimeout(()=>{e(ap)},n)})])}catch{return}finally{clearTimeout(i)}}#b(e){e&&e.cancel().catch(()=>void 0)}#x(e){this.#b(e.body??void 0)}#S(){return this.#o?AbortSignal.any([this.#o,this.#t.signal]):this.#t.signal}#C(){let e=this.#A();if(e!==void 0&&e<=0)throw new lf(this.request)}async#w(){for(let e of this.#i.hooks.beforeRequest){let t=await e({request:this.request,options:this.#M(),retryCount:0});if(up(t))this.#N(t);else if(dp(t))return t}}async#T(e){let t=this.#P(e);for(let n of this.#i.hooks.afterResponse){let r=this.#F(e.clone(),t);this.#m(r);let i;try{i=await n({request:this.request,options:this.#M(),response:r,retryCount:this.#n})}catch(t){throw r!==e&&this.#x(r),this.#x(e),t}if(i instanceof yf)throw r!==e&&this.#x(r),this.#x(e),new sf(i.options);let a=dp(i)?this.#F(i,t):e;r!==e&&r!==a&&r.body!==a.body&&this.#x(r),e!==a&&e.body!==a.body&&this.#x(e),e=a}return e}async#E(e){try{return await e()}catch(t){return this.#D(t,e)}}async#D(e,t){this.#u=!1;let n=Math.min(await this.#p(e),_f),r={signal:this.#o},i=this.#A();if(i!==void 0){if(i<=0)throw new lf(this.request);if(n>=i)throw await Kf(i,r),new lf(this.request)}if(await Kf(n,r),this.#C(),e instanceof sf&&e.customRequest){let t=new globalThis.Request(e.customRequest,this.#i.signal?{signal:this.#i.signal}:void 0);this.#N(t)}for(let t of this.#i.hooks.beforeRetry){let n;try{n=await t({request:this.request,options:this.#M(),error:e,retryCount:this.#n+1})}catch(t){throw t instanceof Error&&t!==e&&this.#s.add(t),t}if(up(n)){this.#N(n);break}if(dp(n))return this.#u=!0,this.#n++,n;if(n===vf)return}return this.#C(),this.#n++,this.#E(t)}#O(){let e=this.#u;return this.#u=!1,e}async#k(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#i.signal=this.#S(),this.request=new globalThis.Request(this.request,{signal:this.#i.signal}));let e=qf(this.#i),t=this.#i.retry.limit>0?this.request.clone():void 0,n=this.#I(this.request,this.#i.body??void 0);this.#a=n,t&&(this.request=t);try{let t=this.#A();if(t!==void 0&&t<=0)throw new lf(this.request);let r=this.#i.timeout===!1?t:t===void 0?this.#i.timeout:Math.min(this.#i.timeout,t),i=r===void 0?await this.#i.fetch(n,e):await Gf(n,e,this.#t,{timeout:r,fetch:this.#i.fetch});return this.#F(i,n)}catch(e){throw Qf(e)?new af(this.request,{cause:e}):e}}#A(){if(this.#l===void 0)return;let e=this.#j()-this.#l;return Math.max(0,this.#i.totalTimeout-e)}#j(){return globalThis.performance?.now()??Date.now()}#M(){if(!this.#c){let{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:i,timeout:a,totalTimeout:o,throwHttpErrors:s,fetch:c,...l}=this.#i;this.#c=Object.freeze(l)}return this.#c}#N(e){this.#c=void 0,this.request=e}#P(e){return this.#d.get(e)??this.request}#F(e,t){return this.#d.set(e,t),e}#I(e,t){return!this.#i.onUploadProgress||!e.body||!uf?e:Df(e,this.#i.onUploadProgress,t??this.#i.body??void 0)}},gp=e=>{let t=(t,n)=>hp.create(t,jf(e,n));for(let n of hf)t[n]=(t,r)=>hp.create(t,jf(e,r,{method:n}));return t.create=e=>gp(jf(e)),t.extend=t=>(typeof t==`function`&&(t=t(e??{})),gp(jf(e,t))),t.stop=vf,t.retry=bf,t},_p=gp();function vp(e){let t=String(e||``).trim();return/^0x[a-fA-F0-9]{40}$/.test(t)?t.toLowerCase():``}function yp(e){return e?`${e.slice(0,6)}...${e.slice(-4)}`:``}function bp(e){return String(e||``).trim().slice(0,4096)}function xp(e,t=``,n=50){return(String(e||``).trim()||String(t||``)).slice(0,n)}function Sp(e){return String(e||``).trim().toUpperCase().replace(/[^A-Z0-9]/g,``).slice(0,8)}function Cp(e){return`${e}_${Date.now()}_${Tp(4)}`}function wp(e){if(globalThis.crypto?.getRandomValues){let t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]%e}return Math.floor(Math.random()*e)}function Tp(e){let t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=Math.floor(Math.random()*256);return[...t].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Ep(e,t,n){return`${e}:${String(t||`GET`).toUpperCase()}:${Dp(n)}`}function Dp(e){try{return new URL(e,`http://most.box`).pathname}catch{return String(e||``).split(`?`)[0]||`/`}}async function Op(e,t,n){if(!e?.danger)return{};let r=Date.now().toString(),i=Ep(r,t,n),{address:a,signature:o}=await yu(e.danger,i);return{Authorization:`${a},${r},${o}`}}var kp=`mostbox_backend_url`,Ap=`mostbox_backend_invite`,jp=`mostbox_remote_nodes`,Mp=`http://localhost:1976`,Np=8;function Pp(){return typeof window>`u`?!1:[`localhost`,`127.0.0.1`].includes(window.location.hostname)}function Fp(){return Pp()?Mp:``}function Ip(){return typeof window>`u`?``:window.location.origin||``}function Lp(){return typeof window>`u`?``:localStorage.getItem(kp)||Fp()}function Rp(){return typeof window>`u`?``:localStorage.getItem(kp)||``}function zp(e){let t=Xp(e);if(!t)return!1;try{let{hostname:e}=new URL(t),n=e.toLowerCase();return!(n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`||n.startsWith(`127.`))}catch{return!0}}function Bp(){return typeof window>`u`?``:localStorage.getItem(Ap)||``}function Vp(e,t={}){if(!e||typeof e!=`object`)return null;let n=Xp(e.url);return zp(n)?{url:n,invite:typeof e.invite==`string`?e.invite.trim():``,active:e.active===!0||t.active===!0,updatedAt:Number(e.updatedAt||t.updatedAt||Date.now())}:null}function Hp(e){let t=new Map,n=``;for(let r of e){let e=Vp(r);if(!e)continue;e.active&&!n?n=e.url:e.active&&n!==e.url&&(e.active=!1);let i=t.get(e.url);(!i||e.updatedAt>=i.updatedAt)&&t.set(e.url,{...i,...e,active:e.active||i?.active===!0})}return[...t.values()].map(e=>({...e,active:e.url===n||!n&&e.active===!0})).sort((e,t)=>e.active===t.active?t.updatedAt-e.updatedAt:e.active?-1:1).slice(0,Np)}function Up(){if(typeof window>`u`)return[];let e=tm(localStorage.getItem(jp)),t=Array.isArray(e)?e:[],n=Rp();return zp(n)&&t.push({url:n,invite:Bp(),active:!0,updatedAt:Date.now()}),Hp(t)}function Wp(e){typeof window>`u`||localStorage.setItem(jp,JSON.stringify(Hp(e)))}function Gp(){return Up().find(e=>e.active)||null}function Kp(e,t=Bp(),n=!0){let r=Xp(e);if(!zp(r))return;let i=Up().map(e=>({...e,active:n?!1:e.active}));i.unshift({url:r,invite:(t||``).trim(),active:n,updatedAt:Date.now()}),Wp(i)}function qp(){Wp(Up().map(e=>({...e,active:!1})))}function Jp(e=Lp()){let t=Xp(e),n=Fp(),r=Zp(t)?t:n;if(!Zp(r))return null;let i=Xp(r);return{url:i,invite:``,active:i===t,local:!0,updatedAt:2**53-1}}function Yp(){if(typeof window>`u`)return[];let e=Xp(Lp()),t=Jp(e),n=Up().map((t,n)=>({...t,active:Xp(t.url)===e,local:!1,order:n+1}));return(t?[{...t,order:0},...n]:n).sort((e,t)=>e.active===t.active?e.local===t.local?e.order-t.order:e.local?-1:1:e.active?-1:1).map(({order:e,...t})=>t)}function Xp(e){return(e||``).trim().replace(/\/+$/,``)}function Zp(e){let t=Xp(e);if(!t)return!1;try{let{hostname:e}=new URL(t),n=e.toLowerCase();return n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`||n.startsWith(`127.`)}catch{return!1}}function Qp(e=Lp()){return!!Bp()&&!Zp(e)}function $p(){if(typeof window>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function em(e){return e.startsWith(`/`)?e:`/${e}`}function tm(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function nm(e){let t=Dp(e),n=Lp();if(!n)return t;try{let e=new URL(n).pathname.replace(/\/+$/,``);if(!e||e===`/`)return t;if(t===e)return`/`;if(t.startsWith(`${e}/`))return t.slice(e.length)}catch{}return t}function rm(e,t=`/ws`){let n=new URL(e),r=n.protocol===`https:`?`wss:`:`ws:`,i=n.pathname.replace(/\/+$/,``);return`${r}//${n.host}${i}${em(t)}`}function im(){let e=_p.create({hooks:{beforeRequest:[async({request:e})=>{let t=new Headers(e.headers||{}),n=Bp();n&&Qp(e.url)&&t.set(`x-mostbox-invite`,n);let r=$p();if(r?.danger)try{let n=await Op(r,e.method,nm(e.url));for(let[e,r]of Object.entries(n))t.set(e,r)}catch{}return new Request(e,{headers:t})}]}});return new Proxy(e,{get(e,t,n){let r=Reflect.get(e,t,n);return[`get`,`post`,`put`,`patch`,`delete`,`head`].includes(t)?(t,n)=>{let i=typeof t==`string`?_m(t):t;return r.call(e,i,n)}:r}})}var am=im();async function om(e){let t=e&&typeof e==`object`&&`response`in e?e.response:e instanceof Response?e:null;if(!t)return{};let n=t.bodyUsed?null:await t.clone().json().catch(()=>null);return{status:t.status,code:typeof n?.code==`string`?n.code:void 0,details:n?.details&&typeof n.details==`object`?n.details:void 0,error:typeof n?.error==`string`?n.error:typeof n?.message==`string`?n.message:void 0}}async function sm(e,t=`请求失败`){let n=await om(e);return n.error?n.error:(e&&typeof e==`object`&&`name`in e?String(e.name):``)===`TimeoutError`?`请求超时,请稍后重试`:e instanceof Error&&e.message?e.message:t}function cm(e){let t=Xp(e);t?(localStorage.setItem(kp,t),zp(t)&&Kp(t)):localStorage.removeItem(kp),am=im()}function lm(e){let t=(e||``).trim();t?localStorage.setItem(Ap,t):localStorage.removeItem(Ap),am=im()}function um({url:e,invite:t}){cm(e),lm(t),zp(e)?Kp(e,t):typeof window<`u`&&qp()}function dm(){cm(``),lm(``),typeof window<`u`&&qp()}function fm(){return Lp()}function pm(){return Ip()}function mm(){return Gp()?.url||``}function hm(){return Gp()?.invite||``}function gm(){return Yp()}function _m(e){return`${Lp()}${em(e)}`}async function vm(e=`GET`,t=`/`){let n={},r=Bp();r&&Qp()&&(n[`x-mostbox-invite`]=r);try{Object.assign(n,await Op($p(),e,Dp(t)))}catch{}return n}async function ym(e=`/ws`){if(typeof window>`u`)return em(e);let t=Lp()||window.location.origin,n=new URL(rm(t,e)),r=Bp();r&&Qp(n.toString())&&n.searchParams.set(`invite`,r);let i=$p();if(i?.danger)try{let t=await Op(i,`GET`,Dp(e)),[r,a,o]=String(t.Authorization||``).split(`,`);r&&o&&(n.searchParams.set(`address`,r),n.searchParams.set(`timestamp`,a),n.searchParams.set(`signature`,o))}catch{}return n.toString()}async function bm(e,t,n){try{let r={};t&&(r[`x-mostbox-invite`]=t);try{Object.assign(r,await Op(n,`GET`,`/api/remote/capabilities`))}catch{}let i=await fetch(`${e}/api/remote/capabilities`,{method:`GET`,headers:r,signal:AbortSignal.timeout(3e3)});if(!i.ok)return{ok:!1,reason:`http`};let a=await i.clone().json().catch(()=>null);return!a||typeof a.remoteAccess!=`boolean`||typeof a.inviteRequired!=`boolean`||typeof a.adminAvailable!=`boolean`||typeof a.listenHost!=`string`?{ok:!1,reason:`http`}:{ok:!0}}catch{return{ok:!1,reason:`http`}}}async function xm(e,t,n){if(typeof WebSocket>`u`||!n?.danger)return{ok:!0};try{let r=new URL(rm(e));if(t&&r.searchParams.set(`invite`,t),n?.danger)try{let e=await Op(n,`GET`,Dp(`/ws`)),[t,i,a]=String(e.Authorization||``).split(`,`);t&&a&&(r.searchParams.set(`address`,t),r.searchParams.set(`timestamp`,i),r.searchParams.set(`signature`,a))}catch{}return await new Promise(e=>{let t=new WebSocket(r.toString()),n=setTimeout(()=>{t.close(),e({ok:!1,reason:`ws`})},4e3);t.onopen=()=>{clearTimeout(n),t.close(),e({ok:!0})},t.onerror=()=>{clearTimeout(n),e({ok:!1,reason:`ws`})}})}catch{return{ok:!1,reason:`ws`}}}async function Sm({url:e,invite:t=``}){let n=Xp(e);if(!n)return{ok:!1,reason:`http`};let r=$p(),[i,a]=await Promise.all([bm(n,t,r),xm(n,t,r)]);return i.ok?a.ok?{ok:!0}:a:i}async function Cm(){try{return(await fetch(`${Mp}/api/node-id`,{method:`GET`,signal:AbortSignal.timeout(2e3)})).ok}catch{return!1}}var wm=`mostbox`,Tm=1,Em=`notes`;function Dm(){return new Promise((e,t)=>{let n=indexedDB.open(wm,Tm);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(Em)||e.createObjectStore(Em,{keyPath:`address`})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function Om(e){let t=await Dm();return new Promise((n,r)=>{let i=t.transaction(Em,`readonly`).objectStore(Em).get(e);i.onsuccess=()=>{let e=i.result;n(e?{notes:e.notes,notesPath:e.notesPath}:null)},i.onerror=()=>r(i.error)})}async function km(e,t,n){let r=await Dm();return new Promise((i,a)=>{let o=r.transaction(Em,`readwrite`).objectStore(Em).put({address:e,notes:t,notesPath:n});o.onsuccess=()=>i(),o.onerror=()=>a(o.error)})}function Am(e){return Array.isArray(e)?e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`file`||t.content!==void 0}).map(e=>({name:String(e.name||`Untitled`),cid:String(e.cid||``),path:Xd(e.path||``),content:String(e.content||``),size:Number(e.size||0),type:`file`,created_at:Number(e.created_at||e.updated_at||Date.now()),updated_at:Number(e.updated_at||e.created_at||Date.now()),isSecret:e.isSecret===!0||String(e.content||``).startsWith(`mp://1`)})):[]}function jm(e,t,n){e&&km(e,t,Xd(n)).catch(e=>{console.warn(`Failed to persist notes:`,e)})}function Mm(e){switch(e){case Qd.EMPTY:return`note.error.nameRequired`;case Qd.SLASH:return`note.error.nameNoSlash`;case Qd.BACKSLASH:return`note.error.nameNoBackslash`;default:return`note.error.nameInvalid`}}var Nm=Vt((e,t)=>({hasBackend:null,checkBackend:async()=>{let t=mm();if(t){let n=hm(),{ok:r}=await Sm({url:t,invite:n});if(r){um({url:t,invite:n}),e({hasBackend:!0});return}}if(await Cm()){cm(`http://localhost:1976`),lm(``),e({hasBackend:!0});return}let n=pm();if(n){let{ok:t}=await Sm({url:n});if(t){cm(``),lm(``),e({hasBackend:!0});return}}t||(cm(``),lm(``)),e({hasBackend:!1})},isDarkMode:!1,setIsDarkMode:t=>{e({isDarkMode:t}),document.documentElement.setAttribute(`data-theme`,t?`dark`:`light`),localStorage.setItem(`theme`,t?`dark`:`light`)},toasts:[],addToast:(t,n=`info`)=>{e(e=>({toasts:[...e.toasts,{id:Date.now(),message:t,type:n}]}))},removeToast:t=>{e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))},showConnectModal:!1,openConnectModal:()=>e({showConnectModal:!0}),closeConnectModal:()=>e({showConnectModal:!1}),localDataReady:!1,initializeLocalData:()=>{e({notes:[],notesPath:``,notesAddress:``,localDataReady:!0})},notes:[],notesPath:``,notesAddress:``,loadUserNotes:async t=>{try{let n=await Om(t);e({notes:n?Am(n.notes):[],notesPath:Xd(n?.notesPath||``),notesAddress:t})}catch(n){console.warn(`Failed to load notes from IndexedDB:`,n),e({notes:[],notesPath:``,notesAddress:t})}},resetAppState:()=>{e({notes:[],notesPath:``,notesAddress:``,toasts:[],showConnectModal:!1})},setNotesPath:n=>{let r=Xd(n);e({notesPath:r}),jm(t().notesAddress,t().notes,r)},saveNote:async n=>{let r=$d(n.name);if(!r.valid)throw Error(Mm(r.errorCode));let i=r.name||n.name,a=Xd(n.path||``),o=String(n.content||``),s=await ef(o),c=new TextEncoder().encode(o).length,l=Date.now(),u=t().notes,d=n.cid?u.findIndex(e=>e.cid===n.cid):u.findIndex(e=>Xd(e.path)===a&&e.name===i),f=Xd(a?`${a}/${i}`:i);if(u.some((e,t)=>t!==d&&Zd(e)===f))throw Error(`note.error.nameConflict`);let p={name:i,cid:s,path:a,content:o,size:c,type:`file`,created_at:(d>=0?u[d]:null)?.created_at||l,updated_at:l,isSecret:n.isSecret===!0||o.startsWith(`mp://1`)},m=d>=0?u.map((e,t)=>t===d?p:e):[...u,p];return e({notes:m}),jm(t().notesAddress,m,t().notesPath),s},deleteNote:(n,r,i)=>{let a=r!==void 0&&i!==void 0?Xd(`${r}/${i}`):``,o=t().notes.filter(e=>{if(n&&e.cid===n)return!1;if(a){let t=Zd(e);return t!==a&&!t.startsWith(`${a}/`)}return!0});e({notes:o}),jm(t().notesAddress,o,t().notesPath)},renameNote:(n,r,i)=>{let a=$d(i);if(!a.valid)throw Error(Mm(a.errorCode));let o=Xd(n),s=Xd(r),c=Xd(s?`${s}/${a.name}`:a.name);if(c.startsWith(`${o}/`))throw Error(`note.error.moveIntoSelf`);if(t().notes.some(e=>{let t=Zd(e);return t!==o&&t===c}))throw Error(`note.error.nameConflict`);let l=tf(t().notes,o,s,a.name);e({notes:l}),jm(t().notesAddress,l,t().notesPath)},importNotes:n=>{let r=Am(n);e({notes:r}),jm(t().notesAddress,r,t().notesPath)}}));if(typeof window<`u`){let e=localStorage.getItem(`theme`),t=typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;(e===`dark`||!e&&t)&&Nm.setState({isDarkMode:!0})}export{Me as $,ku as A,y as At,Ft as B,Zd as C,F as Ct,Mu as D,D as Dt,Bu as E,M as Et,gu as F,$e as G,Tt as H,Au as I,He as J,Ze as K,ou as L,bu as M,d as Mt,_u as N,vu as O,O as Ot,yu as P,Pe as Q,ru as R,ef as S,L as St,Id as T,_ as Tt,xt as U,St as V,ft as W,Be as X,ze as Y,Ne as Z,bp as _,j as _t,um as a,ve as at,wp as b,I as bt,vm as c,xe as ct,fm as d,oe as dt,je as et,gm as f,ae as ft,vp as g,z as gt,Cp as h,B as ht,dm as i,Oe as it,xu as j,b as jt,ju as k,f as kt,_m as l,de as lt,mm as m,ce as mt,am as n,ye as nt,sm as o,Te as ot,hm as p,re as pt,Ye as q,Sm as r,Ee as rt,om as s,Se as st,Nm as t,Ae as tt,ym as u,ie as ut,xp as v,R as vt,Xd as w,m as wt,yp as x,T as xt,Sp as y,E as yt,Z as z};
|
|
4
|
+
`)!==this.#t)throw Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#n=e}return this.#n}getWord(e){let t=this.#r();return X(e>=0&&e<t.length,`invalid word index: ${e}`,`index`,e),t[e]}getWordIndex(e){return this.#r().indexOf(e)}},$c="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",el=`0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60`,tl=null,nl=class e extends Qc{constructor(){super(`en`,$c,el)}static wordlist(){return tl??=new e,tl}},rl=class e extends Wc{address;#e;constructor(e,t){super(t),X(e&&typeof e.sign==`function`,`invalid private key`,`privateKey`,`[ REDACTED ]`),this.#e=e;let n=Vs(this.signingKey.publicKey);qn(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new e(this.#e,t)}async signTransaction(e){e=Vc(e);let{to:t,from:n}=await Kn({to:e.to?Rs(e.to,this):void 0,from:e.from?Rs(e.from,this):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&(X(Fs(e.from)===this.address,`transaction from address mismatch`,`tx.from`,e.from),delete e.from);let r=xc.from(e);return r.signature=this.signingKey.sign(r.unsignedHash),r.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(wc(e)).serialized}authorizeSync(e){X(typeof e.address==`string`,`invalid address for authorizeSync`,`auth.address`,e);let t=this.signingKey.sign(Sc(e));return Object.assign({},{address:Fs(e.address),nonce:mr(e.nonce||0),chainId:mr(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await Rs(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,n){let r=await Bc.resolveNames(e,t,n,async e=>{Y(this.provider!=null,`cannot resolve ENS names without a provider`,`UNSUPPORTED_OPERATION`,{operation:`resolveName`,info:{name:e}});let t=await this.provider.resolveName(e);return Y(t!=null,`unconfigured ENS name`,`UNCONFIGURED_NAME`,{value:e}),t});return this.signingKey.sign(Bc.hash(r.domain,t,r.value)).serialized}};function il(e){return(1<<e)-1<<8-e&255}function al(e){return(1<<e)-1&255}function ol(e,t){Zn(`NFKD`),t??=nl.wordlist();let n=t.split(e);X(n.length%3==0&&n.length>=12&&n.length<=24,`invalid mnemonic length`,`mnemonic`,`[ REDACTED ]`);let r=new Uint8Array(Math.ceil(11*n.length/8)),i=0;for(let e=0;e<n.length;e++){let a=t.getWordIndex(n[e].normalize(`NFKD`));X(a>=0,`invalid mnemonic word at index ${e}`,`mnemonic`,`[ REDACTED ]`);for(let e=0;e<11;e++)a&1<<10-e&&(r[i>>3]|=1<<7-i%8),i++}let a=32*n.length/3,o=il(n.length/3);return X((Z(ga(r.slice(0,a/8)))[0]&o)===(r[r.length-1]&o),`invalid mnemonic checksum`,`mnemonic`,`[ REDACTED ]`),Q(r.slice(0,a/8))}function sl(e,t){X(e.length%4==0&&e.length>=16&&e.length<=32,`invalid entropy size`,`entropy`,`[ REDACTED ]`),t??=nl.wordlist();let n=[0],r=11;for(let t=0;t<e.length;t++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=e[t],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[t]>>8-r,n.push(e[t]&al(8-r)),r+=3);let i=e.length/4,a=parseInt(ga(e).substring(2,4),16)&il(i);return n[n.length-1]<<=i,n[n.length-1]|=a>>8-i,t.join(n.map(e=>t.getWord(e)))}var cl={},ll=class e{phrase;password;wordlist;entropy;constructor(e,t,n,r,i){r??=``,i??=nl.wordlist(),Qn(e,cl,`Mnemonic`),qn(this,{phrase:n,password:r,wordlist:i,entropy:t})}computeSeed(){let e=Ur(`mnemonic`+this.password,`NFKD`);return Wi(Ur(this.phrase,`NFKD`),e,2048,64,`sha512`)}static fromPhrase(t,n,r){let i=ol(t,r);return t=sl(Z(i),r),new e(cl,i,t,n,r)}static fromEntropy(t,n,r){let i=Z(t,`entropy`),a=sl(i,r);return new e(cl,Q(i),a,n,r)}static entropyToPhrase(e,t){return sl(Z(e,`entropy`),t)}static phraseToEntropy(e,t){return ol(e,t)}static isValidMnemonic(e,t){try{return ol(e,t),!0}catch{}return!1}},ul=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},dl=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},fl,pl,ml,hl={16:10,24:12,32:14},gl=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],_l=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],vl=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],yl=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],bl=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],xl=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Sl=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Cl=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],wl=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Tl=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],El=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Dl=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ol=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],kl=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Al=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function jl(e){let t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}var Ml=class e{get key(){return ul(this,fl,`f`).slice()}constructor(t){if(fl.set(this,void 0),pl.set(this,void 0),ml.set(this,void 0),!(this instanceof e))throw Error("AES must be instanitated with `new`");dl(this,fl,new Uint8Array(t),`f`);let n=hl[this.key.length];if(n==null)throw TypeError(`invalid key size (must be 16, 24 or 32 bytes)`);dl(this,ml,[],`f`),dl(this,pl,[],`f`);for(let e=0;e<=n;e++)ul(this,ml,`f`).push([0,0,0,0]),ul(this,pl,`f`).push([0,0,0,0]);let r=(n+1)*4,i=this.key.length/4,a=jl(this.key),o;for(let e=0;e<i;e++)o=e>>2,ul(this,ml,`f`)[o][e%4]=a[e],ul(this,pl,`f`)[n-o][e%4]=a[e];let s=0,c=i,l;for(;c<r;){if(l=a[i-1],a[0]^=_l[l>>16&255]<<24^_l[l>>8&255]<<16^_l[l&255]<<8^_l[l>>24&255]^gl[s]<<24,s+=1,i!=8)for(let e=1;e<i;e++)a[e]^=a[e-1];else{for(let e=1;e<i/2;e++)a[e]^=a[e-1];l=a[i/2-1],a[i/2]^=_l[l&255]^_l[l>>8&255]<<8^_l[l>>16&255]<<16^_l[l>>24&255]<<24;for(let e=i/2+1;e<i;e++)a[e]^=a[e-1]}let e=0,t,o;for(;e<i&&c<r;)t=c>>2,o=c%4,ul(this,ml,`f`)[t][o]=a[e],ul(this,pl,`f`)[n-t][o]=a[e++],c++}for(let e=1;e<n;e++)for(let t=0;t<4;t++)l=ul(this,pl,`f`)[e][t],ul(this,pl,`f`)[e][t]=Dl[l>>24&255]^Ol[l>>16&255]^kl[l>>8&255]^Al[l&255]}encrypt(e){if(e.length!=16)throw TypeError(`invalid plaintext size (must be 16 bytes)`);let t=ul(this,ml,`f`).length-1,n=[0,0,0,0],r=jl(e);for(let e=0;e<4;e++)r[e]^=ul(this,ml,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=yl[r[t]>>24&255]^bl[r[(t+1)%4]>>16&255]^xl[r[(t+2)%4]>>8&255]^Sl[r[(t+3)%4]&255]^ul(this,ml,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ul(this,ml,`f`)[t][e],i[4*e]=(_l[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(_l[r[(e+1)%4]>>16&255]^a>>16)&255,i[4*e+2]=(_l[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(_l[r[(e+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw TypeError(`invalid ciphertext size (must be 16 bytes)`);let t=ul(this,pl,`f`).length-1,n=[0,0,0,0],r=jl(e);for(let e=0;e<4;e++)r[e]^=ul(this,pl,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=Cl[r[t]>>24&255]^wl[r[(t+3)%4]>>16&255]^Tl[r[(t+2)%4]>>8&255]^El[r[(t+1)%4]&255]^ul(this,pl,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=ul(this,pl,`f`)[t][e],i[4*e]=(vl[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(vl[r[(e+3)%4]>>16&255]^a>>16)&255,i[4*e+2]=(vl[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(vl[r[(e+1)%4]&255]^a)&255;return i}};fl=new WeakMap,pl=new WeakMap,ml=new WeakMap;var Nl=class{constructor(e,t,n){if(n&&!(this instanceof n))throw Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Ml(t)},name:{enumerable:!0,value:e}})}},Pl=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},Fl=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Il,Ll,Rl,zl=class e extends Nl{constructor(t,n){super(`CTR`,t,e),Il.set(this,void 0),Ll.set(this,void 0),Rl.set(this,void 0),Pl(this,Rl,new Uint8Array(16),`f`),Fl(this,Rl,`f`).fill(0),Pl(this,Il,Fl(this,Rl,`f`),`f`),Pl(this,Ll,16,`f`),n??=1,typeof n==`number`?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(Fl(this,Rl,`f`))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>2**53-1)throw TypeError(`invalid counter initial integer value`);for(let t=15;t>=0;--t)Fl(this,Rl,`f`)[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw TypeError(`invalid counter initial Uint8Array value length`);Fl(this,Rl,`f`).set(e)}increment(){for(let e=15;e>=0;e--)if(Fl(this,Rl,`f`)[e]===255)Fl(this,Rl,`f`)[e]=0;else{Fl(this,Rl,`f`)[e]++;break}}encrypt(e){var t,n;let r=new Uint8Array(e);for(let e=0;e<r.length;e++)Fl(this,Ll,`f`)===16&&(Pl(this,Il,this.aes.encrypt(Fl(this,Rl,`f`)),`f`),Pl(this,Ll,0,`f`),this.increment()),r[e]^=Fl(this,Il,`f`)[Pl(this,Ll,(n=Fl(this,Ll,`f`),t=n++,n),`f`),t];return r}decrypt(e){return this.encrypt(e)}};Il=new WeakMap,Ll=new WeakMap,Rl=new WeakMap;function Bl(e,t){for(e=String(e);e.length<t;)e=`0`+e;return e}function Vl(e){return typeof e==`string`?Ur(e,`NFKC`):er(e)}var Hl=`m/44'/60'/0'/0/0`;function Ul(e){let t=e.salt==null?Ji(32):Z(e.salt,`options.salt`),n=1<<17,r=8,i=1;return e.scrypt&&(e.scrypt.N&&(n=e.scrypt.N),e.scrypt.r&&(r=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),X(typeof n==`number`&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),`invalid scrypt N parameter`,`options.N`,n),X(typeof r==`number`&&r>0&&Number.isSafeInteger(r),`invalid scrypt r parameter`,`options.r`,r),X(typeof i==`number`&&i>0&&Number.isSafeInteger(i),`invalid scrypt p parameter`,`options.p`,i),{name:`scrypt`,dkLen:32,salt:t,N:n,r,p:i}}function Wl(e,t,n,r){let i=Z(n.privateKey,`privateKey`),a=r.iv==null?Ji(16):Z(r.iv,`options.iv`);X(a.length===16,`invalid options.iv length`,`options.iv`,r.iv);let o=r.uuid==null?Ji(16):Z(r.uuid,`options.uuid`);X(o.length===16,`invalid options.uuid length`,`options.uuid`,r.iv);let s=e.slice(0,16),c=e.slice(16,32),l=Z(new zl(s,a).encrypt(i)),u=xi(ir([c,l])),d={address:n.address.substring(2).toLowerCase(),id:Wr(o),version:3,Crypto:{cipher:`aes-128-ctr`,cipherparams:{iv:Q(a).substring(2)},ciphertext:Q(l).substring(2),kdf:`scrypt`,kdfparams:{salt:Q(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:u.substring(2)}};if(n.mnemonic){let t=r.client==null?`ethers/${Wn}`:r.client,i=n.mnemonic.path||Hl,a=n.mnemonic.locale||`en`,o=e.slice(32,64),s=Z(n.mnemonic.entropy,`account.mnemonic.entropy`),c=Ji(16),l=Z(new zl(o,c).encrypt(s)),u=new Date;d[`x-ethers`]={client:t,gethFilename:`UTC--`+(u.getUTCFullYear()+`-`+Bl(u.getUTCMonth()+1,2)+`-`+Bl(u.getUTCDate(),2)+`T`+Bl(u.getUTCHours(),2)+`-`+Bl(u.getUTCMinutes(),2)+`-`+Bl(u.getUTCSeconds(),2)+`.0Z`)+`--`+d.address,path:i,locale:a,mnemonicCounter:Q(c).substring(2),mnemonicCiphertext:Q(l).substring(2),version:`0.1`}}return JSON.stringify(d)}function Gl(e,t,n){n??={};let r=Vl(t),i=Ul(n);return Wl(Z(la(r,i.salt,i.N,i.r,i.p,64)),i,e,n)}async function Kl(e,t,n){n??={};let r=Vl(t),i=Ul(n);return Wl(Z(await ca(r,i.salt,i.N,i.r,i.p,64,n.progressCallback)),i,e,n)}var ql=`m/44'/60'/0'/0/0`,Jl=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Yl=2147483648,Xl=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),Zl=`0123456789abcdef`;function Ql(e,t){let n=``;for(;e;)n=Zl[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n=`0`+n;return`0x`+n}function $l(e){let t=Z(e);return Dr(ir([t,or(ga(ga(t)),0,4)]))}var eu={};function tu(e,t,n,r){let i=new Uint8Array(37);e&Yl?(Y(r!=null,`cannot derive child of neutered node`,`UNSUPPORTED_OPERATION`,{operation:`deriveChild`}),i.set(Z(r),1)):i.set(Z(n));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;let a=Z(ti(`sha512`,t,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function nu(e,t){let n=t.split(`/`);X(n.length>0,`invalid path`,`path`,t),n[0]===`m`&&(X(e.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,`path`,t),n.shift());let r=e;for(let e=0;e<n.length;e++){let t=n[e];if(t.match(/^[0-9]+'$/)){let n=parseInt(t.substring(0,t.length-1));X(n<Yl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(Yl+n)}else if(t.match(/^[0-9]+$/)){let n=parseInt(t);X(n<Yl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(n)}else X(!1,`invalid path component`,`path[${e}]`,t)}return r}var ru=class e extends rl{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Qn(e,eu,`HDNodeWallet`),qn(this,{publicKey:t.compressedPublicKey});let l=or(Bi(ga(this.publicKey)),0,4);qn(this,{parentFingerprint:n,fingerprint:l,chainCode:r,path:i,index:a,depth:o}),qn(this,{mnemonic:s})}connect(t){return new e(eu,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}#e(){let e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&t.wordlist.locale===`en`&&t.password===``&&(e.mnemonic={path:this.path,locale:`en`,entropy:t.entropy}),e}async encrypt(e,t){return await Kl(this.#e(),e,{progressCallback:t})}encryptSync(e){return Gl(this.#e(),e)}get extendedKey(){return Y(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),$l(ir([`0x0488ADE4`,Ql(this.depth,1),this.parentFingerprint,Ql(this.index,4),this.chainCode,ir([`0x00`,this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new iu(eu,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=vr(t,`index`);X(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Yl&&(r+=`'`));let{IR:i,IL:a}=tu(n,this.chainCode,this.publicKey,this.privateKey);return new e(eu,new Es(yr((_r(a)+BigInt(this.privateKey))%Xl,32)),this.fingerprint,Q(i),r,n,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return nu(this,e)}static#t(t,n){X(nr(t),`invalid seed`,`seed`,`[REDACTED]`);let r=Z(t,`seed`);X(r.length>=16&&r.length<=64,`invalid seed`,`seed`,`[REDACTED]`);let i=Z(ti(`sha512`,Jl,r));return new e(eu,new Es(Q(i.slice(0,32))),`0x00000000`,Q(i.slice(32)),`m`,0,0,n,null)}static fromExtendedKey(t){let n=br(Or(t));X(n.length===82||$l(n.slice(0,78))===t,`invalid extended key`,`extendedKey`,`[ REDACTED ]`);let r=n[4],i=Q(n.slice(5,9)),a=parseInt(Q(n.slice(9,13)).substring(2),16),o=Q(n.slice(13,45)),s=n.slice(45,78);switch(Q(n.slice(0,4))){case`0x0488b21e`:case`0x043587cf`:{let e=Q(s);return new iu(eu,Vs(e),e,i,o,null,a,r,null)}case`0x0488ade4`:case`0x04358394 `:if(s[0]!==0)break;return new e(eu,new Es(s.slice(1)),i,o,null,a,r,null,null)}X(!1,`invalid extended key prefix`,`extendedKey`,`[ REDACTED ]`)}static createRandom(t,n,r){t??=``,n??=ql,r??=nl.wordlist();let i=ll.fromEntropy(Ji(16),t,r);return e.#t(i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){return n||=ql,e.#t(t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,r,i){n??=``,r??=ql,i??=nl.wordlist();let a=ll.fromPhrase(t,n,i);return e.#t(a.computeSeed(),a).derivePath(r)}static fromSeed(t){return e.#t(t,null)}},iu=class e extends Gc{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Qn(e,eu,`HDNodeVoidWallet`),qn(this,{publicKey:n});let l=or(Bi(ga(n)),0,4);qn(this,{publicKey:n,fingerprint:l,parentFingerprint:r,chainCode:i,path:a,index:o,depth:s})}connect(t){return new e(eu,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return Y(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),$l(ir([`0x0488B21E`,Ql(this.depth,1),this.parentFingerprint,Ql(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){let n=vr(t,`index`);X(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Yl&&(r+=`'`));let{IR:i,IL:a}=tu(n,this.chainCode,this.publicKey,null),o=Es.addPoints(a,this.publicKey,!0);return new e(eu,Vs(o),o,this.fingerprint,Q(i),r,n,this.depth+1,this.provider)}derivePath(e){return nu(this,e)}},au=i(((e,t)=>{t.exports={}})),ou=i(((t,n)=>{(function(t){var n=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},r=function(){throw Error(`no PRNG`)},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=n(),s=n([1]),c=n([56129,1]),l=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=r&255}function h(e,t,n,r,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function g(e,t,n,r){return h(e,t,n,r,16)}function _(e,t,n,r){return h(e,t,n,r,32)}function v(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;b=b+i|0,x=x+a|0,S=S+o|0,C=C+s|0,w=w+c|0,T=T+l|0,E=E+u|0,D=D+d|0,O=O+f|0,k=k+p|0,A=A+m|0,j=j+h|0,M=M+g|0,N=N+_|0,P=P+v|0,F=F+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=w>>>0&255,e[17]=w>>>8&255,e[18]=w>>>16&255,e[19]=w>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=E>>>0&255,e[25]=E>>>8&255,e[26]=E>>>16&255,e[27]=E>>>24&255,e[28]=D>>>0&255,e[29]=D>>>8&255,e[30]=D>>>16&255,e[31]=D>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=k>>>0&255,e[37]=k>>>8&255,e[38]=k>>>16&255,e[39]=k>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=j>>>0&255,e[45]=j>>>8&255,e[46]=j>>>16&255,e[47]=j>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=F>>>0&255,e[61]=F>>>8&255,e[62]=F>>>16&255,e[63]=F>>>24&255}function y(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=F>>>0&255,e[13]=F>>>8&255,e[14]=F>>>16&255,e[15]=F>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=O>>>0&255,e[25]=O>>>8&255,e[26]=O>>>16&255,e[27]=O>>>24&255,e[28]=k>>>0&255,e[29]=k>>>8&255,e[30]=k>>>16&255,e[31]=k>>>24&255}function b(e,t,n,r){v(e,t,n,r)}function x(e,t,n,r){y(e,t,n,r)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function C(e,t,n,r,i,a,o){var s=new Uint8Array(16),c=new Uint8Array(64),l,u;for(u=0;u<16;u++)s[u]=0;for(u=0;u<8;u++)s[u]=a[u];for(;i>=64;){for(b(c,s,o,S),u=0;u<64;u++)e[t+u]=n[r+u]^c[u];for(l=1,u=8;u<16;u++)l=l+(s[u]&255)|0,s[u]=l&255,l>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(c,s,o,S),u=0;u<i;u++)e[t+u]=n[r+u]^c[u];return 0}function w(e,t,n,r,i){var a=new Uint8Array(16),o=new Uint8Array(64),s,c;for(c=0;c<16;c++)a[c]=0;for(c=0;c<8;c++)a[c]=r[c];for(;n>=64;){for(b(o,a,i,S),c=0;c<64;c++)e[t+c]=o[c];for(s=1,c=8;c<16;c++)s=s+(a[c]&255)|0,a[c]=s&255,s>>>=8;n-=64,t+=64}if(n>0)for(b(o,a,i,S),c=0;c<n;c++)e[t+c]=o[c];return 0}function T(e,t,n,r,i){var a=new Uint8Array(32);x(a,r,i,S);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=r[s+16];return w(e,t,n,o,a)}function E(e,t,n,r,i,a,o){var s=new Uint8Array(32);x(s,a,o,S);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=a[l+16];return C(e,t,n,r,i,c,s)}var D=function(e){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;var t=e[0]&255|(e[1]&255)<<8,n,r,i,a,o,s,c;this.r[0]=t&8191,n=e[2]&255|(e[3]&255)<<8,this.r[1]=(t>>>13|n<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(n>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,a=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,o=e[10]&255|(e[11]&255)<<8,this.r[6]=(a>>>14|o<<2)&8191,s=e[12]&255|(e[13]&255)<<8,this.r[7]=(o>>>11|s<<5)&8065,c=e[14]&255|(e[15]&255)<<8,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8};D.prototype.blocks=function(e,t,n){for(var r=this.fin?0:2048,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=this.h[0],w=this.h[1],T=this.h[2],E=this.h[3],D=this.h[4],O=this.h[5],k=this.h[6],A=this.h[7],j=this.h[8],M=this.h[9],N=this.r[0],P=this.r[1],F=this.r[2],I=this.r[3],L=this.r[4],R=this.r[5],z=this.r[6],B=this.r[7],V=this.r[8],H=this.r[9];n>=16;)i=e[t+0]&255|(e[t+1]&255)<<8,C+=i&8191,a=e[t+2]&255|(e[t+3]&255)<<8,w+=(i>>>13|a<<3)&8191,o=e[t+4]&255|(e[t+5]&255)<<8,T+=(a>>>10|o<<6)&8191,s=e[t+6]&255|(e[t+7]&255)<<8,E+=(o>>>7|s<<9)&8191,c=e[t+8]&255|(e[t+9]&255)<<8,D+=(s>>>4|c<<12)&8191,O+=c>>>1&8191,l=e[t+10]&255|(e[t+11]&255)<<8,k+=(c>>>14|l<<2)&8191,u=e[t+12]&255|(e[t+13]&255)<<8,A+=(l>>>11|u<<5)&8191,d=e[t+14]&255|(e[t+15]&255)<<8,j+=(u>>>8|d<<8)&8191,M+=d>>>5|r,f=0,p=f,p+=C*N,p+=5*H*w,p+=5*V*T,p+=5*B*E,p+=5*z*D,f=p>>>13,p&=8191,p+=5*R*O,p+=5*L*k,p+=5*I*A,p+=5*F*j,p+=5*P*M,f+=p>>>13,p&=8191,m=f,m+=C*P,m+=w*N,m+=5*H*T,m+=5*V*E,m+=5*B*D,f=m>>>13,m&=8191,m+=5*z*O,m+=5*R*k,m+=5*L*A,m+=5*I*j,m+=5*F*M,f+=m>>>13,m&=8191,h=f,h+=C*F,h+=w*P,h+=T*N,h+=5*H*E,h+=5*V*D,f=h>>>13,h&=8191,h+=5*B*O,h+=5*z*k,h+=5*R*A,h+=5*L*j,h+=5*I*M,f+=h>>>13,h&=8191,g=f,g+=C*I,g+=w*F,g+=T*P,g+=E*N,g+=5*H*D,f=g>>>13,g&=8191,g+=5*V*O,g+=5*B*k,g+=5*z*A,g+=5*R*j,g+=5*L*M,f+=g>>>13,g&=8191,_=f,_+=C*L,_+=w*I,_+=T*F,_+=E*P,_+=D*N,f=_>>>13,_&=8191,_+=5*H*O,_+=5*V*k,_+=5*B*A,_+=5*z*j,_+=5*R*M,f+=_>>>13,_&=8191,v=f,v+=C*R,v+=w*L,v+=T*I,v+=E*F,v+=D*P,f=v>>>13,v&=8191,v+=O*N,v+=5*H*k,v+=5*V*A,v+=5*B*j,v+=5*z*M,f+=v>>>13,v&=8191,y=f,y+=C*z,y+=w*R,y+=T*L,y+=E*I,y+=D*F,f=y>>>13,y&=8191,y+=O*P,y+=k*N,y+=5*H*A,y+=5*V*j,y+=5*B*M,f+=y>>>13,y&=8191,b=f,b+=C*B,b+=w*z,b+=T*R,b+=E*L,b+=D*I,f=b>>>13,b&=8191,b+=O*F,b+=k*P,b+=A*N,b+=5*H*j,b+=5*V*M,f+=b>>>13,b&=8191,x=f,x+=C*V,x+=w*B,x+=T*z,x+=E*R,x+=D*L,f=x>>>13,x&=8191,x+=O*I,x+=k*F,x+=A*P,x+=j*N,x+=5*H*M,f+=x>>>13,x&=8191,S=f,S+=C*H,S+=w*V,S+=T*B,S+=E*z,S+=D*R,f=S>>>13,S&=8191,S+=O*L,S+=k*I,S+=A*F,S+=j*P,S+=M*N,f+=S>>>13,S&=8191,f=(f<<2)+f|0,f=f+p|0,p=f&8191,f>>>=13,m+=f,C=p,w=m,T=h,E=g,D=_,O=v,k=y,A=b,j=x,M=S,t+=16,n-=16;this.h[0]=C,this.h[1]=w,this.h[2]=T,this.h[3]=E,this.h[4]=D,this.h[5]=O,this.h[6]=k,this.h[7]=A,this.h[8]=j,this.h[9]=M},D.prototype.finish=function(e,t){var n=new Uint16Array(10),r,i,a,o;if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,n[0]=this.h[0]+5,r=n[0]>>>13,n[0]&=8191,o=1;o<10;o++)n[o]=this.h[o]+r,r=n[o]>>>13,n[o]&=8191;for(n[9]-=8192,i=(r^1)-1,o=0;o<10;o++)n[o]&=i;for(i=~i,o=0;o<10;o++)this.h[o]=this.h[o]&i|n[o];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,a=this.h[0]+this.pad[0],this.h[0]=a&65535,o=1;o<8;o++)a=(this.h[o]+this.pad[o]|0)+(a>>>16)|0,this.h[o]=a&65535;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},D.prototype.update=function(e,t,n){var r,i;if(this.leftover){for(i=16-this.leftover,i>n&&(i=n),r=0;r<i;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};function O(e,t,n,r,i,a){var o=new D(a);return o.update(n,r,i),o.finish(e,t),0}function k(e,t,n,r,i,a){var o=new Uint8Array(16);return O(o,0,n,r,i,a),g(e,t,o,0)}function A(e,t,n,r,i){var a;if(n<32)return-1;for(E(e,0,t,0,n,r,i),O(e,16,e,32,n-32,e),a=0;a<16;a++)e[a]=0;return 0}function j(e,t,n,r,i){var a,o=new Uint8Array(32);if(n<32||(T(o,0,32,r,i),k(t,16,t,32,n-32,o)!==0))return-1;for(E(e,0,t,0,n,r,i),a=0;a<32;a++)e[a]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function N(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function P(e,t,n){for(var r,i=~(n-1),a=0;a<16;a++)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function F(e,t){var r,i,a,o=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(N(s),N(s),N(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,P(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=s[r]&255,e[2*r+1]=s[r]>>8}function I(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return F(n,e),F(r,t),_(n,0,r,0)}function L(e){var t=new Uint8Array(32);return F(t,e),t[0]&1}function R(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function z(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function V(e,t,n){var r,i,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=n[0],L=n[1],R=n[2],z=n[3],B=n[4],V=n[5],H=n[6],ee=n[7],U=n[8],W=n[9],G=n[10],K=n[11],te=n[12],ne=n[13],re=n[14],ie=n[15];r=t[0],a+=r*I,o+=r*L,s+=r*R,c+=r*z,l+=r*B,u+=r*V,d+=r*H,f+=r*ee,p+=r*U,m+=r*W,h+=r*G,g+=r*K,_+=r*te,v+=r*ne,y+=r*re,b+=r*ie,r=t[1],o+=r*I,s+=r*L,c+=r*R,l+=r*z,u+=r*B,d+=r*V,f+=r*H,p+=r*ee,m+=r*U,h+=r*W,g+=r*G,_+=r*K,v+=r*te,y+=r*ne,b+=r*re,x+=r*ie,r=t[2],s+=r*I,c+=r*L,l+=r*R,u+=r*z,d+=r*B,f+=r*V,p+=r*H,m+=r*ee,h+=r*U,g+=r*W,_+=r*G,v+=r*K,y+=r*te,b+=r*ne,x+=r*re,S+=r*ie,r=t[3],c+=r*I,l+=r*L,u+=r*R,d+=r*z,f+=r*B,p+=r*V,m+=r*H,h+=r*ee,g+=r*U,_+=r*W,v+=r*G,y+=r*K,b+=r*te,x+=r*ne,S+=r*re,C+=r*ie,r=t[4],l+=r*I,u+=r*L,d+=r*R,f+=r*z,p+=r*B,m+=r*V,h+=r*H,g+=r*ee,_+=r*U,v+=r*W,y+=r*G,b+=r*K,x+=r*te,S+=r*ne,C+=r*re,w+=r*ie,r=t[5],u+=r*I,d+=r*L,f+=r*R,p+=r*z,m+=r*B,h+=r*V,g+=r*H,_+=r*ee,v+=r*U,y+=r*W,b+=r*G,x+=r*K,S+=r*te,C+=r*ne,w+=r*re,T+=r*ie,r=t[6],d+=r*I,f+=r*L,p+=r*R,m+=r*z,h+=r*B,g+=r*V,_+=r*H,v+=r*ee,y+=r*U,b+=r*W,x+=r*G,S+=r*K,C+=r*te,w+=r*ne,T+=r*re,E+=r*ie,r=t[7],f+=r*I,p+=r*L,m+=r*R,h+=r*z,g+=r*B,_+=r*V,v+=r*H,y+=r*ee,b+=r*U,x+=r*W,S+=r*G,C+=r*K,w+=r*te,T+=r*ne,E+=r*re,D+=r*ie,r=t[8],p+=r*I,m+=r*L,h+=r*R,g+=r*z,_+=r*B,v+=r*V,y+=r*H,b+=r*ee,x+=r*U,S+=r*W,C+=r*G,w+=r*K,T+=r*te,E+=r*ne,D+=r*re,O+=r*ie,r=t[9],m+=r*I,h+=r*L,g+=r*R,_+=r*z,v+=r*B,y+=r*V,b+=r*H,x+=r*ee,S+=r*U,C+=r*W,w+=r*G,T+=r*K,E+=r*te,D+=r*ne,O+=r*re,k+=r*ie,r=t[10],h+=r*I,g+=r*L,_+=r*R,v+=r*z,y+=r*B,b+=r*V,x+=r*H,S+=r*ee,C+=r*U,w+=r*W,T+=r*G,E+=r*K,D+=r*te,O+=r*ne,k+=r*re,A+=r*ie,r=t[11],g+=r*I,_+=r*L,v+=r*R,y+=r*z,b+=r*B,x+=r*V,S+=r*H,C+=r*ee,w+=r*U,T+=r*W,E+=r*G,D+=r*K,O+=r*te,k+=r*ne,A+=r*re,j+=r*ie,r=t[12],_+=r*I,v+=r*L,y+=r*R,b+=r*z,x+=r*B,S+=r*V,C+=r*H,w+=r*ee,T+=r*U,E+=r*W,D+=r*G,O+=r*K,k+=r*te,A+=r*ne,j+=r*re,M+=r*ie,r=t[13],v+=r*I,y+=r*L,b+=r*R,x+=r*z,S+=r*B,C+=r*V,w+=r*H,T+=r*ee,E+=r*U,D+=r*W,O+=r*G,k+=r*K,A+=r*te,j+=r*ne,M+=r*re,N+=r*ie,r=t[14],y+=r*I,b+=r*L,x+=r*R,S+=r*z,C+=r*B,w+=r*V,T+=r*H,E+=r*ee,D+=r*U,O+=r*W,k+=r*G,A+=r*K,j+=r*te,M+=r*ne,N+=r*re,P+=r*ie,r=t[15],b+=r*I,x+=r*L,S+=r*R,C+=r*z,w+=r*B,T+=r*V,E+=r*H,D+=r*ee,O+=r*U,k+=r*W,A+=r*G,j+=r*K,M+=r*te,N+=r*ne,P+=r*re,F+=r*ie,a+=38*x,o+=38*S,s+=38*C,c+=38*w,l+=38*T,u+=38*E,d+=38*D,f+=38*O,p+=38*k,m+=38*A,h+=38*j,g+=38*M,_+=38*N,v+=38*P,y+=38*F,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=p,e[9]=m,e[10]=h,e[11]=g,e[12]=_,e[13]=v,e[14]=y,e[15]=b}function H(e,t){V(e,t,t)}function ee(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)H(r,r),i!==2&&i!==4&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function U(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=250;i>=0;i--)H(r,r),i!==1&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function W(e,t,r){var i=new Uint8Array(32),a=new Float64Array(80),o,s,l=n(),u=n(),d=n(),f=n(),p=n(),m=n();for(s=0;s<31;s++)i[s]=t[s];for(i[31]=t[31]&127|64,i[0]&=248,R(a,r),s=0;s<16;s++)u[s]=a[s],f[s]=l[s]=d[s]=0;for(l[0]=f[0]=1,s=254;s>=0;--s)o=i[s>>>3]>>>(s&7)&1,P(l,u,o),P(d,f,o),z(p,l,d),B(l,l,d),z(d,u,f),B(u,u,f),H(f,p),H(m,l),V(l,d,l),V(d,u,p),z(p,l,d),B(l,l,d),H(u,l),B(d,f,m),V(l,d,c),z(l,l,f),V(d,d,l),V(l,f,m),V(f,u,a),H(u,p),P(l,u,o),P(d,f,o);for(s=0;s<16;s++)a[s+16]=l[s],a[s+32]=d[s],a[s+48]=u[s],a[s+64]=f[s];var h=a.subarray(32),g=a.subarray(16);return ee(h,h),V(g,g,h),F(e,g),0}function G(e,t){return W(e,t,a)}function K(e,t){return r(t,32),G(e,t)}function te(e,t,n){var r=new Uint8Array(32);return W(r,n,t),x(e,i,r,S)}var ne=A,re=j;function ie(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),ne(e,t,n,r,o)}function ae(e,t,n,r,i,a){var o=new Uint8Array(32);return te(o,i,a),re(e,t,n,r,o)}var oe=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function se(e,t,n,r){for(var i=new Int32Array(16),a=new Int32Array(16),o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=e[0],N=e[1],P=e[2],F=e[3],I=e[4],L=e[5],R=e[6],z=e[7],B=t[0],V=t[1],H=t[2],ee=t[3],U=t[4],W=t[5],G=t[6],K=t[7],te=0;r>=128;){for(w=0;w<16;w++)T=8*w+te,i[w]=n[T+0]<<24|n[T+1]<<16|n[T+2]<<8|n[T+3],a[w]=n[T+4]<<24|n[T+5]<<16|n[T+6]<<8|n[T+7];for(w=0;w<80;w++)if(o=M,s=N,c=P,l=F,u=I,d=L,f=R,p=z,m=B,h=V,g=H,_=ee,v=U,y=W,b=G,x=K,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(I>>>14|U<<18)^(I>>>18|U<<14)^(U>>>9|I<<23),D=(U>>>14|I<<18)^(U>>>18|I<<14)^(I>>>9|U<<23),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=I&L^~I&R,D=U&W^~U&G,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=oe[w*2],D=oe[w*2+1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=i[w%16],D=a[w%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,S=A&65535|j<<16,C=O&65535|k<<16,E=S,D=C,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(M>>>28|B<<4)^(B>>>2|M<<30)^(B>>>7|M<<25),D=(B>>>28|M<<4)^(M>>>2|B<<30)^(M>>>7|B<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=M&N^M&P^N&P,D=B&V^B&H^V&H,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,p=A&65535|j<<16,x=O&65535|k<<16,E=l,D=_,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=S,D=C,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,l=A&65535|j<<16,_=O&65535|k<<16,N=o,P=s,F=c,I=l,L=u,R=d,z=f,M=p,V=m,H=h,ee=g,U=_,W=v,G=y,K=b,B=x,w%16==15)for(T=0;T<16;T++)E=i[T],D=a[T],O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=i[(T+9)%16],D=a[(T+9)%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+1)%16],C=a[(T+1)%16],E=(S>>>1|C<<31)^(S>>>8|C<<24)^S>>>7,D=(C>>>1|S<<31)^(C>>>8|S<<24)^(C>>>7|S<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+14)%16],C=a[(T+14)%16],E=(S>>>19|C<<13)^(C>>>29|S<<3)^S>>>6,D=(C>>>19|S<<13)^(S>>>29|C<<3)^(C>>>6|S<<26),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,i[T]=A&65535|j<<16,a[T]=O&65535|k<<16;E=M,D=B,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[0],D=t[0],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[0]=M=A&65535|j<<16,t[0]=B=O&65535|k<<16,E=N,D=V,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[1],D=t[1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[1]=N=A&65535|j<<16,t[1]=V=O&65535|k<<16,E=P,D=H,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[2],D=t[2],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[2]=P=A&65535|j<<16,t[2]=H=O&65535|k<<16,E=F,D=ee,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[3],D=t[3],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[3]=F=A&65535|j<<16,t[3]=ee=O&65535|k<<16,E=I,D=U,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[4],D=t[4],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[4]=I=A&65535|j<<16,t[4]=U=O&65535|k<<16,E=L,D=W,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[5],D=t[5],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[5]=L=A&65535|j<<16,t[5]=W=O&65535|k<<16,E=R,D=G,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[6],D=t[6],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[6]=R=A&65535|j<<16,t[6]=G=O&65535|k<<16,E=z,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[7],D=t[7],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[7]=z=A&65535|j<<16,t[7]=K=O&65535|k<<16,te+=128,r-=128}return r}function ce(e,t,n){var r=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),o,s=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,se(r,i,t,n),n%=128,o=0;o<n;o++)a[o]=t[s-n+o];for(a[n]=128,n=256-128*(n<112),a[n-9]=0,m(a,n-8,s/536870912|0,s<<3),se(r,i,a,n),o=0;o<8;o++)m(e,8*o,r[o],i[o]);return 0}function le(e,t){var r=n(),i=n(),a=n(),o=n(),s=n(),c=n(),l=n(),d=n(),f=n();B(r,e[1],e[0]),B(f,t[1],t[0]),V(r,r,f),z(i,e[0],e[1]),z(f,t[0],t[1]),V(i,i,f),V(a,e[3],t[3]),V(a,a,u),V(o,e[2],t[2]),z(o,o,o),B(s,i,r),B(c,o,a),z(l,o,a),z(d,i,r),V(e[0],s,c),V(e[1],d,l),V(e[2],l,c),V(e[3],s,d)}function ue(e,t,n){var r;for(r=0;r<4;r++)P(e[r],t[r],n)}function de(e,t){var r=n(),i=n(),a=n();ee(a,t[2]),V(r,t[0],a),V(i,t[1],a),F(e,i),e[31]^=L(r)<<7}function fe(e,t,n){var r,i;for(M(e[0],o),M(e[1],s),M(e[2],s),M(e[3],o),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,ue(e,t,r),le(t,e),le(e,e),ue(e,t,r)}function pe(e,t){var r=[n(),n(),n(),n()];M(r[0],d),M(r[1],f),M(r[2],s),V(r[3],d,f),fe(e,r,t)}function me(e,t,i){var a=new Uint8Array(64),o=[n(),n(),n(),n()],s;for(i||r(t,32),ce(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,pe(o,a),de(e,o),s=0;s<32;s++)t[s+32]=e[s];return 0}var he=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ge(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*he[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*he[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*he[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function _e(e){var t=new Float64Array(64),n;for(n=0;n<64;n++)t[n]=e[n];for(n=0;n<64;n++)e[n]=0;ge(e,t)}function ve(e,t,r,i){var a=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),c,l,u=new Float64Array(64),d=[n(),n(),n(),n()];ce(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=r+64;for(c=0;c<r;c++)e[64+c]=t[c];for(c=0;c<32;c++)e[32+c]=a[32+c];for(ce(s,e.subarray(32),r+32),_e(s),pe(d,s),de(e,d),c=32;c<64;c++)e[c]=i[c];for(ce(o,e,r+64),_e(o),c=0;c<64;c++)u[c]=0;for(c=0;c<32;c++)u[c]=s[c];for(c=0;c<32;c++)for(l=0;l<32;l++)u[c+l]+=o[c]*a[l];return ge(e.subarray(32),u),f}function ye(e,t){var r=n(),i=n(),a=n(),c=n(),u=n(),d=n(),f=n();return M(e[2],s),R(e[1],t),H(a,e[1]),V(c,a,l),B(a,a,e[2]),z(c,e[2],c),H(u,c),H(d,u),V(f,d,u),V(r,f,a),V(r,r,c),U(r,r),V(r,r,a),V(r,r,c),V(r,r,c),V(e[0],r,c),H(i,e[0]),V(i,i,c),I(i,a)&&V(e[0],e[0],p),H(i,e[0]),V(i,i,c),I(i,a)?-1:(L(e[0])===t[31]>>7&&B(e[0],o,e[0]),V(e[3],e[0],e[1]),0)}function be(e,t,r,i){var a,o=new Uint8Array(32),s=new Uint8Array(64),c=[n(),n(),n(),n()],l=[n(),n(),n(),n()];if(r<64||ye(l,i))return-1;for(a=0;a<r;a++)e[a]=t[a];for(a=0;a<32;a++)e[a+32]=i[a];if(ce(s,e,r),_e(s),fe(c,l,s),pe(l,t.subarray(32)),le(c,l),de(o,c),r-=64,_(t,0,o,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=t[a+64];return r}var xe=32,Se=24,Ce=32,we=16,Te=32,Ee=32,De=32,Oe=32,ke=32,Ae=Se,je=Ce,Me=we,Ne=64,Pe=32,Fe=64,Ie=32,Le=64;t.lowlevel={crypto_core_hsalsa20:x,crypto_stream_xor:E,crypto_stream:T,crypto_stream_salsa20_xor:C,crypto_stream_salsa20:w,crypto_onetimeauth:O,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:_,crypto_secretbox:A,crypto_secretbox_open:j,crypto_scalarmult:W,crypto_scalarmult_base:G,crypto_box_beforenm:te,crypto_box_afternm:ne,crypto_box:ie,crypto_box_open:ae,crypto_box_keypair:K,crypto_hash:ce,crypto_sign:ve,crypto_sign_keypair:me,crypto_sign_open:be,crypto_secretbox_KEYBYTES:xe,crypto_secretbox_NONCEBYTES:Se,crypto_secretbox_ZEROBYTES:Ce,crypto_secretbox_BOXZEROBYTES:we,crypto_scalarmult_BYTES:Te,crypto_scalarmult_SCALARBYTES:Ee,crypto_box_PUBLICKEYBYTES:De,crypto_box_SECRETKEYBYTES:Oe,crypto_box_BEFORENMBYTES:ke,crypto_box_NONCEBYTES:Ae,crypto_box_ZEROBYTES:je,crypto_box_BOXZEROBYTES:Me,crypto_sign_BYTES:Ne,crypto_sign_PUBLICKEYBYTES:Pe,crypto_sign_SECRETKEYBYTES:Fe,crypto_sign_SEEDBYTES:Ie,crypto_hash_BYTES:Le,gf:n,D:l,L:he,pack25519:F,unpack25519:R,M:V,A:z,S:H,Z:B,pow2523:U,add:le,set25519:M,modL:ge,scalarmult:fe,scalarbase:pe};function q(e,t){if(e.length!==xe)throw Error(`bad key size`);if(t.length!==Se)throw Error(`bad nonce size`)}function Re(e,t){if(e.length!==De)throw Error(`bad public key size`);if(t.length!==Oe)throw Error(`bad secret key size`)}function ze(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError(`unexpected type, use Uint8Array`)}function Be(e){for(var t=0;t<e.length;t++)e[t]=0}t.randomBytes=function(e){var t=new Uint8Array(e);return r(t,e),t},t.secretbox=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(Ce+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+Ce]=e[a];return A(i,r,r.length,t,n),i.subarray(we)},t.secretbox.open=function(e,t,n){ze(e,t,n),q(n,t);for(var r=new Uint8Array(we+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+we]=e[a];return r.length<32||j(i,r,r.length,t,n)!==0?null:i.subarray(Ce)},t.secretbox.keyLength=xe,t.secretbox.nonceLength=Se,t.secretbox.overheadLength=we,t.scalarMult=function(e,t){if(ze(e,t),e.length!==Ee)throw Error(`bad n size`);if(t.length!==Te)throw Error(`bad p size`);var n=new Uint8Array(Te);return W(n,e,t),n},t.scalarMult.base=function(e){if(ze(e),e.length!==Ee)throw Error(`bad n size`);var t=new Uint8Array(Te);return G(t,e),t},t.scalarMult.scalarLength=Ee,t.scalarMult.groupElementLength=Te,t.box=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox(e,n,a)},t.box.before=function(e,t){ze(e,t),Re(e,t);var n=new Uint8Array(ke);return te(n,e,t),n},t.box.after=t.secretbox,t.box.open=function(e,n,r,i){var a=t.box.before(r,i);return t.secretbox.open(e,n,a)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var e=new Uint8Array(De),t=new Uint8Array(Oe);return K(e,t),{publicKey:e,secretKey:t}},t.box.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Oe)throw Error(`bad secret key size`);var t=new Uint8Array(De);return G(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},t.box.publicKeyLength=De,t.box.secretKeyLength=Oe,t.box.sharedKeyLength=ke,t.box.nonceLength=Ae,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(e,t){if(ze(e,t),t.length!==Fe)throw Error(`bad secret key size`);var n=new Uint8Array(Ne+e.length);return ve(n,e,e.length,t),n},t.sign.open=function(e,t){if(ze(e,t),t.length!==Pe)throw Error(`bad public key size`);var n=new Uint8Array(e.length),r=be(n,e,e.length,t);if(r<0)return null;for(var i=new Uint8Array(r),a=0;a<i.length;a++)i[a]=n[a];return i},t.sign.detached=function(e,n){for(var r=t.sign(e,n),i=new Uint8Array(Ne),a=0;a<i.length;a++)i[a]=r[a];return i},t.sign.detached.verify=function(e,t,n){if(ze(e,t,n),t.length!==Ne)throw Error(`bad signature size`);if(n.length!==Pe)throw Error(`bad public key size`);var r=new Uint8Array(Ne+e.length),i=new Uint8Array(Ne+e.length),a;for(a=0;a<Ne;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+Ne]=e[a];return be(i,r,r.length,n)>=0},t.sign.keyPair=function(){var e=new Uint8Array(Pe),t=new Uint8Array(Fe);return me(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(ze(e),e.length!==Fe)throw Error(`bad secret key size`);for(var t=new Uint8Array(Pe),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},t.sign.keyPair.fromSeed=function(e){if(ze(e),e.length!==Ie)throw Error(`bad seed size`);for(var t=new Uint8Array(Pe),n=new Uint8Array(Fe),r=0;r<32;r++)n[r]=e[r];return me(t,n,!0),{publicKey:t,secretKey:n}},t.sign.publicKeyLength=Pe,t.sign.secretKeyLength=Fe,t.sign.seedLength=Ie,t.sign.signatureLength=Ne,t.hash=function(e){ze(e);var t=new Uint8Array(Le);return ce(t,e,e.length),t},t.hash.hashLength=Le,t.verify=function(e,t){return ze(e,t),e.length===0||t.length===0||e.length!==t.length?!1:h(e,0,t,0,e.length)===0},t.setPRNG=function(e){r=e},(function(){var n=typeof self<`u`?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var r=65536;t.setPRNG(function(e,t){var i,a=new Uint8Array(t);for(i=0;i<t;i+=r)n.getRandomValues(a.subarray(i,i+Math.min(t-i,r)));for(i=0;i<t;i++)e[i]=a[i];Be(a)})}else e!==void 0&&(n=au(),n&&n.randomBytes&&t.setPRNG(function(e,t){var r,i=n.randomBytes(t);for(r=0;r<t;r++)e[r]=i[r];Be(i)}))})()})(n!==void 0&&n.exports?n.exports:self.nacl=self.nacl||{})})),su=r(ou(),1),cu=`/most.box/`,lu=5e4,uu=32,du=1,fu=8,pu=9+su.default.secretbox.nonceLength,mu=pu+su.default.secretbox.overheadLength,hu=new TextEncoder().encode(`MP-AE`);function gu(e,t){let n=Ur(cu+e),r=Z(ga(Z(Wi(Ur(t),n,lu,uu,`sha512`)))),i=ll.entropyToPhrase(r);return{username:e,address:ru.fromPhrase(i).address,danger:Q(r)}}function _u(e){return ll.entropyToPhrase(Z(e))}function vu(e){let t=su.default.box.keyPair.fromSecretKey(Z(e)),n=su.default.sign.keyPair.fromSeed(Z(e));return{public_key:Q(t.publicKey),private_key:Q(t.secretKey),ed_public_key:Q(n.publicKey)}}async function yu(e,t){let n=ru.fromPhrase(_u(e));return{address:n.address,signature:await n.signMessage(t)}}function bu(e,t){let n=new TextEncoder().encode(e),r=su.default.randomBytes(su.default.secretbox.nonceLength),i=Z(t).slice(0,su.default.secretbox.keyLength),a=su.default.secretbox(n,r,i);return[`mp://1`,Ar(r),Ar(a)].join(`.`)}function xu(e,t){let[n,r,i]=String(e||``).split(`.`);if(n!==`mp://1`||!r||!i)return``;let a=Z(t).slice(0,su.default.secretbox.keyLength),o=su.default.secretbox.open(kr(i),kr(r),a);return o?new TextDecoder().decode(o):``}function Su(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Cu(e){return Ar(e).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replaceAll(`=`,``)}function wu(e){let t=String(e||``).trim();if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return null;try{return kr(t.replaceAll(`-`,`+`).replaceAll(`_`,`/`).padEnd(Math.ceil(t.length/4)*4,`=`))}catch{return null}}function Tu(e){let t=new Uint8Array(fu);return new DataView(t.buffer).setBigUint64(0,BigInt(e),!1),t}function Eu(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return Number(t.getBigUint64(0,!1))}function Du(e){let t=wu(e);if(!t||t.length<mu||t[0]!==du)return null;let n=t.slice(1,9),r=t.slice(9,pu),i=t.slice(pu);return{version:t[0],timestampMs:Eu(n),nonce:r,encrypted:i}}function Ou(e,t,n){return su.default.hash(Su([hu,e,t,n])).slice(0,su.default.secretbox.keyLength)}function ku(e,{senderPrivateKey:t,recipientPublicKey:n}){let r=Z(t),i=su.default.box.keyPair.fromSecretKey(r).publicKey,a=Z(n),o=Ou(i,a,su.default.box.before(a,r)),s=su.default.randomBytes(su.default.secretbox.nonceLength),c=su.default.secretbox(new TextEncoder().encode(e),s,o);return Cu(Su([new Uint8Array([du]),Tu(Date.now()),s,c]))}function Au(e){let t=Du(e);return t?{version:t.version,timestampMs:t.timestampMs,nonce:Cu(t.nonce)}:null}function ju(e,{senderPublicKey:t,recipientPrivateKey:n}){let r=Du(e);if(!r)return``;try{let e=Z(n),i=su.default.box.keyPair.fromSecretKey(e).publicKey,a=Z(t),o=Ou(a,i,su.default.box.before(a,e)),s=su.default.secretbox.open(r.encrypted,r.nonce,o);return s?new TextDecoder().decode(s):``}catch{return``}}function Mu(e,t){let{address:n,danger:r}=gu(e,t);return{username:e,address:n,danger:r,displayName:`${e}#${n.slice(-4).toUpperCase()}`}}function Nu(){if(typeof localStorage>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function Pu(e){typeof localStorage>`u`||localStorage.setItem(`mostbox_identity`,JSON.stringify(e))}function Fu(){typeof localStorage>`u`||localStorage.removeItem(`mostbox_identity`)}function Iu(e){return`${e.username}#${e.address.slice(-4).toUpperCase()}`}function Lu(e){return e.displayName?e.displayName:Iu(e)}function Ru(e){if(!e||typeof e!=`object`)return null;let t=e;if(!t.username||!t.address||!t.danger)return null;let n=t.address,r=Lu(t),i=typeof t.avatar==`string`&&t.avatar.trim()||void 0,a=Number(t.profileUpdatedAt);return{username:t.username,address:n,danger:t.danger,displayName:r,logo:typeof t.logo==`string`?t.logo:void 0,logo_dark:typeof t.logo_dark==`string`?t.logo_dark:void 0,data:typeof t.data==`string`&&t.data.trim()||void 0,avatar:i,profileUpdatedAt:Number.isFinite(a)&&a>0?Math.floor(a):void 0,theme:t.theme===`sparkbit`?t.theme:void 0}}function zu(){return{loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``}}var Bu=Vt((e,t)=>({identity:null,wallet:void 0,firstPath:``,showLoginModal:!1,loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``,pendingCloudRestoreAddress:null,setFirstPath:t=>{e({firstPath:t||`/`})},initializeUser:()=>{let t=Ru(Nu());t||Fu(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:``})},closeLoginModal:()=>{e({showLoginModal:!1,...zu()})},setLoginUsername:t=>{e({loginUsername:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},setLoginPassword:t=>{e({loginPassword:t,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginError:``})},togglePassword:()=>{e(e=>({showPassword:!e.showPassword}))},previewLoginIdentity:()=>{let{loginUsername:n,loginPassword:r}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;let i=Mu(n.trim(),r);return e({loginPreviewAddress:i.address,hasPreviewedAvatar:!0,loginError:``}),i},loginUser:()=>{let{loginUsername:n,loginPassword:r,hasPreviewedAvatar:i}=t();if(!n.trim()||!r.trim())return e({loginError:`login.error.credentialsRequired`}),null;if(!i)return e({loginError:`login.error.previewRequired`}),null;e({loginLoading:!0,loginError:``});try{let t=Mu(n.trim(),r);return Pu(t),e({identity:t,wallet:t,pendingCloudRestoreAddress:t.address,showLoginModal:!1,...zu()}),t}catch{return e({loginLoading:!1,loginError:`login.error.failed`}),null}},setUserIdentity:t=>{let n=Ru(t);n&&(Pu(n),e({identity:n,wallet:n}))},consumePendingCloudRestore:n=>{let r=t().pendingCloudRestoreAddress;return!r||r.toLowerCase()!==n.toLowerCase()?!1:(e({pendingCloudRestoreAddress:null}),!0)},logoutUser:()=>{Fu(),e({identity:null,wallet:void 0,pendingCloudRestoreAddress:null})}}));function Vu(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function Hu(e){if(e instanceof Uint8Array&&e.constructor.name===`Uint8Array`)return Wu(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return Wu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));throw Error(`Unknown type, must be binary type`)}function Uu(e){return e?.buffer instanceof ArrayBuffer}function Wu(e){return Uu(e)?e:e.slice()}function Gu(e,t,n){if(e.length>=255)throw TypeError(`Alphabet too long`);for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var a=0;a<e.length;a++){var o=e.charAt(a),s=o.charCodeAt(0);if(r[s]!==255)throw TypeError(o+` is ambiguous`);if(r[s]=a,n){var c=o.toLowerCase().charCodeAt(0),l=o.toUpperCase().charCodeAt(0);c!==s&&(r[c]=a),l!==s&&(r[l]=a)}}var u=e.length,d=e.charAt(0),f=Math.log(u)/Math.log(256),p=Math.log(256)/Math.log(u);function m(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError(`Expected Uint8Array`);if(t.length===0)return``;for(var n=0,r=0,i=0,a=t.length;i!==a&&t[i]===0;)i++,n++;for(var o=(a-i)*p+1>>>0,s=new Uint8Array(o);i!==a;){for(var c=t[i],l=0,f=o-1;(c!==0||l<r)&&f!==-1;f--,l++)c+=256*s[f]>>>0,s[f]=c%u>>>0,c=c/u>>>0;if(c!==0)throw Error(`Non-zero carry`);r=l,i++}for(var m=o-r;m!==o&&s[m]===0;)m++;for(var h=d.repeat(n);m<o;++m)h+=e.charAt(s[m]);return h}function h(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return new Uint8Array;var t=0;if(e[t]!==` `){for(var n=0,i=0;e[t]===d;)n++,t++;for(var a=(e.length-t)*f+1>>>0,o=new Uint8Array(a);e[t];){var s=r[e.charCodeAt(t)];if(s===255)return;for(var c=0,l=a-1;(s!==0||c<i)&&l!==-1;l--,c++)s+=u*o[l]>>>0,o[l]=s%256>>>0,s=s/256>>>0;if(s!==0)throw Error(`Non-zero carry`);i=c,t++}if(e[t]!==` `){for(var p=a-i;p!==a&&o[p]===0;)p++;for(var m=new Uint8Array(n+(a-p)),h=n;p!==a;)m[h++]=o[p++];return m}}}function g(e){var n=h(e);if(n)return n;throw Error(`Non-${t} character`)}return{encode:m,decodeUnsafe:h,decode:g}}var Ku=Gu,qu=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error(`Unknown type, must be binary type`)}},Ju=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw Error(`Invalid prefix character`);this.prefixCodePoint=r,this.baseDecode=n}decode(e){if(typeof e==`string`){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error(`Can only multibase decode strings`)}or(e){return Xu(this,e)}},Yu=class{decoders;constructor(e){this.decoders=e}or(e){return Xu(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Xu(e,t){return new Yu({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var Zu=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new qu(e,t,n),this.decoder=new Ju(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Qu({name:e,prefix:t,encode:n,decode:r}){return new Zu(e,t,n,r)}function $u({name:e,prefix:t,alphabet:n,caseInsensitive:r=!1}){let{encode:i,decode:a}=Ku(n,e,r);return Qu({prefix:t,name:e,encode:i,decode:e=>Hu(a(e))})}function ed(e,t,n,r){let i=e.length;for(;e[i-1]===`=`;)--i;let a=new Uint8Array(i*n/8|0),o=0,s=0,c=0;for(let l=0;l<i;++l){let i=t[e[l]];if(i===void 0)throw SyntaxError(`Non-${r} character`);s=s<<n|i,o+=n,o>=8&&(o-=8,a[c++]=255&s>>o)}if(o>=n||255&s<<8-o)throw SyntaxError(`Unexpected end of data`);return a}function td(e,t,n){let r=t[t.length-1]===`=`,i=(1<<n)-1,a=``,o=0,s=0;for(let r=0;r<e.length;++r)for(s=s<<8|e[r],o+=8;o>n;)o-=n,a+=t[i&s>>o];if(o!==0&&(a+=t[i&s<<n-o]),r)for(;a.length*n&7;)a+=`=`;return a}function nd(e,t){let n={};for(let r=0;r<e.length;++r)if(n[e[r]]=r,t){let t=e[r].toLowerCase(),i=e[r].toUpperCase();t!==e[r]&&(n[t]=r),i!==e[r]&&(n[i]=r)}return n}function rd({name:e,prefix:t,bitsPerChar:n,alphabet:r,caseInsensitive:i=!1}){let a=nd(r,i);return Qu({prefix:t,name:e,encode(e){return td(e,r,n)},decode(t){return ed(t,a,n,e)}})}var id=rd({prefix:`b`,name:`base32`,alphabet:`abcdefghijklmnopqrstuvwxyz234567`,bitsPerChar:5,caseInsensitive:!0});rd({prefix:`B`,name:`base32upper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`c`,name:`base32pad`,alphabet:`abcdefghijklmnopqrstuvwxyz234567=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`C`,name:`base32padupper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`v`,name:`base32hex`,alphabet:`0123456789abcdefghijklmnopqrstuv`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`V`,name:`base32hexupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`t`,name:`base32hexpad`,alphabet:`0123456789abcdefghijklmnopqrstuv=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`T`,name:`base32hexpadupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV=`,bitsPerChar:5,caseInsensitive:!0}),rd({prefix:`h`,name:`base32z`,alphabet:`ybndrfg8ejkmcpqxot1uwisza345h769`,bitsPerChar:5});var ad=$u({prefix:`k`,name:`base36`,alphabet:`0123456789abcdefghijklmnopqrstuvwxyz`,caseInsensitive:!0});$u({prefix:`K`,name:`base36upper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`,caseInsensitive:!0});var od=$u({name:`base58btc`,prefix:`z`,alphabet:`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`});$u({name:`base58flickr`,prefix:`Z`,alphabet:`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`});var sd=dd,cd=128,ld=-128,ud=2**31;function dd(e,t,n){t||=[],n||=0;for(var r=n;e>=ud;)t[n++]=e&255|cd,e/=128;for(;e&ld;)t[n++]=e&255|cd,e>>>=7;return t[n]=e|0,dd.bytes=n-r+1,t}var fd=hd,pd=128,md=127;function hd(e,t){var n=0,t=t||0,r=0,i=t,a,o=e.length;do{if(i>=o)throw hd.bytes=0,RangeError(`Could not decode varint`);a=e[i++],n+=r<28?(a&md)<<r:(a&md)*2**r,r+=7}while(a>=pd);return hd.bytes=i-t,n}var gd=2**7,_d=2**14,vd=2**21,yd=2**28,bd=2**35,xd=2**42,Sd=2**49,Cd=2**56,wd=2**63,Td={encode:sd,decode:fd,encodingLength:function(e){return e<gd?1:e<_d?2:e<vd?3:e<yd?4:e<bd?5:e<xd?6:e<Sd?7:e<Cd?8:e<wd?9:10}};function Ed(e,t=0){return[Td.decode(e,t),Td.decode.bytes]}function Dd(e,t,n=0){return Td.encode(e,t,n),t}function Od(e){return Td.encodingLength(e)}function kd(e,t){let n=t.byteLength,r=Od(e),i=r+Od(n),a=new Uint8Array(i+n);return Dd(e,a,0),Dd(n,a,r),a.set(t,i),new Md(e,n,t,a)}function Ad(e){let t=Hu(e),[n,r]=Ed(t),[i,a]=Ed(t.subarray(r)),o=t.subarray(r+a);if(o.byteLength!==i)throw Error(`Incorrect length`);return new Md(n,i,o,t)}function jd(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&Vu(e.bytes,n.bytes)}}var Md=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=Wu(n),this.bytes=Wu(r)}};function Nd(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return Rd(n,Fd(e),t??od.encoder);default:return zd(n,Fd(e),t??id.encoder)}}var Pd=new WeakMap;function Fd(e){let t=Pd.get(e);if(t==null){let t=new Map;return Pd.set(e,t),t}return t}var Id=class e{code;version;multihash;bytes;"/";constructor(e,t,n,r){this.code=t,this.version=e,this.multihash=n,this.bytes=Wu(r),this[`/`]=this.bytes}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:n}=this;if(t!==Bd)throw Error(`Cannot convert a non dag-pb CID to CIDv0`);if(n.code!==Vd)throw Error(`Cannot convert non sha2-256 multihash CID to CIDv0`);return e.createV0(n)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:n}=this.multihash,r=kd(t,n);return e.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&jd(e.multihash,n.multihash)}toString(e){return Nd(this,e)}toJSON(){return{"/":Nd(this)}}link(){return this}[Symbol.toStringTag]=`CID`;[Symbol.for(`nodejs.util.inspect.custom`)](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let n=t;if(n instanceof e)return n;if(n[`/`]!=null&&n[`/`]===n.bytes||n.asCID===n){let{version:t,code:r,multihash:i,bytes:a}=n;return new e(t,r,i,a??Hd(t,r,i.bytes))}else if(n[Ud]===!0){let{version:t,multihash:r,code:i}=n,a=Ad(r);return e.create(t,i,a)}else return null}static create(t,n,r){if(typeof n!=`number`)throw Error(`String codecs are no longer supported`);if(!(r.bytes instanceof Uint8Array))throw Error(`Invalid digest`);switch(t){case 0:if(n!==Bd)throw Error(`Version 0 CID must use dag-pb (code: ${Bd}) block encoding`);return new e(t,n,r,r.bytes);case 1:return new e(t,n,r,Hd(t,n,r.bytes));default:throw Error(`Invalid version`)}}static createV0(t){return e.create(0,Bd,t)}static createV1(t,n){return e.create(1,t,n)}static decode(t){let[n,r]=e.decodeFirst(t);if(r.length!==0)throw Error(`Incorrect length`);return n}static decodeFirst(t){let n=e.inspectBytes(t),r=n.size-n.multihashSize,i=Hu(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw Error(`Incorrect length`);let a=i.subarray(n.multihashSize-n.digestSize),o=new Md(n.multihashCode,n.digestSize,a,i);return[n.version===0?e.createV0(o):e.createV1(n.codec,o),t.subarray(n.size)]}static inspectBytes(e){let t=0,n=()=>{let[n,r]=Ed(e.subarray(t));return t+=r,n},r=n(),i=Bd;if(r===18?(r=0,t=0):i=n(),r!==0&&r!==1)throw RangeError(`Invalid CID version ${r}`);let a=t,o=n(),s=n(),c=t+s,l=c-a;return{version:r,codec:i,multihashCode:o,digestSize:s,multihashSize:l,size:c}}static parse(t,n){let[r,i]=Ld(t,n),a=e.decode(i);if(a.version===0&&t[0]!==`Q`)throw Error(`Version 0 CID string must not include multibase prefix`);return Fd(a).set(r,t),a}};function Ld(e,t){switch(e[0]){case`Q`:{let n=t??od;return[od.prefix,n.decode(`${od.prefix}${e}`)]}case od.prefix:{let n=t??od;return[od.prefix,n.decode(e)]}case id.prefix:{let n=t??id;return[id.prefix,n.decode(e)]}case ad.prefix:{let n=t??ad;return[ad.prefix,n.decode(e)]}default:if(t==null)throw Error(`To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided`);return[e[0],t.decode(e)]}}function Rd(e,t,n){let{prefix:r}=n;if(r!==od.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let i=n.encode(e).slice(1);return t.set(r,i),i}else return i}function zd(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let i=n.encode(e);return t.set(r,i),i}else return i}var Bd=112,Vd=18;function Hd(e,t,n){let r=Od(e),i=r+Od(t),a=new Uint8Array(i+n.byteLength);return Dd(e,a,0),Dd(t,a,r),a.set(n,i),a}var Ud=Symbol.for(`@ipld/js-cid/CID`),Wd=20;function Gd({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new Kd(e,t,n,r,i)}var Kd=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??Wd,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?qd(n,this.code,t?.truncate):n.then(e=>qd(e,this.code,t?.truncate))}else throw Error(`Unknown type, must be binary type`)}};function qd(e,t,n){if(n!=null&&n!==e.byteLength){if(n>e.byteLength)throw Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,n)}return kd(t,e)}function Jd(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var Yd=Gd({name:`sha2-256`,code:18,encode:Jd(`SHA-256`)});Gd({name:`sha2-512`,code:19,encode:Jd(`SHA-512`)});function Xd(e=``){return String(e).replace(/\\/g,`/`).split(`/`).map(e=>e.trim()).filter(e=>e&&e!==`.`).filter(e=>e!==`..`).join(`/`)}function Zd(e){let t=Xd(e?.path||``),n=String(e?.name||``).trim();return t?`${t}/${n}`:n}var Qd={EMPTY:`empty`,SLASH:`slash`,BACKSLASH:`backslash`};function $d(e){let t=String(e||``).trim();return t?t.includes(`/`)?{valid:!1,errorCode:Qd.SLASH,error:`Name cannot contain /`}:t.includes(`\\`)?{valid:!1,errorCode:Qd.BACKSLASH,error:`Name cannot contain \\`}:{valid:!0,name:t}:{valid:!1,errorCode:Qd.EMPTY,error:`Name is required`}}async function ef(e=``){let t=new TextEncoder().encode(String(e)),n=await Yd.digest(t);return Id.create(1,85,n).toString()}function tf(e,t,n,r){let i=Xd(t),a=Xd(n),o=String(r||``).trim(),s=Xd(a?`${a}/${o}`:o),c=Date.now();return e.map(e=>{let t=Zd(e);if(t===i)return{...e,path:a,name:o,updated_at:c};if(t.startsWith(`${i}/`)){let n=Xd(`${s}/${t.slice(i.length+1)}`),r=n.lastIndexOf(`/`);return{...e,path:r===-1?``:n.slice(0,r),name:n.slice(r+1),updated_at:c}}return e})}var nf=class extends Error{name=`KyError`;get isKyError(){return!0}},rf=class extends nf{name=`HTTPError`;response;request;options;data;constructor(e,t,n){let r=`${e.status||e.status===0?e.status:``} ${e.statusText??``}`.trim(),i=r?`status code ${r}`:`an unknown error`;super(`Request failed with ${i}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=n}},af=class extends nf{name=`NetworkError`;request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},of=class extends Error{name=`NonError`;value;constructor(e){let t=`Non-error value was thrown`;try{typeof e==`string`?t=e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`&&(t=e.message)}catch{}super(t),this.value=e}},sf=class extends nf{name=`ForceRetryError`;customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new of(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:`Forced retry`,t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},cf=class extends Error{name=`SchemaValidationError`;issues;constructor(e){super(`Response schema validation failed`),this.issues=e}},lf=class extends nf{name=`TimeoutError`;request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},uf=(()=>{let e=!1,t=!1,n=typeof globalThis.ReadableStream==`function`,r=typeof globalThis.Request==`function`;if(n&&r)try{t=new globalThis.Request(`https://empty.invalid`,{body:new globalThis.ReadableStream,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`)}catch(e){if(e instanceof Error&&e.message===`unsupported BodyInit type`)return!1;throw e}return e&&!t})(),df=typeof globalThis.AbortController==`function`,ff=typeof globalThis.AbortSignal==`function`&&typeof globalThis.AbortSignal.any==`function`,pf=typeof globalThis.ReadableStream==`function`,mf=typeof globalThis.FormData==`function`,hf=[`get`,`post`,`put`,`patch`,`head`,`delete`],gf={json:`application/json`,text:`text/*`,formData:`multipart/form-data`,arrayBuffer:`*/*`,blob:`*/*`,bytes:`*/*`},_f=2147483647,vf=Symbol(`stop`),yf=class{options;constructor(e){this.options=e}},bf=e=>new yf(e),xf={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Sf={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Cf=new TextEncoder,wf=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=40,t+=Cf.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+=typeof r==`string`?Cf.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof e==`string`?Cf.encode(e).byteLength:e instanceof URLSearchParams?Cf.encode(e.toString()).byteLength:0},Tf=(e,t,n)=>{let r,i=0;return e.pipeThrough(new TransformStream({transform(e,a){if(a.enqueue(e),r){i+=r.byteLength;let e=t===0?0:i/t;e>=1&&(e=1-2**-52),n?.({percent:e,totalBytes:Math.max(t,i),transferredBytes:i},r)}r=e},flush(){r&&(i+=r.byteLength,n?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},r))}}))},Ef=(e,t)=>{if(!e.body)return e;let n={status:e.status,statusText:e.statusText,headers:e.headers};if(e.status===204)return new Response(null,n);let r=Math.max(0,Number(e.headers.get(`content-length`))||0);return new Response(Tf(e.body,r,t),n)},Df=(e,t,n)=>{if(!e.body)return e;let r=wf(n??e.body);return new Request(e,{duplex:`half`,body:Tf(e.body,r,t)})},Of=e=>typeof e==`object`&&!!e,kf=Symbol(`replaceOption`),Af=e=>Of(e)&&e[kf]===!0?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},jf=(...e)=>{for(let t of e)if((!Of(t)||Array.isArray(t))&&t!==void 0)throw TypeError("The `options` argument must be an object");return Vf({},...e)},Mf=(e={},t={})=>{let n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[e,t]of i.entries())r&&t===`undefined`||t===void 0?n.delete(e):n.set(e,t);return n},Nf=e=>{if(!Of(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Pf=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),n=e[zf];return n&&(t[zf]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:Nf(e)?{...e}:e},Ff=e=>Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0)),If=(e,t)=>Nf(e)&&Nf(t)?Ff({...e,...t}):Mf(e,t);function Lf(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Vf(e[n]??[],t[n]??[])}var Rf=(e={},t={})=>({init:Lf(e,t,`init`),beforeRequest:Lf(e,t,`beforeRequest`),beforeRetry:Lf(e,t,`beforeRetry`),beforeError:Lf(e,t,`beforeError`),afterResponse:Lf(e,t,`afterResponse`)}),zf=Symbol(`deletedParameters`),Bf=(e,t)=>{let n=new URLSearchParams,r=new Set;for(let i of[e,t])if(i!==void 0)if(i instanceof URLSearchParams){for(let[e,t]of i.entries())n.append(e,t),r.delete(e);let e=i[zf];if(e)for(let t of e)n.delete(t),r.add(t)}else if(Array.isArray(i))for(let e of i){if(!Array.isArray(e)||e.length!==2)throw TypeError(`Array search parameters must be provided in [[key, value], ...] format`);n.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(Of(i))for(let[e,t]of Object.entries(i))t===void 0?(n.delete(e),r.add(e)):(n.append(e,String(t)),r.delete(e));else{let e=new URLSearchParams(i);for(let[t,i]of e.entries())n.append(t,i),r.delete(t)}return r.size>0&&(n[zf]=r),n},Vf=(...e)=>{let t={},n={},r={},i,a=[];for(let o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(Of(o)){for(let[e,n]of Object.entries(o)){if(e===`signal`&&n instanceof globalThis.AbortSignal){a.push(n);continue}let r=Af(n),{isReplace:o}=r;if(n=r.value,e===`context`){if(n!=null&&(!Of(n)||Array.isArray(n)))throw TypeError("The `context` option must be an object");t={...t,context:n==null?{}:o?{...n}:{...t.context,...n}};continue}if(e===`searchParams`){i=n==null?void 0:o||i===void 0?n:Bf(i,n);continue}Of(n)&&!o&&e in t&&(n=Vf(t[e],n)),t={...t,[e]:n}}if(Of(o.hooks)){let{value:e,isReplace:n}=Af(o.hooks);r=Rf(n?{}:r,e),t.hooks=r}if(Of(o.headers)){let{value:e,isReplace:r}=Af(o.headers);n=r?Pf(e):If(n,e),t.headers=n}}return i!==void 0&&(t.searchParams=i),a.length>0&&(a.length===1?t.signal=a[0]:ff?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t},Hf=e=>hf.includes(e)?e.toUpperCase():e,Uf={limit:2,methods:[`get`,`put`,`head`,`delete`,`options`,`trace`],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Wf=(e={})=>{if(typeof e==`number`)return{...Uf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw Error(`retry.methods must be an array`);if(e.statusCodes&&!Array.isArray(e.statusCodes))throw Error(`retry.statusCodes must be an array`);let t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>e!==void 0));return{...Uf,...t}};async function Gf(e,t,n,r){return new Promise((i,a)=>{let o=setTimeout(()=>{n&&n.abort(),a(new lf(e))},r.timeout);r.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Kf(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener(`abort`,i,{once:!0}));function i(){clearTimeout(a),r(t.reason)}let a=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e)})}var qf=e=>{let t={};for(let n in e)Object.hasOwn(e,n)&&!(n in Sf)&&!(n in xf)&&(t[n]=e[n]);return t},Jf=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[zf]?.size:typeof e==`object`?Object.keys(e).length>0:typeof e==`string`?e.trim().length>0:!!e,Yf=Object.prototype.toString,Xf=e=>Yf.call(e)===`[object Error]`,Zf=new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Qf(e){if(!(e&&Xf(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Zf.has(t)}var $f=(e,t)=>e instanceof t||e?.name===t.name;function ep(e){return $f(e,rf)}function tp(e){return $f(e,af)}function np(e){return $f(e,lf)}var rp=10*1024*1024,ip="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",ap=Symbol(`timedOutResponseData`),op=e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder},sp="The `schema` argument must follow the Standard Schema specification",cp=e=>typeof e==`object`?{...e,...e.methods&&{methods:[...e.methods]},...e.statusCodes&&{statusCodes:[...e.statusCodes]},...e.afterStatusCodes&&{afterStatusCodes:[...e.afterStatusCodes]}}:e,lp=Object.prototype.toString,up=e=>e instanceof globalThis.Request||lp.call(e)===`[object Request]`,dp=e=>e instanceof globalThis.Response||lp.call(e)===`[object Response]`,fp=e=>Array.isArray(e)?e.map(e=>[...e]):Pf(e);function pp(e){let t={...e,json:Pf(e.json),context:Pf(e.context),headers:Pf(e.headers),searchParams:fp(e.searchParams)};return e.retry!==void 0&&(t.retry=cp(e.retry)),t}var mp=async(e,t)=>{if(typeof t!=`object`&&typeof t!=`function`||t===null)throw TypeError(sp);let n=t[`~standard`];if(typeof n!=`object`||!n||typeof n.validate!=`function`)throw TypeError(sp);let r=await n.validate(e);if(r.issues)throw new cf(r.issues);return r.value},hp=class e{static create(t,n){let r=n.hooks?.init??[],i=r.length>0?pp(n):n;for(let e of r)e(i);let a=new e(t,i),o=async()=>{if(typeof a.#i.timeout==`number`&&a.#i.timeout>2147483647)throw RangeError(`The \`timeout\` option cannot be greater than ${_f}`);if(typeof a.#i.totalTimeout==`number`&&a.#i.totalTimeout>2147483647)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${_f}`);await Promise.resolve();let e=await a.#w(),t=e??await a.#E(async()=>a.#k()),n=e!==void 0||a.#O();for(;;){if(t===void 0)return t;if(dp(t))try{t=await a.#T(t)}catch(e){if(!(e instanceof sf))throw e;let r=await a.#D(e,async()=>a.#k());if(r===void 0)return r;t=r,n=a.#O();continue}let e=t;if(!e.ok&&e.type!==`opaque`&&(typeof a.#i.throwHttpErrors==`function`?a.#i.throwHttpErrors(e.status):a.#i.throwHttpErrors)){let r=new rf(e,a.#P(e),a.#M()),i=r;if(r.data=await a.#h(e),n)throw i;let o=await a.#D(r,async()=>a.#k());if(o===void 0)return o;t=o,n=a.#O();continue}break}if(!dp(t))return t;if(a.#m(t),a.#i.onDownloadProgress){if(typeof a.#i.onDownloadProgress!=`function`)throw TypeError("The `onDownloadProgress` option must be a function");if(!pf)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();return a.#x(t),Ef(e,a.#i.onDownloadProgress)}return t},s=(async()=>{try{return await o()}catch(e){if(!(e instanceof Error)||a.#s.has(e))throw e;let t=e;for(let e of a.#i.hooks.beforeError){let n=await e({request:a.request,options:a.#M(),error:t,retryCount:a.#n});n instanceof Error&&(t=n)}throw t}finally{let e=a.#a;a.#b(e?.body??void 0),a.request!==e&&a.#b(a.request.body??void 0)}})();for(let[e,t]of Object.entries(gf))e===`bytes`&&typeof globalThis.Response?.prototype?.bytes!=`function`||(s[e]=async n=>{a.request.headers.set(`accept`,a.request.headers.get(`accept`)||t);let r=await s;if(e!==`json`)return r[e]();let o=await r.text();if(o===``)return n===void 0?JSON.parse(o):mp(void 0,n);let c=i.parseJson?await i.parseJson(o,{request:a.#P(r),response:r}):JSON.parse(o);return n===void 0?c:mp(c,n)});return s}static#e(e){return e&&typeof e==`object`&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)):e}request;#t;#n=0;#r;#i;#a;#o;#s=new WeakSet;#c;#l;#u=!1;#d=new WeakMap;constructor(t,n={}){if(this.#r=t,Object.hasOwn(n,`prefixUrl`))throw Error(ip);if(this.#i={...n,headers:Mf(this.#r.headers,n.headers),hooks:Rf({},n.hooks),method:Hf(n.method??this.#r.method??`GET`),prefix:String(n.prefix||``),retry:Wf(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,totalTimeout:n.totalTimeout??!1,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#r!=`string`&&!(this.#r instanceof URL||this.#r instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#r==`string`){if(this.#i.prefix){let e=this.#i.prefix.replace(/\/+$/,``),t=this.#r.replace(/^\/+/,``);this.#r=`${e}/${t}`}if(this.#i.baseUrl){let e;try{e=new URL(this.#r)}catch{}e||(this.#r=new URL(this.#r,new Request(this.#i.baseUrl).url))}}df&&ff&&(this.#o=this.#i.signal??this.#r.signal,this.#t=new globalThis.AbortController,this.#i.signal=this.#S()),uf&&(this.#i.duplex=`half`),this.#i.json!==void 0&&(this.#i.body=this.#i.stringifyJson?.(this.#i.json)??JSON.stringify(this.#i.json),this.#i.headers.set(`content-type`,this.#i.headers.get(`content-type`)??`application/json`));let r=n.headers&&new globalThis.Headers(n.headers).has(`content-type`);if(this.#r instanceof globalThis.Request&&(mf&&this.#i.body instanceof globalThis.FormData||this.#i.body instanceof URLSearchParams)&&!r&&this.#i.headers.delete(`content-type`),this.request=new globalThis.Request(this.#r,this.#i),Jf(this.#i.searchParams)){let t=new URL(this.request.url),n=this.#i.searchParams?.[zf];if(n)for(let e of n)t.searchParams.delete(e);if(typeof this.#i.searchParams==`string`){let e=this.#i.searchParams.replace(/^\?/,``);e!==``&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{let n=new URLSearchParams(e.#e(this.#i.searchParams));for(let[e,r]of n.entries())t.searchParams.append(e,r)}if(this.#i.searchParams&&typeof this.#i.searchParams==`object`&&!Array.isArray(this.#i.searchParams)&&!(this.#i.searchParams instanceof URLSearchParams))for(let[e,n]of Object.entries(this.#i.searchParams))n===void 0&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#i)}if(this.#i.onUploadProgress&&typeof this.#i.onUploadProgress!=`function`)throw TypeError("The `onUploadProgress` option must be a function");this.#l=typeof this.#i.totalTimeout==`number`?this.#j():void 0}#f(){let e=this.#i.retry.delay(this.#n+1),t=e;return this.#i.retry.jitter===!0?t=Math.random()*e:typeof this.#i.retry.jitter==`function`&&(t=this.#i.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e)),Math.min(this.#i.retry.backoffLimit,t)}async#p(e){if(this.#n>=this.#i.retry.limit)throw e;let t=e instanceof Error?e:new of(e);if(t instanceof sf)return t.customDelay??this.#f();if(!this.#i.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#i.retry.shouldRetry!==void 0){let n=await this.#i.retry.shouldRetry({error:t,retryCount:this.#n+1});if(n===!1)throw e;if(n===!0)return this.#f()}if(np(e)){if(!this.#i.retry.retryOnTimeout)throw e;return this.#f()}if(ep(e)){if(!this.#i.retry.statusCodes.includes(e.response.status))throw e;let t=e.response.headers.get(`Retry-After`)??e.response.headers.get(`RateLimit-Reset`)??e.response.headers.get(`X-RateLimit-Retry-After`)??e.response.headers.get(`X-RateLimit-Reset`)??e.response.headers.get(`X-Rate-Limit-Reset`);if(t&&this.#i.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t)*1e3;return Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse(`2024-01-01`)&&(e-=Date.now()),Number.isFinite(e)?(e=Math.max(0,e),Math.min(this.#i.retry.maxRetryAfter,e)):Math.min(this.#i.retry.maxRetryAfter,this.#f())}if(e.response.status===413)throw e;return this.#f()}if(!tp(e))throw e;return this.#f()}#m(e){let t=this.#P(e);return this.#i.parseJson&&(e.json=async()=>{let n=await e.text();return n===``?JSON.parse(n):this.#i.parseJson(n,{request:t,response:e})}),e}async#h(e){let t=await this.#v(e,this.#g());if(t===ap){this.#C();return}if(!t)return;if(!this.#_(e.headers.get(`content-type`)??``))return t;let n=await this.#y(t,e,this.#g(),this.#P(e));if(n===ap){this.#C();return}return n}#g(){let e=this.#i.timeout===!1?1e4:this.#i.timeout,t=this.#A();if(t===void 0)return e;if(t<=0)throw new lf(this.request);return Math.min(e,t)}#_(e){let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#v(e,t){let{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}let i=op(e.headers.get(`content-type`)??``),a=[],o=0,s=(async()=>{try{for(;;){let{done:e,value:t}=await r.read();if(e)break;if(o+=t.byteLength,o>rp){r.cancel().catch(()=>void 0);return}a.push(i.decode(t,{stream:!0}))}}catch{return}return a.push(i.decode()),a.join(``)})(),c=new Promise(e=>{let n=setTimeout(()=>{e(ap)},t);s.finally(()=>{clearTimeout(n)})}),l=await Promise.race([s,c]);return l===ap&&r.cancel().catch(()=>void 0),l}async#y(e,t,n,r){let i;try{return await Promise.race([Promise.resolve().then(()=>this.#i.parseJson?this.#i.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{i=setTimeout(()=>{e(ap)},n)})])}catch{return}finally{clearTimeout(i)}}#b(e){e&&e.cancel().catch(()=>void 0)}#x(e){this.#b(e.body??void 0)}#S(){return this.#o?AbortSignal.any([this.#o,this.#t.signal]):this.#t.signal}#C(){let e=this.#A();if(e!==void 0&&e<=0)throw new lf(this.request)}async#w(){for(let e of this.#i.hooks.beforeRequest){let t=await e({request:this.request,options:this.#M(),retryCount:0});if(up(t))this.#N(t);else if(dp(t))return t}}async#T(e){let t=this.#P(e);for(let n of this.#i.hooks.afterResponse){let r=this.#F(e.clone(),t);this.#m(r);let i;try{i=await n({request:this.request,options:this.#M(),response:r,retryCount:this.#n})}catch(t){throw r!==e&&this.#x(r),this.#x(e),t}if(i instanceof yf)throw r!==e&&this.#x(r),this.#x(e),new sf(i.options);let a=dp(i)?this.#F(i,t):e;r!==e&&r!==a&&r.body!==a.body&&this.#x(r),e!==a&&e.body!==a.body&&this.#x(e),e=a}return e}async#E(e){try{return await e()}catch(t){return this.#D(t,e)}}async#D(e,t){this.#u=!1;let n=Math.min(await this.#p(e),_f),r={signal:this.#o},i=this.#A();if(i!==void 0){if(i<=0)throw new lf(this.request);if(n>=i)throw await Kf(i,r),new lf(this.request)}if(await Kf(n,r),this.#C(),e instanceof sf&&e.customRequest){let t=new globalThis.Request(e.customRequest,this.#i.signal?{signal:this.#i.signal}:void 0);this.#N(t)}for(let t of this.#i.hooks.beforeRetry){let n;try{n=await t({request:this.request,options:this.#M(),error:e,retryCount:this.#n+1})}catch(t){throw t instanceof Error&&t!==e&&this.#s.add(t),t}if(up(n)){this.#N(n);break}if(dp(n))return this.#u=!0,this.#n++,n;if(n===vf)return}return this.#C(),this.#n++,this.#E(t)}#O(){let e=this.#u;return this.#u=!1,e}async#k(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#i.signal=this.#S(),this.request=new globalThis.Request(this.request,{signal:this.#i.signal}));let e=qf(this.#i),t=this.#i.retry.limit>0?this.request.clone():void 0,n=this.#I(this.request,this.#i.body??void 0);this.#a=n,t&&(this.request=t);try{let t=this.#A();if(t!==void 0&&t<=0)throw new lf(this.request);let r=this.#i.timeout===!1?t:t===void 0?this.#i.timeout:Math.min(this.#i.timeout,t),i=r===void 0?await this.#i.fetch(n,e):await Gf(n,e,this.#t,{timeout:r,fetch:this.#i.fetch});return this.#F(i,n)}catch(e){throw Qf(e)?new af(this.request,{cause:e}):e}}#A(){if(this.#l===void 0)return;let e=this.#j()-this.#l;return Math.max(0,this.#i.totalTimeout-e)}#j(){return globalThis.performance?.now()??Date.now()}#M(){if(!this.#c){let{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:i,timeout:a,totalTimeout:o,throwHttpErrors:s,fetch:c,...l}=this.#i;this.#c=Object.freeze(l)}return this.#c}#N(e){this.#c=void 0,this.request=e}#P(e){return this.#d.get(e)??this.request}#F(e,t){return this.#d.set(e,t),e}#I(e,t){return!this.#i.onUploadProgress||!e.body||!uf?e:Df(e,this.#i.onUploadProgress,t??this.#i.body??void 0)}},gp=e=>{let t=(t,n)=>hp.create(t,jf(e,n));for(let n of hf)t[n]=(t,r)=>hp.create(t,jf(e,r,{method:n}));return t.create=e=>gp(jf(e)),t.extend=t=>(typeof t==`function`&&(t=t(e??{})),gp(jf(e,t))),t.stop=vf,t.retry=bf,t},_p=gp();function vp(e){let t=String(e||``).trim();return/^0x[a-fA-F0-9]{40}$/.test(t)?t.toLowerCase():``}function yp(e){return e?`${e.slice(0,6)}...${e.slice(-4)}`:``}function bp(e){return String(e||``).trim().slice(0,4096)}function xp(e,t=``,n=50){return(String(e||``).trim()||String(t||``)).slice(0,n)}function Sp(e){return String(e||``).trim().toUpperCase().replace(/[^A-Z0-9]/g,``).slice(0,8)}function Cp(e){return`${e}_${Date.now()}_${Tp(4)}`}function wp(e){if(globalThis.crypto?.getRandomValues){let t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]%e}return Math.floor(Math.random()*e)}function Tp(e){let t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=Math.floor(Math.random()*256);return[...t].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Ep(e,t,n){return`${e}:${String(t||`GET`).toUpperCase()}:${Dp(n)}`}function Dp(e){try{return new URL(e,`http://most.box`).pathname}catch{return String(e||``).split(`?`)[0]||`/`}}async function Op(e,t,n){if(!e?.danger)return{};let r=Date.now().toString(),i=Ep(r,t,n),{address:a,signature:o}=await yu(e.danger,i);return{Authorization:`${a},${r},${o}`}}var kp=`mostbox_backend_url`,Ap=`mostbox_backend_invite`,jp=`mostbox_remote_nodes`,Mp=`http://localhost:1976`,Np=8;function Pp(){return typeof window>`u`?!1:[`localhost`,`127.0.0.1`].includes(window.location.hostname)}function Fp(){return Pp()?Mp:``}function Ip(){return typeof window>`u`?``:window.location.origin||``}function Lp(){return typeof window>`u`?``:localStorage.getItem(kp)||Fp()}function Rp(){return typeof window>`u`?``:localStorage.getItem(kp)||``}function zp(e){let t=Xp(e);if(!t)return!1;try{let{hostname:e}=new URL(t),n=e.toLowerCase();return!(n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`||n.startsWith(`127.`))}catch{return!0}}function Bp(){return typeof window>`u`?``:localStorage.getItem(Ap)||``}function Vp(e,t={}){if(!e||typeof e!=`object`)return null;let n=Xp(e.url);return zp(n)?{url:n,invite:typeof e.invite==`string`?e.invite.trim():``,active:e.active===!0||t.active===!0,updatedAt:Number(e.updatedAt||t.updatedAt||Date.now())}:null}function Hp(e){let t=new Map,n=``;for(let r of e){let e=Vp(r);if(!e)continue;e.active&&!n?n=e.url:e.active&&n!==e.url&&(e.active=!1);let i=t.get(e.url);(!i||e.updatedAt>=i.updatedAt)&&t.set(e.url,{...i,...e,active:e.active||i?.active===!0})}return[...t.values()].map(e=>({...e,active:e.url===n||!n&&e.active===!0})).sort((e,t)=>e.active===t.active?t.updatedAt-e.updatedAt:e.active?-1:1).slice(0,Np)}function Up(){if(typeof window>`u`)return[];let e=tm(localStorage.getItem(jp)),t=Array.isArray(e)?e:[],n=Rp();return zp(n)&&t.push({url:n,invite:Bp(),active:!0,updatedAt:Date.now()}),Hp(t)}function Wp(e){typeof window>`u`||localStorage.setItem(jp,JSON.stringify(Hp(e)))}function Gp(){return Up().find(e=>e.active)||null}function Kp(e,t=Bp(),n=!0){let r=Xp(e);if(!zp(r))return;let i=Up().map(e=>({...e,active:n?!1:e.active}));i.unshift({url:r,invite:(t||``).trim(),active:n,updatedAt:Date.now()}),Wp(i)}function qp(){Wp(Up().map(e=>({...e,active:!1})))}function Jp(e=Lp()){let t=Xp(e),n=Fp(),r=Zp(t)?t:n;if(!Zp(r))return null;let i=Xp(r);return{url:i,invite:``,active:i===t,local:!0,updatedAt:2**53-1}}function Yp(){if(typeof window>`u`)return[];let e=Xp(Lp()),t=Jp(e),n=Up().map((t,n)=>({...t,active:Xp(t.url)===e,local:!1,order:n+1}));return(t?[{...t,order:0},...n]:n).sort((e,t)=>e.active===t.active?e.local===t.local?e.order-t.order:e.local?-1:1:e.active?-1:1).map(({order:e,...t})=>t)}function Xp(e){return(e||``).trim().replace(/\/+$/,``)}function Zp(e){let t=Xp(e);if(!t)return!1;try{let{hostname:e}=new URL(t),n=e.toLowerCase();return n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`||n.startsWith(`127.`)}catch{return!1}}function Qp(e=Lp()){return!!Bp()&&!Zp(e)}function $p(){if(typeof window>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function em(e){return e.startsWith(`/`)?e:`/${e}`}function tm(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function nm(e){let t=Dp(e),n=Lp();if(!n)return t;try{let e=new URL(n).pathname.replace(/\/+$/,``);if(!e||e===`/`)return t;if(t===e)return`/`;if(t.startsWith(`${e}/`))return t.slice(e.length)}catch{}return t}function rm(e,t=`/ws`){let n=new URL(e),r=n.protocol===`https:`?`wss:`:`ws:`,i=n.pathname.replace(/\/+$/,``);return`${r}//${n.host}${i}${em(t)}`}function im(){let e=_p.create({hooks:{beforeRequest:[async({request:e})=>{let t=new Headers(e.headers||{}),n=Bp();n&&Qp(e.url)&&t.set(`x-mostbox-invite`,n);let r=$p();if(r?.danger)try{let n=await Op(r,e.method,nm(e.url));for(let[e,r]of Object.entries(n))t.set(e,r)}catch{}return new Request(e,{headers:t})}]}});return new Proxy(e,{get(e,t,n){let r=Reflect.get(e,t,n);return[`get`,`post`,`put`,`patch`,`delete`,`head`].includes(t)?(t,n)=>{let i=typeof t==`string`?_m(t):t;return r.call(e,i,n)}:r}})}var am=im();async function om(e){let t=e&&typeof e==`object`&&`response`in e?e.response:e instanceof Response?e:null;if(!t)return{};let n=t.bodyUsed?null:await t.clone().json().catch(()=>null);return{status:t.status,code:typeof n?.code==`string`?n.code:void 0,details:n?.details&&typeof n.details==`object`?n.details:void 0,error:typeof n?.error==`string`?n.error:typeof n?.message==`string`?n.message:void 0}}async function sm(e,t=`请求失败`){let n=await om(e);return n.error?n.error:(e&&typeof e==`object`&&`name`in e?String(e.name):``)===`TimeoutError`?`请求超时,请稍后重试`:e instanceof Error&&e.message?e.message:t}function cm(e){let t=Xp(e);t?(localStorage.setItem(kp,t),zp(t)&&Kp(t)):localStorage.removeItem(kp),am=im()}function lm(e){let t=(e||``).trim();t?localStorage.setItem(Ap,t):localStorage.removeItem(Ap),am=im()}function um({url:e,invite:t}){cm(e),lm(t),zp(e)?Kp(e,t):typeof window<`u`&&qp()}function dm(){cm(``),lm(``),typeof window<`u`&&qp()}function fm(){return Lp()}function pm(){return Ip()}function mm(){return Gp()?.url||``}function hm(){return Gp()?.invite||``}function gm(){return Yp()}function _m(e){return`${Lp()}${em(e)}`}async function vm(e=`GET`,t=`/`){let n={},r=Bp();r&&Qp()&&(n[`x-mostbox-invite`]=r);try{Object.assign(n,await Op($p(),e,Dp(t)))}catch{}return n}async function ym(e=`/ws`){if(typeof window>`u`)return em(e);let t=Lp()||window.location.origin,n=new URL(rm(t,e)),r=Bp();r&&Qp(n.toString())&&n.searchParams.set(`invite`,r);let i=$p();if(i?.danger)try{let t=await Op(i,`GET`,Dp(e)),[r,a,o]=String(t.Authorization||``).split(`,`);r&&o&&(n.searchParams.set(`address`,r),n.searchParams.set(`timestamp`,a),n.searchParams.set(`signature`,o))}catch{}return n.toString()}async function bm(e,t,n){try{let r={};t&&(r[`x-mostbox-invite`]=t);try{Object.assign(r,await Op(n,`GET`,`/api/remote/capabilities`))}catch{}let i=await fetch(`${e}/api/remote/capabilities`,{method:`GET`,headers:r,signal:AbortSignal.timeout(3e3)});if(!i.ok)return{ok:!1,reason:`http`};let a=await i.clone().json().catch(()=>null);return!a||typeof a.remoteAccess!=`boolean`||typeof a.inviteRequired!=`boolean`||typeof a.adminAvailable!=`boolean`||typeof a.listenHost!=`string`?{ok:!1,reason:`http`}:{ok:!0}}catch{return{ok:!1,reason:`http`}}}async function xm(e,t,n){if(typeof WebSocket>`u`||!n?.danger)return{ok:!0};try{let r=new URL(rm(e));if(t&&r.searchParams.set(`invite`,t),n?.danger)try{let e=await Op(n,`GET`,Dp(`/ws`)),[t,i,a]=String(e.Authorization||``).split(`,`);t&&a&&(r.searchParams.set(`address`,t),r.searchParams.set(`timestamp`,i),r.searchParams.set(`signature`,a))}catch{}return await new Promise(e=>{let t=new WebSocket(r.toString()),n=setTimeout(()=>{t.close(),e({ok:!1,reason:`ws`})},4e3);t.onopen=()=>{clearTimeout(n),t.close(),e({ok:!0})},t.onerror=()=>{clearTimeout(n),e({ok:!1,reason:`ws`})}})}catch{return{ok:!1,reason:`ws`}}}async function Sm({url:e,invite:t=``}){let n=Xp(e);if(!n)return{ok:!1,reason:`http`};let r=$p(),[i,a]=await Promise.all([bm(n,t,r),xm(n,t,r)]);return i.ok?a.ok?{ok:!0}:a:i}async function Cm(){try{return(await fetch(`${Mp}/api/node-id`,{method:`GET`,signal:AbortSignal.timeout(2e3)})).ok}catch{return!1}}var wm=`mostbox`,Tm=1,Em=`notes`;function Dm(){return new Promise((e,t)=>{let n=indexedDB.open(wm,Tm);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(Em)||e.createObjectStore(Em,{keyPath:`address`})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function Om(e){let t=await Dm();return new Promise((n,r)=>{let i=t.transaction(Em,`readonly`).objectStore(Em).get(e);i.onsuccess=()=>{let e=i.result;n(e?{notes:e.notes,notesPath:e.notesPath}:null)},i.onerror=()=>r(i.error)})}async function km(e,t,n){let r=await Dm();return new Promise((i,a)=>{let o=r.transaction(Em,`readwrite`).objectStore(Em).put({address:e,notes:t,notesPath:n});o.onsuccess=()=>i(),o.onerror=()=>a(o.error)})}function Am(e){return Array.isArray(e)?e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`file`||t.content!==void 0}).map(e=>({name:String(e.name||`Untitled`),cid:String(e.cid||``),path:Xd(e.path||``),content:String(e.content||``),size:Number(e.size||0),type:`file`,created_at:Number(e.created_at||e.updated_at||Date.now()),updated_at:Number(e.updated_at||e.created_at||Date.now()),isSecret:e.isSecret===!0||String(e.content||``).startsWith(`mp://1`)})):[]}function jm(e,t,n){e&&km(e,t,Xd(n)).catch(e=>{console.warn(`Failed to persist notes:`,e)})}function Mm(e){switch(e){case Qd.EMPTY:return`note.error.nameRequired`;case Qd.SLASH:return`note.error.nameNoSlash`;case Qd.BACKSLASH:return`note.error.nameNoBackslash`;default:return`note.error.nameInvalid`}}var Nm=Vt((e,t)=>({hasBackend:null,checkBackend:async()=>{let t=mm();if(t){let n=hm(),{ok:r}=await Sm({url:t,invite:n});if(r){um({url:t,invite:n}),e({hasBackend:!0});return}}if(await Cm()){cm(`http://localhost:1976`),lm(``),e({hasBackend:!0});return}let n=pm();if(n){let{ok:t}=await Sm({url:n});if(t){cm(``),lm(``),e({hasBackend:!0});return}}t||(cm(``),lm(``)),e({hasBackend:!1})},isDarkMode:!1,setIsDarkMode:t=>{e({isDarkMode:t}),document.documentElement.setAttribute(`data-theme`,t?`dark`:`light`),localStorage.setItem(`theme`,t?`dark`:`light`)},toasts:[],addToast:(t,n=`info`)=>{e(e=>({toasts:[...e.toasts,{id:Date.now(),message:t,type:n}]}))},removeToast:t=>{e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))},showConnectModal:!1,openConnectModal:()=>e({showConnectModal:!0}),closeConnectModal:()=>e({showConnectModal:!1}),localDataReady:!1,initializeLocalData:()=>{e({notes:[],notesPath:``,notesAddress:``,localDataReady:!0})},notes:[],notesPath:``,notesAddress:``,loadUserNotes:async t=>{try{let n=await Om(t);e({notes:n?Am(n.notes):[],notesPath:Xd(n?.notesPath||``),notesAddress:t})}catch(n){console.warn(`Failed to load notes from IndexedDB:`,n),e({notes:[],notesPath:``,notesAddress:t})}},resetAppState:()=>{e({notes:[],notesPath:``,notesAddress:``,toasts:[],showConnectModal:!1})},setNotesPath:n=>{let r=Xd(n);e({notesPath:r}),jm(t().notesAddress,t().notes,r)},saveNote:async n=>{let r=$d(n.name);if(!r.valid)throw Error(Mm(r.errorCode));let i=r.name||n.name,a=Xd(n.path||``),o=String(n.content||``),s=await ef(o),c=new TextEncoder().encode(o).length,l=Date.now(),u=t().notes,d=n.cid?u.findIndex(e=>e.cid===n.cid):u.findIndex(e=>Xd(e.path)===a&&e.name===i),f=Xd(a?`${a}/${i}`:i);if(u.some((e,t)=>t!==d&&Zd(e)===f))throw Error(`note.error.nameConflict`);let p={name:i,cid:s,path:a,content:o,size:c,type:`file`,created_at:(d>=0?u[d]:null)?.created_at||l,updated_at:l,isSecret:n.isSecret===!0||o.startsWith(`mp://1`)},m=d>=0?u.map((e,t)=>t===d?p:e):[...u,p];return e({notes:m}),jm(t().notesAddress,m,t().notesPath),s},deleteNote:(n,r,i)=>{let a=r!==void 0&&i!==void 0?Xd(`${r}/${i}`):``,o=t().notes.filter(e=>{if(n&&e.cid===n)return!1;if(a){let t=Zd(e);return t!==a&&!t.startsWith(`${a}/`)}return!0});e({notes:o}),jm(t().notesAddress,o,t().notesPath)},renameNote:(n,r,i)=>{let a=$d(i);if(!a.valid)throw Error(Mm(a.errorCode));let o=Xd(n),s=Xd(r),c=Xd(s?`${s}/${a.name}`:a.name);if(c.startsWith(`${o}/`))throw Error(`note.error.moveIntoSelf`);if(t().notes.some(e=>{let t=Zd(e);return t!==o&&t===c}))throw Error(`note.error.nameConflict`);let l=tf(t().notes,o,s,a.name);e({notes:l}),jm(t().notesAddress,l,t().notesPath)},importNotes:n=>{let r=Am(n);e({notes:r}),jm(t().notesAddress,r,t().notesPath)}}));if(typeof window<`u`){let e=localStorage.getItem(`theme`),t=typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches,n=e===`dark`||!e&&t;document.documentElement.setAttribute(`data-theme`,n?`dark`:`light`),Nm.setState({isDarkMode:n})}export{Me as $,ku as A,y as At,Ft as B,Zd as C,F as Ct,Mu as D,D as Dt,Bu as E,M as Et,gu as F,$e as G,Tt as H,Au as I,He as J,Ze as K,ou as L,bu as M,d as Mt,_u as N,vu as O,O as Ot,yu as P,Pe as Q,ru as R,ef as S,L as St,Id as T,_ as Tt,xt as U,St as V,ft as W,Be as X,ze as Y,Ne as Z,bp as _,j as _t,um as a,ve as at,wp as b,I as bt,vm as c,xe as ct,fm as d,oe as dt,je as et,gm as f,ae as ft,vp as g,z as gt,Cp as h,B as ht,dm as i,Oe as it,xu as j,b as jt,ju as k,f as kt,_m as l,de as lt,mm as m,ce as mt,am as n,ye as nt,sm as o,Te as ot,hm as p,re as pt,Ye as q,Sm as r,Ee as rt,om as s,Se as st,Nm as t,Ae as tt,ym as u,ie as ut,xp as v,R as vt,Xd as w,m as wt,yp as x,T as xt,Sp as y,E as yt,Z as z};
|