most-box 0.3.1 → 0.3.2
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 +15 -14
- package/electron/main.js +1 -1
- package/out/admin/index.html +0 -0
- package/out/app/index.html +0 -0
- package/out/assets/AccountMenu-BgbcUc0m.js +1 -0
- package/out/assets/AppTop-DZFTO9-m.js +1 -0
- package/out/assets/CopyButton-B03fpFFc.js +1 -0
- package/out/assets/FilePreviewOverlay-CA04_Ved.js +1 -0
- package/out/assets/{MarketingHeader-7B-OT2XX.js → MarketingHeader-BVJy8hXd.js} +1 -1
- package/out/assets/MarketingLayout-Cltu-DRw.js +1 -0
- package/out/assets/{MilkdownEditor-WedhCoFH.js → MilkdownEditor-Dw_ze7EE.js} +92 -92
- package/out/assets/OpenSidebarButton-C2UJYXKh.js +1 -0
- package/out/assets/arrow-right-CXzRt0Fp.js +1 -0
- package/out/assets/chatJoinInvite-BcPz_IV5.js +1 -0
- package/out/assets/chatNoteDraft-CYbvcEvC.js +1 -0
- package/out/assets/check-iBCQl0yr.js +1 -0
- package/out/assets/circle-alert-dfN4T6Nq.js +1 -0
- package/out/assets/cobol-DHLQUbN7.js +1 -0
- package/out/assets/copy-B7pPZ2MP.js +1 -0
- package/out/assets/{dist-DCX0ws1K.js → dist-1jNICPWO.js} +1 -1
- package/out/assets/{dist-BAJKKN4w.js → dist-B3unnv5t.js} +1 -1
- package/out/assets/{dist-DJdv-Ma3.js → dist-B5MBMmGa.js} +1 -1
- package/out/assets/{dist-CMmmtl3f.js → dist-BAqJdUtV.js} +1 -1
- package/out/assets/{dist-C3lbe8SW.js → dist-BBJOmVU3.js} +1 -1
- package/out/assets/{dist-IN8WN7NI.js → dist-BV5CqsJD.js} +1 -1
- package/out/assets/{dist-DBnWo8ZP.js → dist-Ba7fxbV-.js} +1 -1
- package/out/assets/{dist-BzqqCPi2.js → dist-BxxtNKuo.js} +1 -1
- package/out/assets/{dist-DvWZsW-D.js → dist-C8Ue2rSs.js} +1 -1
- package/out/assets/{dist-C-Tg23jc.js → dist-CIn7Xx5U.js} +1 -1
- package/out/assets/{dist-CbTzBiwL.js → dist-CSyRxrry.js} +3 -3
- package/out/assets/{dist-DTL5jL08.js → dist-CZIuQqmV.js} +1 -1
- package/out/assets/{dist-8QDHqrPN.js → dist-CaaBTHCc.js} +1 -1
- package/out/assets/{dist-yZ96GF-e.js → dist-CgReC0ZE.js} +1 -1
- package/out/assets/{dist-D94V9Zlh.js → dist-Ct90qYA2.js} +1 -1
- package/out/assets/{dist-IGpXmkFm.js → dist-DIFFjNuO.js} +1 -1
- package/out/assets/{dist-CqQavSZV.js → dist-DUB2IhWu.js} +1 -1
- package/out/assets/{dist-B0JrbG7f.js → dist-DheA_Tyz.js} +1 -1
- package/out/assets/{dist-Br_5lLVO.js → dist-DyZh1ncm.js} +1 -1
- package/out/assets/{dist-BPs0Xns9.js → dist-E74uGTy3.js} +1 -1
- package/out/assets/{dist-BFSyuOuw.js → dist-K2s-Uj08.js} +1 -1
- package/out/assets/{dist-zyJb88Zz.js → dist-RU_cpjXQ.js} +1 -1
- package/out/assets/{dist-chOCTzB2.js → dist-eIeCvp_6.js} +1 -1
- package/out/assets/{dist-CfU9fwWz.js → dist-hEE2Ub__.js} +1 -1
- package/out/assets/download-COQOcPqI.js +1 -0
- package/out/assets/{downloadValidation-Ch966YTl.js → downloadValidation-Zvllo2SZ.js} +1 -1
- package/out/assets/external-link-D6tHlYgS.js +1 -0
- package/out/assets/file-text-DiyIGL1I.js +1 -0
- package/out/assets/folder-DAcox9xz.js +1 -0
- package/out/assets/folder-open-Di0oALaC.js +1 -0
- package/out/assets/hard-drive-Cqa7Rstj.js +1 -0
- package/out/assets/index-B6acG3-t.css +1 -0
- package/out/assets/index-DjBN7bZV.js +31 -0
- package/out/assets/index.lazy-BUODxlbz.js +1 -0
- package/out/assets/index.lazy-Ba2rqd32.js +3 -0
- package/out/assets/index.lazy-Bdh8QUOx.js +1 -0
- package/out/assets/index.lazy-BfAHB94y.js +1 -0
- package/out/assets/index.lazy-Bo0LfJNK.js +2 -0
- package/out/assets/index.lazy-C9-w4fAF.js +3 -0
- package/out/assets/index.lazy-CNQbNKyf.js +1 -0
- package/out/assets/index.lazy-Cd0znkpY.js +1 -0
- package/out/assets/index.lazy-CtUrBLS0.js +1 -0
- package/out/assets/index.lazy-CyNgk0ta.js +1 -0
- package/out/assets/index.lazy-D3HxQTg_.js +1 -0
- package/out/assets/index.lazy-DSsE3iyf.js +1 -0
- package/out/assets/index.lazy-DWXndrGa.js +1 -0
- package/out/assets/index.lazy-Dk7cmQ-j.js +2 -0
- package/out/assets/key-round-JR8M3aHl.js +1 -0
- package/out/assets/loader-CwyHYZdX.js +1 -0
- package/out/assets/lock-CuwwlXlx.js +1 -0
- package/out/assets/message-square-BgsNXPft.js +1 -0
- package/out/assets/mp-Dv12gDTx.js +1 -0
- package/out/assets/music-Dn9nm9Qb.js +1 -0
- package/out/assets/notebook-pen-SWT-zZ4v.js +1 -0
- package/out/assets/play-CvWKSMwY.js +1 -0
- package/out/assets/refresh-cw-D4BsHvhi.js +1 -0
- package/out/assets/save-B02sbO9Y.js +1 -0
- package/out/assets/scheme-tChLYBuY.js +1 -0
- package/out/assets/search-HW4oPOBP.js +1 -0
- package/out/assets/send-4dhnJGuS.js +1 -0
- package/out/assets/shield-check-Boae7Nc6.js +1 -0
- package/out/assets/smartphone-JXH-zQXB.js +1 -0
- package/out/assets/textile-CyzeGT9J.js +1 -0
- package/out/assets/trash-2-BLwoM0ME.js +1 -0
- package/out/assets/triangle-alert-B9sMiA9l.js +1 -0
- package/out/assets/upload-DVuXJt_o.js +1 -0
- package/out/assets/useAppStore-DOnk608w.js +4 -0
- package/out/assets/{useChannelMessages-Bs_RWgO4.js → useChannelMessages-CDvw-f_x.js} +1 -1
- package/out/assets/useGameRoom-B1_r6bc7.js +1 -0
- package/out/assets/userProfile-BZvkCuet.js +1 -0
- package/out/assets/wallet-D9Iw4YWE.js +1 -0
- package/out/assets/wifi-ljEI_ySA.js +1 -0
- 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 +2 -2
- 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 +2 -2
- package/out/note/index.html +0 -0
- package/out/ping/index.html +2 -2
- package/out/profile/index.html +0 -0
- package/out/web3/index.html +0 -0
- package/package.json +27 -24
- package/server/index.js +3 -0
- package/server/src/config.js +0 -1
- package/server/src/core/gameRoom.js +12 -19
- package/server/src/http/routes/noteVaultRoutes.js +70 -0
- package/server/src/index.js +9 -0
- package/server/src/utils/accountBackup.js +8 -0
- package/server/src/utils/api.js +0 -14
- package/server/src/utils/auth.js +0 -7
- package/server/src/utils/avatar.js +6 -6
- package/server/src/utils/noteVault.js +197 -2
- package/out/assets/AccountMenu-NjOgag0d.js +0 -1
- package/out/assets/FilePreviewOverlay-CZp6F1s_.js +0 -1
- package/out/assets/MarketingLayout-CyiSCygk.js +0 -1
- package/out/assets/OpenSidebarButton-BoSmO8CY.js +0 -1
- package/out/assets/SidebarHomeLink-CkhGDvZ8.js +0 -1
- package/out/assets/arrow-right-DUxAoZqb.js +0 -1
- package/out/assets/avatar-BZwHW4ll.js +0 -4
- package/out/assets/circle-alert-DSZ0bG_3.js +0 -1
- package/out/assets/cobol-B_OZ4V-R.js +0 -1
- package/out/assets/copy-CK7HMulu.js +0 -1
- package/out/assets/download-Q1uCiwif.js +0 -1
- package/out/assets/external-link-DGzNJOqQ.js +0 -1
- package/out/assets/file-text-C3v0L_lQ.js +0 -1
- package/out/assets/folder-CwtLO09O.js +0 -1
- package/out/assets/hard-drive-B2V5USzR.js +0 -1
- package/out/assets/i18n-DZaOYCSO.js +0 -1
- package/out/assets/index-CBkHUp3F.css +0 -1
- package/out/assets/index-DluhgSHX.js +0 -31
- package/out/assets/index.lazy-B5TYRvFJ.js +0 -1
- package/out/assets/index.lazy-BeDctVci.js +0 -1
- package/out/assets/index.lazy-BjmAkVtV.js +0 -1
- package/out/assets/index.lazy-CHJbzlK6.js +0 -1
- package/out/assets/index.lazy-CITrkWMQ.js +0 -1
- package/out/assets/index.lazy-CTGE5fUt.js +0 -2
- package/out/assets/index.lazy-CUxcXUMy.js +0 -2
- package/out/assets/index.lazy-D84xQtPb.js +0 -3
- package/out/assets/index.lazy-DRqAgqpV.js +0 -1
- package/out/assets/index.lazy-DSAmY1q_.js +0 -1
- package/out/assets/index.lazy-DvbVQRSL.js +0 -1
- package/out/assets/index.lazy-gAJi-rJV.js +0 -1
- package/out/assets/index.lazy-rzyMd-Gz.js +0 -1
- package/out/assets/key-round-Dn5tud-4.js +0 -1
- package/out/assets/loader-CLoDCtNy.js +0 -1
- package/out/assets/lock-BEWKuIqK.js +0 -1
- package/out/assets/message-square-C8ZiYztG.js +0 -1
- package/out/assets/mp-CGBtY36n.js +0 -1
- package/out/assets/music-BsTA8b_M.js +0 -1
- package/out/assets/notebook-pen-DgWzxf2y.js +0 -1
- package/out/assets/play-CVkbAJJU.js +0 -1
- package/out/assets/plus-D1kCYb8G.js +0 -1
- package/out/assets/save-X5c7jlCg.js +0 -1
- package/out/assets/scheme-CyDdOh7e.js +0 -1
- package/out/assets/search-DAV9vDOq.js +0 -1
- package/out/assets/send-C5JjYo-A.js +0 -1
- package/out/assets/shield-check-DuD6OLde.js +0 -1
- package/out/assets/smartphone-gVFruyjO.js +0 -1
- package/out/assets/textile-DWBqthVk.js +0 -1
- package/out/assets/trash-2-CE-3Dc63.js +0 -1
- package/out/assets/triangle-alert-DnOxsFpB.js +0 -1
- package/out/assets/upload-CsnBv3pd.js +0 -1
- package/out/assets/useGameRoom-BxDxm3rp.js +0 -1
- package/out/assets/userProfile-UphvP_bG.js +0 -1
- package/out/assets/wallet-VDaoXwjI.js +0 -1
- package/out/assets/wifi-DfWbmlGE.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
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";import{a as u}from"./i18n-DZaOYCSO.js";var d=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`})),f=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=d()}));function p(e){return e[e.length-1]}function m(e){return typeof e==`function`}function h(e,t){return m(e)?e(t):e}var g=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;function v(e){for(let t in e)if(g.call(e,t))return!0;return!1}var y=()=>Object.create(null),b=(e,t)=>x(e,t,y);function x(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=T(e)&&T(i);if(!a&&!(C(e)&&C(i)))return i;let o=a?e:S(e);if(!o)return i;let s=a?i:S(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:g.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=x(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function S(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!_.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(!_.call(e,t))return!1;r.push(t)}return r}function C(e){if(!w(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!w(n)||!n.hasOwnProperty(`isPrototypeOf`))}function w(e){return Object.prototype.toString.call(e)===`[object Object]`}function T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(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(!E(e[r],t[r],n))return!1;return!0}if(C(e)&&C(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!E(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||!E(e[o],t[o],n)))return!1;return i===a}return!1}function D(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 O(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 k(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function A(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function j(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 A(t)}var M=[`http:`,`https:`,`mailto:`,`tel:`];function N(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var P={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},F=/[&><\u2028\u2029]/g;function I(e){return e.replace(F,e=>P[e])}function L(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+=j(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=j(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function R(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function z(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 B(){throw Error(`Invariant failed`)}function V(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 H=4,ee=5;function U(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 te(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=U(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=te(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=re(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=re(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=ie(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=ie(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=ie(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=re(n.fullPath??n.from);e.kind=ee,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=re(n.fullPath??n.from);e.kind=H,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 ne(e){if(e.pathless)for(let t of e.pathless)ne(t);if(e.static)for(let t of e.static.values())ne(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())ne(t);if(e.dynamic?.length){e.dynamic.sort(G);for(let t of e.dynamic)ne(t)}if(e.optional?.length){e.optional.sort(G);for(let t of e.optional)ne(t)}if(e.wildcard?.length){e.wildcard.sort(G);for(let t of e.wildcard)ne(t)}}function re(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 ie(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 ae(e,t){let n=re(`/`),r=new Uint16Array(6);for(let t of e)W(!1,r,t,1,n,0);ne(n),t.masksTree=n,t.flatCache=V(1e3)}function oe(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=de(e,t.masksTree);return t.flatCache.set(e,r),r}function se(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=re(`/`),W(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),de(r,o,n)}function ce(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=de(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=pe(a.route)),t.matchCache.set(r,a),a}function le(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ue(e,t=!1,n){let r=re(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&&B(),a[e.id]=e,s!==0&&e.path){let t=le(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),ne(r),{processedTree:{segmentTree:r,singleCache:V(1e3),matchCache:V(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function de(e,t,n=!1){let r=e.split(`/`),i=he(e,r,t,n);if(!i)return null;let[a]=fe(e,r,i);return{route:i.node.route,rawParams:a}}function fe(e,t,n){let r=me(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===H)break;if(u.kind===ee){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 pe(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function me(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function he(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!p(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&&!ye(l,n))continue;if(i.parse){if(!ve(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==H&&ye(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===H||i.kind===2)&&ye(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&&(ve(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&_e(p,o))return n;ye(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+ge(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+ge(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+ge(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+ge(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 ge(e,t){return 2**(e-t-1)}function _e(e,t){return e===2**(t-1)-1}function ve(e,t,n){let r,i;try{[r,i]=fe(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 ye(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===H)>(e.node.kind===H)||t.node.kind===H==(e.node.kind===H)&&t.depth>e.depth))):!0}function be(e){return xe(e.filter(e=>e!==void 0).join(`/`))}function xe(e){return e.replace(/\/{2,}/g,`/`)}function Se(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ce(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function we(e){return Ce(Se(e))}function Te(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ee(e,t,n){return Te(e,n)===Te(t,n)}function De({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&&p(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&&(p(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=xe(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Oe(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 ke(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>je(e,n)).join(`/`):je(r,n):r}function Ae({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=te(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=ke(`_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=ke(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=ke(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function je(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Me(e){return e?.isNotFound===!0}var Ne=`__root__`;function Pe(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 Fe(e){return e instanceof Response&&!!e.options}function Ie(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return Pe(e)}var Le=`Error preloading route! ☝️`,Re=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=Ne:this.parentRoute||B();let r=n?Ne:t?.path;r&&r!==`/`&&(r=Se(r));let i=t?.id||r,a=n?Ne:be([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=be([`/`,a]));let o=a===`__root__`?`/`:be([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Ce(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=>Pe({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.`)}},ze=class extends Re{constructor(e){super(e)}},K=r(n(),1),q=a();function Be({children:e,fallback:t=null}){return Ve()?(0,q.jsx)(K.Fragment,{children:e}):(0,q.jsx)(K.Fragment,{children:t})}function Ve(){return K.useSyncExternalStore(He,()=>!0,()=>!1)}function He(){return()=>{}}var Ue=K.createContext(void 0),We=K.createContext(void 0),Ge=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})),Ke=i(((e,t)=>{t.exports=Ge()})),qe=i((e=>{var t=n(),r=Ke();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}})),Je=i(((e,t)=>{t.exports=qe()}))();function Ye(e,t){return e===t}function Xe(e,t,n=Ye){let r=(0,K.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,K.useCallback)(()=>e?.get(),[e]);return(0,Je.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Ze={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function Qe(e){let t=c(),n=K.useContext(e.from?We:Ue),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=K.useRef(void 0);return Xe(i??Ze,n=>{if((e.shouldThrow??!0)&&!n&&B(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=x(a.current,r);return a.current=e,e}return r})}function $e(e){return Qe({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function et(e){let{select:t,...n}=e;return Qe({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function tt(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}})}function nt(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 rt(e){return Qe({...e,select:t=>e.select?e.select(t.context):t.context})}var it=f();function at(e,t){let n=c(),r=s(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,preloadIntentProximity:p,hashScrollIntoView:m,replace:g,startTransition:_,resetScroll:v,viewTransition:y,children:b,target:x,disabled:S,style:C,className:w,onClick:T,onBlur:D,onFocus:O,onMouseEnter:k,onMouseLeave:A,onTouchStart:j,ignoreBlocker:M,params:P,search:F,hash:I,state:L,mask:R,reloadDocument:z,unsafeRelative:B,from:V,_fromLocation:H,...ee}=e,U=Ve(),te=K.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),W=Xe(n.stores.location,e=>e,(e,t)=>e.href===t.href),G=K.useMemo(()=>{let e={_fromLocation:W,...te};return n.buildLocation(e)},[n,W,te]),ne=G.maskedLocation?G.maskedLocation.publicHref:G.publicHref,re=G.maskedLocation?G.maskedLocation.external:G.external,ie=K.useMemo(()=>mt(ne,re,n.history,S),[S,re,ne,n.history]),ae=K.useMemo(()=>{if(ie?.external)return N(ie.href,n.protocolAllowlist)?void 0:ie.href;if(!ht(u)&&!(typeof u!=`string`||u.indexOf(`:`)===-1))try{return new URL(u),N(u,n.protocolAllowlist)?void 0:u}catch{}},[u,ie,n.protocolAllowlist]),oe=K.useMemo(()=>{if(ae)return!1;if(o?.exact){if(!Ee(W.pathname,G.pathname,n.basepath))return!1}else{let e=Te(W.pathname,n.basepath),t=Te(G.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!E(W.search,G.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?U&&W.hash===G.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,W,ae,U,G.hash,G.pathname,G.search,n.basepath]),se=oe?h(i,{})??st:ot,ce=oe?ot:h(a,{})??ot,le=[w,se.className,ce.className].filter(Boolean).join(` `),ue=(C||se.style||ce.style)&&{...C,...se.style,...ce.style},[de,fe]=K.useState(!1),pe=K.useRef(!1),me=e.reloadDocument||ae?!1:d??n.options.defaultPreload,he=f??n.options.defaultPreloadDelay??0,ge=K.useCallback(()=>{n.preloadRoute({...te,_builtLocation:G}).catch(e=>{console.warn(e),console.warn(Le)})},[n,te,G]);l(r,K.useCallback(e=>{e?.isIntersecting&&ge()},[ge]),ft,{disabled:!!S||me!==`viewport`}),K.useEffect(()=>{pe.current||!S&&me===`render`&&(ge(),pe.current=!0)},[S,ge,me]);let _e=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!_t(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,it.flushSync)(()=>{fe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),fe(!1)});n.navigate({...te,replace:g,resetScroll:v,hashScrollIntoView:m,startTransition:_,viewTransition:y,ignoreBlocker:M})}};if(ae)return{...ee,ref:r,href:ae,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...T&&{onClick:T},...D&&{onBlur:D},...O&&{onFocus:O},...k&&{onMouseEnter:k},...A&&{onMouseLeave:A},...j&&{onTouchStart:j}};let ve=e=>{if(S||me!==`intent`)return;if(!he){ge();return}let t=e.currentTarget;if(dt.has(t))return;let n=setTimeout(()=>{dt.delete(t),ge()},he);dt.set(t,n)},ye=e=>{S||me!==`intent`||ge()},be=e=>{if(S||!me||!he)return;let t=e.currentTarget,n=dt.get(t);n&&(clearTimeout(n),dt.delete(t))};return{...ee,...se,...ce,href:ie?.href,ref:r,onClick:pt([T,_e]),onBlur:pt([D,be]),onFocus:pt([O,ve]),onMouseEnter:pt([k,ve]),onMouseLeave:pt([A,be]),onTouchStart:pt([j,ye]),disabled:!!S,target:x,...ue&&{style:ue},...le&&{className:le},...S&&ct,...oe&<,...U&&de&&ut}}var ot={},st={className:`active`},ct={role:`link`,"aria-disabled":!0},lt={"data-status":`active`,"aria-current":`page`},ut={"data-transitioning":`transitioning`},dt=new WeakMap,ft={rootMargin:`100px`},pt=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function mt(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function ht(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var gt=K.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=at(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return K.createElement(`a`,t,o)}return K.createElement(n,a,o)});function _t(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var vt=class extends Re{constructor(e){super(e),this.useMatch=e=>Qe({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>rt({...e,from:this.id}),this.useSearch=e=>nt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>et({...e,from:this.id}),this.useLoaderData=e=>$e({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=K.forwardRef((e,t)=>(0,q.jsx)(gt,{ref:t,from:this.fullPath,...e}))}};function yt(e){return new vt(e)}var bt=class extends ze{constructor(e){super(e),this.useMatch=e=>Qe({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>rt({...e,from:this.id}),this.useSearch=e=>nt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>et({...e,from:this.id}),this.useLoaderData=e=>$e({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=K.forwardRef((e,t)=>(0,q.jsx)(gt,{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=>rt({...e,from:this.options.id}),this.useSearch=e=>nt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>et({...e,from:this.options.id}),this.useLoaderData=e=>$e({...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,K.createContext)({}),Nt=()=>(0,K.useContext)(Mt),Pt=(0,K.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,K.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,K.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ft=(e,t)=>{let n=(0,K.forwardRef)(({className:n,...r},i)=>(0,K.createElement)(Pt,{ref:i,iconNode:t,className:Et(`lucide-${Dt(kt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=kt(e),n},It=Ft(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Lt=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},Rt=(e=>e?Lt(e):Lt),zt=e=>e;function Bt(e,t=zt){let n=K.useSyncExternalStore(e.subscribe,K.useCallback(()=>t(e.getState()),[e,t]),K.useCallback(()=>t(e.getInitialState()),[e,t]));return K.useDebugValue(n),n}var Vt=e=>{let t=Rt(e),n=e=>Bt(t,e);return Object.assign(n,t),n},Ht=(e=>e?Vt(e):Vt),Ut=`6.16.0`;function Wt(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 Gt(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 Kt(e,t,n){for(let r in t){let i=t[r],a=n?n[r]:null;a&&Wt(i,a,r),Object.defineProperty(e,r,{enumerable:!0,value:i,writable:!1})}}function qt(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=>qt(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 qt(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=>`${qt(n,t)}: ${qt(e[n],t)}`).join(`, `)+` }`}}return`[ COULD NOT SERIALIZE ]`}function Jt(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: ${qt(n)}`);for(let e in n){if(e===`shortMessage`)continue;let t=n[e];r.push(e+`=`+qt(t))}}r.push(`code=${t}`),r.push(`version=${Ut}`),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 Kt(i,{code:t}),n&&Object.assign(i,n),i.shortMessage??Kt(i,{shortMessage:r}),i}function J(e,t,n,r){if(!e)throw Jt(t,n,r)}function Y(e,t,n,r){J(e,t,`INVALID_ARGUMENT`,{argument:n,value:r})}var Yt=[`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 Xt(e){J(Yt.indexOf(e)>=0,`platform missing String.prototype.normalize`,`UNSUPPORTED_OPERATION`,{operation:`String.prototype.normalize`,info:{form:e}})}function Zt(e,t,n){if(n??=``,e!==t){let e=n,t=`new`;n&&(e+=`.`,t+=` `+n),J(!1,`private constructor; use ${e}from* methods`,`UNSUPPORTED_OPERATION`,{operation:t})}}function Qt(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}Y(!1,`invalid BytesLike value`,t||`value`,e)}function X(e,t){return Qt(e,t,!1)}function $t(e,t){return Qt(e,t,!0)}function en(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 tn(e){return en(e,!0)||e instanceof Uint8Array}var nn=`0123456789abcdef`;function Z(e){let t=X(e),n=`0x`;for(let e=0;e<t.length;e++){let r=t[e];n+=nn[(r&240)>>4]+nn[r&15]}return n}function rn(e){return`0x`+e.map(e=>Z(e).substring(2)).join(``)}function an(e){return en(e,!0)?(e.length-2)/2:X(e).length}function on(e,t,n){let r=X(e);return n!=null&&n>r.length&&J(!1,`cannot slice beyond data bounds`,`BUFFER_OVERRUN`,{buffer:r,length:r.length,offset:n}),Z(r.slice(t??0,n??r.length))}function sn(e,t,n){let r=X(e);J(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),Z(i)}function cn(e,t){return sn(e,t,!0)}var ln=BigInt(0),un=BigInt(1),dn=9007199254740991;function fn(e,t){let n=mn(e,`value`),r=BigInt(vn(t,`width`)),i=un<<r-un;if(n<ln){n=-n,J(n<=i,`too low`,`NUMERIC_FAULT`,{operation:`toTwos`,fault:`overflow`,value:e});let t=(un<<r)-un;return(~n&t)+un}else J(n<i,`too high`,`NUMERIC_FAULT`,{operation:`toTwos`,fault:`overflow`,value:e});return n}function pn(e,t){return hn(e,`value`)&(un<<BigInt(vn(t,`bits`)))-un}function mn(e,t){switch(typeof e){case`bigint`:return e;case`number`:return Y(Number.isInteger(e),`underflow`,t||`value`,e),Y(e>=-9007199254740991&&e<=dn,`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){Y(!1,`invalid BigNumberish string: ${n.message}`,t||`value`,e)}}Y(!1,`invalid BigNumberish value`,t||`value`,e)}function hn(e,t){let n=mn(e,t);return J(n>=ln,`unsigned value cannot be negative`,`NUMERIC_FAULT`,{fault:`overflow`,operation:`getUint`,value:e}),n}var gn=`0123456789abcdef`;function _n(e){if(e instanceof Uint8Array){let t=`0x0`;for(let n of e)t+=gn[n>>4],t+=gn[n&15];return BigInt(t)}return mn(e)}function vn(e,t){switch(typeof e){case`bigint`:return Y(e>=-9007199254740991&&e<=dn,`overflow`,t||`value`,e),Number(e);case`number`:return Y(Number.isInteger(e),`underflow`,t||`value`,e),Y(e>=-9007199254740991&&e<=dn,`overflow`,t||`value`,e),e;case`string`:try{if(e===``)throw Error(`empty string`);return vn(BigInt(e),t)}catch(n){Y(!1,`invalid numeric string: ${n.message}`,t||`value`,e)}}Y(!1,`invalid numeric value`,t||`value`,e)}function yn(e,t){let n=hn(e,`value`),r=n.toString(16);if(t==null)r.length%2&&(r=`0`+r);else{let i=vn(t,`width`);if(i===0&&n===ln)return`0x`;for(J(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 bn(e,t){let n=hn(e,`value`);if(n===ln){let e=t==null?0:vn(t,`width`);return new Uint8Array(e)}let r=n.toString(16);if(r.length%2&&(r=`0`+r),t!=null){let n=vn(t,`width`);for(;r.length<n*2;)r=`00`+r;J(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 xn(e){let t=Z(tn(e)?e:bn(e)).substring(2);for(;t.startsWith(`0`);)t=t.substring(1);return t===``&&(t=`0`),`0x`+t}var Sn=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,Cn=null;function wn(e){if(Cn==null){Cn={};for(let e=0;e<58;e++)Cn[Sn[e]]=BigInt(e)}let t=Cn[e];return Y(t!=null,`invalid base58 value`,`letter`,e),t}var Tn=BigInt(0),En=BigInt(58);function Dn(e){let t=X(e),n=_n(t),r=``;for(;n;)r=Sn[Number(n%En)]+r,n/=En;for(let e=0;e<t.length&&!t[e];e++)r=Sn[0]+r;return r}function On(e){let t=Tn;for(let n=0;n<e.length;n++)t*=En,t+=wn(e[n]);return t}function kn(e){e=atob(e);let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return X(t)}function An(e){let t=X(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function jn(e,t,n,r,i){Y(!1,`invalid codepoint at offset ${t}; ${e}`,`bytes`,n)}function Mn(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 Nn(e,t,n,r,i){return e===`OVERLONG`?(Y(typeof i==`number`,`invalid bad code point for replacement`,`badCodepoint`,i),r.push(i),0):(r.push(65533),Mn(e,t,n,r,i))}Object.freeze({error:jn,ignore:Mn,replace:Nn});function Pn(e,t){Y(typeof e==`string`,`invalid string value`,`str`,e),t!=null&&(Xt(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);Y(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 Fn(e){let t=e.toString(16);for(;t.length<2;)t=`0`+t;return`0x`+t}function In(e,t,n){let r=0;for(let i=0;i<n;i++)r=r*256+e[t+i];return r}function Ln(e,t,n,r){let i=[];for(;n<t+1+r;){let a=Rn(e,n);i.push(a.result),n+=a.consumed,J(n<=t+1+r,`child data too short`,`BUFFER_OVERRUN`,{buffer:e,length:r,offset:t})}return{consumed:1+r,result:i}}function Rn(e,t){J(e.length!==0,`data too short`,`BUFFER_OVERRUN`,{buffer:e,length:0,offset:1});let n=t=>{J(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=In(e,t+1,r);return n(t+1+r+i),Ln(e,t,t+1+r,r+i)}else if(e[t]>=192){let r=e[t]-192;return n(t+1+r),Ln(e,t,t+1,r)}else if(e[t]>=184){let r=e[t]-183;n(t+1+r);let i=In(e,t+1,r);n(t+1+r+i);let a=Z(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=Z(e.slice(t+1,t+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:Fn(e[t])}}function zn(e){let t=X(e,`data`),n=Rn(t,0);return Y(n.consumed===t.length,`unexpected junk after rlp payload`,`data`,e),n.result}function Bn(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function Vn(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(Vn(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=Bn(t.length);return n.unshift(247+n.length),n.concat(t)}let t=Array.prototype.slice.call(X(e,`object`));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=Bn(t.length);return n.unshift(183+n.length),n.concat(t)}var Hn=`0123456789abcdef`;function Un(e){let t=`0x`;for(let n of Vn(e))t+=Hn[n>>4],t+=Hn[n&15];return t}function Wn(e){let t=X(e,`randomBytes`);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Z(t);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join(`-`)}function Gn(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function Kn(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 qn(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);Gn(e.outputLen),Gn(e.blockLen)}function Jn(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 Yn(e,t){Kn(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var Xn=e=>e instanceof Uint8Array,Zn=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Qn=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),$n=(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 er=async()=>{};async function tr(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 er(),r+=e)}}function nr(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function rr(e){if(typeof e==`string`&&(e=nr(e)),!Xn(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}var ir=class{clone(){return this._cloneInto()}},ar={}.toString;function or(e,t){if(t!==void 0&&ar.call(t)!==`[object Object]`)throw Error(`Options should be object or undefined`);return Object.assign(e,t)}function sr(e){let t=t=>e().update(rr(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var cr=class extends ir{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,qn(e);let n=rr(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 Jn(this),this.iHash.update(e),this}digestInto(e){Jn(this),Kn(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()}},lr=(e,t,n)=>new cr(e,t).update(n).digest();lr.create=(e,t)=>new cr(e,t);function ur(e,t,n,r){qn(e);let{c:i,dkLen:a,asyncTick:o}=or({dkLen:32,asyncTick:10},r);if(Gn(i),Gn(a),Gn(o),i<1)throw Error(`PBKDF2: iterations (c) should be >= 1`);let s=rr(t),c=rr(n),l=new Uint8Array(a),u=lr.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function dr(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),i.fill(0),n}function fr(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=ur(e,t,n,r),l,u=new Uint8Array(4),d=Qn(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 dr(s,c,o,l,f)}function pr(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 mr=class extends ir{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=Qn(this.buffer)}update(e){Jn(this);let{view:t,buffer:n,blockLen:r}=this;e=rr(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=Qn(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){Jn(this),Yn(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;pr(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Qn(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}},hr=(e,t,n)=>e&t^~e&n,gr=(e,t,n)=>e&t^e&n^t&n,_r=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]),vr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yr=new Uint32Array(64),br=class extends mr{constructor(){super(64,32,8,!1),this.A=vr[0]|0,this.B=vr[1]|0,this.C=vr[2]|0,this.D=vr[3]|0,this.E=vr[4]|0,this.F=vr[5]|0,this.G=vr[6]|0,this.H=vr[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)yr[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=yr[e-15],n=yr[e-2],r=$n(t,7)^$n(t,18)^t>>>3;yr[e]=($n(n,17)^$n(n,19)^n>>>10)+yr[e-7]+r+yr[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=$n(o,6)^$n(o,11)^$n(o,25),u=l+t+hr(o,s,c)+_r[e]+yr[e]|0,d=($n(n,2)^$n(n,13)^$n(n,22))+gr(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(){yr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},xr=sr(()=>new br),Sr=BigInt(2**32-1),Cr=BigInt(32);function wr(e,t=!1){return t?{h:Number(e&Sr),l:Number(e>>Cr&Sr)}:{h:Number(e>>Cr&Sr)|0,l:Number(e&Sr)|0}}function Tr(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}=wr(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}var Er=(e,t)=>BigInt(e>>>0)<<Cr|BigInt(t>>>0),Dr=(e,t,n)=>e>>>n,Or=(e,t,n)=>e<<32-n|t>>>n,kr=(e,t,n)=>e>>>n|t<<32-n,Ar=(e,t,n)=>e<<32-n|t>>>n,jr=(e,t,n)=>e<<64-n|t>>>n-32,Mr=(e,t,n)=>e>>>n-32|t<<64-n,Nr=(e,t)=>t,Pr=(e,t)=>e,Fr=(e,t,n)=>e<<n|t>>>32-n,Ir=(e,t,n)=>t<<n|e>>>32-n,Lr=(e,t,n)=>t<<n-32|e>>>64-n,Rr=(e,t,n)=>e<<n-32|t>>>64-n;function zr(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Q={fromBig:wr,split:Tr,toBig:Er,shrSH:Dr,shrSL:Or,rotrSH:kr,rotrSL:Ar,rotrBH:jr,rotrBL:Mr,rotr32H:Nr,rotr32L:Pr,rotlSH:Fr,rotlSL:Ir,rotlBH:Lr,rotlBL:Rr,add:zr,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)},[Br,Vr]=Q.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))),Hr=new Uint32Array(80),Ur=new Uint32Array(80),Wr=class extends mr{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)Hr[n]=e.getUint32(t),Ur[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=Hr[e-15]|0,n=Ur[e-15]|0,r=Q.rotrSH(t,n,1)^Q.rotrSH(t,n,8)^Q.shrSH(t,n,7),i=Q.rotrSL(t,n,1)^Q.rotrSL(t,n,8)^Q.shrSL(t,n,7),a=Hr[e-2]|0,o=Ur[e-2]|0,s=Q.rotrSH(a,o,19)^Q.rotrBH(a,o,61)^Q.shrSH(a,o,6),c=Q.rotrSL(a,o,19)^Q.rotrBL(a,o,61)^Q.shrSL(a,o,6),l=Q.add4L(i,c,Ur[e-7],Ur[e-16]);Hr[e]=Q.add4H(l,r,s,Hr[e-7],Hr[e-16])|0,Ur[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=Q.rotrSH(u,d,14)^Q.rotrSH(u,d,18)^Q.rotrBH(u,d,41),v=Q.rotrSL(u,d,14)^Q.rotrSL(u,d,18)^Q.rotrBL(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=Q.add5L(_,v,b,Vr[e],Ur[e]),S=Q.add5H(x,g,t,y,Br[e],Hr[e]),C=x|0,w=Q.rotrSH(n,r,28)^Q.rotrBH(n,r,34)^Q.rotrBH(n,r,39),T=Q.rotrSL(n,r,28)^Q.rotrBL(n,r,34)^Q.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}=Q.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=Q.add3L(C,T,D);n=Q.add3H(O,S,w,E),r=O|0}({h:n,l:r}=Q.add(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Q.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Q.add(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Q.add(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Q.add(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Q.add(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Q.add(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Q.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(){Hr.fill(0),Ur.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)}},Gr=sr(()=>new Wr);function Kr(){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 qr=Kr(),Jr=qr.crypto||qr.msCrypto;function Yr(e){switch(e){case`sha256`:return xr.create();case`sha512`:return Gr.create()}Y(!1,`invalid hashing algorithm name`,`algorithm`,e)}function Xr(e,t){let n={sha256:xr,sha512:Gr}[e];return Y(n!=null,`invalid hmac algorithm`,`algorithm`,e),lr.create(n,t)}function Zr(e,t,n,r,i){let a={sha256:xr,sha512:Gr}[i];return Y(a!=null,`invalid pbkdf2 algorithm`,`algorithm`,i),fr(a,e,t,{c:n,dkLen:r})}function Qr(e){J(Jr!=null,`platform does not support secure random numbers`,`UNSUPPORTED_OPERATION`,{operation:`randomBytes`}),Y(Number.isInteger(e)&&e>0&&e<=1024,`invalid length`,`length`,e);let t=new Uint8Array(e);return Jr.getRandomValues(t),t}var $r=!1,ei=function(e,t,n){return Xr(e,t).update(n).digest()},ti=ei;function ni(e,t,n){let r=X(t,`key`),i=X(n,`data`);return Z(ti(e,r,i))}ni._=ei,ni.lock=function(){$r=!0},ni.register=function(e){if($r)throw Error(`computeHmac is locked`);ti=e},Object.freeze(ni);var[ri,ii,ai]=[[],[],[]],oi=BigInt(0),si=BigInt(1),ci=BigInt(2),li=BigInt(7),ui=BigInt(256),di=BigInt(113);for(let e=0,t=si,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],ri.push(2*(5*r+n)),ii.push((e+1)*(e+2)/2%64);let i=oi;for(let e=0;e<7;e++)t=(t<<si^(t>>li)*di)%ui,t&ci&&(i^=si<<(si<<BigInt(e))-si);ai.push(i)}var[fi,pi]=Tr(ai,!0),mi=(e,t,n)=>n>32?Lr(e,t,n):Fr(e,t,n),hi=(e,t,n)=>n>32?Rr(e,t,n):Ir(e,t,n);function gi(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=mi(a,o,1)^n[r],c=hi(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=ii[n],a=mi(t,i,r),o=hi(t,i,r),s=ri[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]^=fi[r],e[1]^=pi[r]}n.fill(0)}var _i=class e extends ir{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,Gn(n),0>=this.blockLen||this.blockLen>=200)throw Error(`Sha3 supports only keccak-f1600 function`);this.state=new Uint8Array(200),this.state32=Zn(this.state)}keccak(){gi(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Jn(this);let{blockLen:t,state:n}=this;e=rr(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){Jn(this,!1),Kn(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 Gn(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Yn(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}},vi=((e,t,n)=>sr(()=>new _i(t,e,n)))(1,136,256/8),yi=!1,bi=function(e){return vi(e)},xi=bi;function Si(e){let t=X(e,`data`);return Z(xi(t))}Si._=bi,Si.lock=function(){yi=!0},Si.register=function(e){if(yi)throw TypeError(`keccak256 is locked`);xi=e},Object.freeze(Si);var Ci=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),wi=Uint8Array.from({length:16},(e,t)=>t),Ti=wi.map(e=>(9*e+5)%16),Ei=[wi],Di=[Ti];for(let e=0;e<4;e++)for(let t of[Ei,Di])t.push(t[e].map(e=>Ci[e]));var Oi=[[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)),ki=Ei.map((e,t)=>e.map(e=>Oi[t][e])),Ai=Di.map((e,t)=>e.map(e=>Oi[t][e])),ji=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Mi=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Ni=(e,t)=>e<<t|e>>>32-t;function Pi(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 Fi=new Uint32Array(16),Ii=class extends mr{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)Fi[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=ji[e],p=Mi[e],m=Ei[e],h=Di[e],g=ki[e],_=Ai[e];for(let t=0;t<16;t++){let r=Ni(n+Pi(e,i,o,c)+Fi[m[t]]+f,g[t])+u|0;n=u,u=c,c=Ni(o,10)|0,o=i,i=r}for(let e=0;e<16;e++){let n=Ni(r+Pi(t,a,s,l)+Fi[h[e]]+p,_[e])+d|0;r=d,d=l,l=Ni(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(){Fi.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},Li=sr(()=>new Ii),Ri=!1,zi=function(e){return Li(e)},Bi=zi;function Vi(e){let t=X(e,`data`);return Z(Bi(t))}Vi._=zi,Vi.lock=function(){Ri=!0},Vi.register=function(e){if(Ri)throw TypeError(`ripemd160 is locked`);Bi=e},Object.freeze(Vi);var Hi=!1,Ui=function(e,t,n,r,i){return Zr(e,t,n,r,i)},Wi=Ui;function Gi(e,t,n,r,i){let a=X(e,`password`),o=X(t,`salt`);return Z(Wi(a,o,n,r,i))}Gi._=Ui,Gi.lock=function(){Hi=!0},Gi.register=function(e){if(Hi)throw Error(`pbkdf2 is locked`);Wi=e},Object.freeze(Gi);var Ki=!1,qi=function(e){return new Uint8Array(Qr(e))},Ji=qi;function Yi(e){return Ji(e)}Yi._=qi,Yi.lock=function(){Ki=!0},Yi.register=function(e){if(Ki)throw Error(`randomBytes is locked`);Ji=e},Object.freeze(Yi);var Xi=(e,t)=>e<<t|e>>>32-t;function Zi(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^=Xi(S+P|0,7),A^=Xi(E+S|0,9),P^=Xi(A+E|0,13),S^=Xi(P+A|0,18),j^=Xi(D+C|0,7),F^=Xi(j+D|0,9),C^=Xi(F+j|0,13),D^=Xi(C+F|0,18),I^=Xi(M+O|0,7),w^=Xi(I+M|0,9),O^=Xi(w+I|0,13),M^=Xi(O+w|0,18),T^=Xi(L+N|0,7),k^=Xi(T+L|0,9),N^=Xi(k+T|0,13),L^=Xi(N+k|0,18),C^=Xi(S+T|0,7),w^=Xi(C+S|0,9),T^=Xi(w+C|0,13),S^=Xi(T+w|0,18),O^=Xi(D+E|0,7),k^=Xi(O+D|0,9),E^=Xi(k+O|0,13),D^=Xi(E+k|0,18),N^=Xi(M+j|0,7),A^=Xi(N+M|0,9),j^=Xi(A+N|0,13),M^=Xi(j+A|0,18),P^=Xi(L+I|0,7),F^=Xi(P+L|0,9),I^=Xi(F+P|0,13),L^=Xi(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 Qi(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)Zi(n,o,e,t,n,a),r>0&&(o+=16),Zi(n,a,e,t+=16,n,o)}function $i(e,t,n){let{N:r,r:i,p:a,dkLen:o,asyncTick:s,maxmem:c,onProgress:l}=or({dkLen:32,asyncTick:10,maxmem:1024**3+1024},n);if(Gn(r),Gn(i),Gn(a),Gn(o),Gn(s),Gn(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=fr(xr,e,t,{c:1,dkLen:u*a}),m=Zn(p),h=Zn(new Uint8Array(u*r)),g=Zn(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 ea(e,t,n,r,i){let a=fr(xr,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),i.fill(0),a}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}=$i(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++)Qi(c,t,c,t+=s,i),f();Qi(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];Qi(d,0,l,t,i),f()}}return ea(e,o,u,c,d)}async function na(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}=$i(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 tr(r-1,p,()=>{Qi(c,n,c,n+=s,i),f()}),Qi(c,(r-1)*s,l,t,i),f(),await tr(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];Qi(d,0,l,t,i),f()})}return ea(e,o,u,c,d)}var ra=!1,ia=!1,aa=async function(e,t,n,r,i,a,o){return await na(e,t,{N:n,r,p:i,dkLen:a,onProgress:o})},oa=function(e,t,n,r,i,a){return ta(e,t,{N:n,r,p:i,dkLen:a})},sa=aa,ca=oa;async function la(e,t,n,r,i,a,o){let s=X(e,`passwd`),c=X(t,`salt`);return Z(await sa(s,c,n,r,i,a,o))}la._=aa,la.lock=function(){ia=!0},la.register=function(e){if(ia)throw Error(`scrypt is locked`);sa=e},Object.freeze(la);function ua(e,t,n,r,i,a){let o=X(e,`passwd`),s=X(t,`salt`);return Z(ca(o,s,n,r,i,a))}ua._=oa,ua.lock=function(){ra=!0},ua.register=function(e){if(ra)throw Error(`scryptSync is locked`);ca=e},Object.freeze(ua);var da=function(e){return Yr(`sha256`).update(e).digest()},fa=function(e){return Yr(`sha512`).update(e).digest()},pa=da,ma=fa,ha=!1,ga=!1;function _a(e){let t=X(e,`data`);return Z(pa(t))}_a._=da,_a.lock=function(){ha=!0},_a.register=function(e){if(ha)throw Error(`sha256 is locked`);pa=e},Object.freeze(_a);function va(e){let t=X(e,`data`);return Z(ma(t))}va._=fa,va.lock=function(){ga=!0},va.register=function(e){if(ga)throw Error(`sha512 is locked`);ma=e},Object.freeze(_a);function ya(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function ba(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 xa(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);ya(e.outputLen),ya(e.blockLen)}function Sa(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 Ca(e,t){ba(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var wa=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0,Ta=e=>e instanceof Uint8Array,Ea=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Da=(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 Oa(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ka(e){if(typeof e==`string`&&(e=Oa(e)),!Ta(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function Aa(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!Ta(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}var ja=class{clone(){return this._cloneInto()}};({}).toString;function Ma(e){let t=t=>e().update(ka(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Na(e=32){if(wa&&typeof wa.getRandomValues==`function`)return wa.getRandomValues(new Uint8Array(e));throw Error(`crypto.getRandomValues must be defined`)}function Pa(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 Fa=class extends ja{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=Ea(this.buffer)}update(e){Sa(this);let{view:t,buffer:n,blockLen:r}=this;e=ka(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=Ea(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){Sa(this),Ca(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;Pa(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Ea(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}},Ia=(e,t,n)=>e&t^~e&n,La=(e,t,n)=>e&t^e&n^t&n,Ra=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]),za=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ba=new Uint32Array(64),Va=class extends Fa{constructor(){super(64,32,8,!1),this.A=za[0]|0,this.B=za[1]|0,this.C=za[2]|0,this.D=za[3]|0,this.E=za[4]|0,this.F=za[5]|0,this.G=za[6]|0,this.H=za[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)Ba[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Ba[e-15],n=Ba[e-2],r=Da(t,7)^Da(t,18)^t>>>3;Ba[e]=(Da(n,17)^Da(n,19)^n>>>10)+Ba[e-7]+r+Ba[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=Da(o,6)^Da(o,11)^Da(o,25),u=l+t+Ia(o,s,c)+Ra[e]+Ba[e]|0,d=(Da(n,2)^Da(n,13)^Da(n,22))+La(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(){Ba.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Ha=Ma(()=>new Va),Ua=t({bitGet:()=>lo,bitLen:()=>co,bitMask:()=>fo,bitSet:()=>uo,bytesToHex:()=>Ya,bytesToNumberBE:()=>$a,bytesToNumberLE:()=>eo,concatBytes:()=>ao,createHmacDrbg:()=>ho,ensureBytes:()=>io,equalBytes:()=>oo,hexToBytes:()=>Qa,hexToNumber:()=>Za,numberToBytesBE:()=>to,numberToBytesLE:()=>no,numberToHexUnpadded:()=>Xa,numberToVarBytesBE:()=>ro,utf8ToBytes:()=>so,validateObject:()=>_o}),Wa=BigInt(0),Ga=BigInt(1),Ka=BigInt(2),qa=e=>e instanceof Uint8Array,Ja=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Ya(e){if(!qa(e))throw Error(`Uint8Array expected`);let t=``;for(let n=0;n<e.length;n++)t+=Ja[e[n]];return t}function Xa(e){let t=e.toString(16);return t.length&1?`0${t}`:t}function Za(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return BigInt(e===``?`0`:`0x${e}`)}function Qa(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 $a(e){return Za(Ya(e))}function eo(e){if(!qa(e))throw Error(`Uint8Array expected`);return Za(Ya(Uint8Array.from(e).reverse()))}function to(e,t){return Qa(e.toString(16).padStart(t*2,`0`))}function no(e,t){return to(e,t).reverse()}function ro(e){return Qa(Xa(e))}function io(e,t,n){let r;if(typeof t==`string`)try{r=Qa(t)}catch(n){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else if(qa(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 ao(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!qa(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}function oo(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 so(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function co(e){let t;for(t=0;e>Wa;e>>=Ga,t+=1);return t}function lo(e,t){return e>>BigInt(t)&Ga}var uo=(e,t,n)=>e|(n?Ga:Wa)<<BigInt(t),fo=e=>(Ka<<BigInt(e-1))-Ga,po=e=>new Uint8Array(e),mo=e=>Uint8Array.from(e);function ho(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=po(e),i=po(e),a=0,o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),c=(e=po())=>{i=s(mo([0]),e),r=s(),e.length!==0&&(i=s(mo([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 ao(...n)};return(e,t)=>{o(),c(e);let n;for(;!(n=t(l()));)c();return o(),n}}var go={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 _o(e,t,n={}){let r=(t,n,r)=>{let i=go[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 vo=BigInt(0),yo=BigInt(1),bo=BigInt(2),xo=BigInt(3),So=BigInt(4),Co=BigInt(5),wo=BigInt(8),To=BigInt(16);function Eo(e,t){let n=e%t;return n>=vo?n:t+n}function Do(e,t,n){if(n<=vo||t<vo)throw Error(`Expected power/modulo > 0`);if(n===yo)return vo;let r=yo;for(;t>vo;)t&yo&&(r=r*e%n),e=e*e%n,t>>=yo;return r}function Oo(e,t,n){let r=e;for(;t-- >vo;)r*=r,r%=n;return r}function ko(e,t){if(e===vo||t<=vo)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Eo(e,t),r=t,i=vo,a=yo,o=yo,s=vo;for(;n!==vo;){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!==yo)throw Error(`invert: does not exist`);return Eo(i,t)}function Ao(e){let t=(e-yo)/bo,n,r,i;for(n=e-yo,r=0;n%bo===vo;n/=bo,r++);for(i=bo;i<e&&Do(i,t,e)!==e-yo;i++);if(r===1){let t=(e+yo)/So;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+yo)/bo;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,yo<<BigInt(s-t-1));c=e.sqr(n),l=e.mul(l,n),u=e.mul(u,c),s=t}return l}}function jo(e){if(e%So===xo){let t=(e+yo)/So;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%wo===Co){let t=(e-Co)/wo;return function(e,n){let r=e.mul(n,bo),i=e.pow(r,t),a=e.mul(n,i),o=e.mul(e.mul(a,bo),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%To,Ao(e)}var Mo=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function No(e){return _o(e,Mo.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`}))}function Po(e,t,n){if(n<vo)throw Error(`Expected power > 0`);if(n===vo)return e.ONE;if(n===yo)return t;let r=e.ONE,i=t;for(;n>vo;)n&yo&&(r=e.mul(r,i)),i=e.sqr(i),n>>=yo;return r}function Fo(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 Io(e,t){let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Lo(e,t,n=!1,r={}){if(e<=vo)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:a}=Io(e,t);if(a>2048)throw Error(`Field lengths over 2048 bytes are not supported`);let o=jo(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:a,MASK:fo(i),ZERO:vo,ONE:yo,create:t=>Eo(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return vo<=t&&t<e},is0:e=>e===vo,isOdd:e=>(e&yo)===yo,neg:t=>Eo(-t,e),eql:(e,t)=>e===t,sqr:t=>Eo(t*t,e),add:(t,n)=>Eo(t+n,e),sub:(t,n)=>Eo(t-n,e),mul:(t,n)=>Eo(t*n,e),pow:(e,t)=>Po(s,e,t),div:(t,n)=>Eo(t*ko(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>ko(t,e),sqrt:r.sqrt||(e=>o(s,e)),invertBatch:e=>Fo(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?no(e,a):to(e,a),fromBytes:e=>{if(e.length!==a)throw Error(`Fp.fromBytes: expected ${a}, got ${e.length}`);return n?eo(e):$a(e)}});return Object.freeze(s)}function Ro(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function zo(e){let t=Ro(e);return t+Math.ceil(t/2)}function Bo(e,t,n=!1){let r=e.length,i=Ro(t),a=zo(t);if(r<16||r<a||r>1024)throw Error(`expected ${a}-1024 bytes of input, got ${r}`);let o=Eo(n?$a(e):eo(e),t-yo)+yo;return n?no(o,i):to(o,i)}var Vo=BigInt(0),Ho=BigInt(1);function Uo(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>Vo;)n&Ho&&(r=r.add(i)),i=i.double(),n>>=Ho;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+=Ho);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 Wo(e){return No(e.Fp),_o(e,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...Io(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function Go(e){let t=Wo(e);_o(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:Ko,hexToBytes:qo}=Ua,Jo={Err:class extends Error{constructor(e=``){super(e)}},_parseInt(e){let{Err:t}=Jo;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:Ko(r),l:e.subarray(n+2)}},toSig(e){let{Err:t}=Jo,n=typeof e==`string`?qo(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}=Jo._parseInt(n.subarray(2)),{d:o,l:s}=Jo._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}`}},Yo=BigInt(0),Xo=BigInt(1),Zo=BigInt(3);function Qo(e){let t=Go(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{let i=t.toAffine();return ao(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`&&Yo<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=Ya(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:$a(io(`private key`,e,r))}catch{throw Error(`private key must be ${r} bytes, hex or bigint, not ${typeof e}`)}return i&&(o=Eo(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(io(`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,Zo),{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,Zo),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===Yo)return r;if(s(e),e===Xo)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>Yo||l>Yo;)o&Xo&&(u=u.add(m)),l&Xo&&(f=f.add(m)),m=m.double(),o>>=Xo,l>>=Xo;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===Yo||t===Xo||!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===Xo)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===Xo?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return Ya(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=Uo(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function $o(e){let t=Wo(e);return _o(t,{hash:`hash`,hmac:`function`,randomBytes:`function`},{bits2int:`function`,bits2int_modN:`function`,lowS:`boolean`}),Object.freeze({lowS:!0,...t})}function es(e){let t=$o(e),{Fp:n,n:r}=t,i=n.BYTES+1,a=2*n.BYTES+1;function o(e){return Yo<e&&e<n.ORDER}function s(e){return Eo(e,r)}function c(e){return ko(e,r)}let{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Qo({...t,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x),o=ao;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=$a(s);if(!o(e))throw Error(`Point is not on curve`);let t=d(e),i=n.sqrt(t),a=(i&Xo)===Xo;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=>Ya(to(e,t.nByteLength));function m(e){return e>r>>Xo}function h(e){return m(e)?s(-e):e}let g=(e,t,n)=>$a(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=io(`compactSignature`,e,n*2),new _(g(e,0,n),g(e,n,2*n))}static fromDER(e){let{r:t,s:n}=Jo.toSig(io(`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(io(`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 Qa(this.toDERHex())}toDERHex(){return Jo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Qa(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=zo(t.n);return Bo(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=$a(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=fo(t.nBitLength);function T(e){if(typeof e!=`bigint`)throw Error(`bigint expected`);if(!(Yo<=e&&e<w))throw Error(`bigint expected < 2^${t.nBitLength}`);return to(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=io(`msgHash`,e),p&&(e=io(`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(io(`extraEntropy`,e))}let x=ao(...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===Yo)return;let a=s(n*s(w+i*y));if(a===Yo)return;let o=(r.x===i?0:2)|Number(r.y&Xo),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 ho(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=io(`msgHash`,n),r=io(`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 Jo.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 ts=class extends ja{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,xa(e);let n=ka(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 Sa(this),this.iHash.update(e),this}digestInto(e){Sa(this),ba(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()}},ns=(e,t,n)=>new ts(e,t).update(n).digest();ns.create=(e,t)=>new ts(e,t);function rs(e){return{hash:e,hmac:(t,...n)=>ns(e,t,Aa(...n)),randomBytes:Na}}function is(e,t){let n=t=>es({...e,...rs(t)});return Object.freeze({...n(t),create:n})}var as=BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`),os=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),ss=BigInt(1),cs=BigInt(2),ls=(e,t)=>(e+t/cs)/t;function us(e){let t=as,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=Oo(Oo(Oo(u,n,t)*u%t,n,t)*u%t,cs,t)*l%t,f=Oo(d,i,t)*d%t,p=Oo(f,a,t)*f%t,m=Oo(p,s,t)*p%t,h=Oo(Oo(Oo(Oo(Oo(Oo(m,c,t)*m%t,s,t)*p%t,n,t)*u%t,o,t)*f%t,r,t)*l%t,cs,t);if(!ds.eql(ds.sqr(h),e))throw Error(`Cannot find square root`);return h}var ds=Lo(as,void 0,void 0,{sqrt:us}),fs=is({a:BigInt(0),b:BigInt(7),Fp:ds,n:os,Gx:BigInt(`55066263022277343669578718895168534326250603453777594175500187360389116729240`),Gy:BigInt(`32670510020758816978083085130507043184471273380659243275938904335757337482424`),h:BigInt(1),lowS:!0,endo:{beta:BigInt(`0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`),splitScalar:e=>{let t=os,n=BigInt(`0x3086d221a7d46bcde86c90e49284eb15`),r=-ss*BigInt(`0xe4437ed6010e88286f547fa90abfe4c3`),i=BigInt(`0x114ca50f7a8e2f3f657c1108d9d44cfd8`),a=n,o=BigInt(`0x100000000000000000000000000000000`),s=ls(a*e,t),c=ls(-r*e,t),l=Eo(e-s*n-c*i,t),u=Eo(-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}}}},Ha);fs.ProjectivePoint;var ps=`0x0000000000000000000000000000000000000000`,ms=`0x0000000000000000000000000000000000000000000000000000000000000000`,hs=`Ethereum Signed Message:
|
|
2
|
-
`,gs=BigInt(0),_s=BigInt(1),vs=BigInt(2),ys=BigInt(27),bs=BigInt(28),xs=BigInt(35),Ss=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),Cs=Ss/vs,ws=Symbol.for(`nodejs.util.inspect.custom`),Ts={};function Es(e){return cn(bn(e),32)}var Ds=class e{#e;#t;#n;#r;get r(){return this.#e}set r(e){Y(an(e)===32,`invalid r`,`value`,e),this.#e=Z(e)}get s(){return Y(parseInt(this.#t.substring(0,3))<8,`non-canonical s; use ._s`,`s`,this.#t),this.#t}set s(e){Y(an(e)===32,`invalid s`,`value`,e),this.#t=Z(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=Cs}get v(){return this.#n}set v(e){let t=vn(e,`value`);Y(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=X(this.s);return this.yParity&&(e[0]|=128),Z(e)}get compactSerialized(){return rn([this.r,this.yParityAndS])}get serialized(){return rn([this.r,this.s,this.yParity?`0x1c`:`0x1b`])}constructor(e,t,n,r){Zt(e,Ts,`Signature`),this.#e=t,this.#t=n,this.#n=r,this.#r=null}getCanonical(){if(this.isValid())return this;let t=Ss-BigInt(this._s),n=55-this.v,r=new e(Ts,this.r,Es(t),n);return this.networkV&&(r.#r=this.networkV),r}clone(){let t=new e(Ts,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}}[ws](){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=mn(e,`v`);return t==ys||t==bs?gs:(Y(t>=xs,`invalid EIP-155 v`,`v`,e),(t-xs)/vs)}static getChainIdV(e,t){return mn(e)*vs+BigInt(35+t-27)}static getNormalizedV(e){let t=mn(e);return t===gs||t===ys?27:t===_s||t===bs?28:(Y(t>=xs,`invalid v`,`v`,e),t&_s?27:28)}static from(t){function n(e,n){Y(e,n,`signature`,t)}if(t==null)return new e(Ts,ms,ms,27);if(typeof t==`string`){let r=X(t,`signature`);if(r.length===64){let t=Z(r.slice(0,32)),n=r.slice(32,64),i=n[0]&128?28:27;return n[0]&=127,new e(Ts,t,Z(n),i)}if(r.length===65)return new e(Ts,Z(r.slice(0,32)),Z(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=Es(r),a=(function(e,t){if(e!=null)return Es(e);if(t!=null){n(en(t,32),`invalid yParityAndS`);let e=X(t);return e[0]&=127,Z(e)}n(!1,`missing s`)})(t.s,t.yParityAndS),{networkV:o,v:s}=(function(t,r,i){if(t!=null){let n=mn(t);return{networkV:n>=xs?n:void 0,v:e.getNormalizedV(n)}}if(r!=null)return n(en(r,32),`invalid yParityAndS`),{v:X(r)[0]&128?28:27};if(i!=null){switch(vn(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(Ts,i,a,s);return o&&(c.#r=o),n(t.yParity==null||vn(t.yParity,`sig.yParity`)===c.yParity,`yParity mismatch`),n(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,`yParityAndS mismatch`),c}},Os=class e{#e;constructor(e){Y(an(e)===32,`invalid private key`,`privateKey`,`[REDACTED]`),this.#e=Z(e)}get privateKey(){return this.#e}get publicKey(){return e.computePublicKey(this.#e)}get compressedPublicKey(){return e.computePublicKey(this.#e,!0)}sign(e){Y(an(e)===32,`invalid digest length`,`digest`,e);let t=fs.sign($t(e),$t(this.#e),{lowS:!0});return Ds.from({r:yn(t.r,32),s:yn(t.s,32),v:t.recovery?28:27})}computeSharedSecret(t){let n=e.computePublicKey(t);return Z(fs.getSharedSecret($t(this.#e),X(n),!1))}static computePublicKey(e,t){let n=X(e,`key`);if(n.length===32)return Z(fs.getPublicKey(n,!!t));if(n.length===64){let e=new Uint8Array(65);e[0]=4,e.set(n,1),n=e}return Z(fs.ProjectivePoint.fromHex(n).toRawBytes(t))}static recoverPublicKey(e,t){Y(an(e)===32,`invalid digest length`,`digest`,e);let n=Ds.from(t),r=fs.Signature.fromCompact($t(rn([n.r,n.s])));r=r.addRecoveryBit(n.yParity);let i=r.recoverPublicKey($t(e));return Y(i!=null,`invalid signature for digest`,`signature`,t),`0x`+i.toHex(!1)}static addPoints(t,n,r){let i=fs.ProjectivePoint.fromHex(e.computePublicKey(t).substring(2)),a=fs.ProjectivePoint.fromHex(e.computePublicKey(n).substring(2));return`0x`+i.add(a).toHex(!!r)}},ks=BigInt(0),As=BigInt(36);function js(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=X(Si(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 Ms={};for(let e=0;e<10;e++)Ms[String(e)]=String(e);for(let e=0;e<26;e++)Ms[String.fromCharCode(65+e)]=String(10+e);var Ns=15;function Ps(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>Ms[e]).join(``);for(;t.length>=Ns;){let e=t.substring(0,Ns);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 Fs=(function(){let e={};for(let t=0;t<36;t++){let n=`0123456789abcdefghijklmnopqrstuvwxyz`[t];e[n]=BigInt(t)}return e})();function Is(e){e=e.toLowerCase();let t=ks;for(let n=0;n<e.length;n++)t=t*As+Fs[e[n]];return t}function Ls(e){if(Y(typeof e==`string`,`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith(`0x`)||(e=`0x`+e);let t=js(e);return Y(!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}$/)){Y(e.substring(2,4)===Ps(e),`bad icap checksum`,`address`,e);let t=Is(e.substring(4)).toString(16);for(;t.length<40;)t=`0`+t;return js(`0x`+t)}Y(!1,`invalid address`,`address`,e)}function Rs(e){return e&&typeof e.getAddress==`function`}async function zs(e,t){let n=await t;return(n==null||n===`0x0000000000000000000000000000000000000000`)&&(J(typeof e!=`string`,`unconfigured name`,`UNCONFIGURED_NAME`,{value:e}),Y(!1,`invalid AddressLike value; did not resolve to a value address`,`target`,e)),Ls(n)}function Bs(e,t){if(typeof e==`string`)return e.match(/^0x[0-9a-f]{40}$/i)?Ls(e):(J(t!=null,`ENS resolution requires a provider`,`UNSUPPORTED_OPERATION`,{operation:`resolveName`}),zs(e,t.resolveName(e)));if(Rs(e))return zs(e,e.getAddress());if(e&&typeof e.then==`function`)return zs(e,e);Y(!1,`unsupported addressable value`,`target`,e)}function Vs(e,t){return{address:Ls(e),storageKeys:t.map((e,t)=>(Y(en(e,32),`invalid slot`,`storageKeys[${t}]`,e),e.toLowerCase()))}}function Hs(e){if(Array.isArray(e))return e.map((t,n)=>Array.isArray(t)?(Y(t.length===2,`invalid slot set`,`value[${n}]`,t),Vs(t[0],t[1])):(Y(typeof t==`object`&&!!t,`invalid address-slot set`,`value`,e),Vs(t.address,t.storageKeys)));Y(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 Vs(t,Object.keys(n).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function Us(e){return{address:Ls(e.address),nonce:mn(e.nonce==null?0:e.nonce),chainId:mn(e.chainId==null?0:e.chainId),signature:Ds.from(e.signature)}}function Ws(e){let t;return t=typeof e==`string`?Os.computePublicKey(e,!1):e.publicKey,Ls(Si(`0x`+t.substring(4)).substring(26))}function Gs(e,t){return Ws(Os.recoverPublicKey(e,t))}var Ks=BigInt(0),qs=BigInt(2),Js=BigInt(27),Ys=BigInt(28),Xs=BigInt(35),Zs=BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),Qs=Symbol.for(`nodejs.util.inspect.custom`),$s=4096*32,ec=128;function tc(e){return{blobToKzgCommitment:t=>{if(`computeBlobProof`in e){if(`blobToKzgCommitment`in e&&typeof e.blobToKzgCommitment==`function`)return X(e.blobToKzgCommitment(Z(t)))}else if(`blobToKzgCommitment`in e&&typeof e.blobToKzgCommitment==`function`)return X(e.blobToKzgCommitment(t));if(`blobToKZGCommitment`in e&&typeof e.blobToKZGCommitment==`function`)return X(e.blobToKZGCommitment(Z(t)));Y(!1,`unsupported KZG library`,`kzg`,e)},computeBlobKzgProof:(t,n)=>{if(`computeBlobProof`in e&&typeof e.computeBlobProof==`function`)return X(e.computeBlobProof(Z(t),Z(n)));if(`computeBlobKzgProof`in e&&typeof e.computeBlobKzgProof==`function`)return e.computeBlobKzgProof(t,n);if(`computeBlobKZGProof`in e&&typeof e.computeBlobKZGProof==`function`)return X(e.computeBlobKZGProof(Z(t),Z(n)));Y(!1,`unsupported KZG library`,`kzg`,e)}}}function nc(e,t){let n=e.toString(16);for(;n.length<2;)n=`0`+n;return n+=_a(t).substring(4),`0x`+n}function rc(e){return e===`0x`?null:Ls(e)}function ic(e,t){try{return Hs(e)}catch(n){Y(!1,n.message,t,e)}}function ac(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:rc(r[1]),nonce:sc(r[2],`nonce`),chainId:sc(r[0],`chainId`),signature:Ds.from({yParity:oc(r[3],`yParity`),r:cn(r[4],32),s:cn(r[5],32)})})}return t}catch(n){Y(!1,n.message,t,e)}}function oc(e,t){return e===`0x`?0:vn(e,t)}function sc(e,t){if(e===`0x`)return Ks;let n=mn(e,t);return Y(n<=Zs,`value exceeds uint size`,t,n),n}function $(e,t){let n=mn(e,`value`),r=bn(n);return Y(r.length<=32,`value too large`,`tx.${t}`,n),r}function cc(e){return Hs(e).map(e=>[e.address,e.storageKeys])}function lc(e){return e.map(e=>[$(e.chainId,`chainId`),e.address,$(e.nonce,`nonce`),$(e.signature.yParity,`yParity`),bn(e.signature.r),bn(e.signature._s)])}function uc(e,t){Y(Array.isArray(e),`invalid ${t}`,`value`,e);for(let t=0;t<e.length;t++)Y(en(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function dc(e){let t=zn(e);Y(Array.isArray(t)&&(t.length===9||t.length===6),`invalid field count for legacy transaction`,`data`,e);let n={type:0,nonce:oc(t[0],`nonce`),gasPrice:sc(t[1],`gasPrice`),gasLimit:sc(t[2],`gasLimit`),to:rc(t[3]),value:sc(t[4],`value`),data:Z(t[5]),chainId:Ks};if(t.length===6)return n;let r=sc(t[6],`v`),i=sc(t[7],`r`),a=sc(t[8],`s`);if(i===Ks&&a===Ks)n.chainId=r;else{let e=(r-Xs)/qs;e<Ks&&(e=Ks),n.chainId=e,Y(e!==Ks||r===Js||r===Ys,`non-canonical legacy v`,`v`,t[6]),n.signature=Ds.from({r:cn(t[7],32),s:cn(t[8],32),v:r})}return n}function fc(e,t){let n=[$(e.nonce,`nonce`),$(e.gasPrice||0,`gasPrice`),$(e.gasLimit,`gasLimit`),e.to||`0x`,$(e.value,`value`),e.data],r=Ks;if(e.chainId!=Ks)r=mn(e.chainId,`tx.chainId`),Y(!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!==Ks&&(n.push(bn(r)),n.push(`0x`),n.push(`0x`)),Un(n);let i=BigInt(27+t.yParity);return r===Ks?BigInt(t.v)!==i&&Y(!1,`tx.chainId/sig.v mismatch`,`sig`,t):i=Ds.getChainIdV(r,t.v),n.push(bn(i)),n.push(bn(t.r)),n.push(bn(t._s)),Un(n)}function pc(e,t){let n;try{if(n=oc(t[0],`yParity`),n!==0&&n!==1)throw Error(`bad yParity`)}catch{Y(!1,`invalid yParity`,`yParity`,t[0])}let r=cn(t[1],32),i=cn(t[2],32);e.signature=Ds.from({r,s:i,yParity:n})}function mc(e){let t=zn(X(e).slice(1));Y(Array.isArray(t)&&(t.length===9||t.length===12),`invalid field count for transaction type: 2`,`data`,Z(e));let n={type:2,chainId:sc(t[0],`chainId`),nonce:oc(t[1],`nonce`),maxPriorityFeePerGas:sc(t[2],`maxPriorityFeePerGas`),maxFeePerGas:sc(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:sc(t[4],`gasLimit`),to:rc(t[5]),value:sc(t[6],`value`),data:Z(t[7]),accessList:ic(t[8],`accessList`)};return t.length===9||pc(n,t.slice(9)),n}function hc(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,cc(e.accessList||[])];return t&&(n.push($(t.yParity,`yParity`)),n.push(bn(t.r)),n.push(bn(t.s))),rn([`0x02`,Un(n)])}function gc(e){let t=zn(X(e).slice(1));Y(Array.isArray(t)&&(t.length===8||t.length===11),`invalid field count for transaction type: 1`,`data`,Z(e));let n={type:1,chainId:sc(t[0],`chainId`),nonce:oc(t[1],`nonce`),gasPrice:sc(t[2],`gasPrice`),gasLimit:sc(t[3],`gasLimit`),to:rc(t[4]),value:sc(t[5],`value`),data:Z(t[6]),accessList:ic(t[7],`accessList`)};return t.length===8||pc(n,t.slice(8)),n}function _c(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,cc(e.accessList||[])];return t&&(n.push($(t.yParity,`recoveryParam`)),n.push(bn(t.r)),n.push(bn(t.s))),rn([`0x01`,Un(n)])}function vc(e){let t=zn(X(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];Y(Array.isArray(e),`invalid network format: blobs not an array`,`fields[1]`,e),Y(Array.isArray(r),`invalid network format: commitments not an array`,`fields[2]`,r),Y(Array.isArray(a),`invalid network format: proofs not an array`,`fields[3]`,a),Y(e.length===r.length,`invalid network format: blobs/commitments length mismatch`,`fields`,t),Y(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=vn(t[1]);let e=t[2],a=t[3],o=t[4];Y(r===1,`unsupported EIP-7594 network format version: ${r}`,`fields[1]`,r),Y(Array.isArray(e),`invalid EIP-7594 network format: blobs not an array`,`fields[2]`,e),Y(Array.isArray(a),`invalid EIP-7594 network format: commitments not an array`,`fields[3]`,a),Y(Array.isArray(o),`invalid EIP-7594 network format: proofs not an array`,`fields[4]`,o),Y(e.length===a.length,`invalid network format: blobs/commitments length mismatch`,`fields`,t),Y(e.length*ec===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<ec;e++)n.push(o[t*ec+e]);i.push({data:e[t],commitment:a[t],proof:rn(n)})}t=t[0]}Y(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,`data`,Z(e));let a={type:3,chainId:sc(t[0],`chainId`),nonce:oc(t[1],`nonce`),maxPriorityFeePerGas:sc(t[2],`maxPriorityFeePerGas`),maxFeePerGas:sc(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:sc(t[4],`gasLimit`),to:rc(t[5]),value:sc(t[6],`value`),data:Z(t[7]),accessList:ic(t[8],`accessList`),maxFeePerBlobGas:sc(t[9],`maxFeePerBlobGas`),blobVersionedHashes:t[10],blobWrapperVersion:r};i&&(a.blobs=i),Y(a.to!=null,`invalid address for transaction type: ${n}`,`data`,e),Y(Array.isArray(a.blobVersionedHashes),`invalid blobVersionedHashes: must be an array`,`data`,e);for(let t=0;t<a.blobVersionedHashes.length;t++)Y(en(a.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,`data`,e);return t.length===11||pc(a,t.slice(11)),a}function yc(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,cc(e.accessList||[]),$(e.maxFeePerBlobGas||0,`maxFeePerBlobGas`),uc(e.blobVersionedHashes||[],`blobVersionedHashes`)];if(t&&(r.push($(t.yParity,`yParity`)),r.push(bn(t.r)),r.push(bn(t.s)),n)){if(e.blobWrapperVersion!=null){let t=bn(e.blobWrapperVersion),i=[];for(let{proof:e}of n){let t=X(e),n=t.length/ec;for(let e=0;e<t.length;e+=n)i.push(t.subarray(e,e+n))}return rn([`0x03`,Un([r,t,n.map(e=>e.data),n.map(e=>e.commitment),i])])}return rn([`0x03`,Un([r,n.map(e=>e.data),n.map(e=>e.commitment),n.map(e=>e.proof)])])}return rn([`0x03`,Un(r)])}function bc(e){let t=zn(X(e).slice(1));Y(Array.isArray(t)&&(t.length===10||t.length===13),`invalid field count for transaction type: 4`,`data`,Z(e));let n={type:4,chainId:sc(t[0],`chainId`),nonce:oc(t[1],`nonce`),maxPriorityFeePerGas:sc(t[2],`maxPriorityFeePerGas`),maxFeePerGas:sc(t[3],`maxFeePerGas`),gasPrice:null,gasLimit:sc(t[4],`gasLimit`),to:rc(t[5]),value:sc(t[6],`value`),data:Z(t[7]),accessList:ic(t[8],`accessList`),authorizationList:ac(t[9],`authorizationList`)};return t.length===10||pc(n,t.slice(10)),n}function xc(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,cc(e.accessList||[]),lc(e.authorizationList||[])];return t&&(n.push($(t.yParity,`yParity`)),n.push(bn(t.r)),n.push(bn(t.s))),rn([`0x04`,Un(n)])}var Sc=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:Y(!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?ps:e}set to(e){this.#t=e==null?null:Ls(e)}get nonce(){return this.#r}set nonce(e){this.#r=vn(e,`value`)}get gasLimit(){return this.#i}set gasLimit(e){this.#i=mn(e)}get gasPrice(){let e=this.#a;return e==null&&(this.type===0||this.type===1)?Ks:e}set gasPrice(e){this.#a=e==null?null:mn(e,`gasPrice`)}get maxPriorityFeePerGas(){return this.#o??(this.type===2||this.type===3?Ks:null)}set maxPriorityFeePerGas(e){this.#o=e==null?null:mn(e,`maxPriorityFeePerGas`)}get maxFeePerGas(){return this.#s??(this.type===2||this.type===3?Ks:null)}set maxFeePerGas(e){this.#s=e==null?null:mn(e,`maxFeePerGas`)}get data(){return this.#n}set data(e){this.#n=Z(e)}get value(){return this.#c}set value(e){this.#c=mn(e,`value`)}get chainId(){return this.#l}set chainId(e){this.#l=mn(e)}get signature(){return this.#u||null}set signature(e){this.#u=e==null?null:Ds.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:Hs(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=>Us(e))}get maxFeePerBlobGas(){let e=this.#f;return e==null&&this.type===3?Ks:e}set maxFeePerBlobGas(e){this.#f=e==null?null:mn(e,`maxFeePerBlobGas`)}get blobVersionedHashes(){let e=this.#p;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){Y(Array.isArray(e),`blobVersionedHashes must be an Array`,`value`,e),e=e.slice();for(let t=0;t<e.length;t++)Y(en(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(tn(i)){J(this.#m,`adding a raw blob requires a KZG library`,`UNSUPPORTED_OPERATION`,{operation:`set blobs()`});let e=X(i);if(Y(e.length<=$s,`blob is too large`,`blobs[${r}]`,i),e.length!==$s){let t=new Uint8Array($s);t.set(e),e=t}let a=this.#m.blobToKzgCommitment(e),o=Z(this.#m.computeBlobKzgProof(e,a));t.push({data:Z(e),commitment:Z(a),proof:o}),n.push(nc(1,a))}else{let e=Z(i.data),r=Z(i.commitment),a=Z(i.proof);t.push({data:e,commitment:r,proof:a}),n.push(nc(1,r))}}this.#h=t,this.#p=n}get kzg(){return this.#m}set kzg(e){e==null?this.#m=null:this.#m=tc(e)}get blobWrapperVersion(){return this.#_}set blobWrapperVersion(e){this.#_=e}constructor(){this.#e=null,this.#t=null,this.#r=0,this.#i=Ks,this.#a=null,this.#o=null,this.#s=null,this.#n=`0x`,this.#c=Ks,this.#l=Ks,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:Si(this.#v(!0,!1))}get unsignedHash(){return Si(this.unsignedSerialized)}get from(){return this.signature==null?null:Gs(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:Os.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#v(e,t){J(!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 fc(this,n);case 1:return _c(this,n);case 2:return hc(this,n);case 3:return yc(this,n,t?this.blobs:null);case 4:return xc(this,n)}J(!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&&J(this.maxFeePerGas>=this.maxPriorityFeePerGas,`priorityFee cannot be more than maxFee`,`BAD_DATA`,{value:this}),J(!t||this.type!==0&&this.type!==1,`transaction type cannot have maxFeePerGas or maxPriorityFeePerGas`,`BAD_DATA`,{value:this}),J(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}}[Qs](){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=X(t);if(n[0]>=127)return e.from(dc(n));switch(n[0]){case 1:return e.from(gc(n));case 2:return e.from(mc(n));case 3:return e.from(vc(n));case 4:return e.from(bc(n))}J(!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=Ds.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&&(Y(n.isSigned(),`unsigned transaction cannot define '.hash'`,`tx`,t),Y(n.hash===t.hash,`hash mismatch`,`tx`,t)),t.from!=null&&(Y(n.isSigned(),`unsigned transaction cannot define '.from'`,`tx`,t),Y(n.from.toLowerCase()===(t.from||``).toLowerCase(),`from mismatch`,`tx`,t)),n}};function Cc(e){return Y(typeof e.address==`string`,`invalid address for hashAuthorization`,`auth.address`,e),Si(rn([`0x05`,Un([e.chainId==null?`0x`:bn(e.chainId),Ls(e.address),e.nonce==null?`0x`:bn(e.nonce)])]))}function wc(e){return Si(Pn(e))}function Tc(e){return typeof e==`string`&&(e=Pn(e)),Si(rn([Pn(hs),Pn(String(e.length)),e]))}var Ec=new Uint8Array(32);Ec.fill(0);var Dc=BigInt(-1),Oc=BigInt(0),kc=BigInt(1),Ac=BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`);function jc(e){let t=X(e),n=t.length%32;return n?rn([t,Ec.slice(n)]):Z(t)}var Mc=yn(kc,32),Nc=yn(Oc,32),Pc={name:`string`,version:`string`,chainId:`uint256`,verifyingContract:`address`,salt:`bytes32`},Fc=[`name`,`version`,`chainId`,`verifyingContract`,`salt`];function Ic(e){return function(t){return Y(typeof t==`string`,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}var Lc={name:Ic(`name`),version:Ic(`version`),chainId:function(e){let t=mn(e,`domain.chainId`);return Y(t>=0,`invalid chain ID`,`domain.chainId`,e),Number.isSafeInteger(t)?Number(t):xn(t)},verifyingContract:function(e){try{return Ls(e).toLowerCase()}catch{}Y(!1,`invalid domain value "verifyingContract"`,`domain.verifyingContract`,e)},salt:function(e){let t=X(e,`domain.salt`);return Y(t.length===32,`invalid domain value "salt"`,`domain.salt`,e),Z(t)}};function Rc(e){{let t=e.match(/^(u?)int(\d+)$/);if(t){let n=t[1]===``,r=parseInt(t[2]);Y(r%8==0&&r!==0&&r<=256&&t[2]===String(r),`invalid numeric width`,`type`,e);let i=pn(Ac,n?r-1:r),a=n?(i+kc)*Dc:Oc;return function(t){let r=mn(t,`value`);return Y(r>=a&&r<=i,`value out-of-bounds for ${e}`,`value`,r),yn(n?fn(r,256):r,32)}}}{let t=e.match(/^bytes(\d+)$/);if(t){let n=parseInt(t[1]);return Y(n!==0&&n<=32&&t[1]===String(n),`invalid bytes width`,`type`,e),function(t){return Y(X(t).length===n,`invalid length for ${e}`,`value`,t),jc(t)}}}switch(e){case`address`:return function(e){return cn(Ls(e),32)};case`bool`:return function(e){return e?Mc:Nc};case`bytes`:return function(e){return Si(e)};case`string`:return function(e){return wc(e)}}return null}function zc(e,t){return`${e}(${t.map(({name:e,type:t})=>t+` `+e).join(`,`)})`}function Bc(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 Vc=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}=Bc(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]){Y(!a.has(o.name),`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,`types`,e),a.add(o.name);let i=Bc(o.type).base;Y(i!==r,`circular type reference to ${JSON.stringify(i)}`,`types`,e),!Rc(i)&&(Y(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);Y(a.length!==0,`missing primary type`,`types`,e),Y(a.length===1,`ambiguous primary types or unused types: ${a.map(e=>JSON.stringify(e)).join(`, `)}`,`types`,e),Kt(this,{primaryType:a[0]});function o(i,a){Y(!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,zc(e,i[e])+n.map(e=>zc(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=Rc(e);if(t)return t}let t=Bc(e).array;if(t){let e=t.prefix,n=this.getEncoder(e);return r=>{Y(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(Si)),Si(rn(i))}}let n=this.types[e];if(n){let t=wc(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)?Si(r):r});return r.unshift(t),rn(r)}}Y(!1,`unknown type: ${e}`,`type`,e)}encodeType(e){let t=this.#t.get(e);return Y(t,`unknown type: ${JSON.stringify(e)}`,`name`,e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Si(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(Rc(e))return n(e,t);let r=Bc(e).array;if(r)return Y(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),{});Y(!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=Pc[e];Y(r,`invalid typed-data domain key: ${JSON.stringify(e)}`,`domain`,t),n.push({name:e,type:r})}return n.sort((e,t)=>Fc.indexOf(e.name)-Fc.indexOf(t.name)),e.hashStruct(`EIP712Domain`,{EIP712Domain:n},t)}static encode(t,n,r){return rn([`0x1901`,e.hashDomain(t),e.from(n).hash(r)])}static hash(t,n,r){return Si(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&&!en(t.verifyingContract,20)&&(a[t.verifyingContract]=`0x`);let o=e.from(n);o.visit(r,(e,t)=>(e===`address`&&!en(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=[];Fc.forEach(e=>{let n=t[e];n!=null&&(i[e]=Lc[e](n),a.push({name:e,type:Pc[e]}))});let o=e.from(n);n=o.types;let s=Object.assign({},n);return Y(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 Z(X(t));if(e.match(/^u?int/))return mn(t).toString();switch(e){case`address`:return t.toLowerCase();case`bool`:return!!t;case`string`:return Y(typeof t==`string`,`invalid string`,`value`,t),t}Y(!1,`unsupported type`,`type`,e)})}}};function Hc(e){let t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=Z(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]=mn(e[r],`request.${r}`));let r=`type,nonce`.split(/,/);for(let n of r)!(n in e)||e[n]==null||(t[n]=vn(e[n],`request.${n}`));return e.accessList&&(t.accessList=Hs(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=>tn(e)?Z(e):Object.assign({},e))),t}function Uc(e,t){if(e.provider)return e.provider;J(!1,`missing provider`,`UNSUPPORTED_OPERATION`,{operation:t})}async function Wc(e,t){let n=Hc(t);if(n.to!=null&&(n.to=Bs(n.to,e)),n.from!=null){let t=n.from;n.from=Promise.all([e.getAddress(),Bs(t,e)]).then(([e,t])=>(Y(e.toLowerCase()===t.toLowerCase(),`transaction from mismatch`,`tx.from`,t),e))}else n.from=e.getAddress();return await Gt(n)}var Gc=class{provider;constructor(e){Kt(this,{provider:e||null})}async getNonce(e){return Uc(this,`getTransactionCount`).getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Wc(this,e)}async populateTransaction(e){let t=Uc(this,`populateTransaction`),n=await Wc(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:Y(mn(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)?Y(!1,`eip-1559 transaction do not support gasPrice`,`tx`,e):(n.type===0||n.type===1)&&i&&Y(!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();J(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?J(!1,`failed to get consistent fee data`,`UNSUPPORTED_OPERATION`,{operation:`signer.getFeeData`}):(J(!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 Gt(n)}async populateAuthorization(e){let t=Object.assign({},e);return t.chainId??=(await Uc(this,`getNetwork`).getNetwork()).chainId,t.nonce??=await this.getNonce(),t}async estimateGas(e){return Uc(this,`estimateGas`).estimateGas(await this.populateCall(e))}async call(e){return Uc(this,`call`).call(await this.populateCall(e))}async resolveName(e){return await Uc(this,`resolveName`).resolveName(e)}async sendTransaction(e){let t=Uc(this,`sendTransaction`),n=await this.populateTransaction(e);delete n.from;let r=Sc.from(n);return await t.broadcastTransaction(await this.signTransaction(r))}authorize(e){J(!1,`authorization not implemented for this signer`,`UNSUPPORTED_OPERATION`,{operation:`authorize`})}},Kc=class e extends Gc{address;constructor(e,t){super(t),Kt(this,{address:e})}async getAddress(){return this.address}connect(t){return new e(this.address,t)}#e(e,t){J(!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`)}},qc=class e extends Gc{address;#e;constructor(e,t){super(t),Y(e&&typeof e.sign==`function`,`invalid private key`,`privateKey`,`[ REDACTED ]`),this.#e=e;let n=Ws(this.signingKey.publicKey);Kt(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=Hc(e);let{to:t,from:n}=await Gt({to:e.to?Bs(e.to,this):void 0,from:e.from?Bs(e.from,this):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&(Y(Ls(e.from)===this.address,`transaction from address mismatch`,`tx.from`,e.from),delete e.from);let r=Sc.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(Tc(e)).serialized}authorizeSync(e){Y(typeof e.address==`string`,`invalid address for authorizeSync`,`auth.address`,e);let t=this.signingKey.sign(Cc(e));return Object.assign({},{address:Ls(e.address),nonce:mn(e.nonce||0),chainId:mn(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await Bs(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,n){let r=await Vc.resolveNames(e,t,n,async e=>{J(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 J(t!=null,`unconfigured ENS name`,`UNCONFIGURED_NAME`,{value:e}),t});return this.signingKey.sign(Vc.hash(r.domain,t,r.value)).serialized}},Jc=" !#$%&'()*+,-./<=>?@[]^_`{|}~",Yc=/^[a-z]*$/i;function Xc(e,t){let n=97;return e.reduce((e,r)=>(r===t?n++:r.match(Yc)?e.push(String.fromCharCode(n)+r):(n=97,e.push(r)),e),[])}function Zc(e,t){for(let n=28;n>=0;n--)e=e.split(Jc[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 Xc(Xc(n,`;`),`:`)}function Qc(e){return Y(e[0]===`0`,`unsupported auwl data`,`data`,e),Zc(e.substring(59),e.substring(1,59))}var $c=class{locale;constructor(e){Kt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(` `)}},el=class extends $c{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#n=null}get _data(){return this.#e}_decodeWords(){return Qc(this.#e)}#n;#r(){if(this.#n==null){let e=this._decodeWords();if(wc(e.join(`
|
|
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 Y(e>=0&&e<t.length,`invalid word index: ${e}`,`index`,e),t[e]}getWordIndex(e){return this.#r().indexOf(e)}},tl="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",nl=`0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60`,rl=null,il=class e extends el{constructor(){super(`en`,tl,nl)}static wordlist(){return rl??=new e,rl}};function al(e){return(1<<e)-1<<8-e&255}function ol(e){return(1<<e)-1&255}function sl(e,t){Xt(`NFKD`),t??=il.wordlist();let n=t.split(e);Y(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`));Y(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=al(n.length/3);return Y((X(_a(r.slice(0,a/8)))[0]&o)===(r[r.length-1]&o),`invalid mnemonic checksum`,`mnemonic`,`[ REDACTED ]`),Z(r.slice(0,a/8))}function cl(e,t){Y(e.length%4==0&&e.length>=16&&e.length<=32,`invalid entropy size`,`entropy`,`[ REDACTED ]`),t??=il.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]&ol(8-r)),r+=3);let i=e.length/4,a=parseInt(_a(e).substring(2,4),16)&al(i);return n[n.length-1]<<=i,n[n.length-1]|=a>>8-i,t.join(n.map(e=>t.getWord(e)))}var ll={},ul=class e{phrase;password;wordlist;entropy;constructor(e,t,n,r,i){r??=``,i??=il.wordlist(),Zt(e,ll,`Mnemonic`),Kt(this,{phrase:n,password:r,wordlist:i,entropy:t})}computeSeed(){let e=Pn(`mnemonic`+this.password,`NFKD`);return Gi(Pn(this.phrase,`NFKD`),e,2048,64,`sha512`)}static fromPhrase(t,n,r){let i=sl(t,r);return t=cl(X(i),r),new e(ll,i,t,n,r)}static fromEntropy(t,n,r){let i=X(t,`entropy`),a=cl(i,r);return new e(ll,Z(i),a,n,r)}static entropyToPhrase(e,t){return cl(X(e,`entropy`),t)}static phraseToEntropy(e,t){return sl(e,t)}static isValidMnemonic(e,t){try{return sl(e,t),!0}catch{}return!1}},dl=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)},fl=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},pl,ml,hl,gl={16:10,24:12,32:14},_l=[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],vl=[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],yl=[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],bl=[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],xl=[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],Sl=[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],Cl=[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],wl=[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],Tl=[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],El=[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],Dl=[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],Ol=[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],kl=[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],Al=[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],jl=[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 Ml(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 Nl=class e{get key(){return dl(this,pl,`f`).slice()}constructor(t){if(pl.set(this,void 0),ml.set(this,void 0),hl.set(this,void 0),!(this instanceof e))throw Error("AES must be instanitated with `new`");fl(this,pl,new Uint8Array(t),`f`);let n=gl[this.key.length];if(n==null)throw TypeError(`invalid key size (must be 16, 24 or 32 bytes)`);fl(this,hl,[],`f`),fl(this,ml,[],`f`);for(let e=0;e<=n;e++)dl(this,hl,`f`).push([0,0,0,0]),dl(this,ml,`f`).push([0,0,0,0]);let r=(n+1)*4,i=this.key.length/4,a=Ml(this.key),o;for(let e=0;e<i;e++)o=e>>2,dl(this,hl,`f`)[o][e%4]=a[e],dl(this,ml,`f`)[n-o][e%4]=a[e];let s=0,c=i,l;for(;c<r;){if(l=a[i-1],a[0]^=vl[l>>16&255]<<24^vl[l>>8&255]<<16^vl[l&255]<<8^vl[l>>24&255]^_l[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]^=vl[l&255]^vl[l>>8&255]<<8^vl[l>>16&255]<<16^vl[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,dl(this,hl,`f`)[t][o]=a[e],dl(this,ml,`f`)[n-t][o]=a[e++],c++}for(let e=1;e<n;e++)for(let t=0;t<4;t++)l=dl(this,ml,`f`)[e][t],dl(this,ml,`f`)[e][t]=Ol[l>>24&255]^kl[l>>16&255]^Al[l>>8&255]^jl[l&255]}encrypt(e){if(e.length!=16)throw TypeError(`invalid plaintext size (must be 16 bytes)`);let t=dl(this,hl,`f`).length-1,n=[0,0,0,0],r=Ml(e);for(let e=0;e<4;e++)r[e]^=dl(this,hl,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=bl[r[t]>>24&255]^xl[r[(t+1)%4]>>16&255]^Sl[r[(t+2)%4]>>8&255]^Cl[r[(t+3)%4]&255]^dl(this,hl,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=dl(this,hl,`f`)[t][e],i[4*e]=(vl[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(vl[r[(e+1)%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+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw TypeError(`invalid ciphertext size (must be 16 bytes)`);let t=dl(this,ml,`f`).length-1,n=[0,0,0,0],r=Ml(e);for(let e=0;e<4;e++)r[e]^=dl(this,ml,`f`)[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)n[t]=wl[r[t]>>24&255]^Tl[r[(t+3)%4]>>16&255]^El[r[(t+2)%4]>>8&255]^Dl[r[(t+1)%4]&255]^dl(this,ml,`f`)[e][t];r=n.slice()}let i=new Uint8Array(16),a=0;for(let e=0;e<4;e++)a=dl(this,ml,`f`)[t][e],i[4*e]=(yl[r[e]>>24&255]^a>>24)&255,i[4*e+1]=(yl[r[(e+3)%4]>>16&255]^a>>16)&255,i[4*e+2]=(yl[r[(e+2)%4]>>8&255]^a>>8)&255,i[4*e+3]=(yl[r[(e+1)%4]&255]^a)&255;return i}};pl=new WeakMap,ml=new WeakMap,hl=new WeakMap;var Pl=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 Nl(t)},name:{enumerable:!0,value:e}})}},Fl=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},Il=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)},Ll,Rl,zl,Bl=class e extends Pl{constructor(t,n){super(`CTR`,t,e),Ll.set(this,void 0),Rl.set(this,void 0),zl.set(this,void 0),Fl(this,zl,new Uint8Array(16),`f`),Il(this,zl,`f`).fill(0),Fl(this,Ll,Il(this,zl,`f`),`f`),Fl(this,Rl,16,`f`),n??=1,typeof n==`number`?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(Il(this,zl,`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)Il(this,zl,`f`)[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw TypeError(`invalid counter initial Uint8Array value length`);Il(this,zl,`f`).set(e)}increment(){for(let e=15;e>=0;e--)if(Il(this,zl,`f`)[e]===255)Il(this,zl,`f`)[e]=0;else{Il(this,zl,`f`)[e]++;break}}encrypt(e){var t,n;let r=new Uint8Array(e);for(let e=0;e<r.length;e++)Il(this,Rl,`f`)===16&&(Fl(this,Ll,this.aes.encrypt(Il(this,zl,`f`)),`f`),Fl(this,Rl,0,`f`),this.increment()),r[e]^=Il(this,Ll,`f`)[Fl(this,Rl,(n=Il(this,Rl,`f`),t=n++,n),`f`),t];return r}decrypt(e){return this.encrypt(e)}};Ll=new WeakMap,Rl=new WeakMap,zl=new WeakMap;function Vl(e,t){for(e=String(e);e.length<t;)e=`0`+e;return e}function Hl(e){return typeof e==`string`?Pn(e,`NFKC`):$t(e)}var Ul=`m/44'/60'/0'/0/0`;function Wl(e){let t=e.salt==null?Yi(32):X(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)),Y(typeof n==`number`&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),`invalid scrypt N parameter`,`options.N`,n),Y(typeof r==`number`&&r>0&&Number.isSafeInteger(r),`invalid scrypt r parameter`,`options.r`,r),Y(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 Gl(e,t,n,r){let i=X(n.privateKey,`privateKey`),a=r.iv==null?Yi(16):X(r.iv,`options.iv`);Y(a.length===16,`invalid options.iv length`,`options.iv`,r.iv);let o=r.uuid==null?Yi(16):X(r.uuid,`options.uuid`);Y(o.length===16,`invalid options.uuid length`,`options.uuid`,r.iv);let s=e.slice(0,16),c=e.slice(16,32),l=X(new Bl(s,a).encrypt(i)),u=Si(rn([c,l])),d={address:n.address.substring(2).toLowerCase(),id:Wn(o),version:3,Crypto:{cipher:`aes-128-ctr`,cipherparams:{iv:Z(a).substring(2)},ciphertext:Z(l).substring(2),kdf:`scrypt`,kdfparams:{salt:Z(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/${Ut}`:r.client,i=n.mnemonic.path||Ul,a=n.mnemonic.locale||`en`,o=e.slice(32,64),s=X(n.mnemonic.entropy,`account.mnemonic.entropy`),c=Yi(16),l=X(new Bl(o,c).encrypt(s)),u=new Date;d[`x-ethers`]={client:t,gethFilename:`UTC--`+(u.getUTCFullYear()+`-`+Vl(u.getUTCMonth()+1,2)+`-`+Vl(u.getUTCDate(),2)+`T`+Vl(u.getUTCHours(),2)+`-`+Vl(u.getUTCMinutes(),2)+`-`+Vl(u.getUTCSeconds(),2)+`.0Z`)+`--`+d.address,path:i,locale:a,mnemonicCounter:Z(c).substring(2),mnemonicCiphertext:Z(l).substring(2),version:`0.1`}}return JSON.stringify(d)}function Kl(e,t,n){n??={};let r=Hl(t),i=Wl(n);return Gl(X(ua(r,i.salt,i.N,i.r,i.p,64)),i,e,n)}async function ql(e,t,n){n??={};let r=Hl(t),i=Wl(n);return Gl(X(await la(r,i.salt,i.N,i.r,i.p,64,n.progressCallback)),i,e,n)}var Jl=`m/44'/60'/0'/0/0`,Yl=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Xl=2147483648,Zl=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),Ql=`0123456789abcdef`;function $l(e,t){let n=``;for(;e;)n=Ql[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n=`0`+n;return`0x`+n}function eu(e){let t=X(e);return Dn(rn([t,on(_a(_a(t)),0,4)]))}var tu={};function nu(e,t,n,r){let i=new Uint8Array(37);e&Xl?(J(r!=null,`cannot derive child of neutered node`,`UNSUPPORTED_OPERATION`,{operation:`deriveChild`}),i.set(X(r),1)):i.set(X(n));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;let a=X(ni(`sha512`,t,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function ru(e,t){let n=t.split(`/`);Y(n.length>0,`invalid path`,`path`,t),n[0]===`m`&&(Y(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));Y(n<Xl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(Xl+n)}else if(t.match(/^[0-9]+$/)){let n=parseInt(t);Y(n<Xl,`invalid path index`,`path[${e}]`,t),r=r.deriveChild(n)}else Y(!1,`invalid path component`,`path[${e}]`,t)}return r}var iu=class e extends qc{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Zt(e,tu,`HDNodeWallet`),Kt(this,{publicKey:t.compressedPublicKey});let l=on(Vi(_a(this.publicKey)),0,4);Kt(this,{parentFingerprint:n,fingerprint:l,chainCode:r,path:i,index:a,depth:o}),Kt(this,{mnemonic:s})}connect(t){return new e(tu,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 ql(this.#e(),e,{progressCallback:t})}encryptSync(e){return Kl(this.#e(),e)}get extendedKey(){return J(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),eu(rn([`0x0488ADE4`,$l(this.depth,1),this.parentFingerprint,$l(this.index,4),this.chainCode,rn([`0x00`,this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new au(tu,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=vn(t,`index`);Y(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Xl&&(r+=`'`));let{IR:i,IL:a}=nu(n,this.chainCode,this.publicKey,this.privateKey);return new e(tu,new Os(yn((_n(a)+BigInt(this.privateKey))%Zl,32)),this.fingerprint,Z(i),r,n,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return ru(this,e)}static#t(t,n){Y(tn(t),`invalid seed`,`seed`,`[REDACTED]`);let r=X(t,`seed`);Y(r.length>=16&&r.length<=64,`invalid seed`,`seed`,`[REDACTED]`);let i=X(ni(`sha512`,Yl,r));return new e(tu,new Os(Z(i.slice(0,32))),`0x00000000`,Z(i.slice(32)),`m`,0,0,n,null)}static fromExtendedKey(t){let n=bn(On(t));Y(n.length===82||eu(n.slice(0,78))===t,`invalid extended key`,`extendedKey`,`[ REDACTED ]`);let r=n[4],i=Z(n.slice(5,9)),a=parseInt(Z(n.slice(9,13)).substring(2),16),o=Z(n.slice(13,45)),s=n.slice(45,78);switch(Z(n.slice(0,4))){case`0x0488b21e`:case`0x043587cf`:{let e=Z(s);return new au(tu,Ws(e),e,i,o,null,a,r,null)}case`0x0488ade4`:case`0x04358394 `:if(s[0]!==0)break;return new e(tu,new Os(s.slice(1)),i,o,null,a,r,null,null)}Y(!1,`invalid extended key prefix`,`extendedKey`,`[ REDACTED ]`)}static createRandom(t,n,r){t??=``,n??=Jl,r??=il.wordlist();let i=ul.fromEntropy(Yi(16),t,r);return e.#t(i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){return n||=Jl,e.#t(t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,r,i){n??=``,r??=Jl,i??=il.wordlist();let a=ul.fromPhrase(t,n,i);return e.#t(a.computeSeed(),a).derivePath(r)}static fromSeed(t){return e.#t(t,null)}},au=class e extends Kc{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,r,i,a,o,s,c){super(t,c),Zt(e,tu,`HDNodeVoidWallet`),Kt(this,{publicKey:n});let l=on(Vi(_a(n)),0,4);Kt(this,{publicKey:n,fingerprint:l,parentFingerprint:r,chainCode:i,path:a,index:o,depth:s})}connect(t){return new e(tu,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return J(this.depth<256,`Depth too deep`,`UNSUPPORTED_OPERATION`,{operation:`extendedKey`}),eu(rn([`0x0488B21E`,$l(this.depth,1),this.parentFingerprint,$l(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){let n=vn(t,`index`);Y(n<=4294967295,`invalid index`,`index`,n);let r=this.path;r&&(r+=`/`+(n&2147483647),n&Xl&&(r+=`'`));let{IR:i,IL:a}=nu(n,this.chainCode,this.publicKey,null),o=Os.addPoints(a,this.publicKey,!0);return new e(tu,Ws(o),o,this.fingerprint,Z(i),r,n,this.depth+1,this.provider)}derivePath(e){return ru(this,e)}},ou=i(((e,t)=>{t.exports={}})),su=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],te=n[9],W=n[10],G=n[11],ne=n[12],re=n[13],ie=n[14],ae=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*te,h+=r*W,g+=r*G,_+=r*ne,v+=r*re,y+=r*ie,b+=r*ae,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*te,g+=r*W,_+=r*G,v+=r*ne,y+=r*re,b+=r*ie,x+=r*ae,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*te,_+=r*W,v+=r*G,y+=r*ne,b+=r*re,x+=r*ie,S+=r*ae,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*te,v+=r*W,y+=r*G,b+=r*ne,x+=r*re,S+=r*ie,C+=r*ae,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*te,y+=r*W,b+=r*G,x+=r*ne,S+=r*re,C+=r*ie,w+=r*ae,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*te,b+=r*W,x+=r*G,S+=r*ne,C+=r*re,w+=r*ie,T+=r*ae,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*te,x+=r*W,S+=r*G,C+=r*ne,w+=r*re,T+=r*ie,E+=r*ae,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*te,S+=r*W,C+=r*G,w+=r*ne,T+=r*re,E+=r*ie,D+=r*ae,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*te,C+=r*W,w+=r*G,T+=r*ne,E+=r*re,D+=r*ie,O+=r*ae,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*te,w+=r*W,T+=r*G,E+=r*ne,D+=r*re,O+=r*ie,k+=r*ae,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*te,T+=r*W,E+=r*G,D+=r*ne,O+=r*re,k+=r*ie,A+=r*ae,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*te,E+=r*W,D+=r*G,O+=r*ne,k+=r*re,A+=r*ie,j+=r*ae,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*te,D+=r*W,O+=r*G,k+=r*ne,A+=r*re,j+=r*ie,M+=r*ae,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*te,O+=r*W,k+=r*G,A+=r*ne,j+=r*re,M+=r*ie,N+=r*ae,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*te,k+=r*W,A+=r*G,j+=r*ne,M+=r*re,N+=r*ie,P+=r*ae,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*te,A+=r*W,j+=r*G,M+=r*ne,N+=r*re,P+=r*ie,F+=r*ae,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 te(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 W(e,t){return te(e,t,a)}function G(e,t){return r(t,32),W(e,t)}function ne(e,t,n){var r=new Uint8Array(32);return te(r,n,t),x(e,i,r,S)}var re=A,ie=j;function ae(e,t,n,r,i,a){var o=new Uint8Array(32);return ne(o,i,a),re(e,t,n,r,o)}function oe(e,t,n,r,i,a){var o=new Uint8Array(32);return ne(o,i,a),ie(e,t,n,r,o)}var se=[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 ce(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],te=t[5],W=t[6],G=t[7],ne=0;r>=128;){for(w=0;w<16;w++)T=8*w+ne,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=te,b=W,x=G,E=z,D=G,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&te^~U&W,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=se[w*2],D=se[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=_,te=v,W=y,G=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=te,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]=te=O&65535|k<<16,E=R,D=W,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]=W=O&65535|k<<16,E=z,D=G,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]=G=O&65535|k<<16,ne+=128,r-=128}return r}function le(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,ce(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),ce(r,i,a,n),o=0;o<8;o++)m(e,8*o,r[o],i[o]);return 0}function ue(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 de(e,t,n){var r;for(r=0;r<4;r++)P(e[r],t[r],n)}function fe(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 pe(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,de(e,t,r),ue(t,e),ue(e,e),de(e,t,r)}function me(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),pe(e,r,t)}function he(e,t,i){var a=new Uint8Array(64),o=[n(),n(),n(),n()],s;for(i||r(t,32),le(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,me(o,a),fe(e,o),s=0;s<32;s++)t[s+32]=e[s];return 0}var ge=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 _e(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]*ge[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)*ge[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*ge[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function ve(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;_e(e,t)}function ye(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()];le(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(le(s,e.subarray(32),r+32),ve(s),me(d,s),fe(e,d),c=32;c<64;c++)e[c]=i[c];for(le(o,e,r+64),ve(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 _e(e.subarray(32),u),f}function be(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 xe(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||be(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(le(s,e,r),ve(s),pe(c,l,s),me(l,t.subarray(32)),ue(c,l),fe(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 Se=32,Ce=24,we=32,Te=16,Ee=32,De=32,Oe=32,ke=32,Ae=32,je=Ce,Me=we,Ne=Te,Pe=64,Fe=32,Ie=64,Le=32,Re=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:te,crypto_scalarmult_base:W,crypto_box_beforenm:ne,crypto_box_afternm:re,crypto_box:ae,crypto_box_open:oe,crypto_box_keypair:G,crypto_hash:le,crypto_sign:ye,crypto_sign_keypair:he,crypto_sign_open:xe,crypto_secretbox_KEYBYTES:Se,crypto_secretbox_NONCEBYTES:Ce,crypto_secretbox_ZEROBYTES:we,crypto_secretbox_BOXZEROBYTES:Te,crypto_scalarmult_BYTES:Ee,crypto_scalarmult_SCALARBYTES:De,crypto_box_PUBLICKEYBYTES:Oe,crypto_box_SECRETKEYBYTES:ke,crypto_box_BEFORENMBYTES:Ae,crypto_box_NONCEBYTES:je,crypto_box_ZEROBYTES:Me,crypto_box_BOXZEROBYTES:Ne,crypto_sign_BYTES:Pe,crypto_sign_PUBLICKEYBYTES:Fe,crypto_sign_SECRETKEYBYTES:Ie,crypto_sign_SEEDBYTES:Le,crypto_hash_BYTES:Re,gf:n,D:l,L:ge,pack25519:F,unpack25519:R,M:V,A:z,S:H,Z:B,pow2523:U,add:ue,set25519:M,modL:_e,scalarmult:pe,scalarbase:me};function ze(e,t){if(e.length!==Se)throw Error(`bad key size`);if(t.length!==Ce)throw Error(`bad nonce size`)}function K(e,t){if(e.length!==Oe)throw Error(`bad public key size`);if(t.length!==ke)throw Error(`bad secret key size`)}function q(){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){q(e,t,n),ze(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 A(i,r,r.length,t,n),i.subarray(Te)},t.secretbox.open=function(e,t,n){q(e,t,n),ze(n,t);for(var r=new Uint8Array(Te+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+Te]=e[a];return r.length<32||j(i,r,r.length,t,n)!==0?null:i.subarray(we)},t.secretbox.keyLength=Se,t.secretbox.nonceLength=Ce,t.secretbox.overheadLength=Te,t.scalarMult=function(e,t){if(q(e,t),e.length!==De)throw Error(`bad n size`);if(t.length!==Ee)throw Error(`bad p size`);var n=new Uint8Array(Ee);return te(n,e,t),n},t.scalarMult.base=function(e){if(q(e),e.length!==De)throw Error(`bad n size`);var t=new Uint8Array(Ee);return W(t,e),t},t.scalarMult.scalarLength=De,t.scalarMult.groupElementLength=Ee,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){q(e,t),K(e,t);var n=new Uint8Array(Ae);return ne(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(Oe),t=new Uint8Array(ke);return G(e,t),{publicKey:e,secretKey:t}},t.box.keyPair.fromSecretKey=function(e){if(q(e),e.length!==ke)throw Error(`bad secret key size`);var t=new Uint8Array(Oe);return W(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},t.box.publicKeyLength=Oe,t.box.secretKeyLength=ke,t.box.sharedKeyLength=Ae,t.box.nonceLength=je,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(e,t){if(q(e,t),t.length!==Ie)throw Error(`bad secret key size`);var n=new Uint8Array(Pe+e.length);return ye(n,e,e.length,t),n},t.sign.open=function(e,t){if(q(e,t),t.length!==Fe)throw Error(`bad public key size`);var n=new Uint8Array(e.length),r=xe(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(Pe),a=0;a<i.length;a++)i[a]=r[a];return i},t.sign.detached.verify=function(e,t,n){if(q(e,t,n),t.length!==Pe)throw Error(`bad signature size`);if(n.length!==Fe)throw Error(`bad public key size`);var r=new Uint8Array(Pe+e.length),i=new Uint8Array(Pe+e.length),a;for(a=0;a<Pe;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+Pe]=e[a];return xe(i,r,r.length,n)>=0},t.sign.keyPair=function(){var e=new Uint8Array(Fe),t=new Uint8Array(Ie);return he(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(q(e),e.length!==Ie)throw Error(`bad secret key size`);for(var t=new Uint8Array(Fe),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(q(e),e.length!==Le)throw Error(`bad seed size`);for(var t=new Uint8Array(Fe),n=new Uint8Array(Ie),r=0;r<32;r++)n[r]=e[r];return he(t,n,!0),{publicKey:t,secretKey:n}},t.sign.publicKeyLength=Fe,t.sign.secretKeyLength=Ie,t.sign.seedLength=Le,t.sign.signatureLength=Pe,t.hash=function(e){q(e);var t=new Uint8Array(Re);return le(t,e,e.length),t},t.hash.hashLength=Re,t.verify=function(e,t){return q(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=ou(),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||{})})),cu=r(su(),1),lu=`/most.box/`,uu=5e4,du=32,fu=1,pu=8,mu=9+cu.default.secretbox.nonceLength,hu=mu+cu.default.secretbox.overheadLength,gu=new TextEncoder().encode(`MP-AE`);function _u(e,t){let n=Pn(lu+e),r=X(_a(X(Gi(Pn(t),n,uu,du,`sha512`)))),i=ul.entropyToPhrase(r);return{username:e,address:iu.fromPhrase(i).address,danger:Z(r)}}function vu(e){return ul.entropyToPhrase(X(e))}function yu(e){let t=cu.default.box.keyPair.fromSecretKey(X(e)),n=cu.default.sign.keyPair.fromSeed(X(e));return{public_key:Z(t.publicKey),private_key:Z(t.secretKey),ed_public_key:Z(n.publicKey)}}async function bu(e,t){let n=iu.fromPhrase(vu(e));return{address:n.address,signature:await n.signMessage(t)}}function xu(e,t){let n=new TextEncoder().encode(e),r=cu.default.randomBytes(cu.default.secretbox.nonceLength),i=X(t).slice(0,cu.default.secretbox.keyLength),a=cu.default.secretbox(n,r,i);return[`mp://1`,An(r),An(a)].join(`.`)}function Su(e,t){let[n,r,i]=String(e||``).split(`.`);if(n!==`mp://1`||!r||!i)return``;let a=X(t).slice(0,cu.default.secretbox.keyLength),o=cu.default.secretbox.open(kn(i),kn(r),a);return o?new TextDecoder().decode(o):``}function Cu(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 wu(e){return An(e).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replaceAll(`=`,``)}function Tu(e){let t=String(e||``).trim();if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return null;try{return kn(t.replaceAll(`-`,`+`).replaceAll(`_`,`/`).padEnd(Math.ceil(t.length/4)*4,`=`))}catch{return null}}function Eu(e){let t=new Uint8Array(pu);return new DataView(t.buffer).setBigUint64(0,BigInt(e),!1),t}function Du(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return Number(t.getBigUint64(0,!1))}function Ou(e){let t=Tu(e);if(!t||t.length<hu||t[0]!==fu)return null;let n=t.slice(1,9),r=t.slice(9,mu),i=t.slice(mu);return{version:t[0],timestampMs:Du(n),nonce:r,encrypted:i}}function ku(e,t,n){return cu.default.hash(Cu([gu,e,t,n])).slice(0,cu.default.secretbox.keyLength)}function Au(e,{senderPrivateKey:t,recipientPublicKey:n}){let r=X(t),i=cu.default.box.keyPair.fromSecretKey(r).publicKey,a=X(n),o=ku(i,a,cu.default.box.before(a,r)),s=cu.default.randomBytes(cu.default.secretbox.nonceLength),c=cu.default.secretbox(new TextEncoder().encode(e),s,o);return wu(Cu([new Uint8Array([fu]),Eu(Date.now()),s,c]))}function ju(e){let t=Ou(e);return t?{version:t.version,timestampMs:t.timestampMs,nonce:wu(t.nonce)}:null}function Mu(e,{senderPublicKey:t,recipientPrivateKey:n}){let r=Ou(e);if(!r)return``;try{let e=X(n),i=cu.default.box.keyPair.fromSecretKey(e).publicKey,a=X(t),o=ku(a,i,cu.default.box.before(a,e)),s=cu.default.secretbox.open(r.encrypted,r.nonce,o);return s?new TextDecoder().decode(s):``}catch{return``}}function Nu(e,t){let{address:n,danger:r}=_u(e,t);return{username:e,address:n,danger:r,displayName:`${e}#${n.slice(-4).toUpperCase()}`}}function Pu(){if(typeof localStorage>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function Fu(e){typeof localStorage>`u`||localStorage.setItem(`mostbox_identity`,JSON.stringify(e))}function Iu(){typeof localStorage>`u`||(localStorage.removeItem(`mostbox_identity`),localStorage.removeItem(`mostbox_guest_identity`))}var Lu=`匿名`,Ru=1;function zu(e){return`${e.username}#${e.address.slice(-4).toUpperCase()}`}function Bu(e){return e.displayName?e.displayName:zu(e)}function Vu(e){if(!e||typeof e!=`object`)return null;let t=e;if(!t.username||!t.address||!t.danger||t.username===Lu)return null;let n=t.address,r=Bu(t),i=typeof t.avatar==`string`&&t.avatar.trim()||void 0,a=Number(t.profileUpdatedAt),o=!!i||r!==zu({username:t.username,address:n});return{username:t.username,address:n,danger:t.danger,displayName:r,logo:typeof t.logo==`string`?t.logo:void 0,avatar:i,profileUpdatedAt:Number.isFinite(a)&&a>0?Math.floor(a):o?Ru:void 0,identity:t.identity===`user`||t.identity===`service`||t.identity===`service_ai`?t.identity:void 0}}function Hu(){return{loginUsername:``,loginPassword:``,showPassword:!1,loginPreviewAddress:``,hasPreviewedAvatar:!1,loginLoading:!1,loginError:``}}var Uu=Ht((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=Vu(Pu());t||Iu(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:``})},closeLoginModal:()=>{e({showLoginModal:!1,...Hu()})},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=Nu(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=Nu(n.trim(),r);return Fu(t),e({identity:t,wallet:t,pendingCloudRestoreAddress:t.address,showLoginModal:!1,...Hu()}),t}catch{return e({loginLoading:!1,loginError:`login.error.failed`}),null}},setUserIdentity:t=>{let n=Vu(t);n&&(Fu(n),e({identity:n,wallet:n}))},consumePendingCloudRestore:n=>{let r=t().pendingCloudRestoreAddress;return!r||r.toLowerCase()!==n.toLowerCase()?!1:(e({pendingCloudRestoreAddress:null}),!0)},logoutUser:()=>{Iu(),e({identity:null,wallet:void 0,pendingCloudRestoreAddress:null})}}));function Wu(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 Gu(e){if(e instanceof Uint8Array&&e.constructor.name===`Uint8Array`)return qu(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return qu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));throw Error(`Unknown type, must be binary type`)}function Ku(e){return e?.buffer instanceof ArrayBuffer}function qu(e){return Ku(e)?e:e.slice()}function Ju(e,t){if(e.length>=255)throw TypeError(`Alphabet too long`);for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(n[o]!==255)throw TypeError(a+` is ambiguous`);n[o]=i}var s=e.length,c=e.charAt(0),l=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function d(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)*u+1>>>0,l=new Uint8Array(o);i!==a;){for(var d=t[i],f=0,p=o-1;(d!==0||f<r)&&p!==-1;p--,f++)d+=256*l[p]>>>0,l[p]=d%s>>>0,d=d/s>>>0;if(d!==0)throw Error(`Non-zero carry`);r=f,i++}for(var m=o-r;m!==o&&l[m]===0;)m++;for(var h=c.repeat(n);m<o;++m)h+=e.charAt(l[m]);return h}function f(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return new Uint8Array;var t=0;if(e[t]!==` `){for(var r=0,i=0;e[t]===c;)r++,t++;for(var a=(e.length-t)*l+1>>>0,o=new Uint8Array(a);e[t];){var u=n[e.charCodeAt(t)];if(u===255)return;for(var d=0,f=a-1;(u!==0||d<i)&&f!==-1;f--,d++)u+=s*o[f]>>>0,o[f]=u%256>>>0,u=u/256>>>0;if(u!==0)throw Error(`Non-zero carry`);i=d,t++}if(e[t]!==` `){for(var p=a-i;p!==a&&o[p]===0;)p++;for(var m=new Uint8Array(r+(a-p)),h=r;p!==a;)m[h++]=o[p++];return m}}}function p(e){var n=f(e);if(n)return n;throw Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:f,decode:p}}var Yu=Ju,Xu=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`)}},Zu=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 $u(this,e)}},Qu=class{decoders;constructor(e){this.decoders=e}or(e){return $u(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 $u(e,t){return new Qu({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var ed=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 Xu(e,t,n),this.decoder=new Zu(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function td({name:e,prefix:t,encode:n,decode:r}){return new ed(e,t,n,r)}function nd({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=Yu(n,e);return td({prefix:t,name:e,encode:r,decode:e=>Gu(i(e))})}function rd(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 id(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 ad(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function od({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=ad(r);return td({prefix:t,name:e,encode(e){return id(e,r,n)},decode(t){return rd(t,i,n,e)}})}var sd=od({prefix:`b`,name:`base32`,alphabet:`abcdefghijklmnopqrstuvwxyz234567`,bitsPerChar:5});od({prefix:`B`,name:`base32upper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,bitsPerChar:5}),od({prefix:`c`,name:`base32pad`,alphabet:`abcdefghijklmnopqrstuvwxyz234567=`,bitsPerChar:5}),od({prefix:`C`,name:`base32padupper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=`,bitsPerChar:5}),od({prefix:`v`,name:`base32hex`,alphabet:`0123456789abcdefghijklmnopqrstuv`,bitsPerChar:5}),od({prefix:`V`,name:`base32hexupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV`,bitsPerChar:5}),od({prefix:`t`,name:`base32hexpad`,alphabet:`0123456789abcdefghijklmnopqrstuv=`,bitsPerChar:5}),od({prefix:`T`,name:`base32hexpadupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV=`,bitsPerChar:5}),od({prefix:`h`,name:`base32z`,alphabet:`ybndrfg8ejkmcpqxot1uwisza345h769`,bitsPerChar:5});var cd=nd({prefix:`k`,name:`base36`,alphabet:`0123456789abcdefghijklmnopqrstuvwxyz`});nd({prefix:`K`,name:`base36upper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`});var ld=nd({name:`base58btc`,prefix:`z`,alphabet:`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`});nd({name:`base58flickr`,prefix:`Z`,alphabet:`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`});var ud=md,dd=128,fd=-128,pd=2**31;function md(e,t,n){t||=[],n||=0;for(var r=n;e>=pd;)t[n++]=e&255|dd,e/=128;for(;e&fd;)t[n++]=e&255|dd,e>>>=7;return t[n]=e|0,md.bytes=n-r+1,t}var hd=vd,gd=128,_d=127;function vd(e,t){var n=0,t=t||0,r=0,i=t,a,o=e.length;do{if(i>=o)throw vd.bytes=0,RangeError(`Could not decode varint`);a=e[i++],n+=r<28?(a&_d)<<r:(a&_d)*2**r,r+=7}while(a>=gd);return vd.bytes=i-t,n}var yd=2**7,bd=2**14,xd=2**21,Sd=2**28,Cd=2**35,wd=2**42,Td=2**49,Ed=2**56,Dd=2**63,Od={encode:ud,decode:hd,encodingLength:function(e){return e<yd?1:e<bd?2:e<xd?3:e<Sd?4:e<Cd?5:e<wd?6:e<Td?7:e<Ed?8:e<Dd?9:10}};function kd(e,t=0){return[Od.decode(e,t),Od.decode.bytes]}function Ad(e,t,n=0){return Od.encode(e,t,n),t}function jd(e){return Od.encodingLength(e)}function Md(e,t){let n=t.byteLength,r=jd(e),i=r+jd(n),a=new Uint8Array(i+n);return Ad(e,a,0),Ad(n,a,r),a.set(t,i),new Fd(e,n,t,a)}function Nd(e){let t=Gu(e),[n,r]=kd(t),[i,a]=kd(t.subarray(r)),o=t.subarray(r+a);if(o.byteLength!==i)throw Error(`Incorrect length`);return new Fd(n,i,o,t)}function Pd(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&Wu(e.bytes,n.bytes)}}var Fd=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=qu(n),this.bytes=qu(r)}};function Id(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return Vd(n,Rd(e),t??ld.encoder);default:return Hd(n,Rd(e),t??sd.encoder)}}var Ld=new WeakMap;function Rd(e){let t=Ld.get(e);if(t==null){let t=new Map;return Ld.set(e,t),t}return t}var zd=class e{code;version;multihash;bytes;"/";constructor(e,t,n,r){this.code=t,this.version=e,this.multihash=n,this.bytes=qu(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!==Ud)throw Error(`Cannot convert a non dag-pb CID to CIDv0`);if(n.code!==Wd)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=Md(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&&Pd(e.multihash,n.multihash)}toString(e){return Id(this,e)}toJSON(){return{"/":Id(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??Gd(t,r,i.bytes))}else if(n[Kd]===!0){let{version:t,multihash:r,code:i}=n,a=Nd(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!==Ud)throw Error(`Version 0 CID must use dag-pb (code: ${Ud}) block encoding`);return new e(t,n,r,r.bytes);case 1:return new e(t,n,r,Gd(t,n,r.bytes));default:throw Error(`Invalid version`)}}static createV0(t){return e.create(0,Ud,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=Gu(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 Fd(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]=kd(e.subarray(t));return t+=r,n},r=n(),i=Ud;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]=Bd(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 Rd(a).set(r,t),a}};function Bd(e,t){switch(e[0]){case`Q`:{let n=t??ld;return[ld.prefix,n.decode(`${ld.prefix}${e}`)]}case ld.prefix:{let n=t??ld;return[ld.prefix,n.decode(e)]}case sd.prefix:{let n=t??sd;return[sd.prefix,n.decode(e)]}case cd.prefix:{let n=t??cd;return[cd.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 Vd(e,t,n){let{prefix:r}=n;if(r!==ld.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 Hd(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 Ud=112,Wd=18;function Gd(e,t,n){let r=jd(e),i=r+jd(t),a=new Uint8Array(i+n.byteLength);return Ad(e,a,0),Ad(t,a,r),a.set(n,i),a}var Kd=Symbol.for(`@ipld/js-cid/CID`),qd=20;function Jd({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new Yd(e,t,n,r,i)}var Yd=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??qd,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?Xd(n,this.code,t?.truncate):n.then(e=>Xd(e,this.code,t?.truncate))}else throw Error(`Unknown type, must be binary type`)}};function Xd(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 Md(t,e)}function Zd(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var Qd=Jd({name:`sha2-256`,code:18,encode:Zd(`SHA-256`)});Jd({name:`sha2-512`,code:19,encode:Zd(`SHA-512`)});function $d(e=``){return String(e).replace(/\\/g,`/`).split(`/`).map(e=>e.trim()).filter(e=>e&&e!==`.`).filter(e=>e!==`..`).join(`/`)}function ef(e){let t=$d(e?.path||``),n=String(e?.name||``).trim();return t?`${t}/${n}`:n}var tf={EMPTY:`empty`,SLASH:`slash`,BACKSLASH:`backslash`};function nf(e){let t=String(e||``).trim();return t?t.includes(`/`)?{valid:!1,errorCode:tf.SLASH,error:`Name cannot contain /`}:t.includes(`\\`)?{valid:!1,errorCode:tf.BACKSLASH,error:`Name cannot contain \\`}:{valid:!0,name:t}:{valid:!1,errorCode:tf.EMPTY,error:`Name is required`}}async function rf(e=``){let t=new TextEncoder().encode(String(e)),n=await Qd.digest(t);return zd.create(1,85,n).toString()}function af(e,t=``,n=``){let r=$d(t),i=n.trim().toLowerCase(),a=Array.isArray(e)?e:[];if(i)return a.filter(e=>String(e.name||``).toLowerCase().includes(i)).sort(sf);let o=[],s=new Map;for(let e of a){let t=$d(e.path||``);if(t===r){o.push(e);continue}if(r===``||t.startsWith(`${r}/`)){let n=(r===``?t:t.slice(r.length+1)).split(`/`).filter(Boolean)[0];n&&!s.has(n)&&s.set(n,{name:n,type:`directory`,path:r,size:0,cid:`__dir__${r}/${n}`,created_at:e.created_at||Date.now(),updated_at:e.updated_at||e.created_at||Date.now()})}}return[...s.values(),...o].sort(sf)}function of(e,t,n,r){let i=$d(t),a=$d(n),o=String(r||``).trim(),s=$d(a?`${a}/${o}`:o),c=Date.now();return e.map(e=>{let t=ef(e);if(t===i)return{...e,path:a,name:o,updated_at:c};if(t.startsWith(`${i}/`)){let n=$d(`${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})}function sf(e,t){return e.type===`directory`&&t.type!==`directory`?-1:e.type!==`directory`&&t.type===`directory`?1:(t.updated_at||t.created_at||0)-(e.updated_at||e.created_at||0)}var cf=class extends Error{name=`KyError`;get isKyError(){return!0}},lf=class extends cf{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}},uf=class extends cf{name=`NetworkError`;request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},df=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}},ff=class extends cf{name=`ForceRetryError`;customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new df(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}},pf=class extends Error{name=`SchemaValidationError`;issues;constructor(e){super(`Response schema validation failed`),this.issues=e}},mf=class extends cf{name=`TimeoutError`;request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},hf=(()=>{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})(),gf=typeof globalThis.AbortController==`function`,_f=typeof globalThis.AbortSignal==`function`&&typeof globalThis.AbortSignal.any==`function`,vf=typeof globalThis.ReadableStream==`function`,yf=typeof globalThis.FormData==`function`,bf=[`get`,`post`,`put`,`patch`,`head`,`delete`],xf={json:`application/json`,text:`text/*`,formData:`multipart/form-data`,arrayBuffer:`*/*`,blob:`*/*`,bytes:`*/*`},Sf=2147483647,Cf=Symbol(`stop`),wf=class{options;constructor(e){this.options=e}},Tf=e=>new wf(e),Ef={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},Df={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},Of=new TextEncoder,kf=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=40,t+=Of.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+=typeof r==`string`?Of.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof e==`string`?Of.encode(e).byteLength:e instanceof URLSearchParams?Of.encode(e.toString()).byteLength:0},Af=(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))}}))},jf=(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(Af(e.body,r,t),n)},Mf=(e,t,n)=>{if(!e.body)return e;let r=kf(n??e.body);return new Request(e,{duplex:`half`,body:Af(e.body,r,t)})},Nf=e=>typeof e==`object`&&!!e,Pf=Symbol(`replaceOption`),Ff=e=>Nf(e)&&e[Pf]===!0?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},If=(...e)=>{for(let t of e)if((!Nf(t)||Array.isArray(t))&&t!==void 0)throw TypeError("The `options` argument must be an object");return Kf({},...e)},Lf=(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},Rf=e=>{if(!Nf(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},zf=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),n=e[Wf];return n&&(t[Wf]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:Rf(e)?{...e}:e},Bf=e=>Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0)),Vf=(e,t)=>Rf(e)&&Rf(t)?Bf({...e,...t}):Lf(e,t);function Hf(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Kf(e[n]??[],t[n]??[])}var Uf=(e={},t={})=>({init:Hf(e,t,`init`),beforeRequest:Hf(e,t,`beforeRequest`),beforeRetry:Hf(e,t,`beforeRetry`),beforeError:Hf(e,t,`beforeError`),afterResponse:Hf(e,t,`afterResponse`)}),Wf=Symbol(`deletedParameters`),Gf=(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[Wf];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(Nf(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[Wf]=r),n},Kf=(...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(Nf(o)){for(let[e,n]of Object.entries(o)){if(e===`signal`&&n instanceof globalThis.AbortSignal){a.push(n);continue}let r=Ff(n),{isReplace:o}=r;if(n=r.value,e===`context`){if(n!=null&&(!Nf(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:Gf(i,n);continue}Nf(n)&&!o&&e in t&&(n=Kf(t[e],n)),t={...t,[e]:n}}if(Nf(o.hooks)){let{value:e,isReplace:n}=Ff(o.hooks);r=Uf(n?{}:r,e),t.hooks=r}if(Nf(o.headers)){let{value:e,isReplace:r}=Ff(o.headers);n=r?zf(e):Vf(n,e),t.headers=n}}return i!==void 0&&(t.searchParams=i),a.length>0&&(a.length===1?t.signal=a[0]:_f?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t},qf=e=>bf.includes(e)?e.toUpperCase():e,Jf={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},Yf=(e={})=>{if(typeof e==`number`)return{...Jf,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{...Jf,...t}};async function Xf(e,t,n,r){return new Promise((i,a)=>{let o=setTimeout(()=>{n&&n.abort(),a(new mf(e))},r.timeout);r.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Zf(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 Df)&&!(n in Ef)&&(t[n]=e[n]);return t},$f=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[Wf]?.size:typeof e==`object`?Object.keys(e).length>0:typeof e==`string`?e.trim().length>0:!!e,ep=Object.prototype.toString,tp=e=>ep.call(e)===`[object Error]`,np=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 rp(e){if(!(e&&tp(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:np.has(t)}var ip=(e,t)=>e instanceof t||e?.name===t.name;function ap(e){return ip(e,lf)}function op(e){return ip(e,uf)}function sp(e){return ip(e,mf)}var cp=10*1024*1024,lp="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",up=Symbol(`timedOutResponseData`),dp=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},fp="The `schema` argument must follow the Standard Schema specification",pp=e=>typeof e==`object`?{...e,...e.methods&&{methods:[...e.methods]},...e.statusCodes&&{statusCodes:[...e.statusCodes]},...e.afterStatusCodes&&{afterStatusCodes:[...e.afterStatusCodes]}}:e,mp=Object.prototype.toString,hp=e=>e instanceof globalThis.Request||mp.call(e)===`[object Request]`,gp=e=>e instanceof globalThis.Response||mp.call(e)===`[object Response]`,_p=e=>Array.isArray(e)?e.map(e=>[...e]):zf(e);function vp(e){let t={...e,json:zf(e.json),context:zf(e.context),headers:zf(e.headers),searchParams:_p(e.searchParams)};return e.retry!==void 0&&(t.retry=pp(e.retry)),t}var yp=async(e,t)=>{if(typeof t!=`object`&&typeof t!=`function`||t===null)throw TypeError(fp);let n=t[`~standard`];if(typeof n!=`object`||!n||typeof n.validate!=`function`)throw TypeError(fp);let r=await n.validate(e);if(r.issues)throw new pf(r.issues);return r.value},bp=class e{static create(t,n){let r=n.hooks?.init??[],i=r.length>0?vp(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 ${Sf}`);if(typeof a.#i.totalTimeout==`number`&&a.#i.totalTimeout>2147483647)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${Sf}`);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(gp(t))try{t=await a.#T(t)}catch(e){if(!(e instanceof ff))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 lf(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(!gp(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(!vf)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();return a.#x(t),jf(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(xf))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):yp(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:yp(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(lp);if(this.#i={...n,headers:Lf(this.#r.headers,n.headers),hooks:Uf({},n.hooks),method:qf(n.method??this.#r.method??`GET`),prefix:String(n.prefix||``),retry:Yf(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))}}gf&&_f&&(this.#o=this.#i.signal??this.#r.signal,this.#t=new globalThis.AbortController,this.#i.signal=this.#S()),hf&&(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&&(yf&&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),$f(this.#i.searchParams)){let t=new URL(this.request.url),n=this.#i.searchParams?.[Wf];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 df(e);if(t instanceof ff)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(sp(e)){if(!this.#i.retry.retryOnTimeout)throw e;return this.#f()}if(ap(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(!op(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===up){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===up){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 mf(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=dp(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>cp){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(up)},t);s.finally(()=>{clearTimeout(n)})}),l=await Promise.race([s,c]);return l===up&&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(up)},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 mf(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(hp(t))this.#N(t);else if(gp(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 wf)throw r!==e&&this.#x(r),this.#x(e),new ff(i.options);let a=gp(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),Sf),r={signal:this.#o},i=this.#A();if(i!==void 0){if(i<=0)throw new mf(this.request);if(n>=i)throw await Zf(i,r),new mf(this.request)}if(await Zf(n,r),this.#C(),e instanceof ff&&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(hp(n)){this.#N(n);break}if(gp(n))return this.#u=!0,this.#n++,n;if(n===Cf)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 mf(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 Xf(n,e,this.#t,{timeout:r,fetch:this.#i.fetch});return this.#F(i,n)}catch(e){throw rp(e)?new uf(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||!hf?e:Mf(e,this.#i.onUploadProgress,t??this.#i.body??void 0)}},xp=e=>{let t=(t,n)=>bp.create(t,If(e,n));for(let n of bf)t[n]=(t,r)=>bp.create(t,If(e,r,{method:n}));return t.create=e=>xp(If(e)),t.extend=t=>(typeof t==`function`&&(t=t(e??{})),xp(If(e,t))),t.stop=Cf,t.retry=Tf,t},Sp=xp();function Cp(e){let t=String(e||``).trim();return/^0x[a-fA-F0-9]{40}$/.test(t)?t.toLowerCase():``}function wp(e){return e?`${e.slice(0,6)}...${e.slice(-4)}`:``}function Tp(e){return String(e||``).trim().slice(0,4096)}function Ep(e,t=``,n=50){return(String(e||``).trim()||String(t||``)).slice(0,n)}function Dp(e){return String(e||``).trim().toUpperCase().replace(/[^A-Z0-9]/g,``).slice(0,8)}function Op(e){return`${e}_${Date.now()}_${Ap(4)}`}function kp(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 Ap(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 jp(e,t,n){return`${e}:${String(t||`GET`).toUpperCase()}:${Mp(n)}`}function Mp(e){try{return new URL(e,`http://most.box`).pathname}catch{return String(e||``).split(`?`)[0]||`/`}}async function Np(e,t,n){if(!e?.danger)return{};let r=Date.now().toString(),i=jp(r,t,n),{address:a,signature:o}=await bu(e.danger,i);return{Authorization:`${a},${r},${o}`}}var Pp=`mostbox_backend_url`,Fp=`mostbox_backend_invite`,Ip=`mostbox_remote_nodes`,Lp=`http://localhost:1976`,Rp=8;function zp(){return typeof window>`u`?!1:[`localhost`,`127.0.0.1`].includes(window.location.hostname)}function Bp(){return zp()?Lp:``}function Vp(){return typeof window>`u`?``:window.location.origin||``}function Hp(){return typeof window>`u`?``:localStorage.getItem(Pp)||Bp()}function Up(){return typeof window>`u`?``:localStorage.getItem(Pp)||``}function Wp(e){let t=tm(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 Gp(){return typeof window>`u`?``:localStorage.getItem(Fp)||``}function Kp(e,t={}){if(!e||typeof e!=`object`)return null;let n=tm(e.url);return Wp(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 qp(e){let t=new Map,n=``;for(let r of e){let e=Kp(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,Rp)}function Jp(){if(typeof window>`u`)return[];let e=om(localStorage.getItem(Ip)),t=Array.isArray(e)?e:[],n=Up();return Wp(n)&&t.push({url:n,invite:Gp(),active:!0,updatedAt:Date.now()}),qp(t)}function Yp(e){typeof window>`u`||localStorage.setItem(Ip,JSON.stringify(qp(e)))}function Xp(){return Jp().find(e=>e.active)||null}function Zp(e,t=Gp(),n=!0){let r=tm(e);if(!Wp(r))return;let i=Jp().map(e=>({...e,active:n?!1:e.active}));i.unshift({url:r,invite:(t||``).trim(),active:n,updatedAt:Date.now()}),Yp(i)}function Qp(){Yp(Jp().map(e=>({...e,active:!1})))}function $p(e=Hp()){let t=tm(e),n=Bp(),r=nm(t)?t:n;if(!nm(r))return null;let i=tm(r);return{url:i,invite:``,active:i===t,local:!0,updatedAt:2**53-1}}function em(){if(typeof window>`u`)return[];let e=tm(Hp()),t=$p(e),n=Jp().map((t,n)=>({...t,active:tm(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 tm(e){return(e||``).trim().replace(/\/+$/,``)}function nm(e){let t=tm(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 rm(e=Hp()){return!!Gp()&&!nm(e)}function im(){if(typeof window>`u`)return null;try{let e=localStorage.getItem(`mostbox_identity`);return e?JSON.parse(e):null}catch{return null}}function am(e){return e.startsWith(`/`)?e:`/${e}`}function om(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function sm(e){let t=Mp(e),n=Hp();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 cm(e,t=`/ws`){let n=new URL(e),r=n.protocol===`https:`?`wss:`:`ws:`,i=n.pathname.replace(/\/+$/,``);return`${r}//${n.host}${i}${am(t)}`}function lm(){let e=Sp.create({hooks:{beforeRequest:[async({request:e})=>{let t=new Headers(e.headers||{}),n=Gp();n&&rm(e.url)&&t.set(`x-mostbox-invite`,n);let r=im();if(r?.danger)try{let n=await Np(r,e.method,sm(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`?Sm(t):t;return r.call(e,i,n)}:r}})}var um=lm();async function dm(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,error:typeof n?.error==`string`?n.error:typeof n?.message==`string`?n.message:void 0}}async function fm(e,t=`请求失败`){let n=await dm(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 pm(e){let t=tm(e);t?(localStorage.setItem(Pp,t),Wp(t)&&Zp(t)):localStorage.removeItem(Pp),um=lm()}function mm(e){let t=(e||``).trim();t?localStorage.setItem(Fp,t):localStorage.removeItem(Fp),um=lm()}function hm({url:e,invite:t}){pm(e),mm(t),Zp(e,t)}function gm(){pm(``),mm(``),typeof window<`u`&&Qp()}function _m(){return Hp()}function vm(){return Vp()}function ym(){return Xp()?.url||``}function bm(){return Xp()?.invite||``}function xm(){return em()}function Sm(e){return`${Hp()}${am(e)}`}async function Cm(e=`GET`,t=`/`){let n={},r=Gp();r&&rm()&&(n[`x-mostbox-invite`]=r);try{Object.assign(n,await Np(im(),e,Mp(t)))}catch{}return n}async function wm(e=`/ws`){if(typeof window>`u`)return am(e);let t=Hp()||window.location.origin,n=new URL(cm(t,e)),r=Gp();r&&rm(n.toString())&&n.searchParams.set(`invite`,r);let i=im();if(i?.danger)try{let t=await Np(i,`GET`,Mp(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 Tm(e,t,n){try{let r={};t&&(r[`x-mostbox-invite`]=t);try{Object.assign(r,await Np(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 Em(e,t,n){if(typeof WebSocket>`u`||!n?.danger)return{ok:!0};try{let r=new URL(cm(e));if(t&&r.searchParams.set(`invite`,t),n?.danger)try{let e=await Np(n,`GET`,Mp(`/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 Dm({url:e,invite:t=``}){let n=tm(e);if(!n)return{ok:!1,reason:`http`};let r=im(),[i,a]=await Promise.all([Tm(n,t,r),Em(n,t,r)]);return i.ok?a.ok?{ok:!0}:a:i}async function Om(){try{return(await fetch(`${Lp}/api/node-id`,{method:`GET`,signal:AbortSignal.timeout(2e3)})).ok}catch{return!1}}var km=`mostbox`,Am=1,jm=`notes`;function Mm(){return new Promise((e,t)=>{let n=indexedDB.open(km,Am);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(jm)||e.createObjectStore(jm,{keyPath:`address`})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function Nm(e){let t=await Mm();return new Promise((n,r)=>{let i=t.transaction(jm,`readonly`).objectStore(jm).get(e);i.onsuccess=()=>{let e=i.result;n(e?{notes:e.notes,notesPath:e.notesPath}:null)},i.onerror=()=>r(i.error)})}async function Pm(e,t,n){let r=await Mm();return new Promise((i,a)=>{let o=r.transaction(jm,`readwrite`).objectStore(jm).put({address:e,notes:t,notesPath:n});o.onsuccess=()=>i(),o.onerror=()=>a(o.error)})}function Fm(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:$d(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 Im(e,t,n){e&&Pm(e,t,$d(n)).catch(e=>{console.warn(`Failed to persist notes:`,e)})}function Lm(e){switch(e){case tf.EMPTY:return`note.error.nameRequired`;case tf.SLASH:return`note.error.nameNoSlash`;case tf.BACKSLASH:return`note.error.nameNoBackslash`;default:return`note.error.nameInvalid`}}var Rm=Ht((e,t)=>({hasBackend:null,checkBackend:async()=>{let t=ym();if(t){let n=bm(),{ok:r}=await Dm({url:t,invite:n});if(r){hm({url:t,invite:n}),e({hasBackend:!0});return}}if(await Om()){pm(`http://localhost:1976`),mm(``),e({hasBackend:!0});return}let n=vm();if(n){let{ok:t}=await Dm({url:n});if(t){pm(``),mm(``),e({hasBackend:!0});return}}t||(pm(``),mm(``)),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 Nm(t);e({notes:n?Fm(n.notes):[],notesPath:$d(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=$d(n);e({notesPath:r}),Im(t().notesAddress,t().notes,r)},saveNote:async n=>{let r=nf(n.name);if(!r.valid)throw Error(Lm(r.errorCode));let i=r.name||n.name,a=$d(n.path||``),o=String(n.content||``),s=await rf(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=>$d(e.path)===a&&e.name===i),f=$d(a?`${a}/${i}`:i);if(u.some((e,t)=>t!==d&&ef(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}),Im(t().notesAddress,m,t().notesPath),s},deleteNote:(n,r,i)=>{let a=r!==void 0&&i!==void 0?$d(`${r}/${i}`):``,o=t().notes.filter(e=>{if(n&&e.cid===n)return!1;if(a){let t=ef(e);return t!==a&&!t.startsWith(`${a}/`)}return!0});e({notes:o}),Im(t().notesAddress,o,t().notesPath)},renameNote:(n,r,i)=>{let a=nf(i);if(!a.valid)throw Error(Lm(a.errorCode));let o=$d(n),s=$d(r),c=$d(s?`${s}/${a.name}`:a.name);if(c.startsWith(`${o}/`))throw Error(`note.error.moveIntoSelf`);if(t().notes.some(e=>{let t=ef(e);return t!==o&&t===c}))throw Error(`note.error.nameConflict`);let l=of(t().notes,o,s,a.name);e({notes:l}),Im(t().notesAddress,l,t().notesPath)},importNotes:n=>{let r=Fm(n);e({notes:r}),Im(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)&&Rm.setState({isDarkMode:!0})}var zm={" ":`space`,ArrowLeft:`arrowleft`,ArrowRight:`arrowright`,ArrowUp:`arrowup`,ArrowDown:`arrowdown`,Escape:`escape`,Esc:`escape`,esc:`escape`,Enter:`enter`,Tab:`tab`,Backspace:`backspace`,Delete:`delete`,Insert:`insert`,Home:`home`,End:`end`,PageUp:`pageup`,PageDown:`pagedown`,"+":`plus`,"-":`minus`,"*":`asterisk`,"/":`slash`};function Bm(e){let t=e.replace(`Key`,``).toLowerCase();return zm[e]||t}function Vm(e){let t=e.toLowerCase().split(`+`).map(e=>e.trim()),n={alt:t.includes(`alt`),ctrl:t.includes(`ctrl`),meta:t.includes(`meta`),mod:t.includes(`mod`),shift:t.includes(`shift`)},r=[`alt`,`ctrl`,`meta`,`shift`,`mod`],i=t.find(e=>!r.includes(e));return{...n,key:i===`[plus]`?`+`:i}}function Hm(e,t,n){let{alt:r,ctrl:i,meta:a,mod:o,shift:s,key:c}=e,{altKey:l,ctrlKey:u,metaKey:d,shiftKey:f,key:p,code:m}=t;if(r!==l)return!1;if(o){if(!u&&!d)return!1}else if(i!==u||a!==d)return!1;return s===f?!!(c&&(n?Bm(m)===Bm(c):Bm(p??m)===Bm(c))):!1}function Um(e,t){return n=>Hm(Vm(e),n,t)}function Wm(e,t,n=!1){return e.target instanceof HTMLElement?(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName):!0}function Gm(e,t=[`INPUT`,`TEXTAREA`,`SELECT`],n=!1){let r=(0,K.useEffectEvent)(r=>{e.forEach(([e,i,a={preventDefault:!0,usePhysicalKeys:!1}])=>{Um(e,a.usePhysicalKeys)(r)&&Wm(r,t,n)&&(a.preventDefault&&r.preventDefault(),i(r))})});(0,K.useEffect)(()=>(document.documentElement.addEventListener(`keydown`,r),()=>document.documentElement.removeEventListener(`keydown`,r)),[])}function Km(){return typeof window>`u`?!1:window.electronAPI?.isElectron===!0?!0:/\bElectron\/\d+/i.test(window.navigator?.userAgent||``)}function qm(){let[e,t]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{t(Km())},[]),e}function Jm({children:e,onClose:t,className:n=``}){Gm(t?[[`Escape`,t]]:[]),(0,K.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=()=>{document.documentElement.style.setProperty(`--modal-visual-height`,`${e.height}px`),document.documentElement.style.setProperty(`--modal-visual-top`,`${e.offsetTop}px`)};return t(),e.addEventListener(`resize`,t),e.addEventListener(`scroll`,t),()=>{e.removeEventListener(`resize`,t),e.removeEventListener(`scroll`,t),document.documentElement.style.removeProperty(`--modal-visual-height`),document.documentElement.style.removeProperty(`--modal-visual-top`)}},[]);let r=(0,q.jsxs)(`div`,{className:[`modal-overlay`,n].filter(Boolean).join(` `),children:[(0,q.jsx)(`div`,{className:`modal-overlay-backdrop`}),(0,q.jsx)(`div`,{className:`modal-glass`,children:e})]});return typeof document>`u`?r:(0,it.createPortal)(r,document.body)}function Ym({message:e,type:t,onDone:n,index:r}){return(0,K.useEffect)(()=>{let e=setTimeout(n,3e3);return()=>clearTimeout(e)},[]),(0,q.jsx)(`div`,{className:`toast ${t} toast-stack-${Math.min(Math.max(r,0),5)}`,children:e})}function Xm({title:e,message:t,confirmText:n,onConfirm:r,onClose:i,danger:a}){let{t:o}=u();return(0,q.jsx)(Jm,{onClose:i,children:(0,q.jsxs)(`div`,{className:`confirm-modal`,onClick:e=>e.stopPropagation(),children:[(0,q.jsxs)(`div`,{className:`modal-header`,children:[(0,q.jsx)(`h3`,{children:e}),(0,q.jsx)(`button`,{onClick:i,className:`btn btn-icon`,children:(0,q.jsx)(It,{size:18})})]}),(0,q.jsx)(`p`,{children:t}),(0,q.jsxs)(`div`,{className:`modal-actions`,children:[(0,q.jsx)(`button`,{onClick:i,className:`btn btn-secondary`,children:o(`common.cancel`)}),(0,q.jsx)(`button`,{onClick:r,className:`btn ${a?`btn-danger`:`btn-primary`}`,children:n})]})]})})}function Zm({title:e,placeholder:t,defaultValue:n,confirmText:r,onConfirm:i,onClose:a,isLoading:o,loadingText:s,validate:c,allowEmpty:l=!1}){let{t:d}=u(),[f,p]=(0,K.useState)(n||``),m=f.trim(),h=m&&c?c(m):``,g=(l||!!m)&&!h&&!o;function _(){g&&i(m)}return(0,q.jsx)(Jm,{onClose:a,children:(0,q.jsxs)(`div`,{className:`input-modal`,onClick:e=>e.stopPropagation(),children:[(0,q.jsxs)(`div`,{className:`modal-header`,children:[(0,q.jsx)(`h3`,{children:e}),(0,q.jsx)(`button`,{onClick:a,className:`btn btn-icon`,children:(0,q.jsx)(It,{size:18})})]}),(0,q.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:t,autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&_()},className:`input input-compact`,"aria-invalid":!!h,"aria-describedby":h?`input-modal-error`:void 0}),h&&(0,q.jsx)(`p`,{className:`input-modal-error`,id:`input-modal-error`,children:h}),(0,q.jsxs)(`div`,{className:`modal-actions`,children:[(0,q.jsx)(`button`,{onClick:a,disabled:o,className:`btn btn-secondary`,children:d(`common.cancel`)}),(0,q.jsx)(`button`,{onClick:_,disabled:!g,className:`btn btn-primary ${o?`btn-loading`:``}`,children:o?s||d(`common.processing`):r})]})]})})}var Qm=8,$m=8;function eh({ariaLabel:e,items:t=[],renderContent:n,renderTrigger:r,placement:i=`bottom-end`,disabled:a=!1,className:o=``,menuClassName:s=``}){let c=(0,K.useId)(),l=(0,K.useRef)(null),u=(0,K.useRef)(null),[d,f]=(0,K.useState)(!1),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),_=(0,K.useCallback)(e=>{l.current=e},[]),v=(0,K.useCallback)(()=>{m(!1),g(!1)},[]),y=(0,K.useCallback)(()=>{let e=l.current,t=u.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),a=window.innerWidth,o=window.innerHeight,s=i.startsWith(`top`),c=i.endsWith(`end`),d=s?n.top-r.height-Qm:n.bottom+Qm,f=c?n.right-r.width:n.left,p=Math.max($m,a-r.width-$m),m=Math.max($m,o-r.height-$m),h={top:Math.min(Math.max(d,$m),m),left:Math.min(Math.max(f,$m),p)};t.style.setProperty(`--action-menu-top`,`${h.top}px`),t.style.setProperty(`--action-menu-left`,`${h.left}px`),g(!0)},[i]);(0,K.useEffect)(()=>{f(!0)},[]),(0,K.useEffect)(()=>{a&&v()},[v,a]),(0,K.useLayoutEffect)(()=>{p&&(g(!1),y())},[p,t.length,y]),(0,K.useEffect)(()=>{if(!p)return;let e=window.requestAnimationFrame(()=>{(u.current?.querySelector(`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`))?.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(e)},[p]),(0,K.useEffect)(()=>{if(!p)return;function e(e){let t=e.target;t instanceof Node&&(l.current?.contains(t)||u.current?.contains(t)||v())}function t(e){e.key===`Escape`&&(v(),l.current?.focus({preventScroll:!0}))}return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`keydown`,t),window.addEventListener(`resize`,y),window.addEventListener(`scroll`,y,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`keydown`,t),window.removeEventListener(`resize`,y),window.removeEventListener(`scroll`,y,!0)}},[v,p,y]);function b(e){e.stopPropagation(),!a&&m(e=>!e)}function x(e){e.key===`ArrowDown`&&(e.preventDefault(),a||m(!0))}let S=d&&p?(0,it.createPortal)((0,q.jsx)(`div`,{ref:u,id:c,className:[`ui-action-menu`,h?`is-positioned`:``,s].filter(Boolean).join(` `),role:`menu`,"aria-label":e,onClick:e=>e.stopPropagation(),children:n?n({closeMenu:v}):t.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:[`ui-action-menu-item`,e.icon?`has-icon`:``,e.description?`has-description`:``,e.danger?`danger`:``].filter(Boolean).join(` `),role:`menuitem`,disabled:e.disabled,onClick:t=>{t.stopPropagation(),v(),e.onSelect()},children:[e.icon&&(0,q.jsx)(`span`,{className:`ui-action-menu-item-icon`,children:e.icon}),(0,q.jsx)(`span`,{className:`ui-action-menu-item-label`,children:e.label}),e.description&&(0,q.jsx)(`span`,{className:`ui-action-menu-item-description`,children:e.description})]},e.key))}),document.body):null;return(0,q.jsxs)(`span`,{className:[`ui-action-menu-anchor`,o].filter(Boolean).join(` `),children:[r({ref:_,type:`button`,disabled:a,onClick:b,onKeyDown:x,"aria-haspopup":`menu`,"aria-expanded":p,"aria-controls":c}),S]})}function th(e){return e.replace(/&/g,`&`).replace(/'/g,`'`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function nh(e){let t=e.meta?.title,n=e.meta?.creator,r=e.meta?.source,i=e.meta?.license?.url,a=rh(e);return!t&&!n&&!r&&!i&&!a?``:`<metadata xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"><rdf:RDF><rdf:Description>`+(t?`<dc:title>${th(t)}</dc:title>`:``)+(n?`<dc:creator>${th(n)}</dc:creator>`:``)+(r?`<dc:source xsi:type="dcterms:URI">${th(e.meta?.source??``)}</dc:source>`:``)+(i?`<dcterms:license xsi:type="dcterms:URI">${th(i)}</dcterms:license>`:``)+(a?`<dc:rights>${th(a)}</dc:rights>`:``)+`</rdf:Description></rdf:RDF></metadata>`}function rh(e){let t=e.meta?.title?`„${e.meta?.title}”`:`Design`,n=`„${e.meta?.creator??`Unknown`}”`;e.meta?.source&&(t+=` (${e.meta.source})`);let r=``;return e.meta?.license?.name!==`MIT`&&e.meta?.creator!==`DiceBear`&&e.meta?.title&&(r+=`Remix of `),r+=`${t} by ${n}`,e.meta?.license?.name&&(r+=`, licensed under „${e.meta?.license?.name}”`,e.meta?.license?.url&&(r+=` (${e.meta.license.url})`)),r}var ih=-2147483648,ah=2147483647,oh=1024;function sh(e){return e^=e<<13,e^=e>>17,e^=e<<5,e}function ch(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0,t=sh(t);return t}function lh(e=``){e=e.toString().slice(0,oh);let t=ch(e)||1,n=()=>t=sh(t),r=(e,t)=>Math.floor((n()-ih)/(ah-ih)*(t+1-e)+e);return{seed:e,next:n,bool(e=50){return r(1,100)<=e},integer(e,t){return r(e,t)},pick(e,t){return e.length===0?(n(),t):e[r(0,e.length-1)]??t},shuffle(e){let t=lh(n().toString()),r=[...e];for(let e=r.length-1;e>0;e--){let n=t.integer(0,e);[r[e],r[n]]=[r[n],r[e]]}return r},string(e,t=`abcdefghijklmnopqrstuvwxyz1234567890`){let r=lh(n().toString()),i=``;for(let n=0;n<e;n++)i+=t[r.integer(0,t.length-1)];return i}}}function uh(e){let t=e.attributes.viewBox.split(` `);return{x:parseInt(t[0]),y:parseInt(t[1]),width:parseInt(t[2]),height:parseInt(t[3])}}function dh(e,t,n,r,i){let{width:a,height:o,x:s,y:c}=uh(e),l=`<rect fill="${th(t)}" width="${a}" height="${o}" x="${s}" y="${c}" />`;switch(r){case`solid`:return l+e.body;case`gradientLinear`:return`<rect fill="url(#backgroundLinear)" width="${a}" height="${o}" x="${s}" y="${c}" /><defs><linearGradient id="backgroundLinear" gradientTransform="rotate(${i} 0.5 0.5)"><stop stop-color="${th(t)}"/><stop offset="1" stop-color="${th(n)}"/></linearGradient></defs>`+e.body}}function fh(e,t){let{width:n,height:r,x:i,y:a}=uh(e),o=t?(t-100)/100:0;return`<g transform="translate(${(n/2+i)*o*-1} ${(r/2+a)*o*-1}) scale(${t/100})">${e.body}</g>`}function ph(e,t,n){let r=uh(e);return`<g transform="translate(${(r.width+r.x*2)*((t??0)/100)} ${(r.height+r.y*2)*((n??0)/100)})">${e.body}</g>`}function mh(e,t){let{width:n,height:r,x:i,y:a}=uh(e);return`<g transform="rotate(${t}, ${n/2+i}, ${r/2+a})">${e.body}</g>`}function hh(e){let{width:t,x:n}=uh(e);return`<g transform="scale(-1 1) translate(${t*-1-n*2} 0)">${e.body}</g>`}function gh(e,t){let{width:n,height:r,x:i,y:a}=uh(e);return`<mask id="viewboxMask"><rect width="${n}" height="${r}" rx="${t?n*t/100:0}" ry="${t?r*t/100:0}" x="${i}" y="${a}" fill="#fff" /></mask><g mask="url(#viewboxMask)">${e.body}</g>`}function _h(e){let t={xmlns:`http://www.w3.org/2000/svg`,...e.attributes};return Object.keys(t).map(e=>`${th(e)}="${th(t[e])}"`).join(` `)}function vh(e){let t=lh(Math.random().toString()),n={};return e.body.replace(/(id="|url\(#)([a-z0-9-_]+)([")])/gi,(e,r,i,a)=>(n[i]=n[i]||t.string(8),`${r}${n[i]}${a}`))}var yh={type:`object`,$schema:`http://json-schema.org/draft-07/schema#`,properties:{seed:{type:`string`},flip:{type:`boolean`,default:!1},rotate:{type:`integer`,minimum:0,maximum:360,default:0},scale:{type:`integer`,minimum:0,maximum:200,default:100},radius:{type:`integer`,minimum:0,maximum:50,default:0},size:{type:`integer`,minimum:1},backgroundColor:{type:`array`,items:{type:`string`,pattern:`^(transparent|[a-fA-F0-9]{6})$`}},backgroundType:{type:`array`,items:{type:`string`,enum:[`solid`,`gradientLinear`]},default:[`solid`]},backgroundRotation:{type:`array`,items:{type:`integer`,minimum:-360,maximum:360},default:[0,360]},translateX:{type:`integer`,minimum:-100,maximum:100,default:0},translateY:{type:`integer`,minimum:-100,maximum:100,default:0},clip:{type:`boolean`,default:!0},randomizeIds:{type:`boolean`,default:!1}}};function bh(e){let t={},n=e.properties??{};return Object.keys(n).forEach(e=>{let r=n[e];typeof r==`object`&&r.default!==void 0&&(Array.isArray(r.default)?t[e]=[...r.default]:typeof r.default==`object`?t[e]={...r.default}:t[e]=r.default)}),t}function xh(e,t){let n={...bh(yh),...bh(e.schema??{}),...t};return JSON.parse(JSON.stringify(n))}function Sh(e){return e===`transparent`?e:`#${e}`}function Ch(e,t,n){let r=e.shuffle(t);r.length<=1||t.length==2&&n==`gradientLinear`?(r=t,e.next()):r=e.shuffle(t),r.length===0&&(r=[`transparent`]);let i=r[0],a=r[1]??r[0];return{primary:Sh(i),secondary:Sh(a)}}function wh(e,t={}){t=xh(e,t);let n=lh(t.seed),r=e.create({prng:n,options:t}),i=n.pick(t.backgroundType??[],`solid`),{primary:a,secondary:o}=Ch(n,t.backgroundColor??[],i),s=n.integer(t.backgroundRotation?.length?Math.min(...t.backgroundRotation):0,t.backgroundRotation?.length?Math.max(...t.backgroundRotation):0);t.size&&(r.attributes.width=t.size.toString(),r.attributes.height=t.size.toString()),t.scale!==void 0&&t.scale!==100&&(r.body=fh(r,t.scale)),t.flip&&(r.body=hh(r)),t.rotate&&(r.body=mh(r,t.rotate)),(t.translateX||t.translateY)&&(r.body=ph(r,t.translateX,t.translateY)),a!==`transparent`&&o!==`transparent`&&(r.body=dh(r,a,o,i,s)),(t.radius||t.clip)&&(r.body=gh(r,t.radius??0)),t.randomizeIds&&(r.body=vh(r));let c=`<svg ${_h(r)}>${nh(e)}${r.body}</svg>`;return{toString:()=>c,toJson:()=>({svg:c,extra:{primaryBackgroundColor:a,secondaryBackgroundColor:o,backgroundType:i,backgroundRotation:s,...r.extra?.call(r)}}),toDataUri:()=>`data:image/svg+xml;utf8,${encodeURIComponent(c)}`}}var Th={bite:(e,t)=>`<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#000" fill-opacity=".6"/><path fill-rule="evenodd" clip-rule="evenodd" d="m20 17 6-8H14l6 8ZM32 17l6-8H26l6 8ZM44 17l6-8H38l6 8ZM56 17l6-8H50l6 8Z" fill="#E1E6E8"/>`,diagram:(e,t)=>`<rect x="4" y="4" width="68" height="24" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="8" width="60" height="16" rx="2" fill="#000" fill-opacity=".8"/><path d="M9 17h11l2-4 3 7 4-8 2 9 3-11 3 10 3-3h15l3-4 2 7 3-3h4" stroke="#4EFAC9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>`,grill01:(e,t)=>`<g fill="#000" fill-opacity=".6"><rect x="12" y="12" width="4" height="8" rx="2"/><rect x="36" y="12" width="4" height="8" rx="2"/><rect x="24" y="12" width="4" height="8" rx="2"/><rect x="48" y="12" width="4" height="8" rx="2"/><rect x="60" y="12" width="4" height="8" rx="2"/></g>`,grill02:(e,t)=>`<g fill="#000" fill-opacity=".6"><rect x="28" y="10" width="6" height="14" rx="2"/><rect x="14" y="10" width="6" height="14" rx="2"/><rect x="42" y="10" width="6" height="14" rx="2"/><rect x="56" y="10" width="6" height="14" rx="2"/></g>`,grill03:(e,t)=>`<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#fff"/><path fill="#000" fill-opacity=".1" d="M18 9h4v14h-4zM42 9h4v14h-4zM30 9h4v14h-4zM54 9h4v14h-4z"/>`,smile01:(e,t)=>`<path d="M27.05 8.44a2 2 0 1 1 3.9-.88C31.72 10.96 34.4 13 38 13c3.6 0 6.28-2.04 7.05-5.44a2 2 0 1 1 3.9.88C47.75 13.7 43.43 17 38 17s-9.76-3.3-10.95-8.56Z" fill="#000" fill-opacity=".6"/>`,smile02:(e,t)=>`<path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#000" fill-opacity=".8"/><mask id="mouthSmile02-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="18" y="8" width="40" height="20"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#fff"/></mask><g mask="url(#mouthSmile02-a)"><rect x="30" y="2" width="16" height="14" rx="2" fill="#fff"/></g>`,square01:(e,t)=>`<rect x="24" y="6" width="27" height="8" rx="4" fill="#000" fill-opacity=".8"/>`,square02:(e,t)=>`<rect x="16" y="8" width="44" height="4" rx="2" fill="#000" fill-opacity=".8"/>`},Eh={bulging:(e,t)=>`<circle cx="28" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="74" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="28" cy="24" r="15" fill="#F1EEDA"/><circle cx="74" cy="24" r="15" fill="#F1EEDA"/><rect x="26" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="74" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>`,dizzy:(e,t)=>`<path d="m25 27.2 5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L28.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L25 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5ZM79 27.2l5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L82.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L79 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5Z" fill="#000" fill-opacity=".8"/>`,eva:(e,t)=>`<g fill-rule="evenodd" clip-rule="evenodd"><path d="M53 0c34.75 0 49 17.47 49 31 0 13.53-19.59 17-49 17-29.05 0-51-3.47-51-17S17.11 0 53 0Z" fill="#000" fill-opacity=".8"/><path d="M28.82 34.65c-6.53-1.35-11.24-6.34-10.52-11.14.72-4.79 6.6-7.58 13.12-6.23 6.53 1.36 11.24 6.35 10.52 11.15-.72 4.8-6.6 7.59-13.12 6.23ZM75.42 34.65c-6.52 1.36-12.4-1.43-13.12-6.23-.72-4.8 4-9.8 10.52-11.15 6.52-1.35 12.4 1.44 13.12 6.24.72 4.81-4 9.8-10.52 11.15Z" fill="#25A6F5"/></g>`,frame1:(e,t)=>`<rect y="4" width="104" height="42" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><rect x="66" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21 4h8L12 46H4L21 4Z" fill="#fff" fill-opacity=".4"/>`,frame2:(e,t)=>`<rect x="8" y="10" width="88" height="36" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><rect x="66" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M83 10h5L76 46h-5l12-36Z" fill="#fff" fill-opacity=".4"/>`,glow:(e,t)=>`<g fill="#fff"><circle cx="21" cy="30" r="15" fill-opacity=".1"/><circle cx="83" cy="30" r="15" fill-opacity=".1"/><circle cx="21" cy="30" r="12" fill-opacity=".1"/><circle cx="83" cy="30" r="12" fill-opacity=".1"/><circle cx="21" cy="30" r="6" fill-opacity=".8"/><circle cx="83" cy="30" r="6" fill-opacity=".8"/><circle cx="21" cy="30" r="3" fill-opacity=".8"/><circle cx="83" cy="30" r="3" fill-opacity=".8"/></g>`,happy:(e,t)=>`<path d="m18 19 12-2M20 31c0-3.31 2.9-6 7-6 3.1 0 6 2.69 6 6M86 20l-12-3M84 31c0-3.31-2.9-6-6-6-4.1 0-7 2.69-7 6" stroke="#000" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>`,hearts:(e,t)=>`<path d="M29.27 9.68c-2.55.13-4.96 2.24-6.25 4.15-1.48-1.76-4.1-3.6-6.65-3.47-5.48.28-8.85 3.8-8.63 8.1.3 5.72 4.88 8.89 9.7 12.24 1.71 1.15 5 4.15 5.42 4.82.42.67 2.14.6 2.58-.13a37.8 37.8 0 0 1 4.9-5.36c4.43-3.84 8.66-7.47 8.36-13.2-.23-4.3-3.95-7.44-9.43-7.15ZM87.63 10.36c-2.55-.14-5.17 1.7-6.65 3.47-1.3-1.9-3.7-4.02-6.25-4.15-5.48-.29-9.2 2.86-9.43 7.16-.3 5.72 3.93 9.35 8.36 13.19 1.6 1.32 4.55 4.64 4.9 5.36.35.7 2.06.82 2.58.13.51-.7 3.7-3.67 5.42-4.82 4.81-3.35 9.4-6.52 9.7-12.24.22-4.3-3.15-7.82-8.63-8.1Z" fill="#FF5353" fill-opacity=".8"/>`,robocop:(e,t)=>`<rect x="7" y="16" width="91" height="16" rx="4" fill="#000" fill-opacity=".8"/><mask id="eyesRobocop-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="16" width="91" height="16"><rect x="7" y="16" width="91" height="16" rx="4" fill="#fff"/></mask><g mask="url(#eyesRobocop-a)" fill-rule="evenodd" clip-rule="evenodd" fill="#fff" fill-opacity=".8"><path d="M76 7h18L82 37H64L76 7ZM52 7h9L49 37h-9L52 7Z"/></g>`,round:(e,t)=>`<g fill="#fff"><circle cx="24" cy="30" r="6"/><circle cx="80" cy="30" r="6"/></g>`,roundFrame01:(e,t)=>`<rect y="12" width="104" height="32" rx="16" fill="#000" fill-opacity=".8"/><rect x="24" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/><rect x="70" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/>`,roundFrame02:(e,t)=>`<rect y="11" width="104" height="34" rx="17" fill="#000" fill-opacity=".8"/><circle cx="29" cy="28" r="13" fill="#F1EEDA"/><circle cx="75" cy="28" r="13" fill="#F1EEDA"/><rect x="24" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="70" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>`,sensor:(e,t)=>`<path d="M28 44a20 20 0 0 0 19.9-18h41.52a5 5 0 1 0 0-4H47.9A20 20 0 1 0 28 44Z" fill="#000" fill-opacity=".2"/><circle cx="94" cy="24" r="2" fill="#fff"/><circle cx="28" cy="24" r="16" fill="#000" fill-opacity=".6"/><circle cx="34" cy="16" r="3" fill="#fff"/>`,shade01:(e,t)=>`<path d="M96 2H8c-4.5 0-8 3.5-8 8.03V28c0 4.5 3.5 8 8 8h13c8 0 11 8 18 8h27c7 0 9-8 17-8h13c4.5 0 8-3.5 8-8V10c0-4.5-3.5-8-8-8Z" fill="#000" fill-opacity=".8"/><path d="M87 14H17c-3.5 0-5 3-5 5v2c0 2 1.5 5 5 5h12c6 0 11.62 8 17 8h14c5.38 0 9-8 15-8h12c3.5 0 5-3 5-5v-2c0-2-1.5-5-5-5Z" fill="#FF3D3D"/><path d="M22.44 36.09 37.26 2h11L31.4 40.78l-.76-.58c-2.38-1.82-4.83-3.69-8.2-4.11ZM11.48 36 26.26 2h4L15.48 36h-4Z" fill="#fff" fill-opacity=".2"/>`},Dh=t({eyes:()=>Eh,mouth:()=>Th});function Oh({prng:e,group:t,values:n=[]}){let r=Dh,i=e.pick(n);if(i&&r[t][i])return{name:i,value:r[t][i]}}function kh({prng:e,options:t}){return{mouth:Oh({prng:e,group:`mouth`,values:t.mouth}),eyes:Oh({prng:e,group:`eyes`,values:t.eyes})}}function Ah({prng:e,options:t}){return{}}var jh={$schema:`http://json-schema.org/draft-07/schema#`,properties:{backgroundColor:{type:`array`,items:{type:`string`,pattern:`^(transparent|[a-fA-F0-9]{6})$`},default:[`ffb300`,`1e88e5`,`546e7a`,`6d4c41`,`00acc1`,`f4511e`,`5e35b1`,`43a047`,`757575`,`3949ab`,`039be5`,`7cb342`,`c0ca33`,`fb8c00`,`d81b60`,`8e24aa`,`e53935`,`00897b`,`fdd835`]},eyes:{type:`array`,items:{type:`string`,enum:[`bulging`,`dizzy`,`eva`,`frame1`,`frame2`,`glow`,`happy`,`hearts`,`robocop`,`round`,`roundFrame01`,`roundFrame02`,`sensor`,`shade01`]},default:[`bulging`,`dizzy`,`eva`,`frame1`,`frame2`,`glow`,`happy`,`hearts`,`robocop`,`round`,`roundFrame01`,`roundFrame02`,`sensor`,`shade01`]},mouth:{type:`array`,items:{type:`string`,enum:[`bite`,`diagram`,`grill01`,`grill02`,`grill03`,`smile01`,`smile02`,`square01`,`square02`]},default:[`bite`,`diagram`,`grill01`,`grill02`,`grill03`,`smile01`,`smile02`,`square01`,`square02`]}}},Mh=t({create:()=>Ph,meta:()=>Nh,schema:()=>jh}),Nh={title:`Bottts`,creator:`Pablo Stanley`,source:`https://bottts.com/`,homepage:`https://twitter.com/pablostanley`,license:{name:`Free for personal and commercial use`,url:`https://bottts.com/`}},Ph=({prng:e,options:t})=>{let n=kh({prng:e,options:t}),r=Ah({prng:e,options:t});return{attributes:{viewBox:`0 0 120 120`,fill:`none`,"shape-rendering":`auto`},body:`<g transform="translate(22 68)">${n.mouth?.value(n,r)??``}</g><g transform="translate(8 20)">${n.eyes?.value(n,r)??``}</g>`,extra:()=>({...Object.entries(n).reduce((e,[t,n])=>(e[t]=n?.name,e),{}),...Object.entries(r).reduce((e,[t,n])=>(e[`${t}Color`]=n,e),{})})}},Fh=[`panda`,`owl`,`dolphin`,`tiger`,`turtle`,`snow-mountain`],Ih={mint:`panda`,violet:`owl`,ocean:`dolphin`,ember:`tiger`,sage:`turtle`,dusk:`snow-mountain`};function Lh(e){let t=typeof e==`string`?e.trim():``;return Fh.includes(t)?t:Ih[t]||``}function Rh(e){return zh(Lh(e)||e)}function zh(e){return`/avatars/default/${e}.svg`}function Bh(e){if(typeof e!=`string`)return``;let t=e.trim();return Lh(/^\/avatars\/default\/([^/]+)\.svg$/.exec(t)?.[1]||``)}function Vh(e){return!!Bh(e)}function Hh(e){let t=Bh(e);return t?zh(t):``}function Uh(e){return wh(Mh,{seed:`most.box@`+e,flip:!0,backgroundType:[`gradientLinear`]}).toDataUri()}function Wh(e,t){let n=Bh(t);return n?zh(n):t||(e?Uh(e):`/avatar.png`)}export{Ft as $,Dp as A,z as At,yu as B,k as Bt,xm as C,ce as Ct,Cp as D,V as Dt,Op as E,ue as Et,ef as F,I as Ft,vu as G,Au as H,b as Ht,$d as I,h as It,ju as J,bu as K,zd as L,v as Lt,wp as M,L as Mt,rf as N,E as Nt,Tp as O,B as Ot,af as P,R as Pt,It as Q,Uu as R,N as Rt,_m as S,oe as St,ym as T,ae as Tt,Su as U,x as Ut,Mu as V,p as Vt,xu as W,f as Wt,iu as X,su as Y,X as Z,fm as _,be as _t,Hh as a,Xe as at,Sm as b,Ce as bt,Xm as c,Ve as ct,qm as d,Pe as dt,St as et,Rm as f,Ne as ft,hm as g,Ae as gt,gm as h,Oe as ht,Vh as i,tt as it,kp as j,D as jt,Ep as k,M as kt,Ym as l,Fe as lt,Dm as m,xe as mt,Wh as n,xt as nt,eh as o,Ue as ot,um as p,Me as pt,_u as q,Rh as r,gt as rt,Zm as s,Be as st,Fh as t,Tt as tt,Jm as u,Ie as ut,dm as v,De as vt,bm as w,se as wt,wm as x,pe as xt,Cm as y,we as yt,Nu as z,O as zt};
|